stig
New Member
Posts: 40
|
Post by stig on Sept 1, 2022 16:59:45 GMT -5
gosub [initialize]
gosub [center]
[STEP1]
button #dialog.next, next$,[step1Next],UL,266,198,76,25
button #dialog.cancel,cancel$,[step1Cancel],UL,190,198,76,25
open title1$ for dialog as #dialog
gosub [setfont]
print #dialog, "trapclose [step1Cancel]"
[step1wait]
wait
[step1Cancel]
close #dialog
goto [close]
[step1Next]
close #dialog
goto [STEP2]
[STEP2]
button #dialog.next, next$,[step2Next],UL,266,198,76,25
button #dialog.cancel, cancel$,[step2Cancel],UL,114,198,76,25
button #dialog.back, back$,[step2Back],UL,190,198,76,25
open title2$ for dialog as #dialog
gosub [setfont]
[step2wait]
wait
[step2Cancel]
close #dialog
goto [close]
[step2Back]
close #dialog
goto [STEP1]
[step2Next]
close #dialog
goto [STEP3]
[STEP3]
button #dialog.next, next$,[step3Next],UL,266,198,76,25
button #dialog.cancel, cancel$,[step3Cancel],UL,114,198,76,25
button #dialog.back, back$,[step3Back],UL,190,198,76,25
open title3$ for dialog as #dialog
gosub [setfont]
print #dialog, "trapclose [step3Cancel]"
[step3wait]
wait
[step3Cancel]
close #dialog
goto [close]
[step3Back]
close #dialog
goto [STEP2]
[step3Next]
close #dialog
goto [STEP4]
[STEP4]
button #dialog.next, next$,[step4Next],UL,266,198,76,25
button #dialog.cancel, cancel$,[step4Cancel],UL,114,198,76,25
button #dialog.back, back$,[step4Back],UL,190,198,76,25
open title4$ for dialog as #dialog
gosub [setfont]
print #dialog, "trapclose [step4Cancel]"
[step4wait]
wait
[step4Cancel]
close #dialog
goto [close]
[step4Back]
close #dialog
goto [STEP3]
[step4Next]
close #dialog
goto [STEP5]
[STEP5]
button #dialog.next, finish$,[step5Finish],UL,266,198,76,25
button #dialog.cancel, cancel$,[step5Cancel],UL,114,198,76,25
button #dialog.back, back$,[step5Back],UL,190,198,76,25
open title5$ for dialog as #dialog
gosub [setfont]
print #dialog, "trapclose [step5Cancel]"
[step5wait]
wait
[step5Cancel]
close #dialog
goto [close]
[step5Back]
close #dialog
goto [STEP4]
[step5Finish]
notice "Cool :)"
close #dialog
goto [close]
' subroutines:
[setfont]
print #dialog, "font consolas 14"
return
[center]
UpperLeftX = DisplayWidth/2 - WindowWidth/2
UpperLeftY = DisplayHeight/2 - WindowHeight/2
return
[initialize]
nomainwin
WindowWidth = 360: WindowHeight = 260
cancel$="Cancel": back$="Back"
next$="Next": finish$="Finish"
title1$="Masterpiece of Wizardry: Step1": title2$="Step2"
title3$="Step3": title4$="Step4"
title5$="Step5": title5$="Step5"
return
[close]
end
|
|
|
Post by atomose on Feb 18, 2023 7:35:09 GMT -5
A little help for optimise your code nomainwin WindowWidth = 360: WindowHeight = 260 : UpperLeftY = DisplayHeight/2 - WindowHeight/2 : window = 1 cancel$="Cancel" : back$="Back" : next$="Next" : finish$="Finish" : title1$="Masterpiece of Wizardry : Step1" : title2$="This is how" : title3$="You can easily" : title4$="optimise" : title5$="Your code =)" button #dialog.next, next$,[stepNext],UL,266,190,75,30 button #dialog.cancel,cancel$,[stepCancel],UL,114,190,75,30 button #dialog.back, back$,[backNext],UL,190,190,75,30 statictext #dialog.1, title1$, 30, 30, 300, 20 open "exemple" for dialog as #dialog print #dialog, "font consolas 12" print #dialog, "trapclose [stepCancel]" if window = 1 then #dialog.back "!hide" wait
[stepCancel] close #dialog : end
[stepNext] if window = 5 then wait window = window + 1 gosub [checkDIAL] print #dialog.next, next$ print #dialog.cancel, cancel$ #dialog.back "!show" : print #dialog.back, back$ wait
[backNext] if window = 2 then #dialog.back "!hide" if window = 1 then wait window = window - 1 gosub [checkDIAL] print #dialog.next, next$ print #dialog.cancel, cancel$ if window > 1 then #dialog.back "!show" : print #dialog.back, back$ wait
[checkDIAL] if window = 1 then print #dialog.1, title1$ if window = 2 then print #dialog.1, title2$ if window = 3 then print #dialog.1, title3$ if window = 4 then print #dialog.1, title4$ if window = 5 then print #dialog.1, title5$ return
|
|
stig
New Member
Posts: 40
|
Post by stig on Jul 19, 2023 18:48:52 GMT -5
Thanks
|
|