05-05-2008, 07:17 AM
QM does not limit the number of case. It does not find the label because it is at an offset >= 64KB. The limitation will be removed in next beta, this week.
----
The limit of the number of local variables (256) will still exist. Try to use an user-defined type for dialog controls. Or use multiple child dialogs, which would be the answer to the question 2.
Function Dialog60
Function Tab0
Function Tab1
Function Tab2
Quote:how do you output the tab that is being displayed
----
The limit of the number of local variables (256) will still exist. Try to use an user-defined type for dialog controls. Or use multiple child dialogs, which would be the answer to the question 2.
Function Dialog60
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("Dialog60" &Dialog60)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x10100 0 0 221 159 "Dialog"
;1 Button 0x54030001 0x4 120 140 48 14 "OK"
;2 Button 0x54030000 0x4 170 140 48 14 "Cancel"
;3 SysTabControl32 0x54010040 0x0 0 0 222 134 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
ret
;messages
ARRAY(int)-- tabs.create(3)
sel message
,case WM_INITDIALOG
,;add tabs to the tab control
,str st="A[]B[]C" ;;tab labels
,int i htb=id(3 hDlg); TCITEM ti.mask=TCIF_TEXT; RECT r rr
,foreach(ti.pszText st) SendMessage htb TCM_INSERTITEMA i &ti; i+1
,;calculate y of child dialogs
,GetWindowRect htb &rr; ScreenToClient hDlg +&rr
,SendMessage htb TCM_GETITEMRECT 0 &r
,i=rr.top+r.bottom+2
,;create and initialize child dialogs
,tabs[0]=Tab0(0 0 hDlg i)
,tabs[1]=Tab1(0 0 hDlg i)
,tabs[2]=Tab2(0 0 hDlg i)
,
,_i=0; goto g11 ;;select first tab
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,;get data of child dialogs
,Tab0(0 1 hDlg tabs[0])
,Tab1(0 1 hDlg tabs[1])
,Tab2(0 1 hDlg tabs[2])
,
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case TCN_SELCHANGE
,_i=SendMessage(id(3 hDlg) TCM_GETCURSEL 0 0)
,;g11
,for(i 0 tabs.len) hid tabs[i]
,hid- tabs[_i]Function Tab0
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "4"
str e4
sel message
,case 0 ;;on WM_INITDIALOG of the parent dialog
,ret ShowDialog("" &Tab0 &controls wParam 1 WS_CHILD 0 0 2 lParam)
,case 1 ;;on OK of the parent dialog
,hDlg=lParam
,DT_GetControls hDlg &controls
,out e4
;BEGIN DIALOG
;0 "" 0x10000644 0x0 0 0 187 107 ""
;3 Static 0x54000000 0x0 26 22 48 12 "A"
;4 Edit 0x54030080 0x200 26 38 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
;sel wParam
,;case ...
,;...
ret 1Function Tab1
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "4"
str e4
sel message
,case 0 ;;on WM_INITDIALOG of the parent dialog
,ret ShowDialog("" &Tab1 &controls wParam 1 WS_CHILD 0 0 2 lParam)
,case 1 ;;on OK of the parent dialog
,hDlg=lParam
,DT_GetControls hDlg &controls
,out e4
;BEGIN DIALOG
;0 "" 0x10000644 0x0 0 0 187 107 ""
;3 Static 0x54000000 0x0 26 22 48 12 "B"
;4 Edit 0x54030080 0x200 26 38 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
;sel wParam
,;case ...
,;...
ret 1Function Tab2
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "4"
str e4
sel message
,case 0 ;;on WM_INITDIALOG of the parent dialog
,ret ShowDialog("" &Tab2 &controls wParam 1 WS_CHILD 0 0 2 lParam)
,case 1 ;;on OK of the parent dialog
,hDlg=lParam
,DT_GetControls hDlg &controls
,out e4
;BEGIN DIALOG
;0 "" 0x10000644 0x0 0 0 187 107 ""
;3 Static 0x54000000 0x0 26 22 48 12 "C"
;4 Edit 0x54030080 0x200 26 38 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
;sel wParam
,;case ...
,;...
ret 1