Ice Button Theme Windows Library (for Dark or Light Theme Button)

Share your advanced PureBasic knowledge/code with the community.
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

IceButtons Windows library will add a theme to your ButtonGadget, ButtonImageGadget
They'll still work in the same way as PureBasic Button, they're ButtonGadget, ButtonImageGadget

How tu use:
. Add: XIncludeFile "IceButtons.pbi"
. And apply one of the themes With the function: SetIceButtonTheme(#IceBtn_Theme_DarkBlue) or SetIceButtonTheme(#IceBtn_Theme_LightBlue)
Easy, that's all :wink:
Note that you can SetIceButtonTheme(Theme) anywhere you like in your source, before or after creating the window, gadget's and buttons

Image


Theme attribute (defined in DataSection)
  • #IceBtn_color, Color : Button color
  • #IceBtn_BackColor, Color Or #PB_Default : Button background color, #PB_Default To get window color
  • #IceBtn_DisableColor, Color Or #PB_Default : Disable Button color, #PB_Default To obtain the color by applying a deactivated filter To the button color
  • #IceBtn_FrontColor, Color Or #PB_Default : Button text color, #PB_Default = White Or Black depending on whether the button color is dark Or light
  • #IceBtn_DisableFrontColor, Color Or #PB_Default : Disable text color, #PB_Default To obtain the color by applying a deactivated filter To the button text color
  • #IceBtn_EnableShadow, 0 Or 1 : Disable Or Enable text shadow
  • #IceBtn_ShadowColor, Color Or #PB_Default : Button text shadow color, #PB_Default = White Or Black depending on whether the button text color is dark Or light
  • ##IceBtn_BorderColor, Color or #PB_Default : Button border color, #PB_Default for the Button color
  • #IceBtn_RoundX, Size : from 1 To X. For RoundBox(), the radius of the rounded corners in the X direction
  • #IceBtn_RoundY, Size : from 1 To Y. For RoundBox(), the radius of the rounded corners in the Y direction
Public Functions
  • SetIceButtonTheme(#Theme) : Apply, Change Theme
    . . . - Ex: SetIceButtonTheme(#IceBtn_Theme_DarkBlue) or SetIceButtonTheme(#IceBtn_Theme_LightBlue) or custom future Theme
  • GetIceButtonTheme() : Get the current theme
  • IsIceButton(#Gadget) : Is it an IceButton?
  • FreeIceButtonTheme() : Free the theme, IceButton and associated resources and return to the standard ButtonGadget
  • SetIceBtnThemeAttribute(#Attribut, Value) : Changes a theme attribute value
    . . . - Ex: SetIceBtnThemeAttribute(#IceBtn_color, #Blue) to change the theme Button color attribute in blue
  • GetIceBtnThemeAttribute(#Attribut) : Returns a theme Attribute value
    . . . - Ex: GetIceBtnThemeAttribute(#IceBtn_color)
  • SetIceButtonAttribute(#Gadget, #Attribut, Value) : Changes an IceButton attribute value
    . . . - Ex: SetIceButtonAttribute(#Gadget, #IceBtn_color, #Blue) to change the IceButton color in blue
  • GetIceButtonAttribute(#Gadget, #Attribut) : Returns an IceButton attribute value
    . . . - Ex: GetIceButtonAttribute(#Gadget, #IceBtn_color)

Download latest release

or visit https://github.com/ChrisRfr/IceButtons and add a star if you like 8)

Thanks for your comments, feedback :)
Last edited by ChrisR on Wed Oct 18, 2023 10:10 am, edited 14 times in total.
User avatar
mk-soft
Always Here
Always Here
Posts: 6208
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by mk-soft »

Nice :D

Info: Windows only ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by ChrisR »

Thanks, it's good to point out that it's Windows only :)
I've added: "IceButtons Windows library blablabla"
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by Kuron »

As always, top-notch stuff, Chris!

For those who do not have ICE Design GUI, you should consider it. One heck of a GUI designer!
Best wishes to the PB community. Thank you for the memories. ♥️
radsoft
User
User
Posts: 26
Joined: Mon Sep 11, 2017 2:03 am
Location: New Zealand

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by radsoft »

Hi Chris, this is wonderful, thank you!

I'm wondering if it is possible to do multiline button text? My test (below) didn't work so maybe I'm doing something wrong?

Code: Select all

OpenWindow(0, 20, 20, 800, 600, "Ice Button Testing")
SetWindowColor(0, $FFD7C9)
ButtonGadget(1, 20, 20, 100, 50, "This is a multi line button", #PB_Button_MultiLine)

Define loopEvent

XIncludeFile "IceButtons.pbi"
SetIceButtonTheme(#IceBtn_Theme_LightBlue)

Repeat  
  loopEvent = WaitWindowEvent()
Until loopEvent = #PB_Event_CloseWindow
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by ChrisR »

Kuron wrote: Thu Oct 05, 2023 10:20 pm As always, top-notch stuff, Chris!

For those who do not have ICE Design GUI, you should consider it. One heck of a GUI designer!
Wow, I don't make sales every day (the community is quite small) but this morning made 2 sales :)
It's so nice when customers are satisfied with the work done and let you know it.
Thank you very much 8)
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

radsoft wrote: Fri Oct 06, 2023 2:54 am Hi Chris, this is wonderful, thank you!

I'm wondering if it is possible to do multiline button text? My test (below) didn't work so maybe I'm doing something wrong?
Thanks :)
I had completely missed the multiline button text.
I added it, it looks good now :) The code is updated in the 1st post.
Last edited by ChrisR on Sat Oct 07, 2023 12:01 am, edited 1 time in total.
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ebs »

Chris,

I'm one of your 'early adopters', i.e., first purchasers of IceDesign.
This is a great addition and lets me add a little more 'bling' to my boring old forms. :D

Keep up the good work!

Regards,
Eric
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

Thanks Eric,
The first ones are always a bit special for me, as I'd never sold an application before :D
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

I've updated the code to handle Multiline in combination with the other possible flags #PB_Button_Left, #PB_Button_Right, #BS_Bottom and #BS_Top.
And the tooltip it is now painted with the background color and with the Text in black or white depending on the dark or light color.

I'm over 60 000 chars now, so I've uploaded the code to GitHub. The download link is on the 1st Post.

Image

#
Also, I've added a simple apps to allow you to easily create a custom theme for IceButtons and copy it to clipboard.

Image

:)
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by Kuron »

ChrisR wrote: Fri Oct 06, 2023 1:05 pm Wow, I don't make sales every day (the community is quite small) but this morning made 2 sales :)
It's so nice when customers are satisfied with the work done and let you know it.
Thank you very much 8)
I have used PB since January of 2004. Since then, my complaint has always been the lack of a GUI editor that met my particular needs. Everybody is wired differently and have different wants in a GUI designer. This community is blessed to have 3 very good GUI designers to choose from. PureVision is rock solid stable and Paul gives awesome support, ProGUI is awesome and stable and Princie is a good guy. The way my brain works, ICE Design GUI worked best for me, and has everything I have been wanting since 2004, with the cherry on top in the form of supporting DPI. ^5's

As I said months ago, I was running ICE Design and had it minimized and forgot about it until the end of the day. No crashes or memory leaks, it was still sitting there waiting for me. It has every feature I would want and they work in the way I would expect, and what works best for me. I could not be happier and have found a new rekindled interest in PB, which after my TBI, I had all but given up on relearning programming.

ICE Button Theme library gives an excellent introduction to the quality and competency of ICE Design GUI, that us existing customers have come to know and love. At this point, I am spoiled and can't imagine making apps in PB without using ICE Design GUI. It is money well-spent, and if you do not have it, you should give it a try. It is a purchase you will never regret!
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Library (for Dark or Light Theme Button)

Post by ChrisR »

I designed it thinking about what I'd imagine it to look like, so we're pretty much on the same page :wink:
I fully agree:
Kuron wrote: Sat Oct 07, 2023 1:58 am This community is blessed to have 3 very good GUI designers to choose from. PureVision is rock solid stable and Paul gives awesome support, ProGUI is awesome and stable and Princie is a good guy. The way my brain works, ICE Design GUI worked best for me, and has everything I have been wanting since 2004, with the cherry on top in the form of supporting DPI. ^5's
Yes others very good product, I'm Not in any competition, I respect, I know better now what it represents as work :wink:
Jan2004
Enthusiast
Enthusiast
Posts: 163
Joined: Fri Jan 07, 2005 7:17 pm

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by Jan2004 »

My appreciation and thanks for creating an interesting program. If I use it in my software, expect a reward.

You have a good understanding of buttons. How to make a hover in a graphic button that will change the image on the button. I want a short instruction, which is also a graphic (from a graphic file), to be displayed when hovering over a large graphic button.

Thank you, greetings to you and everyone reading the post.
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

Thanks, from my phone, i'm not at home the next days.
It uses 2Ddrawing, to draw the images before the mouse hover, in MakeIceButtonsImage procedure, not sure you can use it easily for graphic images, ImageButton is probably more appropriate
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Ice Button Theme Windows Library (for Dark or Light Theme Button)

Post by ChrisR »

IceButton updated to v1.4

- Add border color as a theme attribute (it was the same color as the Button):
  • #IceBtn_BorderColor, Color or #PB_Default : Button border color, #PB_Default for the Button color
- ButtonImageGadget are now supported, included in IceButton.
As for buttons, they'll still work in the same way as PureBasic ButtonImage, they're ButtonImageGadget!
With borders added according to state (Default, Hightlight, Pressed, Disabled) as for buttons.
On mouse-over, a slight contrast/brightness change is applied to the Default or Pressed image.

As for ButtonImageGadget, Images can be changed with :
  • SetGadgetAttribute(#Gadget, #PB_Button_Image, ImageID)
  • SetGadgetAttribute(#Gadget, #PB_Button_PressedImage, ImageID)
Note that unlike PB, images are resized to the ButtonImage size.

And another little bonus, it's possible to add text to the ButtonImage with SetGadgetText(#Gadget, Text$), GetGadgetText(#Gadget) is available.

Image

IceButtons.pbi and IceButtons_BuildTheme.pb source code are Updated on Github
Post Reply