View Single Post
  #1  
Old 21-05-2012, 05:13
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Question Trapped in GetUserClick - unusual behavior?

Hi all,

I am using code that's basically straight from the help files to get a user click and do certain actions, however for some reason with this code ESC does not break the cycle (it actually triggers the click action) and neither does the timeout.

Code:
Sub SmoothSeg()
    Dim X As Double, Y As Double
    
    B = False
    
    Dim Seg As Segment, S As Shape
    
    Set S = ActiveSelection.Shapes.First
    
    While Not B
        B = ActiveDocument.GetUserClick(X, Y, 0, 1, False, cdrCursorSmallcrosshair)
        
        If Not B Then
            Set Seg = S.Curve.FindSegmentAtPoint(X, Y, 0, 0.1)
            If Not Seg Is Nothing Then
                Seg.EndNode.Type = cdrSmoothNode
                Seg.StartNode.Type = cdrSmoothNode
                Seg.Type = cdrCurveSegment
                Seg.EndNode.Type = cdrSmoothNode
                Seg.StartNode.Type = cdrSmoothNode
                Seg.Type = cdrCurveSegment
            End If
        End If
    Wend
End Sub
The same basic thing seems to work just fine in other situations, so I suspect it has to do with the curve manipulation.

Any ideas?
Reply With Quote