Hi,
I've a little wish again.
To have possibilities for setting and getting of userdefined datas for MenuItems and ToolBarButtons, would be very cool.
An equivalent to SetGadgetItemData/GetGadgetItemData, quasi.
SetToolBarButtonData (#ToolBar, #ButtonID, *Data )
*Data = GetToolBarButtonData (#ToolBar, #ButtonID )
SetMenuItemData (#Menu, #ItemID, *Data )
*Data = GetMenuItemData (#Menu, #ItemID )
In Windows, there wouldn't be any problem to implement this features.
TBBUTTONINFO has a member, called "lParam".
And MENUITEMINFO has a member, called "dwItemData".
Both are predestinated for implementation of such features.
But, I don't now how to do on OS X or Linux.
Best regards
Wolf
SetToolBarButtonData & SetMenuItemData
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
Re: SetToolBarButtonData & SetMenuItemData
+1
Apologies for resurrecting an old post but I was just about to post a feature request when I found this. Now that we have the BindMenuEvent command I think this could be reconsidered.
Apologies for resurrecting an old post but I was just about to post a feature request when I found this. Now that we have the BindMenuEvent command I think this could be reconsidered.
Re: SetToolBarButtonData & SetMenuItemData
I just made it myself.
Since the MenuItemID and ToolBarButtonID must be unique, you don't need the MenuID or ToolBarID. So two maps are enough.
Since the MenuItemID and ToolBarButtonID must be unique, you don't need the MenuID or ToolBarID. So two maps are enough.
Code: Select all
;-TOP by mk-soft. v1.01.1
Global NewMap ToolBarButtonData.i()
Global NewMap MenuItemData.i()
Procedure GetToolBarButtonData(ToolBarButtonID)
ProcedureReturn ToolBarButtonData(Str(ToolBarButtonID))
EndProcedure
Procedure SetToolBarButtonData(ToolBarButtonID, Value)
ToolBarButtonData(Str(ToolBarButtonID)) = Value
EndProcedure
Procedure GetMenuItemData(MenuItemID)
ProcedureReturn MenuItemData(Str(MenuItemID))
EndProcedure
Procedure SetMenuItemData(MenuItemID, Value)
MenuItemData(Str(MenuItemID)) = Value
EndProcedure
; ****
Last edited by mk-soft on Tue Feb 02, 2021 3:24 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: SetToolBarButtonData & SetMenuItemData
So did I - that's not the point. I think it could usefully form part of the intrinsic library.mk-soft wrote:I just made it myself.