The JavaScript class for using XSheet column markers. Obtain it by calling columnMarkers from the column global object.
More...
|
QScriptValue | value (int markerId, String &propertyName) |
| Gets a property value given its key from the list of key/value pairs. More...
|
|
void | setValue (int markerId, String &propertyName, QVariant &value) |
| Sets a key/value pair on the given marker. More...
|
|
QScriptValue | keyValues (int markerId) |
| Returns the array of property keys that the marker contains. More...
|
|
The JavaScript class for using XSheet column markers. Obtain it by calling columnMarkers from the column global object.
Column marker allows access to markers attached to a column.
Here is an example on how to add an inbetween marker in the first cell column at frame 3, of length 1 (Japanese timesheet):
if (nbCols == 0)
return;
var markerId =
markers.createMarker(3, 1,
"com.toonboom.timesheet.actioninbetween");
markers.setValue(markerId,
"MyKey", 1000);
var valueEquelTo1000 =
markers.value(markerId,
"MyKey");
◆ createMarker
int columnMarkers::createMarker |
( |
int |
startFrame, |
|
|
int |
length, |
|
|
String & |
type |
|
) |
| |
|
slot |
Creates a new marker on the current column and returns an ID to further manipulate it.
- Parameters
-
startFrame | Which frame the marker will start on. |
length | Length of the new marker. |
type | User-customizable string determining the functionality of the marker. |
- Returns
- int ID of the new marker.
◆ keyValues
QScriptValue columnMarkers::keyValues |
( |
int |
markerId | ) |
|
|
slot |
Returns the array of property keys that the marker contains.
- Parameters
-
- Returns
- Array containing all the keys available in the marker's list of key/value pairs.
◆ length
int columnMarkers::length |
( |
int |
markerId | ) |
|
|
slot |
Queries the length of a column marker.
- Parameters
-
markerId | Id of the marker which we want to know the length. |
- Returns
- int Length of the marker.
◆ marker
int columnMarkers::marker |
( |
int |
startFrame, |
|
|
String & |
type |
|
) |
| |
|
slot |
Gets a marker ID from the requested frame, of the given type, if there is one.
- Parameters
-
startFrame | Frame where to look for a marker. |
type | Specific marker type looked for. |
- Returns
- int Marker ID. 0 if not found.
◆ markers [1/2]
QScriptValue columnMarkers::markers |
( |
| ) |
|
|
slot |
Returns the IDs of all markers in the column managed by this marker manager.
- Returns
- Array containing the IDs of all the markers managed by this marker manager.
◆ markers [2/2]
QScriptValue columnMarkers::markers |
( |
int |
startFrame | ) |
|
|
slot |
Returns an array containing all the marker IDs at the requested frame.
- Parameters
-
startFrame | Requested frame. |
- Returns
- Array containing all the marker IDs at the requested frame.
◆ moveMarker
void columnMarkers::moveMarker |
( |
int |
markerId, |
|
|
int |
newStart, |
|
|
int |
newLength |
|
) |
| |
|
slot |
Moves a marker around on the same column and potentially change its length.
- Parameters
-
markerId | ID of the marker to move. |
newStart | New starting frame. |
newLength | New length of the marker. |
◆ overlapingMarkers
QScriptValue columnMarkers::overlapingMarkers |
( |
int |
startFrame | ) |
|
|
slot |
Looks up all the markers that would overlap with the requested frame.
- Returns
- Returns the list of marker IDs that overlap startFrame.
◆ removeMarker
bool columnMarkers::removeMarker |
( |
int |
id | ) |
|
|
slot |
Deletes the requested marker ID.
- Parameters
-
id | ID of the marker to delete. |
- Returns
- true when the deletion succeeds.
-
false if the id could not be found.
◆ setValue
void columnMarkers::setValue |
( |
int |
markerId, |
|
|
String & |
propertyName, |
|
|
QVariant & |
value |
|
) |
| |
|
slot |
Sets a key/value pair on the given marker.
If a pair with the same key already exists it is updated with the new value.
- Parameters
-
markerId | Marker to manipulate. |
propertyName | Key of the value to set. |
value | Value to set in the key/value pair. |
◆ startFrame
int columnMarkers::startFrame |
( |
int |
markerId | ) |
|
|
slot |
Return the start frame of a given marker.
- Parameters
-
markerId | ID of the queried marker. |
- Returns
- int Starting frame of the requested marker.
◆ value
QScriptValue columnMarkers::value |
( |
int |
markerId, |
|
|
String & |
propertyName |
|
) |
| |
|
slot |
Gets a property value given its key from the list of key/value pairs.
Returns a null value if the property does not exist (which is different from returning an empty QVariant; we could still set an empty value to a property value.)
- Parameters
-
markerId | Marker to query. |
propertyName | Key to query from the marker. |
- Returns
- Object stored in the marker at the given key.