Resize ?
Verfasst: 12.12.2020 18:56
Hallo,
ich komme nicht weiter mit meine Test-Code und zwar wie ich in der Procedure ResizeWindowEvent() verfahren sollte beim ändern der Window Breite und Höhe
Danke für eine Hilfe
Gruß
MarcelX
ich komme nicht weiter mit meine Test-Code und zwar wie ich in der Procedure ResizeWindowEvent() verfahren sollte beim ändern der Window Breite und Höhe
Danke für eine Hilfe
Gruß
MarcelX
Code: Alles auswählen
Enumeration
#Window_0
#Container1
#Container2
#Container3
#Splitter1
#Splitter2
#lstCTxt
#lstSCTxt
#lstCG
#lstCSG
#lstG
#lstGTxt
#lstSGT
#lstSG
#lstD
EndEnumeration
Global x1=100
Global x2=90
Global G_colIDwidth = 60
Procedure OpenWindow_0(x = 0, y = 0, width = 800, height = 400)
Window_0 = OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
ContainerGadget(#Container1, 0, 0, 0, 0 ,#PB_Container_Flat)
TextGadget(#lstCTxt, 5, 10, x1, 21, "Catégorie", #PB_Text_Center);|#PB_Text_Border)
ComboBoxGadget(#lstCG, 5, 30, x1-20, 21)
AddGadgetItem(#lstCG, -1, "Tout")
SetGadgetState(#lstCG, 0)
TextGadget(#lstGTxt, 5, 50+20, x1-20, 21, "Groupe", #PB_Text_Center);|#PB_Text_Border)
ListViewGadget(#lstG, 5, 70+20, x1, 130)
CloseGadgetList()
ContainerGadget(#Container2, 0, 0, 0, 0 ,#PB_Container_Flat)
TextGadget(#lstSCTxt, 5, 10, x2, 21, "Catégorie", #PB_Text_Center);|#PB_Text_Border)
ComboBoxGadget(#lstCSG, 5, 30, x2, 21)
AddGadgetItem(#lstCSG, -1, "Tout")
SetGadgetState(#lstCSG, 0)
TextGadget(#lstSGT, 5, 70, x2, 21, "Sous-groupe", #PB_Text_Center);|#PB_Text_Border)
ListViewGadget(#lstSG, 5, 90, x2, 130)
CloseGadgetList()
ContainerGadget(#Container3, 0, 0, 0, 0 ,#PB_Container_Flat)
ListIconGadget(#lstD, 5, 70, 500, 130, "A", G_colIDwidth, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_MultiSelect|#PB_ListIcon_GridLines|#PB_ListIcon_HeaderDragDrop)
AddGadgetColumn(#lstD, 1, "B", 100)
CloseGadgetList()
w= WindowWidth(#Window_0)
SplitterGadget(#Splitter1, 0, 0, 0, 0, #Container1, #Container2, #PB_Splitter_Vertical|#PB_Splitter_FirstFixed )
SplitterGadget(#Splitter2, 5, 70, w-10, 230, #Splitter1, #Container3, #PB_Splitter_Vertical|#PB_Splitter_SecondFixed )
SetGadgetState(#Splitter2, 200)
SetGadgetState(#Splitter1, 90)
EndProcedure
Procedure ResizeWindowEvent()
ResizeGadget(#Container3,#PB_Ignore,#PB_Ignore,WindowWidth(#Window_0) - GadgetWidth(#Splitter1)-20,WindowHeight(#Window_0))
ResizeGadget(#lstD,#PB_Ignore,#PB_Ignore,WindowWidth(#Window_0) - GadgetWidth(#Splitter1)-20,WindowHeight(#Window_0))
ResizeGadget(#Container1,#PB_Ignore,#PB_Ignore,WindowWidth(#Window_0) - GadgetWidth(#Splitter1)-20, WindowHeight(#Window_0))
ResizeGadget(#lstG,#PB_Ignore,#PB_Ignore,#PB_Ignore,WindowHeight(#Window_0))
; ???
EndProcedure
BindEvent(#PB_Event_SizeWindow, @ResizeWindowEvent())
OpenWindow_0()
For a = 1 To 20
AddGadgetItem (#lstG, -1, "Item " + Str(a))
Next
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #Splitter1
newWidth = GadgetWidth(#Container1)-20
ResizeGadget(#lstCTxt, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstG, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstCG, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstGTxt, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
newWidth = GadgetWidth(#Container2)-20
ResizeGadget(#lstSCTxt, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstG, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstCSG, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
ResizeGadget(#lstSGT, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
newWidth = GadgetWidth(#Container3)-20
ResizeGadget(#lstD, #PB_Ignore, #PB_Ignore, newWidth, #PB_Ignore)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow