![]() |
Lomse library. API documentation
0.30.0
|
#include <lomse_command.h>
A command for moving the cursor to a new position.
See constructors for details. Each constructor offers a different alternative for specifying the new cursor position.
Public Types | |
| enum | ECursorAction |
Public Types inherited from DocCommand | |
| enum | ECmdCursorPolicy |
| enum | ECmdUndoPolicy |
| enum | ECmdSelectionPolicy |
Public Member Functions | |
| CmdCursor (ECursorAction cmd, const std::string &name="") | |
| CmdCursor (ImoId id, const std::string &name="") | |
| CmdCursor (int measure, int instr, int staff, const std::string &name="") | |
| CmdCursor (TimeUnits time, int instr, int staff, const std::string &name="") | |
| CmdCursor (DocCursorState &state, const std::string &name="") | |
| int | get_cursor_update_policy () override |
| int | get_undo_policy () override |
| int | get_selection_update_policy () override |
Public Member Functions inherited from DocCmdSimple | |
| virtual | ~DocCmdSimple () |
| bool | is_composite () override |
Public Member Functions inherited from DocCommand | |
| virtual | ~DocCommand () |
| std::string | get_name () |
| bool | is_reversible () |
| bool | is_recordable () |
| std::string | get_error () |
This enum describes the posible actions for CmdCursor commands.
| CmdCursor::CmdCursor | ( | ECursorAction | cmd, |
| const std::string & | name = "" |
||
| ) |
This command moves the cursor to a new position, as specified by parameter cmd.
| cmd | The action to be performed. It must be one of the following values from enum ECursorAction: k_move_next, k_move_prev, k_enter, k_exit, k_move_up, k_move_down or k_cursor_dump. |
| name | The displayable name for the command. If not specified or empty will default to one of the following vaues, depending on the requested action: "Cursor: move next", "Cursor: move prev", "Cursor: move up", "Cursor: move down", "Cursor: enter element" or "Cursor: exit element". |
Remarks
Example
| CmdCursor::CmdCursor | ( | ImoId | id, |
| const std::string & | name = "" |
||
| ) |
This command moves the cursor for pointing to element specified by parameter id.
| id | The ID of the object that will be pointed by the cursor. |
| name | The displayable name for the command. If not specified or empty will default to "Cursor: point to". |
Remarks
| CmdCursor::CmdCursor | ( | int | measure, |
| int | instr, | ||
| int | staff, | ||
| const std::string & | name = "" |
||
| ) |
When the cursor is inside a music score, this command moves the cursor for pointing to the first element (note, rest, clef, etc.) in the measure specified by parameter measure.
| measure | The measure to move the cursor to (0..n). |
| instr | The instrument to move the cursor to. Value -1 means "remain in current instrumnent". For moving to another instrument use instrument number (0 ... num_instruments - 1). |
| staff | The staff to move the cursor to. Value -1 means "remain in current staff". For moving to another staff use staff number (0 ... num_staves - 1). |
| name | The displayable name for the command. If not specified or empty will default to "Cursor: jump to new place". |
Remarks
Example
| CmdCursor::CmdCursor | ( | TimeUnits | time, |
| int | instr, | ||
| int | staff, | ||
| const std::string & | name = "" |
||
| ) |
When the cursor is inside a music score, this command moves the cursor for pointing to a time position equal than the specified by parameter time.
| time | The new time position to move the cursor to. |
| instr | The instrument to move the cursor to. Value -1 means "remain in current instrument". For moving to another instrument use instrument number (0 ... num_instruments - 1). |
| staff | The staff to move the cursor to. Value -1 means "remain in current staff". For moving to another staff use staff number (0 ... num_staves - 1). |
| name | The displayable name for the command. If not specified or empty will default to "Cursor: jump to new place". |
Remarks
| CmdCursor::CmdCursor | ( | DocCursorState & | state, |
| const std::string & | name = "" |
||
| ) |
This command moves the cursor to the state specified by parameter state.
| state | The new state for the cursor. |
| name | The displayable name for the command. If not specified or empty will default to "Cursor: jump to new place". |
Remarks
|
inlineoverridevirtual |
Returns a value from ECmdCursorPolicy that indicates the update policy followed by this command.
Implements DocCommand.
|
inlineoverridevirtual |
Returns a value from ECmdSelectionPolicy that indicates the undo policy followed by this command.
Implements DocCommand.
|
inlineoverridevirtual |
Returns a value from ECmdUndoPolicy that indicates the undo policy followed by this command.
Implements DocCommand.