Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Input From User
#9
It is because ShowDialog cannot decrypt dialog definition. Place dialog definition in other macro and leave it nonencrypted.

Example:

Macro1 (can be encrypted):

Code:
Copy      Help
str controls = "3"
str lb3
lb3="Button1[]Button2[]Button3[]Button4[]Button5[]Button6"
if(!ShowDialog("Macro2" 0 &controls win)) ret

rep 3
,if(lb3[0]='1')
,,mes "Button1"
,if(lb3[1]='1')
,,mes "Button2"
,if(lb3[2]='1')
,,mes "Button3"
,if(lb3[3]='1')
,,mes "Button4"
,if(lb3[4]='1')
,,mes "Button5"
,if(lb3[5]='1')
,,mes "Button6"

Macro2 (must not be encrypted):

Code:
Copy      Help
;\Dialog_Editor

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 105 86 "Form"
;1 Button 0x54030001 0x4 4 68 48 14 "OK"
;2 Button 0x54030000 0x4 54 68 48 14 "Cancel"
;3 ListBox 0x54230109 0x200 4 4 98 61 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010500 "*" ""

Note: first argument of ShowDialog must be name of macro that contains dialog definition.


Alternatively, you can pass dialog definition itself instead of macro name. Use flag 2 with ShowDialog.

Example:

Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 105 86 "Form"
;1 Button 0x54030001 0x4 4 68 48 14 "OK"
;2 Button 0x54030000 0x4 54 68 48 14 "Cancel"
;3 ListBox 0x54230109 0x200 4 4 98 61 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010500 "*" ""


str controls = "3"
str lb3
lb3="Button1[]Button2[]Button3[]Button4[]Button5[]Button6"
if(!ShowDialog(dd 0 &controls 0 2)) ret

rep 3
,if(lb3[0]='1')
,,mes "Button1"
,if(lb3[1]='1')
,,mes "Button2"
,if(lb3[2]='1')
,,mes "Button3"
,if(lb3[3]='1')
,,mes "Button4"
,if(lb3[4]='1')
,,mes "Button5"
,if(lb3[5]='1')
,,mes "Button6"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)