![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This component is the base class for user-defined operations.
All user-defined operations should be derived from this class. All methods of this class are virtual, but only those required by the operation need be overridden. The editor component will trigger methods of the user-defined operation as appropriate. See individual method documentation for further details.
Note that if an operation changes data in the editing data layer, then it should set the changed flag using the TSLUserOperationRequest::setChanged method.
Public Member Functions | |
TSLUserOperation () | |
virtual | ~TSLUserOperation () |
virtual int | activate (void *data) |
virtual bool | activatePossible () |
virtual int | backup () |
virtual bool | backupPossible () |
virtual void | constraintChanged (TSLEditorConstraintType newConstraint, double newParameter) |
virtual void | deactivate () |
virtual int | dialogEntered (int button) |
virtual int | done () |
virtual int | locator (TSLTMC x, TSLTMC y, TSLLocatorType type, TSLButtonType button, TSLModifierType modifier) |
virtual bool | query (TSLVariant *value) |
virtual int | reactivate (void *data) |
virtual void | requestHandler (TSLUserOperationRequest *handler) |
virtual void | resetUndoBuffer () |
virtual int | textEntered (const char *entry, bool cancelled) |
virtual int | undo () |
virtual bool | undoPossible () |
TSLUserOperation::TSLUserOperation | ( | ) |
Default constructor for a User Operation.
|
virtual |
Destructor for User Operation.
|
virtual |
This method is invoked when the operation is initiated,
It may be overridden by the User Operation derived class.
data | A pointer to some operation specific data. If the User Operation is overriding a standard operation, then the type of this data is described in the standard operation documentation. |
|
virtual |
This method is invoked to determine if the current situation allows the operation to be activate e.g. for the delete operation, this would return true if there was anything to delete. Note that this is used to enable or disable GUI elements and should therefore reflect whether activate would a succeed if it was called.
It may be overridden by the User Operation derived class. If not overridden, it is assumed that 'false' would be returned.
Returns the true if the operation can be activated, false otherwise.
|
virtual |
This method is invoked when the backup button is pressed whilst the operation is active.
Returns the prompt number to display, 0 to keep current prompt.
|
virtual |
This method is invoked to determine if the current situation allows the operation to be backed up, e.g. the user is in the midst of constructing a polyline. Note that this is used to enable or disable GUI elements and should therefore reflect whether backup would do anything if it was called, not merely whether backup is supported by this operation.
It may be overridden by the User Operation derived class. If not overridden, it is assumed that 'false' would be returned.
Returns the true if the operation can be backed up, false otherwise.
|
virtual |
This method is invoked when the constraint parameters change. This allows the operation to potentially change echo style, or other internal flags.
newConstraint | The new value of the constraint. |
newParameter | Any parameter required for the new constraint |
|
virtual |
This method is invoked when the operation is completed.
It may be overridden by the User Operation derived class.
|
virtual |
This method is invoked when the user selects a button from a requested dialog box.
button | The button selected by the user, indexed from 1. |
|
virtual |
This method is invoked when the application calls the 'done' method of the Editor, or when a right button locator event is received by the Editor
Returns the prompt number to display, 0 to keep current prompt.
|
virtual |
This method is invoked when a locator event is received by the Editor.
It may be overridden by the User Operation derived class.
x | X location of locator event, in TMC units. |
y | X location of locator event, in TMC units. |
type | Type of locator event, press, motion or release. |
button | Button that triggered the event, left, centre or right. |
modifier | Modifiers that were selected during the event. Shift, Control, both or none. |
|
virtual |
This method is invoked to query the current status of the operation. The actual information returned is operation dependent. For example the attribute operations return the current value that would be applied if the operation were activated.
Individual operations will document what the query will return.
value | A ptr to a TSLVariant for the storage of the result of a query. |
|
virtual |
If the user invokes an operation whilst it is already active, perhaps with different arguments, then this method is called.
It may be overridden by the User Operation derived class.
If it is not overridden then the deactivate method is called followed by the activate method.
data | A pointer to some operation specific data. If the User Operation is overriding a standard operation, then the type of this data is described in the standard operation documentation. |
|
virtual |
This method supplies the User Operation with a request handler.
This method is triggered when the operation is added to an editor. An instance of an operation may only be added to one editor at a time. The handler passed to this method should be remembered by the user operation and used to access such things as the select list, request redraws and gain access to the attached drawing surface and data layer.
handler | The request handler that the operation needs to access the editor functionality. |
|
virtual |
This method is triggered by the Editor when the operation should clear any undo buffer that it may be maintaining.
If the User Operation has implemented the undo feature, then this call informs it that the data is no longer required since another operation has performed some action.
|
virtual |
This method is invoked when the user has entered some text that was previously requested.
entry | This is the string that was entered by the user. It is undefined if the entry was cancelled by the user. |
cancelled | This flag is true if the user cancelled the text request. |
|
virtual |
This method is invoked when the user presses the undo button, when the operation was the last active operation.
Returns the prompt number to display, 0 to keep current prompt.
|
virtual |
This method is invoked to determine if the current situation allows the operation to be undone, e.g. the user has just deleted some objects and calling undo would restore them. Note that this is used to enable or disable GUI elements and should therefore reflect whether undo would do anything if it was called, not merely whether undo is supported by this operation.
It may be overridden by the User Operation derived class. If not overridden, it is assumed that 'false' would be returned.
Returns the true if the operation can be backed up, false otherwise.