Tabbing through EditorGadgets How?
Posted: Mon Nov 09, 2015 8:56 pm
How do you tab through EditorGadgets. I want to be able to hit the tab key and have the cursor move to the next editor gadget in the series. When I hit the tab Key it stays in the same editor gadget. Below is my code.
Thanks for any help with this.
Thanks for any help with this.
Code: Select all
EnableExplicit
Enumeration FormGadget
#WinMain
#Text_0
#Text_1
#Text_3
#Text_4
#Text_6
#text_7
#txtInDir
#txtOutDir
#txtStub
#txtUID
#txtiStart
#txtiEnd
#CB_EXIT
#CB_Stop
EndEnumeration
Enumeration FormFont
#Font_WinMain_0
EndEnumeration
LoadFont(#Font_WinMain_0,"Arial", 9, #PB_Font_Bold)
;========================================================================================
Procedure Win()
Protected iFlags.i = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered
If OpenWindow(#WinMain, 0, 0,500, 200, "WhyNoTabs", iFlags)
SetWindowColor(#WinMain, RGB(255,255,128))
TextGadget(#Text_0, 10, 10, 48, 30, "Input Dir")
SetGadgetColor(#Text_0, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(#Text_0, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#Text_0, FontID(#Font_WinMain_0))
TextGadget(#Text_1, 10, 50, 60, 30, "Output Directory")
SetGadgetColor(#Text_1, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#Text_1, FontID(#Font_WinMain_0))
TextGadget(#Text_3, 10, 90, 70, 25, "Stub")
SetGadgetColor(#Text_3, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#Text_3, FontID(#Font_WinMain_0))
TextGadget(#Text_4, 200, 90, 50, 25, "Run ID")
SetGadgetColor(#Text_4, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#Text_4, FontID(#Font_WinMain_0))
TextGadget(#Text_6, 10, 130, 50, 30, "Start File Date")
SetGadgetColor(#Text_6, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#Text_6, FontID(#Font_WinMain_0))
TextGadget(#text_7, 200, 130, 50, 30, "End File Date")
SetGadgetColor(#text_7, #PB_Gadget_BackColor,RGB(255,255,128))
SetGadgetFont(#text_7, FontID(#Font_WinMain_0))
EditorGadget(#txtInDir, 80, 10, 370, 20)
EditorGadget(#txtOutDir, 80, 50, 370, 20)
EditorGadget(#txtStub, 80, 90, 90, 20)
EditorGadget(#txtUID, 260, 90, 90, 20)
EditorGadget(#txtiStart, 80, 130, 90, 20)
EditorGadget(#txtiEnd, 260, 130, 90, 20)
ButtonGadget(#CB_EXIT, 130, 160, 65, 30, "Exit")
SetGadgetFont(#CB_EXIT, FontID(#Font_WinMain_0))
ButtonGadget(#CB_Stop, 310, 160, 65, 30, "Stop")
SetGadgetFont(#CB_Stop, FontID(#Font_WinMain_0))
EndIf
EndProcedure
;=========================================================================
Procedure WaitForUser()
Protected iExit = #False
Protected sInpFilesDir.s = "", sOutFilesDir.s=""
Protected l.l,sStub.s,sTemp.s,sFileName.s,lR.l
Define Event
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow:
iExit = #True
Break
Case #PB_Event_Gadget
Select EventGadget()
Case #CB_EXIT
iExit = #True
Break
Case #CB_STOP
EndSelect
EndSelect
Until iExit = #True
End
EndProcedure
Win()
WaitForUser()
End