
Toolbar+ dropdown arrow, popupmenu, toggle buttons, gadgets
Re: Toolbar+ dropdown arrow, popupmenu, toggle buttons, gadg

Re: Toolbar+ dropdown arrow, popupmenu, toggle buttons, gadg
Hey Eddy
Great include, iv used it many times, but i was asked to create a bigger toolbar with 24x24 icons so i made a small edit to the main function, as i was pleased with the result i thought id post the function in this thread for everyone else
simply replace the CrerateToolBarPlus function with the below one, pass a 'Size' of 16 or 24
Great include, iv used it many times, but i was asked to create a bigger toolbar with 24x24 icons so i made a small edit to the main function, as i was pleased with the result i thought id post the function in this thread for everyone else
simply replace the CrerateToolBarPlus function with the below one, pass a 'Size' of 16 or 24
Code: Select all
ProcedureDLL CreateToolBarPlus(ID, Parent, Size=16) ;Create toolbar plus
Shared ToolbarPlusParent
Shared ToolbarPlus
Shared ToolbarPlusID
Result=CreateToolBar(ID, parent)
ToolbarPlusID=ID
ToolbarPlusParent=parent
ValidateGadgetID(Result, ToolbarPlusID, ToolbarPlus)
; ====================
; Change Style
; ====================
#TB_SETEXTENDEDSTYLE=$400+84
#TB_GETEXTENDEDSTYLE=$400+85
#TBSTYLE_EX_DRAWDDARROWS=$1
Protected es=SendMessage_(ToolbarPlus, #TB_GETEXTENDEDSTYLE, 0, 0) | #TBSTYLE_EX_DRAWDDARROWS
SendMessage_(ToolbarPlus, #TB_SETEXTENDEDSTYLE, 0, es)
hImageList = ImageList_Create_(Size, Size, #ILC_COLOR32 | #ILC_MASK, 20, 0)
If hImageList
SendMessage_(ToolbarPlus, #TB_SETIMAGELIST, 0, hImageList)
Select Size
Case 24
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_STD_LARGE_COLOR, #HINST_COMMCTRL)
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_HIST_LARGE_COLOR, #HINST_COMMCTRL)
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_VIEW_LARGE_COLOR, #HINST_COMMCTRL)
Default
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_STD_SMALL_COLOR, #HINST_COMMCTRL)
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_HIST_SMALL_COLOR, #HINST_COMMCTRL)
SendMessage_(ToolbarPlus, #TB_LOADIMAGES, #IDB_VIEW_SMALL_COLOR, #HINST_COMMCTRL)
EndSelect
EndIf
SendMessage_(ToolbarPlus, #TB_AUTOSIZE, 0, 0)
ShowWindow_(ToolbarPlus, #True)
ProcedureReturn Result
EndProcedure
Re: Toolbar+ dropdown arrow, popupmenu, toggle buttons, gadg
Thanks for sharing your code for using larger icons LuaDev
But there must be some other changes you made too, as I get
several EnableExplicit errors with your modified procedure.
I've never been very good in working with Enable Explicit problems,
but I corrected the ones that erred, as least they didn't error again.
But then I got Constant not found:#TOOLBAR - which is in your
example program? I'm using the latest PB4.61beta.
Thanks for your input.
But there must be some other changes you made too, as I get
several EnableExplicit errors with your modified procedure.
I've never been very good in working with Enable Explicit problems,
but I corrected the ones that erred, as least they didn't error again.
But then I got Constant not found:#TOOLBAR - which is in your
example program? I'm using the latest PB4.61beta.
Thanks for your input.