06-28-2007, 06:54 AM
[Edited to clarify question]
Hi,
I need to combine a number of (currently separate and working) variable-input interfaces (e.g. a list box, a input box and a date picker) onto one dialog (call it "Form")
I'm using a Smart Diag (if there's a better way, pls lemme know). The trouble I'm having is with launching the date picker macro as part of the diag. I currently have it launched from a button using "event" BN_CLICKED. Here are the problems:
1. If possible the date picker control should really be right on the diag "form" as opposed to a button which opens it.
2. Even using a button to launch, I get the date picker interface window only after closing the dialog Form. I've tried to run it from the Form function "case" in a sep thread, and tried flag 0x400 and a few other things w/o any luck.
Just using a test dialog with only one button, I call the date picker from the button click event (e.g. case mac "murFTP_call_date")
Here's the murFTP_call_date macro:
And it's associated dialog/function murFTP_func_date:
As I said earlier, I'd rather not even launch it with a button but rather have the date picker directly on the dialog/form.
Any advice is much appreciated!
Steve
Hi,
I need to combine a number of (currently separate and working) variable-input interfaces (e.g. a list box, a input box and a date picker) onto one dialog (call it "Form")
I'm using a Smart Diag (if there's a better way, pls lemme know). The trouble I'm having is with launching the date picker macro as part of the diag. I currently have it launched from a button using "event" BN_CLICKED. Here are the problems:
1. If possible the date picker control should really be right on the diag "form" as opposed to a button which opens it.
2. Even using a button to launch, I get the date picker interface window only after closing the dialog Form. I've tried to run it from the Form function "case" in a sep thread, and tried flag 0x400 and a few other things w/o any luck.
Just using a test dialog with only one button, I call the date picker from the button click event (e.g. case mac "murFTP_call_date")
Here's the murFTP_call_date macro:
str controls = "5 6"
str sb5C e6 t
SYSTEMTIME- t_st1 t_st2 t_st3 ;;we share these variables with the dialog procedure
if(!ShowDialog("murFTP_func_date" &murFTP_func_date)) ret
DATE d.fromsystemtime(t_st1) ;;convert to DATE (for easy display)
str s=d
t.time(d "%Y%m%d")
out t
And it's associated dialog/function murFTP_func_date:
/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 216 123 "murFTP: Enter Event Date"
1 Button 0x54030001 0x4 100 102 48 14 "OK"
2 Button 0x54030000 0x4 154 102 50 14 "Cancel"
3 SysDateTimePick32 0x54000000 0x204 76 52 68 16 ""
4 Static 0x54000000 0x0 6 10 106 22 "Press OK to use today's date or choose another date below."
END DIALOG
DIALOG EDITOR: "" 0x202000A "" ""
ret
messages
SYSTEMTIME- t_st1 t_st2 t_st3
sel message
case WM_INITDIALOG
DT_Init(hDlg lParam)
here can be initialized using DTM_SETSYSTEMTIME
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)
SendMessage(id(4 hDlg) DTM_GETSYSTEMTIME 0 &t_st2)
SendMessage(id(5 hDlg) DTM_GETSYSTEMTIME 0 &t_st3)
case IDCANCEL DT_Cancel hDlg
ret 1
As I said earlier, I'd rather not even launch it with a button but rather have the date picker directly on the dialog/form.
Any advice is much appreciated!
Steve