Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CopySelection from inherited class of control node (Read 2526 times)
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
CopySelection from inherited class of control node
Jul 21st, 2009 at 9:41am
Print Post  
I have a node class inherited from the control node
I am trying to do copy and past but when I paste it pasts the control node object not my real objected which inherited from the control node

I change the control node to shape node , it works fine

so What is the problem with control node
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CopySelection from inherited class of control
Reply #1 - Jul 21st, 2009 at 12:24pm
Print Post  
You should override ControlNode.Clone() to return an instance of your class.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Re: CopySelection from inherited class of control
Reply #2 - Jul 21st, 2009 at 1:26pm
Print Post  
I did but it take the same control
I think I have to clone also the child control
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CopySelection from inherited class of control
Reply #3 - Jul 21st, 2009 at 1:37pm
Print Post  
Yes, you must clone the hosted control too. ControlNode.Clone returns a ControlNode instance created using the ControlNode copy constructor. The copy constructor has some code that clones the hosted control, so you could define your copy constructor that calls base, and use it in the Clone override implementation.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Re: CopySelection from inherited class of control
Reply #4 - Jul 21st, 2009 at 3:03pm
Print Post  
yes thans, it works now

but could I ask another queestion

I have a control node but I need the child control like a button to be as a disabled

not really disable but not just taking event like click
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CopySelection from inherited class of control
Reply #5 - Jul 22nd, 2009 at 6:16am
Print Post  
You could set ControlNode.ControlMouseAction = ControlMouseAction.IgnoreControl; This works for hosted Buttons, but might not work for controls that capture the mouse.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint