geHiDragFig
geHiDragFig(
w_windowID
r_form
t_srcPrompt
t_dstPrompt
t_cmdName
l_selSet
g_useMultiWindow
[ l_firstPoint ]
)
=> l_results
Description
Used in conjunction with other SKILL functions to implement the dragging of selected database figures.
Arguments
|
w_windowID
|
Window ID.
|
|
r_form
|
Form data structure. This works best with an options form created using hiCreateAppForm or hiCreateLayoutForm, with ?formType as 'options. You can toggle the appearance of the options form using the F3 key. The form is closed when the geHiDragFig function completes. Valid Values: Any valid form of data structure or 0 if there is no form.
|
|
t_srcPrompt
|
Prompt string for the origin or source point.
|
|
t_dstPrompt
|
Prompt string for the destination point.
|
|
t_cmdName
|
The command name depends on the dragging action you desire, such as copy, move, or stretch. The command name could be any string or empty string, and the behavior is the same. Valid Values: Copy, Move, Stretch, or any other string or empty string.
|
|
l_selSet
|
Specifies which selected set or object’s image is to be dragged. Its value could be a selected set, a selected object, or nil. In each case, the return value is the same. It prompts you to specify the first point with the mouse (source point in source cellview), then it prompts you to specify the second point with the mouse (destination point in the destination cellview).
Valid Values: geGetSelSet or any valid selected set or nil.
If the argument is nil, a dragging image does not appear on the screen; otherwise, a dragging image appears and can be moved with the mouse. You can use geGetSelSet to get the value of the selected set or object. It returns nil if nothing is selected.
|
|
g_useMultiWindow
|
Supports multiple windows. If you set this argument to nil, you cannot use snap mode. If you set this argument to t, the snap mode is only respected in the source window. Valid Values: t (supports multiple windows), nil (does not support multiple windows).
|
|
l_firstPoint
|
First source point specified as a list.
|
Value Returned
|
l_results
|
Returns the value in the following format:
((source_point_CV source_point_coordination)(destination_point_CV destination_point_coordination))
|
Examples
The following example shows geHiDragFig used along with geGetSelSet to implement the dragging of database figures:
selSet = geGetSelSet()
geHiDragFig(window(2) 0 "Enter Origin Point" "Enter Destination Point" "Copy" selSet t)
The example returns the following value:
((db:21429292 (-0.4375 0.8125))
(db:21429292 (-0.4375 -0.1875))
)
The following example shows the use of an options form:
let((selSet result)
hiCreateAppForm(
?name 'ExDragForm
?formType 'options
?buttonLayout 'HideCancel
?formTitle "Drag Options"
?fields list(
list(
hiCreateBooleanButton(?name 'deleteOrig ?buttonText "Delete Original")
0:0 400:30 100
)
)
)
selSet = geGetSelSet()
result = geHiDragFig(
hiGetCurrentWindow()
ExDragForm
"Enter Origin Point"
"Enter Destination Point"
"Copy"
selSet
t
)
printf("Delete: %L\nResult: %L\n"
ExDragForm->deleteOrig->value
result
)
)
The example returns the following result:
Delete: nil
Result: ((db:0x2af5f19a (34.44 55.61)) (db:0x2af5f19a (44.745 -13.895)))
The following example shows a multi-window scenario. When you use the same code as in the previous example to drag an image to another window, the example returns the following result:
Delete: t
Result: ((db:0x2af5f19a (29.575 55.285)) (db:0x2c659a9a (0.3 0.795)))
The image that is dragged into another window is just an image, not a real object. You cannot select or save it. The window is not edited.
Related Topics
Selection Functions
hiCreateAppForm
Return to top