com.esri.arcgis.controls
Interface ITOCControlEvents

All Superinterfaces:
EventListener, Serializable
All Known Implementing Classes:
ITOCControlEventsAdapter, ITOCControlEventsProxy

public interface ITOCControlEvents
extends EventListener, Serializable

Provides access to events that occur with interaction to the TOCControl.

Description

This is the main events interface for the TOCControl. Generally there is no need to explicitly set event handlers, as most development environments will automatically provide event handlers.

Product Availability

Available with ArcGIS Engine.


Method Summary
 void onBeginLabelEdit(ITOCControlEventsOnBeginLabelEditEvent theEvent)
          Fires when label editing begins.
 void onDoubleClick(ITOCControlEventsOnDoubleClickEvent theEvent)
          Fires when the user presses and releases the mouse button twice in quick succession.
 void onEndLabelEdit(ITOCControlEventsOnEndLabelEditEvent theEvent)
          Fires when label editing ends.
 void onKeyDown(ITOCControlEventsOnKeyDownEvent theEvent)
          Fires after a key is pressed on the keyboard.
 void onKeyUp(ITOCControlEventsOnKeyUpEvent theEvent)
          Fires after a pressed key is released.
 void onMouseDown(ITOCControlEventsOnMouseDownEvent theEvent)
          Fires when the user presses any mouse button while over the TOCControl.
 void onMouseMove(ITOCControlEventsOnMouseMoveEvent theEvent)
          Fires when the user moves the mouse pointer over the TOCControl.
 void onMouseUp(ITOCControlEventsOnMouseUpEvent theEvent)
          Fires when the user releases a mouse button while over the TOCControl.
 

Method Detail

onMouseDown

void onMouseDown(ITOCControlEventsOnMouseDownEvent theEvent)
                 throws IOException,
                        AutomationException
Fires when the user presses any mouse button while over the TOCControl.

Description

The OnMouseDown event is triggered when the user presses a mouse button on the TOCControl. Use the event to specify actions that will occur when a given mouse button is pressed.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

Remarks

Use the win32 SetCapture function to continue receiving mouse events (until the mouse is released) when the mouse is moved outside the control's display area. The win32 ReleaseCapture function releases the mouse.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onMouseUp

void onMouseUp(ITOCControlEventsOnMouseUpEvent theEvent)
               throws IOException,
                      AutomationException
Fires when the user releases a mouse button while over the TOCControl.

Description

The OnMouseUp event is triggered when the user releases a mouse button on the TOCControl. Use the event to specify actions that will occur when a given mouse button is released.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

Remarks

Use the win32 SetCapture function to continue receiving mouse events (until the mouse is released) when the mouse is moved outside the control's display area. The win32 ReleaseCapture function releases the mouse.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onMouseMove

void onMouseMove(ITOCControlEventsOnMouseMoveEvent theEvent)
                 throws IOException,
                        AutomationException
Fires when the user moves the mouse pointer over the TOCControl.

Description

The OnMouseMove event is triggered continually as the mouse moves over the TOCControl.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onDoubleClick

void onDoubleClick(ITOCControlEventsOnDoubleClickEvent theEvent)
                   throws IOException,
                          AutomationException
Fires when the user presses and releases the mouse button twice in quick succession.

Description

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for
the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

Remarks

The OnDoubleClick event is triggered when the user releases and presses a mouse button and then presses and releases it again on the TOCControl. If the double click does not occur within the system's double click time limit, the TOCControl will recognise another OnMouseDown event. Otherwise the event sequence is as follows:

OnMouseDown
OnMouseUp
OnDoubleClick
OnMouseUp

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onKeyDown

void onKeyDown(ITOCControlEventsOnKeyDownEvent theEvent)
               throws IOException,
                      AutomationException
Fires after a key is pressed on the keyboard.

Description

The OnKeyDown event is triggered when the user presses a key whilst the TOCControl has focus.

keyCode specifies a virtual key code value of the key pressed on the keyboard. For alpha-numeric keys this corresponds to the ASCII value, for example "A" key returns 65 which is the ASCII value for capital A. Other key codes are F1 to F12 are 112 to 123 respectively.

Shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

Remarks

Some development environments will filter out keystrokes. Typically the arrow keys are used to change control focus and will not fire the OnKeyDown event. To intercept these keys use the KeyIntercept property.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onKeyUp

void onKeyUp(ITOCControlEventsOnKeyUpEvent theEvent)
             throws IOException,
                    AutomationException
Fires after a pressed key is released.

Description

The OnKeyUp event is triggered when the user releases a key whilst the TOCControl has focus.

keyCode specifies a virtual key code value of the key pressed on the keyboard. For alpha-numeric keys this corresponds to the ASCII value, for example "A" key returns 65 which is the ASCII value for capital A. Other key codes are F1 to F12 are 112 to 123 respectively.

Shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

Remarks

Some development environments will filter out keystrokes. Typically the arrow keys are used to change control focus and will not fire the OnKeyUp event. To intercept these keys use the KeyIntercept property.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onBeginLabelEdit

void onBeginLabelEdit(ITOCControlEventsOnBeginLabelEditEvent theEvent)
                      throws IOException,
                             AutomationException
Fires when label editing begins.

Description

canEdit specifies a boolean indicating whether the label can be edited. By default all labels can be editied. Set canEdit to False to prevent the label from being changed. Use the HitTest method to determine what kind of item label is being editied.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onEndLabelEdit

void onEndLabelEdit(ITOCControlEventsOnEndLabelEditEvent theEvent)
                    throws IOException,
                           AutomationException
Fires when label editing ends.

Description

canEdit specifies a boolean indicating whether the label can be edited. Set canEdit to False to reset the label to its previous value. By default all labels can be editied. Use the HitTest method to determine what kind of item label is being editied.

newLabel specifies a string containing the new label given by the user.

Product Availability

Available with ArcGIS Engine.

Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.