Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Editing of Arrow names & passing arrow referen (Read 4162 times)
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Editing of Arrow names & passing arrow referen
Aug 15th, 2007 at 8:45pm
Print Post  
I wanted to provide the users the possibility of editing the arrow names, but arrows don't have the .BeginInplaceEdit of boxes, so I thought about opening a window with the arrow reference when the user double-clicks on it, change the text (and possibly some other arrow properties) in the form and then update the Flowchart with the supplied arrow reference.

The code is as follows:

    Private Sub AxFlowChart1_ArrowDblClicked(ByVal sender As Object, ByVal e As AxFLOWCHARTLib._IFlowChartEvents_ArrowDblClickedEvent) Handles AxFlowChart1.ArrowDblClicked
        'Open Arrow edition screen
       Dim ArrForm As New ArrowForm
       ArrForm.MdiParent = Main
       ArrowForm.ArrowLine = Me.AxFlowChart1.ActiveArrow
       ArrForm.Show()
    End Sub

This is supposed to pass the reference to a variable declared as:

    Public ArrowLine As FLOWCHARTLib.arrow

The text is then supposed to change with the following event:

    Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
       If Not (ArrowLine Is Nothing) Then
           ArrowLine.Text = txtName.Text
       End If
    End Sub

However, the "ArrowLine" is always nothing, so the reference is apparently not passed to the other form.

What am I doing wrong?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing of Arrow names & passing arrow ref
Reply #1 - Aug 16th, 2007 at 6:38am
Print Post  
Hi,

Use the e.Arrow event argument to access the arrow that has been double clicked.

Stoyan
  
Back to top
 
IP Logged
 
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Re: Editing of Arrow names & passing arrow ref
Reply #2 - Aug 16th, 2007 at 4:32pm
Print Post  
Hello, Stoyan

Thank you for the response, but it does not work either. It did not work either when I tried to pass the arrow reference using ".Findarrow" and the tag ID. For some mysterious reason I am unable to pass on an arrow reference from the Diagram form to the form that has to edit the arrow data.

However, if I make the call the other way round, i.e., from the "child" form ArrForm that has to edit the arrow data using ".Findarrow" then it DOES work:

               ArrowLine = Main.CurrentDiagram.AxFlowChart1.FindArrow(m_ArrowId)


It has me left totally mystified.... given that with this latter solution I have been able to find a workaround it's OK, but if you find where the problem is in my code I'd like to hear about it...

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing of Arrow names & passing arrow ref
Reply #3 - Aug 17th, 2007 at 4:05am
Print Post  
ArrForm.MdiParent = Main
--> ArrowForm.ArrowLine = Me.AxFlowChart1.ActiveArrow
ArrForm.Show()

You are setting the ArrowLine member of one form (ArrowForm, which is the default form instance created by VB.NET), but then displaying a different form (ArrForm).

Stoyan
  
Back to top
 
IP Logged
 
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Re: Editing of Arrow names & passing arrow ref
Reply #4 - Aug 17th, 2007 at 2:31pm
Print Post  
There is only one diagram, I am not trying to send arrows between different diagrams or display it in different forms.

"Arrowform" is simply a new form so as to be able to edit the arrow name, as I cannot do it on the diagram itself. It does not contain a diagram of its own.

"Arrowline" is supposed to be simply a reference to the arrow so that when I update the name of the arrow in the Arrowform  form I can call back the original diagram in the original form (using Arrowline.Text) and update directly the corresponding arrow.

Eventually I got the workaround to get a reference to the corresponding arrow using:

ArrowLine = Main.CurrentDiagram.AxFlowChart1.FindArrow(m_ArrowId)

This allows me to change the arrow name in the original diagram while I am still editing the name in the Arrform arrow name editing form.

What surprises me is that I cannot pass the object from the original form TO the arrow editing form for the callback, but I CAN get the callback reference FROM the arrow editing form.... very mysterious....
???

Thank you anyhow for your help
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing of Arrow names & passing arrow ref
Reply #5 - Aug 18th, 2007 at 9:01am
Print Post  
I think you are using two different forms in these three lines of code:

ArrForm.MdiParent = Main
ArrowForm.ArrowLine = Me.AxFlowChart1.ActiveArrow
ArrForm.Show()

One form is ArrForm, and the other form is ArrowForm. You are setting ArrowForm.ArrowLine, but then calling ArrForm.Show(), thus displaying
a form where ArrowLine is not set.

Stoyan
  
Back to top
 
IP Logged
 
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Re: Editing of Arrow names & passing arrow ref
Reply #6 - Aug 19th, 2007 at 1:56pm
Print Post  
Ooops... now that was a really stupid mistake... Roll Eyes

In any case it has demonstrated (again) that your customer service is first-class.

Thank you very much, Stoyo!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Editing of Arrow names & passing arrow ref
Reply #7 - Aug 20th, 2007 at 5:36am
Print Post  
8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint