18.08.2015, 09:39
Excellent, glad it's working for you It takes a little bit of getting used to, and often I was wondering if it was my code or a bug that stopped some things from working. Good luck with the rest of the project
WBStartup
Dim PageName$(2)
PageName$(0)="Function"
PageName$(1)="Scheme"
#CyTimerOscil=11
#CyOption=22
MUIApplicationTitle "ChipCalc 555"
MUIApplicationVersion "$VER: ChipCalc 555 0.1 (10.08.2015)"
MUIApplicationCopyright "(c)2015 Carlos.D."
MUIApplicationAuthor "Carlos D."
MUIApplicationDescription "555 calculator"
MUIApplicationBase "CHIPCALC"
MUILabel 0," Chip 555 as ",#MUIO_Label_DoubleFrame
MUILabel 1," Calculate the",#MUIO_Label_DoubleFrame
MUICycle 2,"Timer","Oscilator"
MUICycle 3,"Resistor value","Capacitor value","Time periode"
MUICycle 4,"Resistor 1 value","Resistor 2 value","Frequency"
MUILabel 5," Resistor 1 in Ohms> ",#MUIO_Label_DoubleFrame
MUILabel 6," Capacitor in uF > ",#MUIO_Label_DoubleFrame
MUILabel 7," Time periode in sec>",#MUIO_Label_DoubleFrame
MUILabel 8," Resistor 2 in Ohms> ",#MUIO_Label_DoubleFrame
MUILabel 9," Frequency in Hz>",#MUIO_Label_DoubleFrame
MUIString 10,"",9
MUISet 10,#MUIA_String_Accept,"0123456789"
MUIString 11,"",10
MUISet 11,#MUIA_String_Accept,"0123456789"
MUIString 12,"",6
MUISet 12,#MUIA_String_Accept,"0123456789"
MUIAddObjsHGroup 13,5,10 ;value of Resistor 1
MUICreateHGroup 13
MUIAddObjsHGroup 14,6,11 ;value of Capacitor
MUICreateHGroup 14
MUIAddObjsHGroup 15,7,12 ;Value of Time periode
MUICreateHGroup 15
MUIAddObjsHGroup 16,8,11 ;value of Resistor 2
MUIAddObjsHGroup 17,9,12 ;value of Frequency
MUIAddObjsHGroup 18,0,2 ;555 as timer / oscilator choice
MUICreateHGroup 18
MUIAddObjsHGroup 19,1,3 ;555 as timer
MUICreateHGroup 19
MUIAddObjsHGroup 20,1,4 ;555 as oscilator
MUIVSpace 21,20
MUIVSpace 22,5
MUIAddObjsVGroup 23,19,21,13,14,15 ;All group of Timer
MUIAddObjsVGroup 24,22,20,21,13,16,17 ;All group of Oscilator
MUICreateVGroup 23
MUIAddObjsPage 25,23
MUICreatePage 25,"Function","Scheme"
MUIMakeObject 26,#MUIO_HBar,20
MUIAddObjsVGroup 27,18,26,25
MUICreateVGroup 27
MUICreateWindow 28,"ChipCalc","PAGE",27
MUIAddSubWindow 28
If MUICreateApplication <> True Then End
MUINotifyApp 28,#MUIA_Window_CloseRequest,1,-11
MUINotifyApp 2,#MUIA_Cycle_Active,#MUIV_EveryTime,#CyTimerOscil
MUINotifyApp 3,#MUIA_Cycle_Active,#MUIV_EveryTime,#CyOption
success=MUIOpenWindow (28)
Repeat
ev.l=MUIWaitEvent
Select ev
Case #CyTimerOscil
cy2=MUIGetCycle (2)
If cy2=0 Then Gosub _Timer
If cy2=1 Then NPrint "Oscilator"
Case #CyOption
cy3=MUIGetCycle (3)
Gosub _Timer
End Select
Until ev=-11
MUICloseWindow 28
End
._Timer
If cy3=0
MUISet 10,#MUIA_Disabled,True
MUISet 11,#MUIA_Disabled,False
MUISet 12,#MUIA_Disabled,False
EndIf
If cy3=1
MUISet 10,#MUIA_Disabled,False
MUISet 11,#MUIA_Disabled,True
MUISet 12,#MUIA_Disabled,False
; cap$=MUIGetString$ (10)
NPrint "Capacitor =",cap$
EndIf
If cy3=2
MUISet 10,#MUIA_Disabled,False
MUISet 11,#MUIA_Disabled,False
MUISet 12,#MUIA_Disabled,True
EndIf
Return
Der Wanderer schrieb:It is because you are using MUISet wrong. It it wants a taglist.
Daedalus schrieb:I used the new command GetGlobalStrAddr instead to fix it:
[ab3]MUISet 10, #MUIA_String_Accept, GetGlobalStrAddr("0123456789")[/ab3]
But this needs the latest snapshot of AmiBlitz as the command has been added since the 3.6.1 release was put together.
AlfaRomeo schrieb:maybe because, in my code it still accept the introduction of some few letters
Daedalus schrieb:...effectively it will be random bytes, so by chance there are some bytes that are allowed. You might find that the accepted characters change over time, depending on what else your program does.@Daedalus