collectordave wrote:[...]
have you tried the vectoricon designer?
If you mean the vectorIcons collection offered as a pbi file, yes, indeed.
And I think every program, yours included, would greatly benefit from using that.
If you're not sure how to properly integrate the icon collection within your app, let me know.
I wasn't, so i asked LittleJohn
(father of the vectorIcons project) for an example.
He sent me a simple, but very clear, demo. Just brilliant, really.
Update:
Here's that short demo, somewhat modified by me :
Code: Select all
; ------------------------------------------------------------
; February 2017
;
; handcrafted by LittleJohn after
; ToolBar example from PureBasic Help File;
; tested with PB 5.44 LTS x64 on Windows 10
; tested with PB 5.6b8 x64 on Windows 10
;
; ------------------------------------------------------------
EnableExplicit
XIncludeFile <your path>"\vectoricons.pbi"
Enumeration
#Add
#Refresh
#Delet
#ZoomIn
#ZoomOut
#Quit
EndEnumeration
Define.i event, tbIconSize=16
If OpenWindow(0, 100, 200, 250, 200, "Vectoricons toolBar example", #PB_Window_SystemMenu | #PB_Window_SizeGadget) = 0
MessageRequester("Fatal error", "Can't open main window.")
End
EndIf
If CreateToolBar(0, windowID(0))
ToolBarImageButton(#Add, ImageID(VectorIcons::Add("", #PB_Any, tbIconSize, VectorIcons::#CSS_ForestGreen)))
ToolBarToolTip(0, #Add, "Add")
ToolBarImageButton(#Refresh, ImageID(VectorIcons::Refresh("", #PB_Any, tbIconSize, VectorIcons::#CSS_ForestGreen)))
ToolBarToolTip(0, #Refresh, "Refresh")
ToolBarImageButton(#Delet, ImageID(VectorIcons::Delete("", #PB_Any, tbIconSize, VectorIcons::#VI_GuardsmanRed)))
ToolBarToolTip(0, #Delet, "Delete")
ToolBarSeparator()
ToolBarImageButton(#ZoomIn, ImageID(VectorIcons::ZoomIn("", #PB_Any, tbIconSize, VectorIcons::#CSS_Black)))
ToolBarToolTip(0, #ZoomIn, "Zoom in")
ToolBarImageButton(#ZoomOut, ImageID(VectorIcons::ZoomOut("", #PB_Any, tbIconSize, VectorIcons::#CSS_Black)))
ToolBarToolTip(0, #ZoomOut, "Zoom out")
ToolBarImageButton(#Quit, ImageID(VectorIcons::Quit("", #PB_Any, tbIconSize, VectorIcons::#CSS_Black)))
ToolBarToolTip(0, #Quit, "Quit")
EndIf
If CreateMenu(0, windowID(0))
MenuTitle("Project")
MenuItem(#Add, "Add")
MenuItem(#Refresh, "Refresh")
MenuItem(#Delet, "Delete")
MenuBar()
MenuItem(#ZoomIn, "Zoom in")
MenuItem(#ZoomOut, "Zoom out")
;HideMenu(0,1)
EndIf
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Menu
Debug "ToolBar or Menu ID: " + Str(EventMenu()) + " " + GetMenuItemText(0,EventMenu())
EndSelect
ForEver
Check how the icons get incorporated into the toolbar.
No more external icon files to keep track of, nor to binaryInclude.
As i said, simply brilliant and very practical.