Hi ChrisR! Thanks for the update! I appreciate your help. Hope you're not taking offense to all these issues - I just want your code to be rock-solid so it can be dropped into any app and work flawlessly. <Wink>. Only three small issues left at the moment.
I can confirm the latest code works better with my window now except for one bit: the background color of an editable ComboBox is still white instead of dark, like in the screenshot and test code below.
My test code:
Code: Select all
If OpenWindow(#Window_1, 200, 200, 320, 60, "Window 1", #PB_Window_SystemMenu)
button = ButtonGadget(#PB_Any, 10, 20, 300, 25, "Click to open second window")
If OpenWindow(#Window_2, 600, 200, 320, 260, "Window 2", #PB_Window_SystemMenu | #PB_Window_Invisible)
ComboBoxGadget(#Combo, 10, 10, 300, 28, #PB_ComboBox_Editable | #CBS_HASSTRINGS | #CBS_OWNERDRAWFIXED)
For I = 1 To 5 : AddGadgetItem(#Combo, -1,"ComboBox Element " + Str(I)) : Next
ListIconGadget(#ListIcon, 0, 0, 0, 0, "ListIcon Column 1", 180)
AddGadgetColumn(#ListIcon, 1, "Column 2", 120)
For I = 1 To 5 : AddGadgetItem(#ListIcon, -1,"Column 1 Element " + Str(I) +Chr(10)+ "Column 2 Element " + Str(I)) : Next
EditorGadget(#Editor, 0, 0, 0, 0)
For I = 0 To 5 : AddGadgetItem(#Editor, I, "Editor Line " + Str(I)) : Next
SplitterGadget(#Splitter, 10, 50, 300, 200, #ListIcon, #Editor, #PB_Splitter_Separator)
SetObjectColor(#PB_All, #PB_All, RGB(50,50,50))
ev = WaitWindowEvent()
If ev = #PB_Event_Gadget And EventGadget() = button
Until ev = #PB_Event_CloseWindow
I have another window that gets opened on demand by the app (after selecting a menu item on the main window to open it), and only its background color goes dark. Its TextGadget and ListIcon don't go dark at all. See the below screenshot of its top-right corner (for privacy) and the code I'm using to open it and make it dark (not compilable, but surely it shows if I'm doing something wrong?).
Code: Select all
win=OpenWindow(#PB_Any,0,0,w,h,"Window",#PB_Window_Invisible|#PB_Window_SystemMenu|#PB_Window_WindowCentered,app) ; app = Main app window.
For i=1 To ws
SetObjectColor(win,#PB_All,colordarkmode) ; Doesn't make TXT or LIG gadgets go dark.
When my main app's window is hidden (HideWindow) and then shown, or unminimized from a minimized state, the ListIcon backgrounds show white briefly before changing back to dark. A noticeable flash. Any tips on how to stop that? Thanks.