SplitterGadget with PanelGadget Flickering problem [Resolved]
Posted: Mon May 27, 2024 11:48 am
Hi,
I read a lot of posts about flickering gadgets when resizing window but nothing to fix Panel gadget as child of a splitter gadget.
Here is a sample :
As you can see, the listicon and the columns name of the Panel are flickering when we move the splitter.
Uncommenting
Uncommenting
#WS_EX_COMPOSITED and #WS_CLIPSIBLINGS | WS_CLIPCHILDREN fix the Panel flickering but some drawing problem appears with the StringGadgets.
Is there a way to fix this ?
Thanks for your time.
I read a lot of posts about flickering gadgets when resizing window but nothing to fix Panel gadget as child of a splitter gadget.
Here is a sample :
Code: Select all
Enumeration Gadgets
#Splitter
#listicon
#panel
#str1
#str2
#str3
#str4
EndEnumeration
Procedure BindSplitterV()
Static SplitterPos
Protected Position = GetGadgetState(EventGadget())
If SplitterPos <> Position
SplitterPos = Position
;UpdateWindow_(GadgetID(#listicon))
;UpdateWindow_(GadgetID(#panel))
EndIf
EndProcedure
OpenWindow(0, 0, 0, 400, 400, "Splitter", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
ListIconGadget(#listicon, 5, 5, 150, 200, "col1", 100)
PanelGadget(#panel, 0, 0, 200, 200)
AddGadgetItem (#panel, -1, "Panel 1")
StringGadget(#str1, 5, 5, 100, 25, "string one")
StringGadget(#str2, 5, 35, 100, 25, "string two")
StringGadget(#str3, 5, 65, 100, 25, "string three")
StringGadget(#str4, 5, 95, 100, 25, "string four")
AddGadgetItem (#panel, -1, "Panel 2")
AddGadgetItem (#panel, -1, "Panel 3")
CloseGadgetList()
SplitterGadget(#Splitter, 5, 5, 390, 390, #listicon, #panel, #PB_Splitter_Vertical)
BindGadgetEvent(#Splitter, @BindSplitterV())
; SetWindowLongPtr_(GadgetID(#Splitter), #GWL_EXSTYLE, GetWindowLongPtr_(GadgetID(#Splitter), #GWL_EXSTYLE) | #WS_EX_COMPOSITED)
; SetWindowLongPtr_(GadgetID(#Splitter), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#Splitter), #GWL_STYLE) | #WS_CLIPSIBLINGS | #WS_CLIPCHILDREN)
While WaitWindowEvent() <> #PB_Event_CloseWindow : WendUncommenting
fixes the Listicon.UpdateWindow_(GadgetID(#listicon))
Uncommenting
doesn't fix the Panel.UpdateWindow_(GadgetID(#panel))
#WS_EX_COMPOSITED and #WS_CLIPSIBLINGS | WS_CLIPCHILDREN fix the Panel flickering but some drawing problem appears with the StringGadgets.
Is there a way to fix this ?
Thanks for your time.