Libs : ToolbarPlus
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
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
yes i can but it's already done in page -2-
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
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Simple change this line:
To
Code: Select all
ToolBarDate (#TOOLBAR, #GADGET1, 1, 1, 120, 21, "%dd / %mm / %yyyy")
Code: Select all
ToolBarComboBox(#TOOLBAR, #GADGET1, 1, 1, 120, 120)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: Libs : ToolbarPlus
Hi,
I downloaed the File for ToolbarPlus.
Added it as a Include to my Source and use the functions:
In Eventhandling this code:
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.
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]")
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
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.