Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SmartDialog vs. Dialog
#1
while testing with dialogs i found a strange behaivor:

this one is recognized as smartdialog:
Dialog2
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90C80A44 0x118 0 0 305 135 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 RichEdit20A 0x54033040 0x200 4 22 194 14 "url1"
;4 RichEdit20A 0x54033040 0x200 200 22 34 14 "size1"
;5 Edit 0x54030000 0x200 4 4 96 14 "title"
;END DIALOG
;DIALOG EDITOR: "" 0x2010807 "" ""


ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)

sel message
,case WM_INITDIALOG
,mov 1700 100 hDlg
,ret 1
,case WM_DROPFILES TO_DropFiles hDlg wParam
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_SETFOCUS<<16|5
,,out "huhu"
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1

when removing:
Dialog2
Code:
Copy      Help
,case EN_SETFOCUS<<16|5
,,out "huhu"

it is not a smartdialog anymore, but with:

Dialog2
Code:
Copy      Help
,;case EN_SETFOCUS<<16|5
,,;out "huhu"

its a smartdialog again.

it took me 20 minutes to find out why my dialog switched back to normal.
pi
#2
What do you mean "not recognized as smart dialog"? Does dialog editor refuses to add messages?
#3
yes.
pi
#4
Works well here.

Maybe this line in DE_Events returns -1?

Code:
Copy      Help
m2=findrx(s "^[ ;]messages2[](.*[])*sel wParam[][\t,]" 0 8 l2)

It could return -1 for example if

Code:
Copy      Help
sel wParam

does not end with carriage return and newline characters (for example, comments are added, or there is only newline without carriage return).

Or there is an empty line without tab:
Code:
Copy      Help
;messages2
sel wParam

,case EN_SETFOCUS<<16|5
,,out "huhu"


Other possible reason - the code is not in a function.
#5
Quote:does not end with carriage return and newline characters (for example, comments are added, or there is only newline without carriage return).

that might have been the problem.
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)