PureBasic Forum
http://forums.purebasic.com/english/

[Module] ToolBarExModule.pbi
http://forums.purebasic.com/english/viewtopic.php?f=12&t=69707
Page 1 of 1

Author:  Thorsten1867 [ Tue Nov 28, 2017 10:51 am ]
Post subject:  [Module] ToolBarExModule.pbi

ToolBarEx

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

ToolBarEXModule.pbi


Code:
  ; 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)

Author:  Kwai chang caine [ Tue Nov 28, 2017 12:11 pm ]
Post subject:  Re: [Module] ToolBarExModule.pbi

Works nice and looks professional on W10 X64 :shock:
Thanks for sharing 8)

Author:  mk-soft [ Wed Dec 20, 2017 8:27 pm ]
Post subject:  Re: [Module] ToolBarExModule.pbi

Very Cool... Thanks

small bug for mac with fontID

correct...
Code:
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

Author:  HanPBF [ Wed Dec 20, 2017 9:14 pm ]
Post subject:  Re: [Module] ToolBarExModule.pbi

Very nice!
I like this: download, run, works!

Thanks a lot for sharing!

Author:  Cyllceaux [ Mon Nov 25, 2019 1:17 pm ]
Post subject:  Re: [Module] ToolBarExModule.pbi

If I have no Items,

My app runs extreme slow and dies on line 526

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/