Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Want to know about Handler (Read 7778 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Want to know about Handler
May 19th, 2009 at 4:46pm
Print Post  
Hi Stoyan,

I have made a ShapeNode in which I have set Expandable property = true. This time I am able to see "+" button just beside my ShapeNode. Now I have 2 questions.

1. I want to put this expandable button inside my Node at BottomRight position. How can I do this?

2. I want to perform some operation on this expandable button click. Which handler I can use to do this?

I am sending an image to your email ID that will give you clear idea of my query.

Many thanks in advance,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #1 - May 20th, 2009 at 5:10am
Print Post  
1. The closest you can get with the built-in button is setting ExpandButtonPosition to OuterLowerRight. We'll have to implement corresponding Inner values to let you place it inside. Otherwise, you could do that using custom drawing or an attached node.

2. Set ExpandButtonAction = RaiseEvents and handle the ExpandButtonClicked event.

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #2 - May 20th, 2009 at 8:08am
Print Post  
I have attached innerNode in my OriginalNode but when I click on expand button, NodeClicked event is getting call. I want ExpandButtonClicked event shoild be called.

Any Suggestion?

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #3 - May 20th, 2009 at 2:05pm
Print Post  
It's working as expected in my test. Are you sure you haven't missed the +/- icon?

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #4 - May 20th, 2009 at 2:18pm
Print Post  
Our inner node is actually locked(since it is a child of mainNode) so may be we are not getting the correct node.

I am sending you my sample application.Please have a look into that and suggest where is the problem.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #5 - May 20th, 2009 at 2:44pm
Print Post  
The +/- button is ignored for locked nodes, so the control registers a hit on the node under the locked one. Instead of locking it, you could set its EnabledHandles property to None and set e.Cancel from the NodeSelecting handler.
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #6 - May 21st, 2009 at 7:38am
Print Post  
Hi Stoyan,

Please have a look at the SampleApplication again which I have mailed to you yesterday.

1. In Application, when I click on expand button of a Node, a new window (PopUp) appears. This window starts from the point where I click by mouse. Now suppose if my Node is at extreme Right or extreme Bottom position of the screen and I clicked on Expand button, that time my window does not get appear fully; some portion of it cut by the screen.
In this situation, diagram should be resized or scrollbar should expand to make my window fully visible.

2. I want to change cursor when MouseEnter to the ExpandButton only.Is it possible? if yes, how ?

Please suggest something.

3. Suppose I have clicked on expand button and a property window get appear on the screen. Now what I want when I do anything like-

a. NodeClick
b. NodeDoubleClick.
c. DiagramClick.
d. NodeModified.
e. NodeSelection.
f. LinkClick.
h. LinkDoubleClick.
i. ZoomFactorChange. etc etc...

my window should get disappear. To close window  for each of the event may be the one solution but there are so many cases which I need to handle, so is there any common way by which I can get the solution ?


Many Thanks in Advance,
Bala
« Last Edit: May 21st, 2009 at 1:49pm by Bala »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #7 - May 21st, 2009 at 1:49pm
Print Post  
1. In the application you sent us, the popup window is not clipped by the diagram but part of it is off-screen when displayed near the edge. That's your own window, right? you should check the screen width and height (see the System.Windows.SystemParameters class) and offset he window to the left or top if you detect its tight/bottom sides are larger than the screen dimensions.

2. You could use Constants.GetExpandIconSize to get the size of the button and hit-test it based on the position ii is displayed.

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #8 - May 21st, 2009 at 1:50pm
Print Post  
Hi Stoyan,
Thanks for the reply.

Previous Query
============
For 1) It would not be user friendly if we open our property popup window sometimes to left and sometimes to right, it would be better if we could set diagram bounds to accomodate the window. Please suggest something on this.

For 2) Could you please provide us some code lines for your hittest suggestion as we are not able to get MouseEnter/mouseLeave events on the expand button to change the cursor?

Another query
===========
Suppose I have clicked on expand button and a property window get appear on the screen. Now what I want when I do anything like-

a. NodeClick
b. NodeDoubleClick.
c. DiagramClick.
d. NodeModified.
e. NodeSelection.
f. LinkClick.
h. LinkDoubleClick.
i. ZoomFactorChange. etc etc...

my window should get disappear. To close the opened window on each of the event listed above may be one solution but there are so many cases of this types which I need to handle, so is there any common way/event which can solve this?


Many Thanks in Advance,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #9 - May 22nd, 2009 at 7:28am
Print Post  
Hi,

1. If you detect the window is close to the diagram border, add its size to Diagram.Bounds and add it to ScrollX and ScrollY.
2. You could do that from the mouse move handler. When you detect the mouse is over the outer node, find the rectangle coordinated of the +/- icon from the outerNode.Bounds and Constants.GetExpanderSize and check if Rect.Contains(mousePosition).
3. You could enable the UndoManager, even if you do not need undo/redo support, and hide your window in response to ActionRecorded.

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #10 - May 23rd, 2009 at 1:10pm
Print Post  
Hi Stoyan,

I have tried all this but not got desired solution.
Could you please send some simple snippet so that I can proceed in that direction.
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #11 - May 26th, 2009 at 12:04pm
Print Post  
Hi Stoyan,

According to you suggestion, I have tried to implement Hand Cursor over expand button and Flickering issue of expand button, it is not yet completely solve. Its behavior is very inconsistent. Please have a look at the sample project.

I have some queries regarding these problems.

1). If a Node is selected (Node1) then expand button is not appear while MouseEnter. Why?

2). If mouse pointer just passes through the border of the node, node get selected even while MouseLeave. Why?

3). when mouse pointer is over the expand button, cursor should get change to hand cursor but expand button get invisible and mouse pointer doesn’t get change. Why?

Please suggest on these issues as soon as possible.

Thanks & Regards,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #12 - May 26th, 2009 at 4:06pm
Print Post  
Our developer has modified your application a bit, you can find it on the private messages page. On your points 1-3 from a few posts above:

1. The updated code shows extending the diagram to the right and bottom to fit the popup.

2. Detecting the +/- button is shown in the Diagram.MouseMove handler.

3. You can use the UndoManager event for actions that modify the diagram. For others you will have to handle additional events, e.g. for zooming, scrolling and changing the selection.
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Want to know about Handler
Reply #13 - May 27th, 2009 at 2:32pm
Print Post  
Hi Stoyan,

Thanks for reply and sample application.

For 1-

Diagram bound is extending while window is clipping but diagram should be adjusted after that.I have tried to adjust but only node is moving to visible area.I want, both node and window change there position with respect to diagram move.

For 2 and 3- its working. Again thanks for the reply Smiley

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Want to know about Handler
Reply #14 - May 28th, 2009 at 7:01am
Print Post  
Hi Bala,

I am not sure I can understand that, what do you need to adjust? From what I can see in the test app after the modifications by our developer, the diagram extends to fit both the node and the popup.

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