New topic: 

Putting one of two overlapping controls "on top"?

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        barrytraver          Post subject: Putting one of two 
overlapping controls "on top"?Posted: Sat Apr 06, 2013 2:05 am                  
       
Joined: Fri Sep 30, 2005 1:53 pm
Posts: 876
Location: Philadelphia, PA                In Visual Basic you can set a Window 
so that it will be "always on top" of other forms.  I'd like to do something 
similar with controls, but forget about the word "always."

Suppose I have two overlapping controls in REALbasic.  What determines which 
control is "on top"?  I haven't seen anything in the docs about it, but 
experimentation seems to indicate that not only Tab Order for controls but also 
what control is "on top" is determined by the TabIndex order.  Is that correct?

If so, let's suppose that I have the following overlapping controls:

Control1 (TabIndex = 0) 
Control2 (TabIndex = 1) 
Control3 (TabIndex = 2) 
Control4 (TabIndex = 3)

And suppose that I want to put Control 2 "on top" and Control 3 on the bottom.  
How can that be done, particularly via code?  (I do  know that chapter 3 of the 
User's Guide contains helpful information on changing the Tab Order in the IDE 
in other ways, but that's not what I want.)

Here's a related question.  Suppose you want to change the TabIndex order 
either in the IDE or via code.  I have a vague recollection that the TabIndex 
numbers ought to be changed in a specific order, e.g., from low to high or high 
to low (I don't know which).  If that is true (and I'm not sure that it is), 
then is the order in which you ought to set the new TabIndex values determined 
by the old order or the new order?

Thanks in advance for the help.

Barry Traver   
                             Top                timhare          Post subject: 
Re: Putting one of two overlapping controls "on top"?Posted: Sat Apr 06, 2013 
3:17 am                         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12207
Location: Portland, OR  USA                Overlapping controls, especially 
controls that can gain focus, is generally a bad idea.  It leads to nasty 
visual artifacts as each control redraws itself (and thus violates the layering 
completely) when it gains focus.  Do the controls need to be visible at the 
same time?  If not, a pagepanel would be a good solution that would allow you 
to make each control visible and active as needed.

Neither control layering nor tab index can be changed at run time.  You set it 
in the IDE and it stays that way.  But, you can use dynamic controls and take 
advantage of the fact that controls will be layered in the order they were 
added to the window, and they will be tab-indexed in that order as well.  So to 
change the layering, you would destroy control2 and add it back.  It would then 
be above control3.  It would also be above control4, so if you wanted control4 
to be on top of all the controls, you would have to destroy it and add it back 
after you added control2.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 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