What makes this all work is the Preview Generator inserts INCLUDE('WindowPreview.INC','section')
in the preview code. My INC file includes my VLB Class that finds all the LIST controls on the Window and changes the FROM(Queue) to a VLB (Virtual List Box) that my code in the CbVlbClass provides the data. The class will also scan for numeric @N ENTRY controls and change the IDE sample data to my Fit Data. It also changes @P and @K to correct sample data.
C:\Clarion11\Accessory\Libsrc\win\WindowPreviewer.inc
SECTION('Includes')
!Put variable and equate declarations here
INCLUDE('CBWndPreview.INC'),ONCE
INCLUDE('CbVlbPreview.INC'),ONCE !Class for LIST Sample data and @n @p @k
WndPrvCls CBWndPreviewClass
ListPreview CbVlbAllPreviewClass !FYI: If Shift is Down the Init does not happen
FixListPrv BYTE !Must wait until InAccept. There is no SECTION for BeforeAccept or AfterData
!---------------------------------
SECTION('AfterOpen')
!Put code that needs to be executed after the window is opened, but before entering the ACCEPT loop
WndPrvCls.Init(2) !2=Secret Button Across Top; 1=Upper Left Corner 8x8 (default)
0{PROP:System} = 1 !SYSTEM Menu to close window because below set: windowPreviewerCanExit__=False
!Let ESC close window and use Mouse if Window ALRTs. ALRTs do NOT work in a Preview.
LOOP K#=255 TO 1 BY -1 ; 0{PROP:Alrt,K#}=0 ; END
!---------------------------------
SECTION('InAccept')
IF ~FixListPrv THEN !04/04/2021 Setup VLB to supply Preview Data
FixListPrv=1
ListPreview.Init() !Do after Generated preview sets up LIST.
ListPreview.EntryInit() !Setup ENTRY with 1,234.12.
END
windowPreviewerCanExit__ = FALSE !Carl likes button clicks NOT closing window to test Alt+Keys. Can close with SYSTEM Red X (turned on above) or Escape (if not alrt).
windowPreviewerCanExit__ = FALSE !Carl likes button clicks NOT closing window to test Alt+Keys. Can close with SYSTEM Red X (turned on above) or Escape (if not alrt).
If you want to not use my preview simple rename the WindowPreviewer.INC file in LibSrc,
See also my post on The Window Previewer could not display the window