How do you make the ToolBar resize or autosize. Also is there a way to make it on the right or left or bottom of the window?
Thanks
ToolBar autosize
-
RJP Computing
- Enthusiast

- Posts: 202
- Joined: Sun Apr 27, 2003 4:44 am
- Location: Michigan, USA
- Contact:
ToolBar autosize
-Ryan
RJP Computing
Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
RJP Computing
Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
This is one way I know of:
As you can see the Toolbar has a minimum size, it should be the same as the minimum size of a window in Windows (you can change it somewhere...)
Code: Select all
OpenWindow(0,100,100,10,240,#PB_Window_SystemMenu,"Test")
CreateMenu(0, WindowID(0))
MenuItem(1, "New")
MenuItem(2, "Open")
;MenuItem(3, "Save")
CreateToolBar(1, WindowID(0))
ToolBarStandardButton(1, #PB_ToolBarIcon_New)
ToolBarStandardButton(2, #PB_ToolBarIcon_Open)
ToolBarStandardButton(3, #PB_ToolBarIcon_Save)
SendMessage_(1, #TB_AUTOSIZE, 0, 0)
ResizeWindow(320, 240)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
I am to provide the public with beneficial shocks.
Alfred Hitshock
Just remembered, long time ago I tried to resise a toolbar with other sendmessages, also tried to make a double row toolbar or resize the button size, and it didn't work 100%.
Got the sizes right, but the tooltip was on the wrong spot (locations for a normal sized toolbar)
It was so weird, that I stopped my tests.
As I said it was long time ago (it was with PureBasic 2.6 or so...) and I used the build-in Toolbar and Tooltips
BTW Danilo made once a special toolbar library with some cool stuff.
I think the name was CoolToolbar or similar (I don't use it...)
Got the sizes right, but the tooltip was on the wrong spot (locations for a normal sized toolbar)
It was so weird, that I stopped my tests.
As I said it was long time ago (it was with PureBasic 2.6 or so...) and I used the build-in Toolbar and Tooltips
BTW Danilo made once a special toolbar library with some cool stuff.
I think the name was CoolToolbar or similar (I don't use it...)
I am to provide the public with beneficial shocks.
Alfred Hitshock
-
RJP Computing
- Enthusiast

- Posts: 202
- Joined: Sun Apr 27, 2003 4:44 am
- Location: Michigan, USA
- Contact:
That doesn't seem to work. Could there be another message I need to send when WM_SIZE is sent?fsw wrote:This is one way I know of:As you can see the Toolbar has a minimum size, it should be the same as the minimum size of a window in Windows (you can change it somewhere...)Code: Select all
OpenWindow(0,100,100,10,240,#PB_Window_SystemMenu,"Test") CreateMenu(0, WindowID(0)) MenuItem(1, "New") MenuItem(2, "Open") ;MenuItem(3, "Save") CreateToolBar(1, WindowID(0)) ToolBarStandardButton(1, #PB_ToolBarIcon_New) ToolBarStandardButton(2, #PB_ToolBarIcon_Open) ToolBarStandardButton(3, #PB_ToolBarIcon_Save) SendMessage_(1, #TB_AUTOSIZE, 0, 0) ResizeWindow(320, 240) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Thanks
-Ryan
RJP Computing
Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
RJP Computing
Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
This is not correct:
This should work:Code: Select all
CreateToolBar(1, WindowID(0)) ToolBarStandardButton(1, #PB_ToolBarIcon_New) ToolBarStandardButton(2, #PB_ToolBarIcon_Open) ToolBarStandardButton(3, #PB_ToolBarIcon_Save) SendMessage_(1, #TB_AUTOSIZE, 0, 0) ; <--
Code: Select all
hToolbar = CreateToolBar(1, WindowID(0))
ToolBarStandardButton(1, #PB_ToolBarIcon_New)
ToolBarStandardButton(2, #PB_ToolBarIcon_Open)
ToolBarStandardButton(3, #PB_ToolBarIcon_Save)
SendMessage_(hToolbar, #TB_AUTOSIZE, 0, 0)
El_Choni

