Method GetUserRect
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
GetUserRect(onStateChangedDelegate)
Initiates an action (check BaseActionObj) where the user will create a new line in the component's drawing area. The function is running asynchronously, so you need to implement statechangeDelegate event/delegate to manage the method results The action has the actionType == ACTION_RECT_VIEW
public void GetUserRect(onStateChangedDelegate statechangeDelegate)
Parameters
statechangeDelegateonStateChangedDelegateA function created using the onStateChangedDelegate as model.
Examples
function CmdZoomWindow(canvasId) {
var vdcanvas = vdmanager.vdrawObject(canvasId);
vdcanvas.GetUserRect(_onActioncmdZoomStateChanged);
}
function _onActioncmdZoomStateChanged(action, status) {
var vdcanvas = action.vdrawOwner();
if (status == 'start') {
action.DispProps = (vdConst.ACTION_DISPLAY_DEFAULT ^ vdConst.ACTION_DISPLAY_USEFILLCOLOR);
vdcanvas.Prompt('pick first corner');
} else if (status == 'count') {
vdcanvas.Prompt('pick second corner');
} else if (status == 'end') {
vdcanvas.Prompt(':');
if (!action.IsCanceled()) {
vdcanvas.zoomwindow(action.ResValue[0], action.ResValue[1]);
vdcanvas.redraw();
}
}
}