Status bar
Status bar
I'm wondering on what's the expected behaviour on this, is the status bar supposed to take some space into the window's inne height (like it does on the Mac) or is it supposed to do like the toolbar and be an additional height?
Re: Status bar
The statusbar is like any other child window and sits in the client area of the window. You will thus have to subtract the height of the statusbar from the height of the window's client area when calculating how much of the window you can use.
What I am saying is that, unlike menus and scrollbars, GetClientRect_() will ignore statusbars and toolbars etc. and will not adjust the height value returned because there is a statusbar present.
What I am saying is that, unlike menus and scrollbars, GetClientRect_() will ignore statusbars and toolbars etc. and will not adjust the height value returned because there is a statusbar present.
I may look like a mule, but I'm not a complete ass.
Re: Status bar
Thanks srod. I was wondering as this doesn't happen with the toolbars, and it's not clearly stated in the help that the status bar will take space in the window's client area 

Re: Status bar
No, it is the same with toolbars which also encroach into the clientarea.
If you add a scrollbar to a window (not a separate scrollbar control) then Windows adjusts the size of the client area. Thus you can consider a window's scrollbars as being separate from the window's client area.
This is not true for toolbars and statusbars which actually sit inside the clientarea (Windows makes no adjustment).
If you add a scrollbar to a window (not a separate scrollbar control) then Windows adjusts the size of the client area. Thus you can consider a window's scrollbars as being separate from the window's client area.
This is not true for toolbars and statusbars which actually sit inside the clientarea (Windows makes no adjustment).
I may look like a mule, but I'm not a complete ass.
Re: Status bar
Are you sure?
On the Mac the toolbar is not taking the client area height. Not on Carbon, havent tested on Cocoa.
On the Mac the toolbar is not taking the client area height. Not on Carbon, havent tested on Cocoa.
Re: Status bar
Ok I tested on Windows and on Cocoa, it seems the Toolbar is taking the client area height only on Windows... weird.
Re: Status bar
Absolutely sure.

Code: Select all
If OpenWindow(0, 100, 150, 300, 100, "PureBasic - StatusBar Example", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
GetClientRect_(WindowID(0), rc.RECT)
Debug "Client height before toolbar = " + Str(rc\bottom)
If CreateToolBar(0, WindowID(0))
ToolBarStandardButton(0, #PB_ToolBarIcon_New)
GetClientRect_(WindowID(0), rc.RECT)
Debug "Client height after toolbar = " + Str(rc\bottom)
EndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I may look like a mule, but I'm not a complete ass.
Re: Status bar
Yes, but not on Mac 

Re: Status bar
How did you get the client height on the mac?
I may look like a mule, but I'm not a complete ass.
Re: Status bar
I didn't. Just create a window with a height of 25, add a toolbar, and you'll easily see the available height is still 25, whereas it's not on Windowssrod wrote:How did you get the client height on the mac?

Re: Status bar
Ah, you mean the window resizes in order to keep the client area it's original size?
Windows does not do that at all; although there are functions for modifying the window size in relation to various window styles.
Windows does not do that at all; although there are functions for modifying the window size in relation to various window styles.
I may look like a mule, but I'm not a complete ass.
Re: Status bar
Err, no idea how it work, but the Toolbar never eats the client area on PB Mac. Can get messy with cross platform apps!srod wrote:Ah, you mean the window resizes in order to keep the client area it's original size?
Windows does not do that at all; although there are functions for modifying the window size in relation to various window styles.
Re: Status bar
Sounds like it could do with a feature request!srod wrote:Yep - messy and ugly!

Re: Status bar
Sorry, but the behaviour of Mac's PB 4.61 with the Carbon framework (Snow Leopard) doesn't differ from that of Windows' PB 4.61 (Windows 7 Home Premium x64, PB x86 and x64): both don't change the window's height when adding a StatusBar. Please try the following code example on Mac and Windows:Polo wrote:I didn't. Just create a window with a height of 25, add a toolbar, and you'll easily see the available height is still 25, whereas it's not on Windowssrod wrote:How did you get the client height on the mac?
Code: Select all
OpenWindow(0, 270, 100, 200, 60, "StatusBar test")
ButtonGadget(0, 45, 10, 110, 20, "Add StatusBar")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
If EventType() = #PB_EventType_LeftClick
If CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
StatusBarText(0, 0, "StatusBar")
DisableGadget(0, #True)
EndIf
EndIf
EndIf
EndSelect
ForEver