New topic: 

PopupMenu and Rowtag

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

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        helgetjelta          Post subject: PopupMenu and RowtagPosted: 
Wed Mar 30, 2011 2:11 pm                         
Joined: Tue Feb 20, 2007 2:05 pm
Posts: 57                How can I use the rowtag to show a specific listindex 
of a PopupMenu...

I have stored the rowtag in a database (this is my RecID) and I, when populate 
my PopupMenus, throw in the RecID as rowtags...

So how can I make my popupmenu, show the listindex whose rowtag is my recID... ?

Cheers Helge

What I do now it loop through to find the first that has the right RowTag that 
matches my RecID, then I use the number from my For_Loop, and use this as value 
for listindex of my PopupMenu...

There has to be an easier way?   
                             Top                Bob Keeney          Post 
subject: Re: PopupMenu and RowtagPosted: Wed Mar 30, 2011 2:53 pm               
                  
Joined: Fri Sep 30, 2005 11:48 am
Posts: 2273
Location: Lenexa, KS                Code://passing in recid
for i as integer = 0 to MyPopup.Listcount-1
  if myPopup.RowTag(i) = recid then
   myPopup.listindex = i
   exit  //exit the loop when it's found.  
  end
next      
_________________
Bob K.

30+ hours of Real Studio Video Training (including over 6 hours of Web Edition) 
at http://www.bkeeney.com/
Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting 
     
BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/  
                             Top                 helgetjelta          Post 
subject: Re: PopupMenu and RowtagPosted: Wed Mar 30, 2011 3:29 pm               
          
Joined: Tue Feb 20, 2007 2:05 pm
Posts: 57                Hi Bob,

That's what I'm doing now, but if you have a long popupmenu, won't it take long 
?

BTW; the popup will never consists of thousands of entries...so it should not 
take that long...

thanks anyway   
                             Top                Bob Keeney          Post 
subject: Re: PopupMenu and RowtagPosted: Wed Mar 30, 2011 3:49 pm               
                  
Joined: Fri Sep 30, 2005 11:48 am
Posts: 2273
Location: Lenexa, KS                It's pretty fast and as soon as it finds 
the entry it exits.  So, unless you do have thousands of entries in your popup 
(which would suggest a different UI) this will be fast enough.  If it's not 
fast enough then you probably need something other than the popupMenu.

My advice:  get it working first and then figure out where the slow downs are 
occurring.  I've never found this method to be the thing the slows down a 
window.  YMMV.      
_________________
Bob K.

30+ hours of Real Studio Video Training (including over 6 hours of Web Edition) 
at http://www.bkeeney.com/
Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting 
     
BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/  
                             Top                 Jym          Post subject: Re: 
PopupMenu and RowtagPosted: Wed Mar 30, 2011 9:42 pm                         
Joined: Sat Oct 01, 2005 5:19 pm
Posts: 2344                I can't imagine why it would take much time to do.  
If your popmenu is too long then you're using the wrong control.  You can 
subclass the popmenu and add an array to it, but I'm pretty sure that's all the 
RowTag really is, so it would be doubtful if it speeds it up   
                             Top                timhare          Post subject: 
Re: PopupMenu and RowtagPosted: Thu Mar 31, 2011 2:34 am                        
 
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 9597
Location: Portland, OR  USA                It would take hundreds of thousands, 
maybe millions, of entries before you noticed any slowdown.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 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