Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jun 23, 2018 8:52 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Rounded Bottom Bar with Declare Function
PostPosted: Fri Sep 02, 2011 2:22 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Kind of. Unlike Carbon, in Cocoa you cannot adjust the title bar height for standard windows. You must use a textured window, turn off automatic content view recalculation. Once you do that, you can achieve largely the same effect as Carbon, except your background *will* be a textured background. How you handle that is up to you.

The declare looks like this:
Const NSMinYEdge = 1 // Bottom
Const NSMaxYEdge = 3 // Top
Declare Sub SetAutorecalculatesContentBorder Lib "AppKit" Selector "setAutorecalculatesContentBorderThickness:forEdge:" (inWindow As WindowPtr, inRecalculates As Boolean, inEdge As UInt32)

So call
SetAutorecalculatesContentBorder(Self,False,NSMaxYEdge)
SetContentBorderThickness(Self,56,NSMaxYEdge)
to adjust the top height. Since you have a textured window in this case, turning off AutorecalculateContentBorder for the bottom edge is also a good idea. And, if you try this on a normal window, you'll get a Cocoa exception.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Rounded Bottom Bar with Declare Function
PostPosted: Sun Jun 17, 2012 4:34 pm 
Offline

Joined: Sun Jun 24, 2007 1:40 pm
Posts: 559
Amazing! Thanks. This worked perfectly. Any suggestions for accomplishing the same on Windows XP-7 ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rounded Bottom Bar with Declare Function
PostPosted: Fri Jan 04, 2013 9:05 pm 
Offline

Joined: Mon Dec 31, 2012 1:31 pm
Posts: 3
Bump from an old topic but I can't seem to get this to work. Does anyone mind posting an .rbp so I can take a look at the code?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rounded Bottom Bar with Declare Function
PostPosted: Sat Jan 05, 2013 12:22 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
In the sample code provide, you will see the const NSMaxYEdge is being used, which is top edge (under the title bar).. You can only set this if your window is a textured (metal) window.. You can use the NSMinYEdge const on a standard document window to have the bottom border..

_________________
Real Studio 2012r1.1 | MacBook Pro i5, 10.6.8 | Windows 7


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group