Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combo Box and SysDateTimePick32
#1
Ok..Well I got the SysDateTimePick32 to work just fine. It took me a while, but I got it up and running. Now I can't get a combo box to display the options when I call the function from a macro.

Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
def DTM_FIRST 0x1000
def DTM_GETSYSTEMTIME (DTM_FIRST + 1)
def DTM_SETSYSTEMTIME (DTM_FIRST + 2)
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "New Student Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 SysDateTimePick32 0x54000000 0x204 6 6 90 12 ""
;4 ComboBox 0x54230243 0x0 6 24 90 213 "Teach"
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "" "" ""


str controls = "4"
str Teach
Teach="&Andrew[]Jim[]James[]Don[]Derek"

ret
;messages
SYSTEMTIME- t_st1
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
int ctrlid=wParam&0xFFFF; message=wParam>>16
sel wParam
,case IDOK
,DT_Ok hDlg
,SendMessage(id(3 hDlg) DTM_GETSYSTEMTIME 0 &t_st1)    
,case IDCANCEL DT_Cancel hDlg
ret 1


Then the macro:
Code:
Copy      Help
if(!ShowDialog("dialog_with_date_picker" &dialog_with_date_picker)) ret
Date_output
Get_Teacher

What am I doing wrong?
#2
str controls = "4"
str Teach
Teach="&Andrew[]Jim[]James[]Don[]Derek"

must be before ShowDialog.
#3
Code:
Copy      Help
str controls = "4"
str Teach
Teach="&Andrew[]Jim[]James[]Don[]Derek"
if(!ShowDialog("dialog_with_date_picker" &dialog_with_date_picker)) ret
Date_output
Get_Teacher

I've tried this. I have put the list declarations just about everywhere in the code. The only way I can get the combo box to work is if I run the date picker as a macro with the show in that..like this

Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
def DTM_FIRST 0x1000
def DTM_GETSYSTEMTIME (DTM_FIRST + 1)
def DTM_SETSYSTEMTIME (DTM_FIRST + 2)
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "New Student Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 SysDateTimePick32 0x54000000 0x204 6 6 90 12 ""
;4 ComboBox 0x54230243 0x0 6 24 90 213 "Teach"
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "" "" ""


str controls = "4"
str Teach
Teach="&Andrew[]Jim[]James[]Don[]Derek"
if(!ShowDialog("dialog with date picker" 0 &controls)) ret

ret
;messages
SYSTEMTIME- t_st1
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
int ctrlid=wParam&0xFFFF; message=wParam>>16
sel wParam
,case IDOK
,DT_Ok hDlg
,SendMessage(id(3 hDlg) DTM_GETSYSTEMTIME 0 &t_st1)    
,case IDCANCEL DT_Cancel hDlg
ret 1

But then I can't get that macro to work right with the functions
Code:
Copy      Help
Date_output
Get_Teacher
#4
Third argument of ShowDialog must be &controls.

When you click Apply in dialog editor, it shows correct ShowDialog code in QM output. If in dialog editor Options you click 'Together with dialog definition', then Apply also modifies the code in the macro for you. Otherwise you can copy/paste.
#5
I just got that worked out while I was waiting around. Thanks for the help.


Forum Jump:


Users browsing this thread: 1 Guest(s)