Code: Alles auswählen
SendMessage_(hwndToolbar,#TB_SETBITMAPSIZE,0,32 | 32 << 16)

Code: Alles auswählen
SendMessage_(hwndToolbar,#TB_SETBITMAPSIZE,0,32 | 32 << 16)
Sparkie hat im englischen Forum ein direkt einsetzbares Code-Beispiel für PB 3.9x veröffentlicht:Thomas hat geschrieben: Kann man auch größere Toolbarsymbole darstellen?
z.B. 24x24-Pixel-Große Grafiken statt immer nur den kleinen 16x16-Pixel-Grafiken?
Das klappt aber nicht mit den ToolBarStandardButton(...)!Shardik hat geschrieben:Sparkie hat im englischen Forum ein direkt einsetzbares Code-Beispiel für PB 3.9x veröffentlicht:Thomas hat geschrieben: Kann man auch größere Toolbarsymbole darstellen?
z.B. 24x24-Pixel-Große Grafiken statt immer nur den kleinen 16x16-Pixel-Grafiken?
http://www.purebasic.fr/english/viewtop ... 06&start=3
Was ist an den anders?Gibt es ne möglichkeit ToolBarButtons wie beim IE zu erstellen?
Bzw TBSTYLE_DROPDOWN .MSDN hat geschrieben: BTNS_DROPDOWN
Version 5.80. Creates a drop-down style button that can display a list when the button is clicked. Instead of the WM_COMMAND message used for normal buttons, drop-down buttons send a TBN_DROPDOWN notification. An application can then have the notification handler display a list of options. Use the equivalent style flag, TBSTYLE_DROPDOWN, for version 4.72 and earlier.
If the toolbar has the TBSTYLE_EX_DRAWDDARROWS extended style, drop-down buttons will have a drop-down arrow displayed in a separate section to their right. If the arrow is clicked, a TBN_DROPDOWN notification will be sent. If the associated button is clicked, a WM_COMMAND message will be sent.
Ok,Fluid Byte hat geschrieben:Code: Alles auswählen
OpenWindow(0,0,0,400,300,"void",$CC0001) hwndToolbar = CreateToolBar(0,WindowID(0)) For i=0 To 5 : ToolBarStandardButton(i,i) : Next SendMessage_(hwndToolbar,#TB_SETBUTTONSIZE,0,32 | 32 << 16) SendMessage_(hwndToolbar,#TB_AUTOSIZE,0,0) While WaitWindowEvent() ! 16 : Wend
Ich war jetzt zu faul, mit ResourceHacker die korrekte DLL zu suchen, aber mit der Shell32.Dll würde es so gehen:Thomas hat geschrieben: Ok,
wie krieg ich hier die Icons größer und kann trotzdem noch ToolbarStandardButton(...) nutzen?
Code: Alles auswählen
#TB_SETIMAGELIST = #WM_USER + 48
#TB_GETIMAGELIST = #WM_USER + 49
Procedure MakeLong(LowWord.W, HighWord.W)
ProcedureReturn (LowWord * $10000) | (HighWord & $FFFF)
EndProcedure
If OpenWindow(0, 0, 0, 350, 250, "ToolBar mit großen Standard-Icons", #PB_Window_SystemMenu |#PB_Window_SizeGadget | #PB_Window_ScreenCentered)
hTB = CreateToolBar(0, WindowID(0))
hOldIList = SendMessage_(hTB, #TB_GETIMAGELIST, 0, 0);
hNewIList = ImageList_Duplicate_(hOldIList)
ImageList_Destroy_(hOldIList)
ImageList_SetIconSize_(hNewIList, 32, 32)
SendMessage_(hTB, #TB_SETIMAGELIST, 0, hNewIList)
SendMessage_(hTB, #TB_SETBITMAPSIZE, 0, MakeLong(32,32))
SendMessage_(hTB, #TB_SETBUTTONSIZE, 0, MakeLong(36,36))
SendMessage_(hTB, #TB_AUTOSIZE, 0, 0)
; ----- Icons aus Shell32.dll extrahieren
Shell32Icon0 = ExtractIcon_(0, "Shell32.dll", 42)
Shell32Icon1 = ExtractIcon_(0, "Shell32.dll", 43)
Shell32Icon2 = ExtractIcon_(0, "Shell32.dll", 44)
ToolBarImageButton(0, Shell32Icon0)
ToolBarImageButton(1, Shell32Icon1)
ToolBarImageButton(2, Shell32Icon2)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Menu
Debug "ToolBar ID: "+Str(EventMenu())
EndIf
Until EventID = #PB_Event_CloseWindow
ImageList_Destroy_(hNewIList)
EndIf
Code: Alles auswählen
If OpenWindow(0, 0, 0, 350, 250, "ToolBarPro mit großen Standard-Icons", #PB_Window_SystemMenu |#PB_Window_SizeGadget | #PB_Window_ScreenCentered)
CreateTB(0, WindowID(0), 24, 24, #TBpro_FLAT | #TBpro_BORDER)
AddTBsysIcons()
AddTBbutton(0, #TBpro_FILEOPEN, #TBpro_BUTTON)
AddTBbutton(1, #TBpro_FILESAVE, #TBpro_BUTTON)
AddTBseparator()
AddTBbutton(2, #TBpro_DELETE, #TBpro_BUTTON)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Menu
Debug "ToolBar ID: " + Str(EventMenu())
EndIf
Until EventID = #PB_Event_CloseWindow
EndIf