AccuDrawViewportUI Class

Provides an in viewport user interface for AccuDraw that can optionally follow the cursor or remain at a fixed location.

Extends

Methods

Name Description
constructor(): AccuDrawViewportUI Create a new instance of this class to set as accuDraw for this session.  
currentControlRect(vp: ScreenViewport): undefined | ViewRect Protected Return the ViewRect currently occupied by the controls in the supplied view.  
grabInputFocus(): void Request to set focus to the active AccuDraw input field to start entering values.  
modifyControlRect(_rect: ViewRect, _vp: ScreenViewport): void Protected Use to override the position of the controls in the supplied view.  
onCompassDisplayChange(state: "show" | "hide"): void Change notification for when the compass is shown or hidden.  
onCompassModeChange(): void Change notification for when the compass mode switches between polar and rectangular inputs.  
onFieldKeyinStatusChange(item: ItemField): void Change notification for when the supplied input field switches between dynamic and partial input.  
onFieldLockChange(item: ItemField): void Change notification for when the supplied input field lock status is modified.  
onFieldValueChange(item: ItemField): void Change notification for when the supplied input field value has been modified.  
onMotion(ev: BeButtonEvent): void Change notification of a motion event in the view.  
refreshControls(): void Call to update the currently displayed controls after settings are changed.  
setFocusItem(index: ItemField): void Request to set focus to the specified AccuDraw input field to start entering values.  
setHorizontalFixedLayout(): void Call to set a horizontal layout that is anchored to the bottom middle of the view.  
setVerticalCursorLayout(): void Call to set a vertical layout that follows the cursor.  

Inherited methods

Name Inherited from Description
defaultFocusItem(): ItemField Inherited AccuDraw Get default focus item for the current compass mode
disableForSession(): void Inherited AccuDraw Disable AccuDraw so that it can not be used by interactive tools.
enableForSession(): void Inherited AccuDraw Enable AccuDraw so that it can be used by interactive tools.
getAngleFormatter(): undefined | FormatterSpec Inherited AccuDraw Allow the AccuDraw user interface to supply the angle/direction formatter
getAngleParser(): undefined | ParserSpec Inherited AccuDraw Allow the AccuDraw user interface to supply the angle/direction parser
getFieldLock(index: ItemField): boolean Inherited AccuDraw Get the current lock state for the supplied input field
getFormattedValueByIndex(index: ItemField): string Inherited AccuDraw Can be called by sub-classes to get a formatted value to display for an AccuDraw input field
getLengthFormatter(): undefined | FormatterSpec Inherited AccuDraw Allow the AccuDraw user interface to supply the distance parser
getLengthParser(): undefined | ParserSpec Inherited AccuDraw Allow the AccuDraw user interface to supply the distance parser
getValueByIndex(index: ItemField): number Inherited AccuDraw Get the current value for the supplied input field
isDynamicKeyinStatus(index: ItemField): boolean Inherited AccuDraw Get the current keyin status for the supplied input field
itemFieldInputIsValid(key: string, item: ItemField): boolean Protected Inherited AccuDraw Call from an AccuDraw UI event to check if key is valid for updating the input field value.
onRotationModeChange(): void Inherited AccuDraw Called after compass rotation is changed
processFieldInput(index: ItemField, input: string, synchText: boolean): Promise<void> Inherited AccuDraw Call from an AccuDraw UI event to sync the supplied input field value
processMotion(): void Inherited AccuDraw Can be called by sub-classes as the default implementation of onMotion.
sendDataPoint(pt: Point3d, viewport: ScreenViewport): Promise<void> Inherited AccuDraw Emulate a mouse click at the specified location in the supplied view by sending button down/up events.
setCompassMode(mode: CompassMode): void Inherited AccuDraw Change current compass input mode to either polar or rectangular
setFieldLock(index: ItemField, locked: boolean): void Inherited AccuDraw Change the lock status for the supplied input field
setRotationMode(mode: RotationMode): void Inherited AccuDraw Change current compass orientation
setValueByIndex(index: ItemField, value: number): void Inherited AccuDraw Set the current value for the supplied input field

Properties

Name Type Description
controlProps Static { backgroundColor: string, borderRadius: string, button: { margin: string, outlineWidth: string, pressedColor: string, shadow: string }, columnSpacingFactor: number, cursorOffset: { x: number, y: number }, fieldSize: number, fixedLocation: boolean, horizontalArrangement: boolean, mathOperations: boolean, rowSpacingFactor: number, simplifiedInput: boolean, suspendLocateToolTip: boolean, text: { color: string, focusColor: string, fontFamily: string, fontSize: string } } Settings to control the behavior and visual appearance of the viewport controls.  
hasInputFocus Accessor ReadOnly boolean Return whether keyboard shortcuts can or can't be used.  

Inherited properties

Name Type Inherited from Description
alwaysShowCompass Inherited boolean AccuDraw When true the compass is always active and on screen instead of following the current tools request to activate
angleRoundOff Accessor Inherited ReadOnly RoundOff AccuDraw Get angle round off settings
autoFocusFields Inherited boolean AccuDraw When true locking the angle also moves focus to the angle input field
autoPointPlacement Inherited boolean AccuDraw When true fully specifying a point by entering both distance and angle in polar mode or XY[Z] in rectangular mode, the point is automatically accepted
axisIndexing Inherited boolean AccuDraw When true the current point is adjusted to the x and y axes when within a close tolerance
bearingFixedToPlane2d Accessor Inherited boolean AccuDraw Allow the AccuDraw user interface to specify bearing directions are always in xy plane
compassMode Inherited CompassMode AccuDraw The current compass mode
contextSensitive Inherited boolean AccuDraw When true all tool hints are applied as opposed to only selected hints
currentState Accessor Inherited CurrentState AccuDraw Current AccuDraw state
distanceIndexing Inherited boolean AccuDraw When true the current point is adjusted to the last locked distance value when within a close tolerance
distanceRoundOff Accessor Inherited ReadOnly RoundOff AccuDraw Get distance round off settings
dontMoveFocus Inherited boolean AccuDraw Disable automatic focus change when user is entering input.
floatingOrigin Inherited boolean AccuDraw When true the compass follows the origin hint as opposed to remaining at a fixed location
isActive Accessor Inherited ReadOnly boolean AccuDraw When true the compass is displayed and adjusting input points for the current interactive tool
isBearingMode Accessor Inherited ReadOnly boolean AccuDraw Allow the AccuDraw user interface to specify bearing
isDeactivated Accessor Inherited ReadOnly boolean AccuDraw When true the compass is not displayed or adjusting points, the current interactive tool has disabled automatic activation, but can still be enabled via shortcuts
isEnabled Accessor Inherited ReadOnly boolean AccuDraw When true AccuDraw is enabled by the application and can be used by interactive tools
isInactive Accessor Inherited ReadOnly boolean AccuDraw When true the compass is not displayed or adjusting points, but it can be automatically activated by the current interactive tool or via shortcuts
newFocus Inherited ItemField AccuDraw Set input field to move focus to (X_Item or Y_Item) for automatic focus change.
rotationMode Inherited RotationMode AccuDraw The current compass rotation
smartKeyin Inherited boolean AccuDraw When true improve behavior for +/- input when cursor switches side and try to automatically manage focus
stickyZLock Inherited boolean AccuDraw When true the z input field will remain locked with it's current value after a data button

Defined in

Last Updated: 05 February, 2025