Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need to put controls inside ShapeNode (Read 3032 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Need to put controls inside ShapeNode
May 11th, 2010 at 4:15am
Print Post  
Hi,

We are using ShapeNode as a master node in our application. We have attached some nodes with it using AttachedTo method as childs of this main node.

We want to put some controls as well inside this master node(as the child of this master node). Is it possible to put some controls like Button,Slider etc as child of ShapeNode? How?

Please let us know your suggestion.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to put controls inside ShapeNode
Reply #1 - May 11th, 2010 at 6:24am
Print Post  
Yes, try this:

Code
Select All
var button = new Button();
var node = new DiagramNodeAdapter(diagram, button);
node.Bounds = new Rect(10, 10, 60, 30);
diagram.Nodes.Add(node);
node.AttachTo(masterNode, AttachToNode.TopLeft); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need to put controls inside ShapeNode
Reply #2 - May 11th, 2010 at 9:16am
Print Post  
Hi Stoyan,

We are facing two problems with this approach

Problems:

1. We have created attached button but it is not coming in front. It goes behind and not visible to user.
2. Resizable handle is appearing over the button. We don’t want this resize handle over the button, we don’t want to resize it.

We have sent a snap shot for the problems, stated above. Please let us know your suggestion.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to put controls inside ShapeNode
Reply #3 - May 11th, 2010 at 11:32am
Print Post  
Call node.AttachTo(mainNode) instead of mainNode.AttachTo(node) and it appears as expected, and I guess that's what you had in mind originally.
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need to put controls inside ShapeNode
Reply #4 - May 11th, 2010 at 12:09pm
Print Post  
Yes Stoyan,
This has solved our problem.

Thanks,
Anshul
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need to put controls inside ShapeNode
Reply #5 - May 13th, 2010 at 9:33am
Print Post  
Hi Stoyan,

We have attached a DiagramNodeAdapter with a ShapeNode. In DiagramNodeAdapter we have added some UIElement like Button,Slider,ComboBox etc.

When we try to move this node, we want if mouse is over any UIElement than Node should not move. It should move only when mouse is directly over the Node.

Exa- When we try to change value of slider by dragging the slider button, it moves the node and also changes the value of slider. In this case node should not move because we want to change the the value of the slider. We have tried many events to keep focus on the slider but not got success.

Please let us know how to solve this problem.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to put controls inside ShapeNode
Reply #6 - May 14th, 2010 at 5:20am
Print Post  
Hi,

Handle the slider's PreviewMouseMove event like this:

Code
Select All
void button_PreviewMouseMove(object sender, MouseEventArgs e)
{
	if (e.LeftButton == MouseButtonState.Pressed && diagram.Interaction != null)
		diagram.CancelDrag();
} 



We'll see if we can add some built-in support for this for the next release.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to put controls inside ShapeNode
Reply #7 - May 18th, 2010 at 11:44am
Print Post  
Hi,

This version adds a MouseInputMode property to DiagramNodeAdapter -
https://mindfusion.eu/_beta/wpfdiag232_mouseinput.zip

Set it to HandledByHostedControl for interactive controls such as sliders and scrollbars.

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