OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21-05-2012, 04: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
  #2  
Old 24-05-2012, 13:07
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default GetUserClick

Joe,

You never declare B as a Boolean, therefore your code does not know when to exit the While loop. ;-)

-Shelby
Reply With Quote
  #3  
Old 24-05-2012, 13:09
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default

That's what I get for kinda copying out just the "most important parts" from the examples... Gonna go and bow my head in shame...

Thanks, Shelby!
Reply With Quote
Reply

Tags
curves, getuserclick, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default word wrapping behavior on Paragraph Textbox Janga CorelDRAW/Corel DESIGNER VBA 1 12-02-2010 22:08
Default word wrapping behavior on Paragraph Textbox Janga General 0 11-02-2010 11:41
GetUserClick Webster CorelDRAW/Corel DESIGNER VBA 2 09-11-2006 01:03
GetUserClick? ssskurt CorelDRAW CS 0 23-12-2002 11:46


All times are GMT -5. The time now is 21:32.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com