Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Disabling Creating of  Boxes and Arrows (Read 2628 times)
Teun
YaBB Newbies
*
Offline



Posts: 3
Joined: Sep 6th, 2006
Disabling Creating of  Boxes and Arrows
Sep 6th, 2006 at 6:22am
Print Post  
Hi,


I try to disable the creating of boxes and arrows.
with event RequestCreateArrow.

But this does not work in my case. As a workaround i coded the RequestAttachAroow event. This is working fine by not allowing the arrow to be attached. But it is quite annoying that the user could try. How could i resolve this?

I am using version 3.2.3

In my flowchart the only thing the user is allowed to do is double click and dragging boxes.

I include my Vb code for clarification.

Regards,

Teun

Private Sub flwModel_RequestCreateArrow(ByVal arrow As FLOWCHARTLibCtl.IArrowItem, pbCreate As Boolean)

     '+
'Description:
'     Request Create Arrow event - prevent user from attaching arrow to a different
'       box
'Arguments: [IN]  arrow - the arrow being modified
'           [IN]  changingOrg - True if moving arrow start point, False if end point
'           [IN]  obj - Object arrow is to be attached to
'           [OUT] attach - True to allow modification of arrow, False to cancel it
'-
On Error GoTo errHandler:

    Const strPROCEDURE As String = "flwModel_RequestCreateArrow"

    pbCreate = False

    Exit Sub
   
errHandler:
    If gobjError.ErrSet = False Then
       Call gobjError.SetError(Err.Number, Err.Description, mstrMODULE, strPROCEDURE, gstrCOMPONENT)
    End If
    mblnError = True
    Call gobjError.ShowError
    Call gobjError.ClearError
    Call subUnloadForm(Me)
   
      
End Sub

Private Sub flwModel_RequestAttachArrow(ByVal arrow As FLOWCHARTLibCtl.IArrowItem, _
                                       ByVal changingOrg As Boolean, _
                                       ByVal obj As Object, _
                                       attach As Boolean)
'+
'Description:
'     Request Attach Arrow event - prevent user from attaching arrow to a different
'       box
'Arguments: [IN]  arrow - the arrow being modified
'           [IN]  changingOrg - True if moving arrow start point, False if end point
'           [IN]  obj - Object arrow is to be attached to
'           [OUT] attach - True to allow modification of arrow, False to cancel it
'-
On Error GoTo errHandler:

    Const strPROCEDURE As String = "flwModel_RequestAttachArrow"

    attach = False

    Exit Sub
   
errHandler:
    If gobjError.ErrSet = False Then
       Call gobjError.SetError(Err.Number, Err.Description, mstrMODULE, strPROCEDURE, gstrCOMPONENT)
    End If
    mblnError = True
    Call gobjError.ShowError
    Call gobjError.ClearError
    Call subUnloadForm(Me)

End Sub
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Creating of  Boxes and Arrows
Reply #1 - Sep 6th, 2006 at 6:39am
Print Post  
Hi,

Set FlowChart.Behavior = bhModify. That will prevent users from drawing new boxes and arrows, but will let them select and modify non-Locked objects.

You can set arrow.AllowMoveStart and AllowmoveEnd = false to prevent arrows being attached to different objects.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Teun
YaBB Newbies
*
Offline



Posts: 3
Joined: Sep 6th, 2006
Re: Disabling Creating of  Boxes and Arrows
Reply #2 - Sep 6th, 2006 at 7:02am
Print Post  
Hi

I tried the bhModify before and i t did not work. However now i saw the FireMouseMove was set to True.

Setting this to False everything is functioning as expected.

Regards,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Creating of  Boxes and Arrows
Reply #3 - Sep 6th, 2006 at 7:11am
Print Post  
Hi,

The bhModify behavior does not depend on the FireMouseMove value. That should work even if FireMouseMove is true, unless you change the Behavior in the MouseMove event handler?

Stoyan
  
Back to top
 
IP Logged
 
Teun
YaBB Newbies
*
Offline



Posts: 3
Joined: Sep 6th, 2006
Re: Disabling Creating of  Boxes and Arrows
Reply #4 - Sep 6th, 2006 at 7:30am
Print Post  
Hi,

I only have a MouseUp event.  Anyway things are working now as expected.

Regards,

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