Moveable toolbar
Posted: Sun Oct 30, 2005 1:50 pm
Code updated For 5.20+
Hello,
This demonstate a moveable toolbar.
I wish a lot of fun with it
Hello,
This demonstate a moveable toolbar.
I wish a lot of fun with it

Code: Select all
; Movable Toolbar
; 2005 Hroudtwolf
; PureBasic-Lounge.de & English PureBasic forums
Declare CreateToolBarBox ()
Enumeration
#Hauptfenster
#ToolBarBox
#Tools
#TB_New
#TB_Open
#TB_Save
#TB_Cut
#TB_Copy
#TB_Paste
EndEnumeration
#Hauptfensterflag=#PB_Window_ScreenCentered|#PB_Window_SystemMenu
If OpenWindow (#Hauptfenster,0,0,700,500,"Movable Toolbar Test",#Hauptfensterflag)
CreateToolBarBox () ; Jumping to the procedure which will making the moveable toolbar
Repeat
FensterErreigniss=WaitWindowEvent ()
Select FensterErreigniss
Case #PB_Event_CloseWindow
SchliesseProgramm=1
Case #WM_LBUTTONDOWN
If EventWindow()=#ToolBarBox
SendMessage_(WindowID(#ToolBarBox),#WM_NCLBUTTONDOWN, #HTCAPTION,0)
EndIf
EndSelect
Until SchliesseProgramm=1
EndIf
End
Procedure CreateToolBarBox ()
TBWHnd=OpenWindow (#ToolBarBox,10,50,177,25,"",#WS_POPUP|#WS_BORDER)
SetParent_(TBWHnd,WindowID(#Hauptfenster))
SetWindowLong_(TBWHnd,#GWL_EXSTYLE,#WS_EX_TOOLWINDOW)
If CreateToolBar (#Tools,TBWHnd)
ToolBarSeparator()
ToolBarSeparator()
ToolBarStandardButton(#TB_New, #PB_ToolBarIcon_New)
ToolBarStandardButton(#TB_Open, #PB_ToolBarIcon_Open)
ToolBarStandardButton(#TB_Save, #PB_ToolBarIcon_Save)
ToolBarSeparator()
ToolBarStandardButton(#TB_Cut, #PB_ToolBarIcon_Cut)
ToolBarStandardButton(#TB_Copy, #PB_ToolBarIcon_Copy)
ToolBarStandardButton(#TB_Paste, #PB_ToolBarIcon_Paste)
ToolBarSeparator()
ToolBarSeparator()
EndIf
EndProcedure