Page 3 of 3

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Sat Feb 08, 2025 10:56 am
by Zapman
The code in the first post has been updated.
The FrameGadget now reacts to its creation flags (#PB_Frame_Single, #PB_Frame_Double, #PB_Frame_Flat or #PB_Frame_Container). Drawing a big contener is far faster.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Wed Feb 12, 2025 1:36 pm
by Zapman
The code in the first post has been updated again.
• The PanelGadget has now colorized arrows (when there is too much panels to see all of them). See the picture of the first post of this subject.
• A new 'ApplyColorsToAllGadgets(WindowNum, FrontColor, BackColor)' function allows you to colorize all the gadgets of a window with a simple line.
• The 'SetGadgetColorEx()' procedure is more rational and simple.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Wed Feb 19, 2025 5:30 pm
by Zapman
A new big update of the code figuring in the first post:
  • All gadgets are now fully colorized by the library (including ExplorerComboGadget, DateGadget and CalendarGadget).
  • Hovered gadgets are highlighted.
  • The overall operation is even faster.
Runs on Windows 7 -> Windows 11, with x64 and x86.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Wed Feb 19, 2025 6:31 pm
by Caronte3D
Thanks! It's very useful and easy to work with :wink:

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Sun Feb 23, 2025 9:15 pm
by dcr3
Realy nice, that you come back to it, not only added color to the others gadgets,but also improved it. :D

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Mon Feb 24, 2025 10:19 am
by Zapman
dcr3 wrote: Sun Feb 23, 2025 9:15 pmRealy nice, that you come back to it, not only added color to the others gadgets,but also improved it. :D
And the library is still compact, even though she gained a little weight :D
Thank you dcr3.
I just discovered some small issues with the ExplorerComboGadget and the DateGadget and CalendarGadget for older versions of Windows. A future release will fix this soon.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Tue Feb 25, 2025 11:46 am
by Zapman
ExplorerCombo, Calendar and Date gadgets had problems with some versions of Windows. That is now fixed.
The code in the first message of this subject has been updated.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Tue Feb 25, 2025 3:37 pm
by Caronte3D
File not found :D

Code: Select all

XIncludeFile "../Références API/GetCallbackMessagesNames.pb"

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Tue Feb 25, 2025 6:05 pm
by Caronte3D
TextGadget of Container2 not show at first:

Code: Select all

IncludeFile "SetGadgetColorEx.pbi"


If OpenWindow(0, 400, 400, 200, 200, "PureBasic Window", #PB_Window_SystemMenu)
  
  Define Container1=ContainerGadget(#PB_Any,10,10,180,180)   
  SetGadgetColor(Container1,#PB_Gadget_BackColor,#Red)
  TextGadget(#PB_Any,10,10,160,80,"Container 1") 
  Define button1=ButtonGadget(1,10,100,140,20,"Go to Container2")
  CloseGadgetList()
  HideGadget(Container1,1)
  
  Define Container2=ContainerGadget(#PB_Any,10,10,180,180)   
  SetGadgetColor(Container2,#PB_Gadget_BackColor,#Blue)
  TextGadget(#PB_Any,10,10,160,80,"Container 2")   
  Define button2=ButtonGadget(2,10,100,140,20,"Go to Container1")
  CloseGadgetList()
  
  
   Repeat
     Event = WaitWindowEvent()
     Select Event    
       Case #PB_Event_Gadget
         Select EventGadget()
           Case 1
             HideGadget(Container1,1)
             HideGadget(Container2,0)
           Case 2
             HideGadget(Container2,1)
             HideGadget(Container1,0)             
         EndSelect     
     EndSelect
   Until Event = #PB_Event_CloseWindow

EndIf

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Tue Feb 25, 2025 7:00 pm
by Zapman
Caronte3D wrote: Tue Feb 25, 2025 3:37 pm File not found :D

Code: Select all

XIncludeFile "../Références API/GetCallbackMessagesNames.pb"
Sorry for this thoughtlessness. This line should have been deleted. I just updated the file.
Caronte3D wrote: Tue Feb 25, 2025 6:05 pm TextGadget of Container2 not show at first:

Code: Select all

...
That's interresting! Thank's for that test idea. I'll work on it.

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Tue Feb 25, 2025 7:48 pm
by Zapman
Caronte3D wrote: Tue Feb 25, 2025 6:05 pm TextGadget of Container2 not show at first:
It's fixed and the code has been updated.
Thanks again for this test!

Re: A very simple SetGadgetColorEx() function [Windows]

Posted: Mon Mar 10, 2025 6:25 pm
by Zapman
Code has been updated.

Due to a bug, the memory was not entirely cleaned when closing the gadget's window.
This is fixed whith the actual version (available in the first post of this subject).

Since there haven't been any bug reports for a while and I don't see what could be improved, I think we can consider this version as final (before the next one :D).