Posts: 1,271
Threads: 399
Joined: Mar 2003
when working with smart dialogs you might find my function usefull.
the macro should be fired from your custom qm editor toolbar.
its thought as run dialog button.
toggle between edit dialog and run dialog.
the run macro part is not included.
you have to add it on your own :mrgreen:
Function
qmDialogSwitcher
out
str mName.getmacro("" 1)
str mCode.getmacro("")
;str firstline.getl(mCode 0)
int i=findw( mCode "\Dialog_Editor")
sel i
,case 0
,,mCode.from(" " mCode)
,case 1
,,mCode.ltrim
,case else
,,out "this is not a dialog"
,,end
,,
mCode.setmacro(mName)
Posts: 1,271
Threads: 399
Joined: Mar 2003
could be coded better
hock:
Function
qmDialogSwitcher
out
str mName.getmacro("" 1)
str mCode.getmacro("")
str firstline.getl(mCode 0)
int i=findw( mCode "\Dialog_Editor")
if i<2
,if i=0
,,mCode.from(" " mCode)
,else
,,mCode.ltrim
,mCode.setmacro(mName)
,0.5
,key Cr
else
,mes "this is not a dialog"
Posts: 153
Threads: 33
Joined: Aug 2009
Liked the idea. Made it a bit different.
Function
qmDialogSwitcher
str mName.getmacro("" 1)
str mCode.getmacro("")
str firstline.getl(mCode)
if(find(firstline "\Dialog_Editor")=-1) ret
if(firstline.beg(" ")) mCode.ltrim
else mCode- " "
mCode.setmacro(mName)
key Cr