//QM v2.9. Do not edit with text editor!!! //
10    0
E_ÅÙ<³Š@¢]7v„m(…øoG÷}÷®S¦‘&¡
  Main_Program7_Gin F5 8 3641DACC 0
 \Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

 ---- child dialog ----

type DCSCONTROLS842 ~controls ~o3Opt ~o4Opt ~o5Opt ~e6 ~e9 ~si10 ~c12Che
DCSCONTROLS842 d.controls="3 4 5 6 9 10 12"

 init some controls
d.o3Opt=1
d.si10="&shell32.dll,23"
for(_i 0 100) d.e6.formata("%i[]" _i)

 init ChildDialog variable
#compile ChildDialog
ChildDialog- cd
cd.Init(3 "dlg_cd_smart_child2_Gin" &dlg_cd_smart_child2_Gin &d 0 0xe0ffff)

 ---- main dialog ----

str controls = "5 6"
str o5Pre o6Nex

if(!ShowDialog("Main_Program7_Gin" &Main_Program7_Gin &controls)) ret

out "c4Che=%s, d.e9=%s, d.c12Che=%s, d.o3Opt=%s, d.o4Opt=%s, d.o5Opt=%s" d.e9 d.c12Che d.o3Opt d.o4Opt d.o5Opt

 BEGIN DIALOG
 0 "" 0x90CB0A44 0x100 0 0 333 263 "Main Dialog"
 5 Button 0x54033009 0x4 170 242 48 14 "< Previous"
 6 Button 0x54003009 0x4 224 242 48 14 "Next >"
 2 Button 0x54030000 0x4 276 242 48 14 "Cancel"
 3 Static 0x44000000 0x0 4 4 324 234 ""
 END DIALOG
 DIALOG EDITOR: "" 0x2030001 "" "0" ""

ret
 messages
cd.Message(hDlg message wParam lParam)
sel message
	case WM_INITDIALOG
	DT_Page(hDlg 0)
	EnableWindow(id(5 hDlg)0)
	int-- t; t = 0
	case WM_DESTROY DT_DeleteData(hDlg)
	case WM_COMMAND goto messages2
ret
 messages2
sel wParam
,case 6
,EnableWindow(id(5 hDlg)1)
,t+1
,if(t = 2)
,,hid(id(5 hDlg))
,,hid(id(6 hDlg))
,,hid(id(2 hDlg))
,,hid(id(3 hDlg))
,,EnableWindow(id(6 hDlg)0)
,DT_Page(hDlg t)
	
	case 5
	EnableWindow(id(6 hDlg)1)
	t-1
	if(t = 0)
		EnableWindow(id(5 hDlg)0)
	DT_Page(hDlg t)
	
	case IDOK
	case IDCANCEL
ret 1

  dlg_cd_smart_child2_Gin  8 364123B9 0
 \Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

 BEGIN DIALOG
 0 "" 0x10000444 0x200 0 0 217 255 ""
 3 Button 0x54032009 0x0 2 86 72 13 "Option 1 of 3"
 4 Button 0x54002009 0x0 2 158 64 13 "Option 2 of 3"
 5 Button 0x54002009 0x0 2 240 66 13 "Option 3 of 3"
 6 Edit 0x54031044 0x200 176 0 18 254 ""
 7 Button 0x54032000 0x0 124 36 48 14 "Browse..."
 8 Static 0x54000000 0x0 126 68 24 13 "Static"
 9 Edit 0x54030080 0x200 2 36 120 14 ""
 10 Static 0x54000003 0x0 4 4 16 16 ""
 11 Static 0x54000000 0x0 40 6 132 22 "Quick Macros"
 12 Button 0x54012003 0x0 2 54 48 12 "Check"
 END DIALOG
 DIALOG EDITOR: "DCSCONTROLS842" 0x2030003 "" "" ""

ret
 messages
sel message
	case WM_INITDIALOG
	 this is not necessary. Just sets font of control 11.
	__Font-- f
	f.Create("Georgia" 16 1)
	f.SetDialogFont(hDlg "11")
	f.SetDialogFontColor(hDlg 0xff0000 "11")
	
	case WM_DESTROY
	case WM_COMMAND goto messages2
ret
 messages2
sel wParam
	case IDOK
	case 7
	if(OpenSaveDialog(0 _s)) _s.setwintext(id(9 hDlg))
ret 1

  ChildDialog.Message  16 363A422C 0
 /
function hDlg message wParam lParam

 Call this function before sel message in parent dialog function.

sel message
	case WM_INITDIALOG
	 create
	m_hdlgc=ShowDialog(m_macro m_dlgproc m_controls hDlg 1 WS_CHILD WS_POPUP m_param)
	SetProp m_hdlgc "this" &this
	m_subc=SetWindowLong(m_hdlgc DWL_DLGPROC &CHD_DlgProc)
	
	 replace the template control
	RECT rc r; int ht cy
	GetClientRect(m_hdlgc &rc) ;;client before
	ht=id(m_ctrlid hDlg)
	GetWindowRect(ht &r); MapWindowPoints(0 hDlg +&r 2)
	cy=r.bottom-r.top
	MoveWindow m_hdlgc r.left r.top r.right-r.left cy 0
	DestroyWindow ht
	SetWindowLong m_hdlgc GWL_ID m_ctrlid
	
	 set scroll range if needed. It also adds scrollbar.
	GetClientRect(m_hdlgc &r) ;;client after
	if(r.bottom<rc.bottom)
		SCROLLINFO si.cbSize=sizeof(si)
		si.fMask=SIF_RANGE|SIF_PAGE
		si.nMax=rc.bottom
		si.nPage=r.bottom
		SetScrollInfo m_hdlgc SB_VERT &si 0
		m_scmax=si.nMax-si.nPage
		m_scpage=si.nPage
	
	case WM_COMMAND if(wParam=IDOK) DT_GetControls(m_hdlgc)

  ChildDialog.Init  16 3639DC15 0
function ctrlid [$macro] [dlgproc] [!*controls] [param] [bcolor]

 Call this function before calling ShowDialog for the main dialog.

 ctrlid - id of a Static control in main dialog. The child dialog will inherit its position, dimensions and id, and will destroy it.
 macro, dlgproc, controls, param - what you would use with ShowDialog to create the child dialog.
 bcolor - background color. If 0, uses default dialog color.

m_ctrlid=ctrlid
m_macro=macro
memcpy &m_dlgproc &dlgproc 4*4
if(bcolor) m_bcbrush=CreateSolidBrush(bcolor)

  ChildDialog  16 3639F36B 0
class ChildDialog
	-m_ctrlid
	-~m_macro -m_dlgproc -!*m_controls -m_param
	-m_bcolor -__GdiHandle'm_bcbrush
	-m_hdlgc -m_subc
	-m_scmax -m_scpage

  private  65600 3639E0DC 0

  ChildDialog.__DlgProc  16 363A140F 6
 /
function# hDlg message wParam lParam

sel message
	case WM_VSCROLL
	int code=wParam&0xffff
	int pos=wParam>>16
	int ppos=GetScrollPos(hDlg SB_VERT)
	 out "%i %i" code pos
	sel code
		case SB_THUMBTRACK
		case SB_LINEDOWN pos=ppos+16
		case SB_LINEUP pos=ppos-16
		case SB_PAGEDOWN pos=ppos+m_scpage
		case SB_PAGEUP pos=ppos-m_scpage
		case else ret
	if(pos<0) pos=0; else if(pos>m_scmax) pos=m_scmax
	SetScrollPos hDlg SB_VERT pos 1
	ScrollWindowEx hDlg 0 ppos-pos 0 0 0 0 SW_SCROLLCHILDREN|SW_ERASE|SW_INVALIDATE

int r=CallWindowProc(m_subc hDlg message wParam lParam)

sel message
	case [WM_CTLCOLORDLG,WM_CTLCOLORBTN,WM_CTLCOLORSTATIC]
	if(m_bcolor)
		SetBkColor wParam m_bcolor
		ret m_bcbrush

ret r

  CHD_DlgProc  8 3639F3AC 6
 /
function# hDlg message wParam lParam

ChildDialog* p=+GetProp(hDlg "this")
if(p) ret p.__DlgProc(hDlg message wParam lParam)

  file  268500992 0

  