New topic: 

Detecting if user accepted or canceled dialog

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        basil.bourque          Post subject: Detecting if user accepted 
or canceled dialogPosted: Wed Jun 09, 2010 7:22 pm                         
Joined: Thu Apr 15, 2010 10:41 pm
Posts: 27
Location: Seattle-area                Is there an automatic way, or a 
convention, for detecting if the user accepted or canceled a dialog box?

For the MessageDialog windows, it seems that you check for which type of button 
was returned:
ActionButton, CancelButton, and AlternateActionButton

What do RB programmers do for their own custom dialog boxes? 

The approach I've considered is to add a String property to the dialog window's 
class. The Action methods on the accept and cancel buttons would set that 
property to "accept" or "cancel". (Or maybe a boolean value, whatever)

Does that make sense? 
Is there an easier or built-in way to do this? 
Is there a convention among RB programmers?      
_________________
--Basil Bourque

(Using REAL Studio 2010 release 2 with REAL Server 2009r1.2 on Mac OS X 10.6.2 
& .3)  
                             Top                 jens bendig          Post 
subject: Re: Detecting if user accepted or canceled dialogPosted: Wed Jun 09, 
2010 7:53 pm                         
Joined: Tue Mar 06, 2007 11:01 am
Posts: 993
Location: Bremen, Germany                Hi Basil,

I have kind of a base-window-object that automatically creates a 
container-control with a submit
and a cancel-button and embeds this within itself. Then it subscribes itself on 
that container-control. If the user clicks cancel, a property on that 
base-object will notice that. If not, another property makes a notice. 

After recieving this message from it´s own container-control with the 
submit-cancel-buttons on it, the base Agent returns to it´s initiator (thats 
the object who invoked a derivative of this agent) and this object will ask if 
the agent was canceled or not.

This sounds complicated, but you have to build the base-object just once in 
your life. Lateron you can derive all your custom-windows from that one.

Let me know if you need a more detailed explanation, I am not sure if I speak 
clear for you.

Jens   
                             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