Object Model Reference : Classes : D : Document : Methods : Document.GetUserArea |
Function GetUserArea(x1 As Double, y1 As Double, x2 As Double, y2 As Double, ShiftState As Long, TimeOut As Long, Snap As Boolean, CursorShape As cdrCursorShape) As Long
Member of Document
The GetUserArea method allows the user to specify a rectangular area in the document window (marquee selection). It also retrieves information about the state of the Ctrl, Shift, and Alt keys at the time of the selection.
Parameter
|
Description
|
x1
|
Specifies the x-coordinate for the upper-left corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.
|
y1
|
Specifies the y-coordinate for the upper-left corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.
|
x2
|
Specifies the x-coordinate for the lower-right corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.
|
y2
|
Specifies the y-coordinate for the lower-right corner of a rectangle shape on the active page that defines the user area. This value is measured in document units.
|
ShiftState
|
Specifies the shift state
|
TimeOut
|
Specifies the amount of time, in seconds, to wait for the user to click
The default value for this parameter is 10.
|
Snap
|
Specifies whether to recognize the snap
The default value for this parameter is True. 0 recognizes the snap, while 1 ignores the snap.
|
CursorShape
|
Specifies the shape of the cursor
This value returns cdrCursorShape.
|
The following VBA example allows the user to select a rectangular area and then creates a rectangle with dimensions specified by the selection. If the user pressed Shift while making the selection, the rectangle receives round corners
Sub Test() |
Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double |
Dim Shift As Long |
Dim b As Boolean |
Dim s As Shape |
Dim cr As Long, cg As Long, cb As Long |
b = ActiveDocument.GetUserArea(x1, y1, x2, y2, Shift, 10, False, cdrCursorEyeDrop) |
If Not b Then |
Set s = ActiveDocument.ActiveLayer.CreateRectangle(x1, y1, x2, y2) |
If (Shift And 1) <> 0 Then ' Shift pressed |
s.Rectangle.SetRoundness 50 |
End If |
End If |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.