Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] TitleBar Height (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Sound input level and recording
Next thread: [MBS] MBS REALbasic HelpMenu Plugin


[MBS] 6.5pr9   -   Christian Schmitz
  [MBS] TitleBar Height   -   Paul Rehill
   Re: [MBS] TitleBar Height   -   Christian Schmitz

[MBS] TitleBar Height
Date: 17.12.06 23:00 (Mon, 18 Dec 2006 09:00:21 +1100)
From: Paul Rehill
Hi Christian

Does this function return Window1's titlebar height under Mac OS X?

Window1.WindowTitleBarRectMBS.Height

The WindowTitleBarRectMBS class is marked as 31 Dec 2005 in the
documentation. Is this when it first became available?

I am looking for a replacement for the following code which returns the
titlebar's height as I have to get rid of TargetCarbon references for a UB
build:

Function GetTitleBarHeight(extends w as Window)
#if TargetCarbon
declare function GetWindowBounds lib "CarbonLib" (window as integer,
regionCode as short, globalBounds as Ptr) as Integer
const kWindowTitleBarRgn = 0
dim titleRect as MemoryBlock
dim err as Integer
titleRect = NewMemoryBlock(8)
err = GetWindowBounds(w.MacWindowPtr, kWindowTitleBarRgn,titleRect)
if err <> 0 then
Return Screen(0).AvailableTop
end if
Return titleRect.Short(4) - titleRect.Short(0)
#else
Return 0
#endif
End Function

Thanks

Paul

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] TitleBar Height
Date: 18.12.06 00:44 (Mon, 18 Dec 2006 00:44:25 +0100)
From: Christian Schmitz
Paul Rehill <<email address removed>> wrote:

> Hi Christian
>
> Does this function return Window1's titlebar height under Mac OS X?
>
> Window1.WindowTitleBarRectMBS.Height

Yes.

> The WindowTitleBarRectMBS class is marked as 31 Dec 2005 in the
> documentation. Is this when it first became available?

No. This is the date the file describing this class was last changed.

> I am looking for a replacement for the following code which returns the
> titlebar's height as I have to get rid of TargetCarbon references for a UB
> build:

That's the same code I use in the plugins.

Gruß
Christian