Page 1 of 1

[Module] ToolBarExModule.pbi

Posted: Tue Nov 28, 2017 10:51 am
by Thorsten1867
ToolBarEx

The module is based on IconBarGadged by "kenmo". (05/2016)

ToolBarEXModule.pbi

Code: Select all

  ; ToolBar::AddItem()                   - Add a clickable ToolBarEx item
  ; ToolBar::AutoSize()
  ; ToolBar::Button()                    - A helper function to create a single-item ToolBarEx which acts like a button gadget
  ; ToolBar::ClearItems()                - Remove all items from an ToolBarEx
  ; ToolBar::CountItems()                - Returns the number of ToolBarEx items (or all positions, including dividers and spacers)
  ; ToolBar::Disable()                   - Disable an ToolBarEx (True, False, or #Toggle)
  ; ToolBar::DisableItem()               - Disable an individual ToolBarEx item (True, False, or #Toggle)
  ; ToolBar::Free()                      - Removes an ToolBarEx and releases all its memory
  ; ToolBar::Gadget()
  ; ToolBar::GetAttribute()              - Get an ToolBarEx attribute (including some read-only attributes)
  ; ToolBar::GetColor()                  - Get an ToolBarEx color
  ; ToolBar::GetDisplayMode()
  ; ToolBar::GetFitHeight()
  ; ToolBar::GetFitWidth()
  ; ToolBar::GetFontID()
  ; ToolBar::GetItemText()               - Get an ToolBarEx item's text (specified by item number, clickable items only)
  ; ToolBar::GetLatchItem()  
  ; ToolBar::GetMargin()
  ; ToolBar::GetPadding()
  ; ToolBar::GetPopupMenu()  
  ; ToolBar::GetRadius()  
  ; ToolBar::GetReturnValue()  
  ; ToolBar::GetSpacing()
  ; ToolBar::GetViewHeight()
  ; ToolBar::GetViewWidth()
  ; ToolBar::Hide()                      - Hide an ToolBarEx (True, False, or #Toggle)
  ; ToolBar::Divider()                   - Add an ToolBarEx divider (vertical line between items)
  ; ToolBar::ItemNumberFromPosition()    - Convert an ToolBarEx position index (zero-based - includes dividers and spacers)
  ; ToolBar::LockRedraw()                - Lock ToolBarEx redraw (True, False, or #Toggle)
  ; ToolBar::LockSizes()                 - Lock ToolBarEx item sizes (True, False, or #Toggle)
  ; ToolBar::PositionFromItemNumber()    - Convert an ToolBarEx Item Number (zero-based - only includes clickable items)
  ; ToolBar::RemoveItem()
  ; ToolBar::Resize()                    - Remove an ToolBarEx item (icon, divider, or spacer) by position
  ; ToolBar::SetColor()                  - Set an ToolBarEx color or reset to default
  ; ToolBar::SetDisplayMode()            - Set the Display Mode (#ImageOnly, #ImageAndText, #TextOnly)
  ; ToolBar::SetFont()                   - Specify a custom font by its FontID (not its PB font number
  ; ToolBar::SetItemText()               - Set an ToolBarEx item's text (specified by item number, clickable items only)
  ; ToolBar::SetLatchItem()              - Specify a latched item by its item number (not its position number)
  ; ToolBar::SetMargin()                 - Set the margin (empty pixels between buttons and gadget border)
  ; ToolBar::SetMouseOverEvents()
  ; ToolBar::SetPadding()                - Set the button padding (pixels between buttons and dividers)
  ; ToolBar::SetPopupMenu()              - Specify a PB popup menu to automatically appear on right-clicks
  ; ToolBar::SetRadius()                 - Set the highlight corner radius (0 = no rounded corners)
  ; ToolBar::SetReturnValue()            - Set the Return Value mode (#ItemNumber, #Position, #UserData)
  ; ToolBar::SetSpacing()                - Set the button spacing (empty pixels between buttons and dividers)
  ; ToolBar::Spacer()                    - Add an ToolBarEx spacer (empty section which automatically fills any extra horizontal space)

Re: [Module] ToolBarExModule.pbi

Posted: Tue Nov 28, 2017 12:11 pm
by Kwai chang caine
Works nice and looks professional on W10 X64 :shock:
Thanks for sharing 8)

Re: [Module] ToolBarExModule.pbi

Posted: Wed Dec 20, 2017 8:27 pm
by mk-soft
Very Cool... Thanks

small bug for mac with fontID

correct...

Code: Select all

Procedure GadgetDefaults()
    Define.i TempGadget
    
    CompilerIf #PB_Compiler_OS = #PB_OS_MacOS    ; Default font
      If GadgetDefault\FontID = #Null
        TempGadget = TextGadget(#PB_Any, 0, 0, 0, 0, "")
        If TempGadget
          GadgetDefault\FontID = GetGadgetFont(TempGadget)
          FreeGadget(TempGadget)
        EndIf
      EndIf
    CompilerElse
      GadgetDefault\FontID = GetGadgetFont(#PB_Default)
    CompilerEndIf

Re: [Module] ToolBarExModule.pbi

Posted: Wed Dec 20, 2017 9:14 pm
by HanPBF
Very nice!
I like this: download, run, works!

Thanks a lot for sharing!

Re: [Module] ToolBarExModule.pbi

Posted: Mon Nov 25, 2019 1:17 pm
by Cyllceaux
If I have no Items,

My app runs extreme slow and dies on line 526