Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set a ShapeNode to Focus? (Read 2131 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Set a ShapeNode to Focus?
Dec 23rd, 2008 at 5:54pm
Print Post  
Hi Stoyan,

I need to synchronize another grid control with my Diagram control. That means when a ShapeNode is clicked, I need to select a correspondent row in another grid control.

The problem is the focus of the keyboard is changed to the grid control. I can't use Del key to delete the clicked ShapeNode.

I tried to call ShapeNode.Focus() function
and System.Window.Input.Keyboard.SetFocus(node) to set the focus item back to the ShapeNode. It doesn't work.

Is there a way to implement this feature?

Maybe this is my last question for 2008. Thank you very much for your great help. Best wishes for the new year!
  
Back to top
 
IP Logged
 
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Re: Set a ShapeNode to Focus?
Reply #1 - Dec 23rd, 2008 at 6:08pm
Print Post  
Hi Stoyan,

I got it! The reason why I can't set the ShapeNode to focus is that the default value of Focusable property of the ShapeNode is false.

After I set it to true, it works. By the way, is there any side effects if I set the Focusable property to true?

Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Set a ShapeNode to Focus?
Reply #2 - Dec 23rd, 2008 at 7:24pm
Print Post  
Hi Chris,

The control doesn't handle keyboard events at all, but uses command bindings, for example to ApplicationCommands.Delete. I believe routed commands are handled first by the parent controls of the focused item, so setting the node to focus should not prevent the command from getting to the diagram.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint