18.08.2015, 01:36
Hi Daedalus,
You´re right, everything you wrote is correct.
This is the first time I used MUI and I want to make an application that uses 2 cycle gadgets, so I wanted to understand how cycle gadgets are detected by the code but I never got do the Notify works as it should. This is because I always used the MUINotify instead of MUINotifyApp.
My app is at the begining of coding (I was only testing how MUI works) and I was stuck with the Notify but, with your help, I reached my goal and now the code works well:
You´re right, everything you wrote is correct.
This is the first time I used MUI and I want to make an application that uses 2 cycle gadgets, so I wanted to understand how cycle gadgets are detected by the code but I never got do the Notify works as it should. This is because I always used the MUINotify instead of MUINotifyApp.
My app is at the begining of coding (I was only testing how MUI works) and I was stuck with the Notify but, with your help, I reached my goal and now the code works well:
Code:
WBStartup
Dim PageName$(2)
PageName$(0)="Oscillator"
PageName$(1)="Timer"
#MyCycle1=11
#MyCycle2=22
MUIApplicationTitle "ChipCalc 555"
MUIApplicationVersion "$VER: ChipCalc 555 0.1 (10.08.2015)"
MUIApplicationCopyright "(c)2015 C.Domingues"
MUIApplicationAuthor "C.Domingues"
MUIApplicationDescription "555 calculator"
MUIApplicationBase "CHIPCALC"
MUILabel 0,"Calculate the",#MUIO_Label_DoubleFrame
MUILabel 1,"Calculate the",#MUIO_Label_DoubleFrame
MUICycle 2,"Resistor value","Capacitor value","Time periode"
MUICycle 3,"Resistor 1 value","Resistor 2 value","Frequency value"
MUISimpleButton 4,"Simple Button A"
MUISimpleButton 5,"Simple Button B"
MUIAddObjsHGroup 6,0,2
MUICreateHGroup 6
MUIAddObjsVGroup 7,6,4
MUICreateVGroup 7
MUIAddObjsHGroup 8,1,3
MUICreateHGroup 8
MUIAddObjsVGroup 9,8,5
MUICreateVGroup 9
MUIAddObjsPage 10,7,9
MUICreatePage 10,"Timer","Oscillator"
MUICreateWindow 11,"ChipCalc","PAGE",10
MUIAddSubWindow 11
If MUICreateApplication <> True Then End
MUINotifyApp 11,#MUIA_Window_CloseRequest,1,-11
MUINotifyApp 2,#MUIA_Cycle_Active,#MUIV_EveryTime,#MyCycle1
MUINotifyApp 3,#MUIA_Cycle_Active,#MUIV_EveryTime,#MyCycle2
success=MUIOpenWindow (11)
Repeat
ev.l=MUIWaitEvent
Select ev
Case #MyCycle1
cy=MUIGetCycle (2)
NPrint "MyChoice is Cycle1: ",cy
Case #MyCycle2
cy=MUIGetCycle (3)
NPrint "MyChoice is Cycle2: ",cy
End Select
Until ev=-11
MUICloseWindow 11
End