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

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==GRAPH Messages==


The following messages are sent by graph items.
The following messages are sent by graph items.
Line 34: Line 33:
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>.


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 <code>[[Programmer Guide/Macro Library/BEGIN|SET GRAPH]]</code>.====CMITEM====
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 <code>[[Programmer Guide/Macro Library/BEGIN|SET GRAPH]]</code>.
 
==CMITEM==


<code>GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var></code>
<code>GRAPH <var>graphitemname</var> CMITEM <var>menuitem</var></code>
Line 40: Line 41:
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


====DATASETLOADED====
==DATASETLOADED==


<code>GRAPH <var>graphitemname</var> DATASETLOADED <var>inputName</var></code>
<code>GRAPH <var>graphitemname</var> DATASETLOADED <var>inputName</var></code>
Line 46: Line 47:
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).


====KEY====
==KEY==


<code>GRAPH <var>graphitemname</var> KEY <var>keycode keyname</var></code>
<code>GRAPH <var>graphitemname</var> KEY <var>keycode keyname</var></code>
Line 54: Line 55:
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 <code>[[Programmer Guide/Macro Library/BEGIN|SET GRAPH]]</code>.
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 <code>[[Programmer Guide/Macro Library/BEGIN|SET GRAPH]]</code>.


====RESTORE====
==RESTORE==


<code>GRAPH <var>graphitemname</var> RESTORE <var>par</var></code>
<code>GRAPH <var>graphitemname</var> RESTORE <var>par</var></code>
Line 60: Line 61:
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).


====STOP====
==STOP==


<code>GRAPH <var>graphitemname</var> STOP <var>par</var></code>
<code>GRAPH <var>graphitemname</var> STOP <var>par</var></code>
Line 66: Line 67:
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).


====WHEEL====
==WHEEL==


<code>GRAPH <var>graphitem</var> WHEEL <var>wheelcode delta control shift left right</var></code>
<code>GRAPH <var>graphitem</var> WHEEL <var>wheelcode delta control shift left right</var></code>
Line 72: Line 73:
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.


====Cursor Messages====
==Cursor Messages==


=====CURSORSELECTED=====
===CURSORSELECTED===


<code>GRAPH <var>graphitemname</var> CURSORSELECTED 1|2</code>
<code>GRAPH <var>graphitemname</var> CURSORSELECTED 1|2</code>
Line 82: Line 83:




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


<code>GRAPH <var>graphitemname</var> CURSORDESELECTED <var>cursorID</var></code>
<code>GRAPH <var>graphitemname</var> CURSORDESELECTED <var>cursorID</var></code>
Line 88: Line 89:
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.


====Metasegments messages====
==Metasegments messages==


The following messages are generated and sent to the containing graph when metasegments are manipulated.
The following messages are generated and sent to the containing graph when metasegments are manipulated.
Line 98: Line 99:
: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!
: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=====
===MSCOMMAND===


<code>GRAPH <var>graphitemname</var> MSCOMMAND <var>msindex</var></code>
<code>GRAPH <var>graphitemname</var> MSCOMMAND <var>msindex</var></code>
Line 104: Line 105:
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.


=====MSDESELECT=====
===MSDESELECT===


<code>GRAPH <var>graphitemname</var> MSDESELECT <var>msindex</var></code>
<code>GRAPH <var>graphitemname</var> MSDESELECT <var>msindex</var></code>
Line 110: Line 111:
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.


=====MSRESIZING=====
===MSRESIZING===


<code>GRAPH <var>graphitemname</var> MSRESIZING <var>msindex</var></code>
<code>GRAPH <var>graphitemname</var> MSRESIZING <var>msindex</var></code>
Line 118: Line 119:
This does not affect the <code>MSUPDATE</code> message, which is sent by a graph when a metasegment has finished being resized.
This does not affect the <code>MSUPDATE</code> message, which is sent by a graph when a metasegment has finished being resized.


=====MSSELECT=====
===MSSELECT===


<code>GRAPH <var>graphitemname</var> MSSELECT <var>msindex</var></code>
<code>GRAPH <var>graphitemname</var> MSSELECT <var>msindex</var></code>
Line 124: Line 125:
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).


=====MSUPDATE=====
===MSUPDATE===


<code>GRAPH <var>graphitemname</var> MSUPDATE <var>msindex</var></code>
<code>GRAPH <var>graphitemname</var> MSUPDATE <var>msindex</var></code>
Line 130: Line 131:
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).


====Selection messages====
==Selection messages==


=====SELECTIONACTIVATED=====
===SELECTIONACTIVATED===


<code>GRAPH <var>graphitemname</var> SELECTIONACTIVATED <var>id</var></code>
<code>GRAPH <var>graphitemname</var> SELECTIONACTIVATED <var>id</var></code>
Line 138: Line 139:
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>.


=====SELECTIONCHANGED=====
===SELECTIONCHANGED===


<code>GRAPH <var>graphitemname</var> SELECTIONCHANGED <var>id</var></code>
<code>GRAPH <var>graphitemname</var> SELECTIONCHANGED <var>id</var></code>
Line 144: Line 145:
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>.


=====SELECTIONDEACTIVATED=====
===SELECTIONDEACTIVATED===


<code>GRAPH <var>graphitemname</var> SELECTIONDEACTIVATED <var>id modified</var></code>
<code>GRAPH <var>graphitemname</var> SELECTIONDEACTIVATED <var>id modified</var></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>.
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:10, 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