Page 2 of 3

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 12:27 am
by juror
Nice.

Might just be one of the things legends are made of :D

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 12:50 am
by Fangbeast
In your case, if you really wanted to, you could put [ IconBarGadget | Strings and Combos | Another IconBarGadget ], in fact there is already a helper procedure which creates a one-button IconBarGadget.
D'oh!! I am so dumb that I never thought of that!! Remind me to soundly bash myself around the head with a rubber chicken!

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 3:55 am
by Fangbeast
Strange one. I made an extra 'exit' button with the helper "IconBarGadgetButton" so that I could have other gadgets in between but the highlight over the button is a good 2-3mm shorter in height than the full bar as I hover over it?

If I hover over the "Add" button, the highlight box is nearly the height of the bar. If I hover over the "Exit" button, the highlight box comes up right underneath the last pixel of the word "exit".

Can't see anything obvious.

Code: Select all

  IBG(0) = IconBarGadget(0, 490, 790, 78, #IconBarDisplay_ImageAndText)
  
  AddIconBarGadgetItem(IBG(0), "Add",           #butAdd)
  AddIconBarGadgetItem(IBG(0), "Copy",          #butCopy)  
  AddIconBarGadgetItem(IBG(0), "Delete",        #butDelete)
  AddIconBarGadgetItem(IBG(0), "Edit",          #butEdit)
  AddIconBarGadgetItem(IBG(0), "Undelete",      #butUndelete)
  AddIconBarGadgetItem(IBG(0), "Export",        #butExport)
  AddIconBarGadgetItem(IBG(0), "Import",        #butImport)
  AddIconBarGadgetItem(IBG(0), "Find",          #butFind)
  AddIconBarGadgetItem(IBG(0), "Help",          #butHelp)
  AddIconBarGadgetItem(IBG(0), "Print",         #butPrint)
  AddIconBarGadgetItem(IBG(0), "Sticky",        #butStickywindow)
  AddIconBarGadgetItem(IBG(0), "ToolTips",      #butTooltips)
  AddIconBarGadgetItem(IBG(0), "TitleClock",    #butClock)
  AddIconBarGadgetItem(IBG(0), "Setup",         #butSetup)
    
  SetIconBarGadgetFontID(IBG(0),    LoadFont(0, "Comic Sans MS", 10))
  SetIconBarGadgetColor(IBG(0),     #IconBar_BackgroundColor,   $BFBFBF)
  SetIconBarGadgetColor(IBG(0),     #IconBar_HighlightColor,    $400040)
  SetIconBarGadgetColor(IBG(0),     #IconBar_TextColor,         $701919)
  SetIconBarGadgetRadius(IBG(0), 7)
  
  SetIconBarGadgetAttribute(IBG(0), #IconBar_MouseOverEvents, #True)
  
  IBG(1) = IconBarGadgetButton(800, 490, 54, 78, #butExit, "Exit", #IconBarDisplay_ImageAndText)
  
  SetIconBarGadgetFontID(IBG(1),    LoadFont(1, "Comic Sans MS", 10))
  SetIconBarGadgetColor(IBG(1),     #IconBar_BackgroundColor,   $BFBFBF)
  SetIconBarGadgetColor(IBG(1),     #IconBar_HighlightColor,    $400040)
  SetIconBarGadgetColor(IBG(1),     #IconBar_TextColor,         $701919)
  SetIconBarGadgetRadius(IBG(1), 7)  
  

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 5:21 pm
by kenmo
I think I know why... The "Button" procedure changes the default margin around the highlight to 0.

I assumed if someone was using a standalone button and gave coordinates, then they want the highlight at those exact coordinates with no margin. Didn't really think too much about this small change.

But if you want the "button" version to look exactly like the "normal" version, maybe try:

Code: Select all

SetIconBarGadgetMargin(IBG(1), #IconBar_Default)
or just use another "normal" IconBar? (I can't test right now.)

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 6:48 pm
by davido
@kenmo,

The Ribbon is great addition. Thank you very much. :D

I wonder; is it possible to add or delete icons dynamically?
I tried this but they were always added on the last tab. Couldn't delete any, though.

This is not a request for you to add this feature, unless of course you wish to: it would be nice if it could be done as is.

Re: IconBarGadget - custom graphical toolbars

Posted: Tue Aug 05, 2014 10:14 pm
by Fangbeast
kenmo wrote:I think I know why... The "Button" procedure changes the default margin around the highlight to 0.

I assumed if someone was using a standalone button and gave coordinates, then they want the highlight at those exact coordinates with no margin. Didn't really think too much about this small change.

But if you want the "button" version to look exactly like the "normal" version, maybe try:

Code: Select all

SetIconBarGadgetMargin(IBG(1), #IconBar_Default)
or just use another "normal" IconBar? (I can't test right now.)
Didn't change it. I'll try a normal iconbar when I get back from the shopping and junk food expedition :)

Re: IconBarGadget - custom graphical toolbars

Posted: Wed Aug 06, 2014 10:00 pm
by kenmo
davido wrote:The Ribbon is great addition. Thank you very much. :D

I wonder; is it possible to add or delete icons dynamically?
I tried this but they were always added on the last tab. Couldn't delete any, though.
Thanks davido. :) The Ribbon isn't really an addition (yet) just a rough start of an idea. It needs A LOT MORE features, even if it's icons-only (no ComboBoxes or other gadgets).

There are no functions for dynamic RibbonBars written yet. But you can use a function like this to get an individual IconBarGadget from a Ribbon tab, and then use dynamic IconBarGadget functions on it!

Code: Select all

Procedure.i GetIconBarFromRibbonBar(*RB.RB_RIBBONBAR, Tab.i)
  If (*RB And (Tab >= 0) And (Tab < ListSize(*RB\IconBar())))
    SelectElement(*RB\IconBar(), Tab)
    ProcedureReturn (*RB\IconBar())
  EndIf
EndProcedure

Re: IconBarGadget - custom graphical toolbars

Posted: Thu Aug 07, 2014 6:16 am
by davido
@kenmo,
An unexpected bonus!
Thank you very much. :D

Re: IconBarGadget - custom graphical toolbars

Posted: Tue May 03, 2016 9:41 am
by Joris
@kenmo, nice and very usefull stuff.

Thanks.

Re: IconBarGadget - custom graphical toolbars

Posted: Mon Apr 29, 2024 1:38 pm
by doctorized
Nice work but no dpi awareness included.

Re: IconBarGadget - custom graphical toolbars

Posted: Thu May 02, 2024 2:54 pm
by ebs
I would like to experiment with this code, but the link to the ZIP file containing the images is broken.

Does anyone have the file "iconbargadget_1.2.zip"?
If not, I guess I'll just find/create some suitable images. Thanks!

Re: IconBarGadget - custom graphical toolbars

Posted: Fri May 03, 2024 11:59 am
by blueb
I have version 1.12 of Kenmo's IconBarGadget.pbi and included images.

PM me and I'll zip it up for you :)

Re: IconBarGadget - custom graphical toolbars

Posted: Fri May 03, 2024 1:14 pm
by BarryG
Can you please put the zip file online somewhere? Like https://filebin.net or something? I don't do PMs anymore.

Re: IconBarGadget - custom graphical toolbars

Posted: Fri May 03, 2024 1:18 pm
by ebs
PM me and I'll zip it up for you
PM sent - thank you very much!

Re: IconBarGadget - custom graphical toolbars

Posted: Fri May 03, 2024 2:21 pm
by blueb
Hi Barry,

Here's my Dropbox link: https://www.dropbox.com/scl/fi/jenqi1ym ... dyycm&dl=0


I'll make it available for a month or so. (I hate cluttering my Dropbox account with files that are there 'forever') :mrgreen: