Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Control node and ModificationStart (Read 2972 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Control node and ModificationStart
Jan 14th, 2010 at 8:41am
Print Post  
Hi Stoyo

The sample provided for custom control uses ModificationStart="AutoHandles" so whenever user moves mouse over the control handles are shown.

I removed the [b]ModificationStart="AutoHandles"[/b] and now I am not able to click on the control which uses "Grid" control for resizing.

I am able to click on the control which displays image and sometimes on the control which displays calendar (only when i click on white area of the calendar)

Is it not possible to make the controlnode active and show its handles whenever hosted control get mouse event.

Regards
Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control node and ModificationStart
Reply #1 - Jan 14th, 2010 at 8:54am
Print Post  
Hi Rajesh,

Unfortunately in Silverlight we can detect clicks only over controls that do not capture the mouse, and the grid captures it. In WPF we use the Preview* type of messages to always detect clicks, but they are not available in Silverlight. As a workaround you can handle whatever event the hosted control raises upon click, e.g. CellClicked, and add its ControlNode to the selection so that the adjustment handles appear.

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


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Control node and ModificationStart
Reply #2 - Jan 14th, 2010 at 9:10am
Print Post  
Hi Stoyo

Thanks for your reply.

Acutally my requirement can be satisfied by using TableNode and Cells. But with there are some restriction and then I used control node and ListBox to show same.

With TableNode I have following issues -
1. I can drag-drop table node (using Telerik DragDrop)
2. But I cannot have events for Drag-Drop of cells.
I tried to get the cell using CellFromPoint function but somehow it is not working ( Since point calculated is not correct - the issue with it, for first few rows i detect correct cell but after following rows i get data for first few rows in same sequence. Like 7th row mapped to 1, 8th row mapped to 2 etc )
3. There is no scrollbar for table node ( Not a major issue)

To get correct cell, I thought of using Container node and normal Node. With container node is it possible that future version support something like below -

1. Autosize child elements according to the container node ( all child elements should be equally sized)
2. They should use stack panel behavior or WrapPanel behavior to show stack of child items.

Regards
Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control node and ModificationStart
Reply #3 - Jan 14th, 2010 at 12:14pm
Print Post  
Hi Rajesh,

I can't reproduce the problem with CellFromPoint. If you enable AllowInplaceEdit and double click a cell, does the edit-control appear over the correct cell? - this uses the CellFromPoint method internally.

Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Control node and ModificationStart
Reply #4 - Jan 15th, 2010 at 4:49am
Print Post  
Hi Stoyo

What you are saying will work since it will be handled within diagram lite control.

In my case Telerik Drag Drop manager raises the event in which sender object is diagram control and that events another parameter holds mouse position along with other information.
In this situation, I need to re-calculate the postion relative to diagram/table node and seems that calcuation is not correct.

Another two issues :
1. In your first reply you said handling click event is not possible in silverlight. I am wondering how mouse move event get handle to shown adjustment handle then ?

2. Using List box in control node, I repositioned it with help of auto handles and then change the diagram bounds in node modified event. Once diagram bounds are changed scrollbar in list box which is hosted in control node stops working (no mouse or keyboard event gets handled by the listbox).

-Rajesh


-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control node and ModificationStart
Reply #5 - Jan 15th, 2010 at 8:43am
Print Post  
Hi Rajesh,

If the drag-and-drop event takes a MouseEventArgs (or derived) object as argument, call args.GetPosition(diagram.DocumentPlane) to find the document coordinates of the point, which you should then pass as argument to CellFromPoint.

Otherwise if you have the client-area coordinates of a point, try calling diagram.TransformToVisual(diagram.DocumentPlane).Transform(point) to get the document coordinates.

The problem with mouse events happen only if a hosted control calls CaptureMouse from its MouseDown handler. Then the diagram no longer receives mouse events until the control releases the capture. Usually the diagram has already detected some mouse move events before that happens, and successfully shows the auto-handles.

We will try handling the MouseDown/Up events raised by hosted controls instead of depending on event bubbling to see if this helps.

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