PureBasic Forum
https://www.purebasic.fr/english/

Libs : ToolbarPlus
https://www.purebasic.fr/english/viewtopic.php?f=14&t=16133
Page 3 of 3

Author:  eddy [ Sat Sep 09, 2006 11:39 am ]
Post subject: 

It's not the last version.
It's a good idea.

Author:  QuimV [ Mon Mar 19, 2007 6:22 pm ]
Post subject: 

Eddy,
Where can I find your ToolBar library?
Is it updated to PB4?
Thanks in advanced for sharing.

Author:  Flype [ Mon Mar 19, 2007 7:06 pm ]
Post subject: 

Hello, you might use this include.

Code:
;-
;- TOOLBAREX.PBI
;- For PureBasic 4.0
;-

EnableExplicit

;-
;- PRIVATE FUNCTIONS
;-

Procedure.l ToolBarGadgetOpen(toolbar, offsetX, w)
  Protected t.TBBUTTON, r.RECT, pos.l, ret.l
  pos = SendMessage_(ToolBarID(toolbar), #TB_BUTTONCOUNT,  0, 0)    : ToolBarSeparator()
  ret = SendMessage_(ToolBarID(toolbar), #TB_GETBUTTON,    pos, @t) : t\iBitmap = offsetX + w
  ret = SendMessage_(ToolBarID(toolbar), #TB_DELETEBUTTON, pos, 0)
  ret = SendMessage_(ToolBarID(toolbar), #TB_INSERTBUTTON, pos, t)
  ret = SendMessage_(ToolBarID(toolbar), #TB_GETITEMRECT,  pos, @r)
  UseGadgetList(ToolBarID(toolbar))
  ProcedureReturn r\left
EndProcedure
Procedure.l ToolBarGadgetClose(toolbar)
  UseGadgetList(GetParent_(ToolBarID(toolbar)))
EndProcedure

;-
;- PUBLIC FUNCTIONS
;-

ProcedureDLL.l ToolBarDate(toolbar.l, gadget.l, offsetX.l, offsetY.l, w.l, h.l, mask.s)
  DateGadget(gadget, ToolBarGadgetOpen(toolbar, offsetX, w) + offsetX, offsetY, w, h, mask)
  ToolBarGadgetClose(toolbar)
EndProcedure
ProcedureDLL.l ToolBarButton(toolbar.l, gadget.l, offsetX.l, offsetY.l, w.l, h.l, Text.s)
  ButtonGadget(gadget, ToolBarGadgetOpen(toolbar, offsetX, w) + offsetX, offsetY, w, h, Text)
  ToolBarGadgetClose(toolbar)
EndProcedure
ProcedureDLL.l ToolBarComboBox(toolbar.l, gadget.l, offsetX.l, offsetY.l, w.l, h.l, flags.l = 0)
  ComboBoxGadget(gadget, ToolBarGadgetOpen(toolbar, offsetX, w) + offsetX, offsetY, w, h, flags)
  ToolBarGadgetClose(toolbar)
EndProcedure

;-
;- END OF FILE
;-

DisableExplicit

Author:  QuimV [ Mon Mar 19, 2007 7:44 pm ]
Post subject: 

Thank You Flype,
Could You send an example of use?
Thanks a lot!! :D

Author:  Flype [ Tue Mar 20, 2007 12:10 am ]
Post subject: 

yes i can but it's already done in page -2- :wink:

Code:
#WINDOW  = 7
#TOOLBAR = 10
#GADGET1 = 1
#GADGET2 = 2

If OpenWindow(#WINDOW, 200, 100, 400, 240, "Test", #PB_Window_SystemMenu)
 
  If CreateToolBar(#TOOLBAR, WindowID(#WINDOW))
    ToolBarStandardButton(1, #PB_ToolBarIcon_New)
    ToolBarStandardButton(2, #PB_ToolBarIcon_New)
    ToolBarStandardButton(3, #PB_ToolBarIcon_New)
    ToolBarSeparator()
    ToolBarDate  (#TOOLBAR, #GADGET1, 1, 1, 120, 21, "%dd / %mm / %yyyy")
    ToolBarSeparator()
    ToolBarButton(#TOOLBAR, #GADGET2, 1, 1, 50, 21, "Exit")
    ToolBarSeparator()
    ToolBarStandardButton(4, #PB_ToolBarIcon_New)
    ToolBarStandardButton(5, #PB_ToolBarIcon_New)
    ToolBarStandardButton(6, #PB_ToolBarIcon_New)
  EndIf
 
  GadgetToolTip(#GADGET1, "DateGadget in toolbar")
  GadgetToolTip(#GADGET2, "Exit")
 
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_Menu
        If EventMenu() = 1
          Break
        EndIf
      Case #PB_Event_Gadget
        If EventGadget() = #GADGET2
          Break
        EndIf
      Case #PB_Event_CloseWindow
        Break
    EndSelect
  ForEver
 
EndIf

Author:  QuimV [ Tue Mar 20, 2007 8:38 am ]
Post subject: 

:o
You are right Flype, but this example don't show the use of
ToolBarComboBox.
Thanks in advanced for your help.

Author:  ts-soft [ Tue Mar 20, 2007 5:02 pm ]
Post subject: 

Simple change this line:
Code:
ToolBarDate  (#TOOLBAR, #GADGET1, 1, 1, 120, 21, "%dd / %mm / %yyyy")
To
Code:
ToolBarComboBox(#TOOLBAR, #GADGET1, 1, 1, 120, 120)
:wink:

Author:  QuimV [ Tue Mar 20, 2007 7:18 pm ]
Post subject: 

:) Thanks ts-soft

Author:  saimen [ Tue Mar 31, 2009 12:01 pm ]
Post subject: 

Do you have this lib for pb4.30??

Author:  Mistrel [ Tue Mar 31, 2009 12:42 pm ]
Post subject: 

I didn't even know this library existed. I'd love to play with it myself. :)

Author:  eddy [ Thu Apr 02, 2009 5:27 pm ]
Post subject: 

It's open source

:arrow: new version for PB 4.30 : http://www.purebasic.fr/english/viewtop ... ht=toolbar

Author:  ThorstenD [ Thu Apr 02, 2009 10:29 pm ]
Post subject: 

Thank you :D

Author:  Mistrel [ Fri Apr 03, 2009 4:18 am ]
Post subject: 

Thanks. :)

Author:  PB_Rainer [ Mon Aug 05, 2019 1:39 pm ]
Post subject:  Re: Libs : ToolbarPlus

Hi,

I downloaed the File for ToolbarPlus.

Added it as a Include to my Source and use the functions:

Code:
MyToolBar = CreateToolBar(#PB_Any, GadgetID(MyToolBarContainer),#PB_ToolBar_Large | #PB_ToolBar_Text)
If OpenToolbarGadgetList(Mytoolbar)
   ToolBarImageButton(#Toolbar_load,ImageID(Img_TabWindow_0), #PB_ToolBar_Normal , "Original-Design laden [F3]")
    SetToolBarArrow()
   SetToolBarPopup(100)
   ToolBarImageButton(#Toolbar_Save,ImageID(Img_TabWindow_1), #PB_ToolBar_Normal , "Design mit Steuerstreifen speichern [F2]")


In Eventhandling this code:

Code:
Select Event      
     Case #PB_Event_Menu
        If Event_Menu = #PB_EventType_ToolbarPopup
        DisplayPopupMenu(100,WindowID(TabWindow), ToolbarPopupX(), ToolbarPopupY())
      EndIf
      Select EventMenu()
         Case 3001 To 3030
            GetMenuItemText(100, EventMenu())
            Design_LoadFromList(GetMenuItemText(100, EventMenu()))
            Case #Toolbar_load, 1003
               Icon_Load(EventMenu())
            Case #Toolbar_Save, 1002


All is working fine as long as the source is running in runmode.

After compiling into an EXE the dropdown-arrow will not be highlighted when on it with the mouse. And when clicking to it the popupMenu will not open.
Does anyone can help me?

Thanks in advance
Rainer

More information.
the same exe-file is running an my dell laptop as it should on the hp pc with the described error.

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