Code: Select all
; PureBasic Visual Designer v3.81 build 1321
IncludeFile "GeneratedIncludeFile.pb"
Global conv_type
Global celcius
Global fahrenheit
conv_type = 1
celcius = #string_C
fahrenheit = #string_F
Open_Window_0()
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
;Debug "WindowID: " + Str(EventWindowID())
GadgetID = EventGadgetID()
If GadgetID = #chk_celc
conv_type = 1
ElseIf GadgetID = #chk_fahr
conv_type = 0
EndIf
If GadgetID = #Convert_0 And conv_type = 1
fahrenheit = (9/5)*(#string_C) +32
ElseIf GadgetID = #Convert_0 And conv_type = 0
celcius = (5/9)*(#string_F-32)
EndIf
EndIf
Until Event = #PB_EventCloseWindow
End
;
What I tried to make it do
Ok.. The check boxes are to enable a selection between either Celcius to fahrenheit or fahrenheit to celcius. I want to be able to only check one of the options. When the option is selected and the user inputs the relevent info in the correct box, then clicks go, the calculation is made and the result to show in the other box.
confused, not me coz i get it, i just cant explain it well.
Any hints as to where and how I'm going about this incorrectly
