Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting a MuiCycle event and its selected option
#12
Hi,

does anyone knows why, in the code below, the string gadgets objects 10,11 and 12 only accept the keys ipahlcC instead of numbers (0123456789) as it is supposed to?

Code:
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
Zitieren


Nachrichten in diesem Thema

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste