New topic: 

Do Screen().AvailableTop, AvailableLeft, etc actually work?

<http://forums.realsoftware.com/viewtopic.php?t=34355>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        NA9D          Post subject: Do Screen().AvailableTop, 
AvailableLeft, etc actually work?Posted: Tue Jun 22, 2010 8:18 am               
          
Joined: Mon Feb 01, 2010 3:36 pm
Posts: 102                Hey all,

Do the "available" properties in the Screen class actually work?  They are 
supposed to return the top position, height, etc. of the current screen taking 
into account menu bars, task bars, etc.  But they don't.  They give the 
absolute coordinates instead.  For example, my software has a function called 
"DetermineScreen" which determines what monitor I am using for the window.  On 
my Mac, if I set Top for my window to AvailableTop, the top edge of the window 
is not below my menu bar but underneath it.  Similarly, on Windows, my windows 
are going below the task bar when using AvailableHeight.  I don't think these 
do what the manual state or maybe I am missing something?

Here is my code:
Code:DIM CurrentMonitor As Integer

CurrentMonitor = DetermineScreen(self)
me.Top = Screen(CurrentMonitor).AvailableTop
me.Left = Screen(CurrentMonitor).AvailableLeft


I get the EXACT same screen position if instead I use Screen(CurrentMonitor).Top

So to me, this "Available" property seems broken.  Anyone else see this?  Is it 
a known issue or am I misunderstanding it?   
                             Top                 mjh          Post subject: Re: 
Do Screen().AvailableTop, AvailableLeft, etc actually woPosted: Tue Jun 22, 
2010 8:45 am                         
Joined: Sun Feb 19, 2006 3:10 pm
Posts: 777
Location: Hamburg, Germany                You didn’t take into account that 
Window.Top is the top of the window’s content region, not of the window as 
such. You should add the height of the window’s title bar.      
_________________
Michael J. Hußmann 
http://digicam-experts.de  
                             Top                NA9D          Post subject: Re: 
Do Screen().AvailableTop, AvailableLeft, etc actually woPosted: Tue Jun 22, 
2010 9:03 am                         
Joined: Mon Feb 01, 2010 3:36 pm
Posts: 102                mjh wrote:You didn’t take into account that 
Window.Top is the top of the window’s content region, not of the window as 
such. You should add the height of the window’s title bar.

OK.  I was unaware of that. But it's still going beyond the height of the title 
bar I think.  I will look into this.  I'm still not convinced the available 
properties work as advertised, but I'll play with it some more.   
                             Top                 mjh          Post subject: Re: 
Do Screen().AvailableTop, AvailableLeft, etc actually woPosted: Tue Jun 22, 
2010 9:15 am                         
Joined: Sun Feb 19, 2006 3:10 pm
Posts: 777
Location: Hamburg, Germany                NA9D wrote:But it's still going 
beyond the height of the title bar I think.  I will look into this.  I'm still 
not convinced the available properties work as advertised, but I'll play with 
it some more.
It works for me. Try adding 22 (the standard height of the title bar of a 
document window) to AvailableTop and the window should be positioned flush with 
the menu bar. There are declares for determining the actual height of the title 
bar as this might change (and depends on the type of window).      
_________________
Michael J. Hußmann 
http://digicam-experts.de  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to