Fix my GUI Code?

BlitzPlus Forums/BlitzPlus Programming/Fix my GUI Code?

Mental Image(Posted 2004) [#1]
Hi,

I am no doubt missing something really obvious, but I have a problem with the following code (generated by Blitzvision btw):

;*******************************************************************************

quitSEAR=0
Repeat

If KeyDown(200) Then
If vpos>0 Then
vpos=vpos-1
render_screen
End If
End If

If KeyDown(208) Then
If vpos<event_total-28 Then
vpos=vpos+1
render_screen
End If
End If

WaitEvent()
Select EventID()
Case Event_WindowClose
quitSEAR=1

Case Event_MenuEvent
Select EventData()
Case 1 ;MenuBar_SEAR_Open
Case 2 ;MenuBar_SEAR_AppendFiles
Case 3 ;MenuBar_SEAR_Close
Case 4 ;MenuBar_SEAR_Exit
Case 5 ;MenuBar_SEAR_HelpTopics
Case 6 ;MenuBar_SEAR_About
End Select

Case Event_GadgetAction
Select EventSource()
Case Gadget_SEAR_CheckLCPTrain
CheckLCPTrain_flag = SwapAndFilter(CheckLCPTrain_flag)
filter_data
render_screen
Case Gadget_SEAR_CheckErrors

Case Gadget_SEAR_CheckSEARDigital

Case Gadget_SEAR_CheckSEARAnalogue

Case Gadget_SEAR_CheckSeperators

Case Gadget_SEAR_CheckWarning



Case Gadget_SEAR_ButtonEZ
Case Gadget_SEAR_ButtonTrends
Case Gadget_SEAR_ButtonTimes
Case Gadget_SEAR_ButtonErrors
Case Gadget_SEAR_ButtonClear
Case Gadget_SEAR_Button32
Case Gadget_SEAR_Button33
Case Gadget_SEAR_Button34
End Select

End Select

Until quitSEAR

;----------------------------------------------------------

Basically, it all works fine and the Keydown(200) and Keydown(208) calls work as they should between the "Repeat-Until" loop, until I click on one of the checkboxes (Gadget_SEAR_ etc) and then the keydown calls don't work any more (I have put debug code in and am sure thatthey are not being called). BUT, the event loops still work fine.

Any ideas?

Thanks.