Page 3 of 3

Posted: Sat Sep 09, 2006 11:39 am
by eddy
It's not the last version.
It's a good idea.

Posted: Mon Mar 19, 2007 6:22 pm
by QuimV
Eddy,
Where can I find your ToolBar library?
Is it updated to PB4?
Thanks in advanced for sharing.

Posted: Mon Mar 19, 2007 7:06 pm
by Flype
Hello, you might use this include.

Code: Select all

;- 
;- 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

Posted: Mon Mar 19, 2007 7:44 pm
by QuimV
Thank You Flype,
Could You send an example of use?
Thanks a lot!! :D

Posted: Tue Mar 20, 2007 12:10 am
by Flype
yes i can but it's already done in page -2- :wink:

Code: Select all

#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 

Posted: Tue Mar 20, 2007 8:38 am
by QuimV
:o
You are right Flype, but this example don't show the use of
ToolBarComboBox.
Thanks in advanced for your help.

Posted: Tue Mar 20, 2007 5:02 pm
by ts-soft
Simple change this line:

Code: Select all

ToolBarDate  (#TOOLBAR, #GADGET1, 1, 1, 120, 21, "%dd / %mm / %yyyy")
To

Code: Select all

ToolBarComboBox(#TOOLBAR, #GADGET1, 1, 1, 120, 120)
:wink:

Posted: Tue Mar 20, 2007 7:18 pm
by QuimV
:) Thanks ts-soft

Posted: Tue Mar 31, 2009 12:01 pm
by saimen
Do you have this lib for pb4.30??

Posted: Tue Mar 31, 2009 12:42 pm
by Mistrel
I didn't even know this library existed. I'd love to play with it myself. :)

Posted: Thu Apr 02, 2009 5:27 pm
by eddy
It's open source

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

Posted: Thu Apr 02, 2009 10:29 pm
by ThorstenD
Thank you :D

Posted: Fri Apr 03, 2009 4:18 am
by Mistrel
Thanks. :)

Re: Libs : ToolbarPlus

Posted: Mon Aug 05, 2019 1:39 pm
by PB_Rainer
Hi,

I downloaed the File for ToolbarPlus.

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

Code: Select all

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 all

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.