Programmer Guide/Shell Items/Graph/GRAPH Messages: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:
'''Context Menu'''
'''Context Menu'''


<code>GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var></code>
GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var>


This message is generated if a context menu item (right mouse click) was selected. The parameter <var>menuitem</var> is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a <code>CMSTAT</code> message, since only one context menu can be added to each graph. If the <code>copy/print ...</code> item was selected, the graph does not generate a message but displays the standard copy/print dialog instead
This message is generated if a context menu item (right mouse click) was selected. The parameter <var>menuitem</var> is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a <code>CMSTAT</code> message, since only one context menu can be added to each graph. If the <code>copy/print ...</code> item was selected, the graph does not generate a message but displays the standard copy/print dialog instead
Line 11: Line 11:
'''Print'''
'''Print'''


<code>GRAPH <var>graphitemname</var> STOP <var>par</var></code>
GRAPH <var>graphitemname</var> STOP <var>par</var>


If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a <code>STOP</code> message to the shell. The parameter <var>par</var> is meaningless (and normally set to 0).
If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a <code>STOP</code> message to the shell. The parameter <var>par</var> is meaningless (and normally set to 0).
Line 17: Line 17:
'''Activate'''
'''Activate'''


<code>GRAPH <var>graphitemname</var> RESTORE <var>par</var></code>
GRAPH <var>graphitemname</var> RESTORE <var>par</var>


This message is generated when a graph is activated (becomes the current graph in the display). The parameter <var>par</var> is meaningless (and normally set to 0).
This message is generated when a graph is activated (becomes the current graph in the display). The parameter <var>par</var> is meaningless (and normally set to 0).
Line 23: Line 23:
'''Mouse Wheel'''
'''Mouse Wheel'''


<code>GRAPH <var>graphitem</var> WHEEL <var>wheelcode delta control shift left right</var></code>
GRAPH <var>graphitem</var> WHEEL <var>wheelcode</var> <var>delta</var> <var>control</var> <var>shift</var> <var>left</var> <var>right</var>


The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.
The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.
Line 29: Line 29:
'''Keyboard'''
'''Keyboard'''


<code>GRAPH <var>graphitemname</var> KEY <var>keycode keyname</var></code>
GRAPH <var>graphitemname</var> KEY <var>keycode</var> <var>keyname</var>


The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of <var>keycode</var>.
The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of <var>keycode</var>.
Line 37: Line 37:
==CMITEM==
==CMITEM==


<code>GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var></code>
GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var>


This message is generated if a context menu item (right mouse click) was selected. The parameter <var>menuitem</var> is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a <code>CMSTAT</code> message, since only one context menu can be added to each graph. If the <code>copy/print ...</code> item was selected, the graph does not generate a message but displays the standard copy/print dialog instead
This message is generated if a context menu item (right mouse click) was selected. The parameter <var>menuitem</var> is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a <code>CMSTAT</code> message, since only one context menu can be added to each graph. If the <code>copy/print ...</code> item was selected, the graph does not generate a message but displays the standard copy/print dialog instead
Line 43: Line 43:
==DATASETLOADED==
==DATASETLOADED==


<code>GRAPH <var>graphitemname</var> DATASETLOADED <var>inputName</var></code>
GRAPH <var>graphitemname</var> DATASETLOADED <var>inputName</var>


The <code>DATASETLOADED</code> message is sent by a graph when the data for a particular graph input has been successfully loaded. The message was implemented because data is now loaded in a separate thread. The <var>inputName</var> identifies the data which has loaded and is a combination of the input (X or Y) and the input index (E.g. Y0 for the first Y input).
The <code>DATASETLOADED</code> message is sent by a graph when the data for a particular graph input has been successfully loaded. The message was implemented because data is now loaded in a separate thread. The <var>inputName</var> identifies the data which has loaded and is a combination of the input (X or Y) and the input index (E.g. Y0 for the first Y input).
Line 49: Line 49:
==KEY==
==KEY==


<code>GRAPH <var>graphitemname</var> KEY <var>keycode keyname</var></code>
GRAPH <var>graphitemname</var> KEY <var>keycode</var> <var>keyname</var>


The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of <var>keycode</var>.
The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of <var>keycode</var>.
Line 57: Line 57:
==RESTORE==
==RESTORE==


<code>GRAPH <var>graphitemname</var> RESTORE <var>par</var></code>
GRAPH <var>graphitemname</var> RESTORE <var>par</var>


This message is generated when a graph is activated (becomes the current graph in the display). The parameter <var>par</var> is meaningless (and normally set to 0).
This message is generated when a graph is activated (becomes the current graph in the display). The parameter <var>par</var> is meaningless (and normally set to 0).
Line 63: Line 63:
==STOP==
==STOP==


<code>GRAPH <var>graphitemname</var> STOP <var>par</var></code>
GRAPH <var>graphitemname</var> STOP <var>par</var>  


If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a <code>STOP</code> message to the shell. The parameter <var>par</var> is meaningless (and normally set to 0).
If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a <code>STOP</code> message to the shell. The parameter <var>par</var> is meaningless (and normally set to 0).
Line 69: Line 69:
==WHEEL==
==WHEEL==


<code>GRAPH <var>graphitem</var> WHEEL <var>wheelcode delta control shift left right</var></code>
GRAPH <var>graphitem</var> WHEEL <var>wheelcode</var> <var>delta</var> <var>control</var> <var>shift</var> <var>left</var> <var>right</var>


The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.
The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.
Line 77: Line 77:
===CURSORSELECTED===
===CURSORSELECTED===


<code>GRAPH <var>graphitemname</var> CURSORSELECTED 1|2</code>
GRAPH <var>graphitemname</var> CURSORSELECTED 1|2


The <code>CURSORSELECTED</code> message is sent when the first (1) or second (2) cursor is selected.
The <code>CURSORSELECTED</code> message is sent when the first (1) or second (2) cursor is selected.




===CURSORDESELECTED===
===CURSORDESELECTED===


<code>GRAPH <var>graphitemname</var> CURSORDESELECTED <var>cursorID</var></code>
GRAPH <var>graphitemname</var> CURSORDESELECTED <var>cursorID</var>


The <code>CURSORDESELECTED</code> message is sent when the first (<var>cursorID</var>=1) or second (<var>cursorID</var>=2) cursor is deselected.
The <code>CURSORDESELECTED</code> message is sent when the first (<var>cursorID</var>=1) or second (<var>cursorID</var>=2) cursor is deselected.
Line 101: Line 100:
===MSCOMMAND===
===MSCOMMAND===


<code>GRAPH <var>graphitemname</var> MSCOMMAND <var>msindex</var></code>
GRAPH <var>graphitemname</var> MSCOMMAND <var>msindex</var>


The <code>MSCOMMAND</code> message is generated when a metasegment is double-clicked.
The <code>MSCOMMAND</code> message is generated when a metasegment is double-clicked.
Line 107: Line 106:
===MSDESELECT===
===MSDESELECT===


<code>GRAPH <var>graphitemname</var> MSDESELECT <var>msindex</var></code>
GRAPH <var>graphitemname</var> MSDESELECT <var>msindex</var>


The <code>MSDESELECT</code> message is generated when a selected metasegment is deselected.
The <code>MSDESELECT</code> message is generated when a selected metasegment is deselected.
Line 113: Line 112:
===MSRESIZING===
===MSRESIZING===


<code>GRAPH <var>graphitemname</var> MSRESIZING <var>msindex</var></code>
GRAPH <var>graphitemname</var> MSRESIZING <var>msindex</var>  


The <code>MSRESIZING</code> message is sent by a graph whilst a metasegment is being resized. This can be useful, for example, for changing the metasegment's text whilst resizing is taking place (e.g. displaying the changing coordinates).
The <code>MSRESIZING</code> message is sent by a graph whilst a metasegment is being resized. This can be useful, for example, for changing the metasegment's text whilst resizing is taking place (e.g. displaying the changing coordinates).
Line 121: Line 120:
===MSSELECT===
===MSSELECT===


<code>GRAPH <var>graphitemname</var> MSSELECT <var>msindex</var></code>
GRAPH <var>graphitemname</var> MSSELECT <var>msindex</var>


The <code>MSSELECT</code> message is generated when a metasegments is selected by the user (clicked on).
The <code>MSSELECT</code> message is generated when a metasegments is selected by the user (clicked on).
Line 127: Line 126:
===MSUPDATE===
===MSUPDATE===


<code>GRAPH <var>graphitemname</var> MSUPDATE <var>msindex</var></code>
GRAPH <var>graphitemname</var> MSUPDATE <var>msindex</var>


The <code>MSUPDATE</code> message is generated when a metasegment is resized or moved by the user. The message is sent once resizing has finished (i.e. the left mouse button is released).
The <code>MSUPDATE</code> message is generated when a metasegment is resized or moved by the user. The message is sent once resizing has finished (i.e. the left mouse button is released).
Line 135: Line 134:
===SELECTIONACTIVATED===
===SELECTIONACTIVATED===


<code>GRAPH <var>graphitemname</var> SELECTIONACTIVATED <var>id</var></code>
GRAPH <var>graphitemname</var> SELECTIONACTIVATED <var>id</var>


The <code>SELECTIONACTIVATED</code> message is sent when an inactive selection is activated by the user. The <var>id</var> identifies the selection in the graph <var>graphitemname</var>.
The <code>SELECTIONACTIVATED</code> message is sent when an inactive selection is activated by the user. The <var>id</var> identifies the selection in the graph <var>graphitemname</var>.
Line 141: Line 140:
===SELECTIONCHANGED===
===SELECTIONCHANGED===


<code>GRAPH <var>graphitemname</var> SELECTIONCHANGED <var>id</var></code>
GRAPH <var>graphitemname</var> SELECTIONCHANGED <var>id</var>


The <code>SELECTIONCHANGED</code> message is sent when the shape of a selection is changed by the user.The <var>id</var> identifies the selection in the graph <var>graphitemname</var>.
The <code>SELECTIONCHANGED</code> message is sent when the shape of a selection is changed by the user.The <var>id</var> identifies the selection in the graph <var>graphitemname</var>.
Line 147: Line 146:
===SELECTIONDEACTIVATED===
===SELECTIONDEACTIVATED===


<code>GRAPH <var>graphitemname</var> SELECTIONDEACTIVATED <var>id modified</var></code>
GRAPH <var>graphitemname</var> SELECTIONDEACTIVATED <var>id</var> <var>modified</var>


The <code>SELECTIONDEACTIVATED</code> message is sent when an active selection is deactivated by the user. The <var>id</var> identifies the selection in the graph <var>graphitemname</var>. The value of <var>modified</var> is <code>1</code> if the selection has been modified since it was last set (see the SELECTION SET command), otherwise it is <code>0</code>.
The <code>SELECTIONDEACTIVATED</code> message is sent when an active selection is deactivated by the user. The <var>id</var> identifies the selection in the graph <var>graphitemname</var>. The value of <var>modified</var> is <code>1</code> if the selection has been modified since it was last set (see the SELECTION SET command), otherwise it is <code>0</code>.

Revision as of 22:14, 29 October 2012


The following messages are sent by graph items.

Context Menu

GRAPH graphitemname CMITEM menuitem

This message is generated if a context menu item (right mouse click) was selected. The parameter menuitem is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a CMSTAT message, since only one context menu can be added to each graph. If the copy/print ... item was selected, the graph does not generate a message but displays the standard copy/print dialog instead

Print

GRAPH graphitemname STOP par

If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a STOP message to the shell. The parameter par is meaningless (and normally set to 0).

Activate

GRAPH graphitemname RESTORE par

This message is generated when a graph is activated (becomes the current graph in the display). The parameter par is meaningless (and normally set to 0).

Mouse Wheel

GRAPH graphitem WHEEL wheelcode delta control shift left right

The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.

Keyboard

GRAPH graphitemname KEY keycode keyname

The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of keycode.

Some special keys (e.g. cursor keys) may be processed by the graph. For details about the configuration of keyboard handling read the description of the command SET GRAPH.

CMITEM

GRAPH graphitemname CMITEM menuitem

This message is generated if a context menu item (right mouse click) was selected. The parameter menuitem is the (zero-based) index of the selected menu item. Note: unlike dialogs, the graphs do not send a CMSTAT message, since only one context menu can be added to each graph. If the copy/print ... item was selected, the graph does not generate a message but displays the standard copy/print dialog instead

DATASETLOADED

GRAPH graphitemname DATASETLOADED inputName

The DATASETLOADED message is sent by a graph when the data for a particular graph input has been successfully loaded. The message was implemented because data is now loaded in a separate thread. The inputName identifies the data which has loaded and is a combination of the input (X or Y) and the input index (E.g. Y0 for the first Y input).

KEY

GRAPH graphitemname KEY keycode keyname

The key message is generated by the active graph when a (non-system) key is pressed. See DIALOG and DISPLAY item messages for message parameters details. See Keyname Parameter Values for the format of keycode.

Some special keys (e.g. cursor keys) may be processed by the graph. For details about the configuration of keyboard handling read the description of the command SET GRAPH.

RESTORE

GRAPH graphitemname RESTORE par

This message is generated when a graph is activated (becomes the current graph in the display). The parameter par is meaningless (and normally set to 0).

STOP

GRAPH graphitemname STOP par 

If a copy/print process (initiated via a command or the copy/print dialog) has finished, the graph sends a STOP message to the shell. The parameter par is meaningless (and normally set to 0).

WHEEL

GRAPH graphitem WHEEL wheelcode delta control shift left right

The wheel message is generated by the active graph when the position of the mouse wheel has been changed. See DIALOG and DISPLAY item messages for message parameters details.

Cursor Messages

CURSORSELECTED

GRAPH graphitemname CURSORSELECTED 1|2

The CURSORSELECTED message is sent when the first (1) or second (2) cursor is selected.


CURSORDESELECTED

GRAPH graphitemname CURSORDESELECTED cursorID

The CURSORDESELECTED message is sent when the first (cursorID=1) or second (cursorID=2) cursor is deselected.

Metasegments messages

The following messages are generated and sent to the containing graph when metasegments are manipulated.

The following parameter has the same meaning for all metasegment messages:

msindex
The current index of the metasegment generating the message. This can be used to access the metasegment's properties. The index is only valid until the next time a metasegment is generated, updated or deleted!

MSCOMMAND

GRAPH graphitemname MSCOMMAND msindex

The MSCOMMAND message is generated when a metasegment is double-clicked.

MSDESELECT

GRAPH graphitemname MSDESELECT msindex

The MSDESELECT message is generated when a selected metasegment is deselected.

MSRESIZING

GRAPH graphitemname MSRESIZING msindex 

The MSRESIZING message is sent by a graph whilst a metasegment is being resized. This can be useful, for example, for changing the metasegment's text whilst resizing is taking place (e.g. displaying the changing coordinates).

This does not affect the MSUPDATE message, which is sent by a graph when a metasegment has finished being resized.

MSSELECT

GRAPH graphitemname MSSELECT msindex

The MSSELECT message is generated when a metasegments is selected by the user (clicked on).

MSUPDATE

GRAPH graphitemname MSUPDATE msindex

The MSUPDATE message is generated when a metasegment is resized or moved by the user. The message is sent once resizing has finished (i.e. the left mouse button is released).

Selection messages

SELECTIONACTIVATED

GRAPH graphitemname SELECTIONACTIVATED id

The SELECTIONACTIVATED message is sent when an inactive selection is activated by the user. The id identifies the selection in the graph graphitemname.

SELECTIONCHANGED

GRAPH graphitemname SELECTIONCHANGED id

The SELECTIONCHANGED message is sent when the shape of a selection is changed by the user.The id identifies the selection in the graph graphitemname.

SELECTIONDEACTIVATED

GRAPH graphitemname SELECTIONDEACTIVATED id modified

The SELECTIONDEACTIVATED message is sent when an active selection is deactivated by the user. The id identifies the selection in the graph graphitemname. The value of modified is 1 if the selection has been modified since it was last set (see the SELECTION SET command), otherwise it is 0.

Navigation menu

Personal tools