New topic: 

Control Typecasting

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

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        Jaco          Post subject: Control TypecastingPosted: Fri Mar 
29, 2013 10:04 am                         
Joined: Fri Mar 29, 2013 9:02 am
Posts: 1                Is there a way to typecast a control at runtime? I mean 
permanently, not just to access some property.
I have a control which inherit from textfield and build some behavior on it 
(Call it class A). Under certain conditions some methods need to behave 
differently. So instead of al lot of IF …THEN… ELSE I was thinking of 
typecasting that control at runtime to another similar class (call It class B), 
to respond to de same methods in another way.

At the time I put another control which is class B hidden in the form, and when 
the condition rises, copy the content of the  control A to B, hide A and show 
B. It works, but I find this method somehow dirty. B Inherits from A since most 
of the behavior is the same.

Thanks.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
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