Looking for a way to detect when and what tab is clicked on a PanelGadget. ie the point when the tab gets the focus.
I came across this thread from 2007 http://www.purebasic.fr/english/viewtop ... ab+clicked
I prefer the NetMaestro code in the 3rd post over akj's 4th post as akj code detects the tab focus multiple times whereas NetMaestro code does the single detection.
I have a 4 tab PanelGadget. On Tab 3 I have a combobox that contains a list of files in a directory. To refresh this file list I have been using a separate button to reload the files into the combobox.
What I am trying to do is run the reload code when the Tab 3 get focus, thus getting rid of the reload button.
However I am not sure after hours of testing how to actually fire the reload code once the tab 3 is selected. The Netmaestro code is this...The change is detected in the procedure where is fires off a Debug, but I am not sure how to get it to fire an event that can detected with EventType
Code: Select all
Global oldproc, lastgadget, lastitem
Procedure WindowProc(hwnd, msg, wparam, lparam)
Select msg
Case #TCM_GETITEM
gadget = GetDlgCtrlID_(hwnd)
item = wparam
If gadget<>lastgadget Or item<>lastitem
lastgadget = gadget
lastitem = item
Debug "Gadget: "+Str(gadget)+", item: "+Str(item)
EndIf
EndSelect
ProcedureReturn CallWindowProc_(oldproc, hwnd, msg, wparam, lparam)
EndProcedure
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
PanelGadget (1, 10, 20, 290, 180)
AddGadgetItem(1, -1, "Sub-Panel 1")
AddGadgetItem(1, -1, "Sub-Panel 2")
AddGadgetItem(1, -1, "Sub-Panel 3")
AddGadgetItem(1, -1, "Sub-Panel 4")
CloseGadgetList()
oldproc = SetWindowLong_(GadgetID(1), #GWL_WNDPROC, @WindowProc())
Repeat
;*********************************
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
eg
PS, as this code is from 2007, has things become easier in the last 10 years at detect a PanelGadget Tab Event
Thanks really much if you can answer.