Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic arrow disappearing (Read 1499 times)
Amanda@tjx
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Sep 19th, 2006
arrow disappearing
Sep 19th, 2006 at 5:01pm
Print Post  
I have recently upgraded to version v.2 and code that worked before no longer does.

Specifically, I have code in ArrowCreating that checked the origin and destination boxes to verify an arrow between the 2 is allowed.  I also have code in ArrowCreated to update the origin and destination boxes as well as updating some properties on the arrow.

All this worked in the previous version.

Now, it seems when ArrowCreating is fired there are a couple of problems:
1. Periodically, the origin and destination boxes are the same so e.confirm is being set because I do not allow the user to draw an arrow to itself.

2. If the origin and dest are not the same then I use a message box to ask the user what text to assign to the arrow.  The message box is displayed as before, but ArrowCreated is NOT being fired and the arrow doesn't actually get attached to the dest box.

In both cases above, the arrow is always drawn but when I click anywhere on the flowchart the arrow disappears.

What has changed????  I need to fix the problem ASAP.  If you have any suggestions please let me know.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: arrow disappearing
Reply #1 - Sep 19th, 2006 at 5:50pm
Print Post  
In older versions ArrowCreating was raised only once per arrow, after releasing the mouse button. Now it is raised after each mouse movement while the user draws an arrow, and once again when they release the mouse button. This is done so that the control gives some visual indication (by changing the mouse cursor) whether the arrow can be created at the current mouse position.

Maybe the control looses the mouse capture when you show the message box and cancels drawing the arrow. I will check if there is a way to discover whether this is the final ArrowCreating message raised for an arrow, so you can show the MessageBox only when the mouse button is released.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: arrow disappearing
Reply #2 - Sep 19th, 2006 at 6:11pm
Print Post  
I've found the static Control.MouseButtons property lets you check the state of mouse buttons. You can use it to find out if ArrowCreating has been raised for the last time for an arrow, after releasing the mouse button:

Code
Select All
Private Sub fc_ArrowCreating(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.AttachConfirmArgs) Handles fc.ArrowCreating
  If (Control.MouseButtons And MouseButtons.Left) = 0 Then
    MessageBox.Show("are you sure?")
  End If
End Sub
 



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