this code below behaves somehow weird:
1) I need that the selected entries staying selected even without focus in both Tree and List
2) In the current example, on Windows 7, the lower list showing selection in blue and the upper in some light grey if no focus
3) If I change the background color to a darker one (commented), the selection color in lower list changes back to some light grey if no focus
4) How to change the selection color in TreeView for no-focus (rg to blue)?
5) How to make it always the blue selection and not a light grey one? I found no API for this
Code: Select all
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
#Image = 0
#Background = $F0F0F0; BBGGRR -> brighter one
; #Background = $D0D0D0; BBGGRR -> darker one
XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='400' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <vbox expand='item:2' spacing='0'>"+
" <tree name='tree' width='160' height='150' flags='#PB_Tree_AlwaysShowSelection'/>"+
" <listicon name='files' width='160' height='150' flags='#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_FullRowSelect'/>"+
" </vbox>"+
"</window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
For x.i = 1 To 10
AddGadgetItem(DialogGadget(#Dialog, "tree"), -1, "Tree entry " + Str(x.i))
AddGadgetItem(DialogGadget(#Dialog, "files"), -1, "File entry " + Str(x.i))
Next
SetGadgetColor(DialogGadget(#Dialog, "tree"), #PB_Gadget_BackColor, #Background)
SetGadgetColor(DialogGadget(#Dialog, "files"), #PB_Gadget_BackColor, #Background)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Error -Dialog- : " + DialogError(#Dialog)
EndIf
Else
Debug "Error XML : " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIfKukulkan

