08-05-2008, 04:07 AM
Hi,
I am having trouble - how do you unselect a combobox in a smart dialog. It seems that once you select an item, from a list, you can't get that combobox back to an unselected state (i.e. item = -1). I tried adding a dummy item " " i.e. "1[]2[]3[] ". Which works ok but now I have three parallel comboboxes and if the user picks from one, the other two have to go to "unselected"
When I tried something like:
Function Dialog4
This caused an unstoppable loop that eventually crashed QM. I tried then instead using CB_SelectItem with an item "-1" but seem to be getting same kind of recursive loop.
This is the simplified code (only two comboboxes):
Function Dialog4
Thanks for any ideas.
Stuart
I am having trouble - how do you unselect a combobox in a smart dialog. It seems that once you select an item, from a list, you can't get that combobox back to an unselected state (i.e. item = -1). I tried adding a dummy item " " i.e. "1[]2[]3[] ". Which works ok but now I have three parallel comboboxes and if the user picks from one, the other two have to go to "unselected"
When I tried something like:
Function Dialog4
sel wParam
,case CBN_SELCHANGE<<16|3
,,CB_SelectString(id(4 hDlg) " ")
,,CB_SelectString(id(5 hDlg) " ")
,case CBN_SELCHANGE<<16|4
,,CB_SelectString(id(3 hDlg) " ")
,,CB_SelectString(id(5 hDlg) " ")
,case CBN_SELCHANGE<<16|5
,,CB_SelectString(id(3 hDlg) " ")
,,CB_SelectString(id(4 hDlg) " ")
This caused an unstoppable loop that eventually crashed QM. I tried then instead using CB_SelectItem with an item "-1" but seem to be getting same kind of recursive loop.
This is the simplified code (only two comboboxes):
Function Dialog4
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4"
str cb3 cb4 cb5
cb3 = "1[]2[]3"
cb4="4[]5[]6"
if(!ShowDialog("Dialog4" &Dialog4 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 2 20 96 213 ""
;4 ComboBox 0x54230243 0x0 2 40 96 213 ""
;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 CBN_SELCHANGE<<16|3
,,CB_SelectItem(id(4 hDlg) -1)
,case CBN_SELCHANGE<<16|4
,,CB_SelectItem(id(3 hDlg) -1)
,case IDOK
,case IDCANCEL
ret 1
;
Thanks for any ideas.
Stuart