To apply with the DPI scaling factor or other.
Code: Select all
EnableExplicit
Enumeration Window
#Window_0
EndEnumeration
Enumeration Gadgets
#Track_1
#Btn_1
#Btn_2
#Splitter
EndEnumeration
Macro Scale(XY) : Round(XY * ScaleXY, #PB_Round_Down) : EndMacro
Declare Resize_Window_0()
Declare Open_Window_0(X = 0, Y = 0, Width = 220, Height = 150)
Global ScaleXY.f = 1.00
Procedure Resize_Window_0()
ResizeWindow(#Window_0, #PB_Ignore, #PB_Ignore, Scale(220), Scale(150))
ResizeGadget(#Track_1, Scale(10), Scale(10), Scale(200), Scale(20))
ResizeGadget(#Splitter, Scale(10), Scale(40), WindowWidth(#Window_0) - Scale(20), WindowHeight(#Window_0) - Scale(50))
EndProcedure
Procedure Open_Window_0(X = 0, Y = 0, Width = 220, Height = 150)
If OpenWindow(#Window_0, X, Y, Scale(Width), Scale(Height), "Splitter Separator Size!", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TrackBarGadget(#Track_1, Scale(10), Scale(10), Scale(200), Scale(20), 100, 200)
SetGadgetState(#Track_1, ScaleXY * 100)
ButtonGadget(#Btn_1, 0, 0, 0, 0, "Button 1")
ButtonGadget(#Btn_2, 0, 0, 0, 0, "Button 2")
SplitterGadget(#Splitter, Scale(10), Scale(40), WindowWidth(#Window_0) - Scale(20), WindowHeight(#Window_0) - Scale(50), #Btn_1, #Btn_2, #PB_Splitter_Separator)
SetGadgetState(#Splitter, GadgetHeight(#Splitter) / 2)
EndIf
EndProcedure
Open_Window_0()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case #Track_1
ScaleXY = GetGadgetState(#Track_1) / 100
Resize_Window_0()
EndSelect
EndSelect
ForEver