Sparkie wrote:Not to worry zikitrake, I'm not bothered by your lib.zikitrake wrote:The last thing that I would like is to bother someone.![]()
I thought since you created a lib for all this that you may have been using a method that was different and simpler than what I was using. My curiosity had me wondering.

Try this code to see what are the diferences, please
Code: Select all
Enumeration
#ButtonGadget
#StringGadget
#CheckboxGadget
#OptionGadget
EndEnumeration
; --> How many gadgets to tab
gadgetsToTab = 4
; --> Array of gadget tab stops
Global Dim tabStop(gadgetsToTab-1)
; --> Set tab stop order
tabStop(0) = #StringGadget
tabStop(1) = #OptionGadget
tabStop(2) = #ButtonGadget
tabStop(3) = #CheckboxGadget
; --> Procedure to change z-order (tab stops)
Procedure GadgetTabOrder()
; Get zero based array size
tabCount = PeekL(@tabStop(0)-8)
For gad = 0 To tabCount - 1
If gad = 0
; First gadget is first tab stop
pos = #HWND_TOP
Else
; Remaining gadgets follow previous gadget
pos = GadgetID(previousGad)
EndIf
previousGad = tabStop(gad)
; --> Make the z-order change
SetWindowPos_(GadgetID(tabStop(gad)), pos, -1, -1, -1, -1, #SWP_NOMOVE | #SWP_NOSIZE | #SWP_SHOWWINDOW)
Next gad
EndProcedure
Procedure WindowToSort(title.s)
OpenWindow(0, 0, 0, 220, 130,title, #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
CheckBoxGadget(#CheckboxGadget, 70, 10, 200, 20, "Fouth Tab")
ButtonGadget(#ButtonGadget, 10, 10, 50, 20, "Third Tab")
StringGadget(#StringGadget, 10, 100, 200, 20, "First Tab")
OptionGadget(#OptionGadget, 10, 40, 200, 20, "Second Tab")
EndProcedure
WindowToSort("Without reorder")
Repeat: event = WaitWindowEvent(): Until event = #PB_Event_CloseWindow
WindowToSort("Sparkie Original")
GadgetTabOrder()
Repeat: event = WaitWindowEvent(): Until event = #PB_Event_CloseWindow
WindowToSort("Sparkie Modified")
Ziki_GadgetTabOrder(WindowID(0))
Repeat: event = WaitWindowEvent(): Until event = #PB_Event_CloseWindow