I have tested with XP styles enabled and disabled. There is slightly less flickering with #WS_CLIPCHILDREN.
There is still flickering either way which needs to be handled (#WS_CLIPCHILDREN or not). The #WS_EX_COMPOSITED example and the link was provided to show this and demonstrate how to make both a panel and a list gadget draw properly inside of a splitter. This solution also demonstrates how to benefit from the #WS_CLIPCHILDREN style.
The :roll: was merely a challenge "You can do better than that, srod!" and I provided an example to back it up. I still believe that this style helps more than hurts and it can always be disabled. But I still have yet to see a solid example that proves it hurts.
Mistrel wrote:Would you provide an example? (In the informative sense)
I still have yet to see an example to demonstrate how #WS_CLIPCHILDREN creates more flickering. freak said there is a problem with some gadgets (which ones?), srod says panel gadgets (it does not appear worse here), fred says panels and lists (also not worse here), and Sparkie has publicly expressed his distaste of my use of :roll:.
What I'm asking is for an example or a link that demonstrates more flickering with this style using PB gadgets so that I'll know what to watch out for.
Code: Select all
OpenWindow(0,0,0,322,240,"ContainerGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
ContainerGadget(0,8,32,306,133,#PB_Container_Raised)
;/ Panel
PanelGadget(1,0,0,306,200)
AddGadgetItem(1,-1,"Sub-Panel 1")
AddGadgetItem(1,-1,"Sub-Panel 2")
AddGadgetItem(1,-1,"Sub-Panel 3")
CloseGadgetList()
;/ List Icon
ListIconGadget(2,0,0,306,200,"",120)
For i=0 To 100
AddGadgetItem(2,-1,"HelloHello"+#LF$+"HelloHelloHelloHello"+#LF$+"Hello")
Next
CloseGadgetList()
HideGadget(2,1)
;/ Toggle
ButtonGadget(3,8,8,100,22,"Show Toggle")
ButtonGadget(4,116,8,100,22,"Disable Style")
WindowStyle=GetWindowLongPtr_(GadgetID(0),#GWL_STYLE)
SetWindowLongPtr_(GadgetID(0),#GWL_STYLE,WindowStyle|#WS_CLIPCHILDREN)
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_SizeWindow
ResizeGadget(0,8,32,WindowWidth(0)-16,WindowHeight(0)-40)
GetClientRect_(GadgetID(0),@Rect.RECT)
ResizeGadget(1,0,0,Rect\right,Rect\bottom)
ResizeGadget(2,0,0,Rect\right,Rect\bottom)
Case #PB_Event_Gadget
If EventGadget()=3
If Not ShowToggle
HideGadget(1,1)
HideGadget(2,0)
ShowToggle=1
Else
HideGadget(1,0)
HideGadget(2,1)
ShowToggle=0
EndIf
EndIf
If EventGadget()=4
If Not StyleToggle
WindowStyle=GetWindowLongPtr_(GadgetID(0),#GWL_STYLE)
SetWindowLongPtr_(GadgetID(0),#GWL_STYLE,WindowStyle&(~#WS_CLIPCHILDREN))
SetGadgetText(4,"Enable Style")
StyleToggle=1
Else
WindowStyle=GetWindowLongPtr_(GadgetID(0),#GWL_STYLE)
SetWindowLongPtr_(GadgetID(0),#GWL_STYLE,WindowStyle|#WS_CLIPCHILDREN)
SetGadgetText(4,"Disable Style")
StyleToggle=0
EndIf
EndIf
EndSelect
Until Event=#PB_Event_CloseWindow