class PInteractor: PINTERACTOR_ANCESTOR

This class defines the common behaviour of all user interface interaction entity.

Inheritance:


Public Classes

[more]enum PositionOrigin
Origin specification for the SetPosition() function.
[more]enum CoordinateSystem
Coordinate system used for position & dimensions
[more]enum AutoAdjustType
Options for the AutoAdjustBounds() function.

Public Fields

[more]PCursor cursor
The normal mouse cursor to be used in this interactor.

Public Methods

[more] PInteractor ( PInteractor * parent, BOOL hiddenChild = FALSE )
Create a a new interactor attaching it to the parent interactor.
[more]virtual ~PInteractor ()
Destroy the interactor, and all its child interactors.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine if the two interactors are the same.
[more]PInteractor* GetParent () const
Get the interactor layout that this interactor is contained in.
[more]BOOL IsChild ( PInteractor * parent ) const
Determine if this interactor is a child or grandchild etc of the interactor layout specified.
[more]PINDEX GetNumChildren ()
Get the number of children the interactor currently contains.
[more]PInteractor& operator[] ( PINDEX index )
Get access to the child interactor at the specified index.
[more]virtual void UpdateCommandSources ()
Update all command sources.
[more]virtual void SetFont ( const PFont & newFont, BOOL toChildren = TRUE )
Set the font to be used by default by this interactor.
[more]const PRealFont& GetFont ()
Get the font to be used by default in all child interactors.
[more]PDIMENSION ToPixelsDX ( PDIMENSION x ) const
Convert the layout X coordinate value to screen pixels.
[more]PDIMENSION ToPixelsDY ( PDIMENSION y ) const
Convert the layout Y coordinate value to screen pixels.
[more]PORDINATE ToPixelsX ( PORDINATE x ) const
Convert the layout X coordinate value to screen pixels.
[more]PORDINATE ToPixelsY ( PORDINATE y ) const
Convert the layout Y coordinate value to screen pixels.
[more]PDim ToPixels ( const PDim & dim ) const
Convert the layout dimension value to screen pixels.
[more]PPoint ToPixels ( const PPoint & pt ) const
Convert the layout point value to screen pixels.
[more]PRect ToPixels ( const PRect & r ) const
Convert the layout rectange value to screen pixels.
[more]PDIMENSION FromPixelsDX ( PDIMENSION x ) const
Convert the screen pixels to a layout X coordinate value.
[more]PDIMENSION FromPixelsDY ( PDIMENSION y ) const
Convert the screen pixels to a layout Y coordinate value.
[more]PORDINATE FromPixelsX ( PORDINATE x ) const
Convert the screen pixels to a layout X coordinate value.
[more]PORDINATE FromPixelsY ( PORDINATE y ) const
Convert the screen pixels to a layout Y coordinate value.
[more]PDim FromPixels ( const PDim & dim ) const
Convert the dimensions in screen pixels to layout coordinates.
[more]PPoint FromPixels ( const PPoint & pt ) const
Convert the point in screen pixels to layout coordinates.
[more]PRect FromPixels ( const PRect & r ) const
Convert the rectangle in screen pixels to layout coordinates.
[more]void SetPosition ( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
Set the position of the interactor.
[more]PPoint GetPosition ( CoordinateSystem coords ) const
Get the position of the interactor relative to its parent.
[more]PPoint ToScreen ( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
Convert the point from the interactor relative coordinates to absolute screen coordinates.
[more]PPoint FromScreen ( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
Convert the point from the absolute screen coordinates to interactor relative coordinates.
[more]void SetDimensions ( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the interactor.
[more]PDim GetDimensions ( CoordinateSystem coords ) const
Get the dimensions of the interactor.
[more]PRect GetStructureBounds ( CoordinateSystem coords ) const
Get the external bounds of the interactor.
[more]virtual PRect GetDrawingBounds ( CoordinateSystem coords ) const
Get the drawing bounds for the interactor.
[more]void AutoAdjustBounds ( PRect & bounds, AutoAdjustType type = AdjustBounds )
Adjust the interactor relative to the specified bounds rect.
[more]BOOL ContainsPoint ( const PPoint & pt, CoordinateSystem coords ) const
Determine if the point specified is inside the interactors area.
[more]PInteractor* FindInteractor ( const PPoint & pt, CoordinateSystem coords ) const
Find the interactor that is at the specified coordinates.
[more]virtual void Enable ( BOOL enabled = TRUE )
Enable or disable the interactor.
[more]void Disable ()
Disable the interactor, ignoring all input to it.
[more]BOOL IsEnabled () const
Determine if the interactor is enabled and input may be processed.
[more]virtual void ShowAll ()
Show the interactor and all child and grandchild etc interactors.
[more]virtual void Show ( BOOL visible = TRUE )
Show or hide the interactor.
[more]void Hide ()
Hide the interactor from view.
[more]BOOL IsVisible () const
Determine if interactor may be visible.
[more]virtual void BringToTop ()
Bring the interactor to the top of any layering order for overlapping windows or interactors.
[more]virtual BOOL IsOnTop () const
Determine if the interactor is currently on top of any layering order for overlapping windows or interactors.
[more]void Invalidate ( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as requiring a redraw.
[more]void Validate ( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as not requiring a redraw.
[more]void Update ()
Force an immediate update of the window.
[more]void GrabMouse ()
Grab the mouse for exclusive use by this interactor.
[more]void ReleaseMouse ()
Relenquish the exclusive use of the mouse after a GrabMouse() call.
[more]BOOL HasMouse () const
Determine if this interactor currently has exclusive use of the mouse pointer.
[more]void GrabFocus ()
Make this interactor have the user keyboard input focus.
[more]BOOL HasFocus () const
Determine if this interactor currently has the keyboard focus.
[more]virtual void SetCursor ( const PCursor & newCursor )
Set the cursor to be used for this interactor.
[more]PCursor GetCursor () const
Get the current cursor shape that is being used whenever the mouse pointer is over this interactor.
[more]void SetCursorToParent ( BOOL useParent = TRUE )
Set the cursor to always be whatever the interactors parent is using as a cursor shape.
[more]void SetAllCursors ( const PCursor & newCursor )
Set the current cursor to the new shape and set all child interactors to temporarily use that cursor.
[more]void RestoreAllCursors ()
Restore the current cursor and all child interactors cursor to parent flags to the state as of the previous call to SetAllCursors()
[more]void SetWaitCursor ()
Set the cursor for this interactor and all child interactors to the platform dependent standard wait cursor.
[more]void SetCursorPos ( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the cursor.
[more]PPoint GetCursorPos ( CoordinateSystem coords ) const
Get the current cursor position in the interactors coordinate system.
[more]virtual void ShowCursor ( BOOL show = TRUE )
Show or hide the mouse cursor.
[more]void HideCursor ()
Hide the mouse cursor, this is equivalent to ShowCursor(FALSE)
[more]void SetCaret ( const PCaret & newCaret )
Set the text caret shape to be as specified.
[more]PCaret GetCaret () const
Get the current text caret shape.
[more]void SetCaretPos ( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the text caret within the interactor.
[more]PPoint GetCaretPos ( CoordinateSystem coords ) const
Get the position of the text caret within the interactor.
[more]virtual void ShowCaret (BOOL show = TRUE)
Show or hide the text caret.
[more]void HideCaret ()
Hide the text caret, this is equivalent to ShowCaret(FALSE)
[more]virtual void SetForegroundColour ( const PColour & newColour )
Set the default foreground colour of the interactor.
[more]const PColour& GetForegroundColour () const
Get the default foreground colour of the interactor.
[more]virtual void SetBackgroundColour ( const PColour & newColour )
Set the default background colour of the interactor.
[more]const PColour& GetBackgroundColour () const
Get the default background colour of the interactor.
[more]PDim GetBorderSize () const
Get the width of vertical border and height of horizontal border for this interactor.
[more]const PColour& GetBorderColour () const
Get the colour of the interactors border.
[more]PCanvas* StartMouseTrack ( BOOL wantsCanvas = FALSE )
Begin a mouse track operation, calling the OnMouseTrack() function for each mouse move.
[more]virtual void OnMouseMove ( PKeyCode button, const PPoint & where )
The system calls this whenever the mouse moves over the interactors usable area.
[more]virtual void OnMouseDown ( PKeyCode button, const PPoint & where, BOOL doubleClick )
The system calls this whenever a mouse button is pressed in the interactors usable area.
[more]virtual void OnMouseUp ( PKeyCode button, const PPoint & where )
The system calls this whenever a mouse button is released in the interactors usable area.
[more]virtual BOOL OnKeyDown ( PKeyCode key, unsigned repeat )
The system calls this whenever a keyboard key was pressed and this interactor had the focus.
[more]virtual void OnKeyUp ( PKeyCode key )
The system calls this whenever a keyboard key was released and this interactor had the focus.
[more]virtual void OnKeyInput ( const PString & str )
The system calls this whenever a keyboard key was pressed and this interactor had the focus.
[more]virtual void OnGainFocus ()
The system calls this whenever the interactor is given the focus from another window in the system.
[more]virtual void OnLostFocus ()
The system calls this whenever the interactor had the focus and it has been changed to another window in the system.
[more]virtual void OnStartInput ()
The system calls this whenever the interactor is given the focus the first time for a given PTitledWindow or PInteractorLayout.
[more]virtual BOOL OnEndInput ()
The system calls this whenever the system wishes to change focus to another interactor in a given PTitledWindow or PInteractorLayout.
[more]virtual void OnRedraw ( PCanvas & canvas )
The system calls this whenever it requires that the interactors usable area needs to be updated and redrawn.
[more]virtual void OnControlNotify ( PControl & control, int option )
This function is called whenever a control needs to notify its parent interactor that somthing has happened to it.
[more]virtual void OnSelectHelp ()
This function is called whenever a help select mode is activated and this interactor is selected
[more]virtual PBalloon* OnBalloonHelp ()
This function is called whenever a balloon help function for the interactor is required.
[more]virtual void OnMouseTrack ( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
This function is called whenever a drag track is in progress.
[more]virtual void _SetPosition ( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )
Set the position of the interactor.

Public

[more] Overrides from class PObject
[more] New functions for class
[more] System callback functions.

Protected Fields

[more]PApplication* owner
The interactors owner application
[more]PInteractor* parent
The interactor layout that contains this interactor.
[more]PInteractorList children
The list of children in this interactor layout.
[more]PRealFont font
The font used by the interactor.
[more]PCursor savedCursor
The saved mouse cursor to be used in this interactor after a call to RestoreAllCursors().
[more]PCaret caret
The text caret to be used in this interactor.
[more]PPoint caretPosition
The current location of the caret (in pixels).
[more]int caretVisible
The current count for visibility of caret in interactor.
[more]PColour foregroundColour
The foreground colour used in this interactor
[more]PColour backgroundColour
The background colour used in this interactor
[more]PInteractor* mouseTrackInteractor
The interactor used in the dracking of a drag operation, if NULL no drag track is happening.
[more]PInteractorCanvas* mouseTrackCanvas
The canvas used in the dracking of a drag operation, if NULL no drag track is happening.

Protected Methods

[more] PInteractor ()
Special constructor used with PTopLevelWindow.
[more]virtual void _SetDimensions ( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the interactor.
[more]virtual void _Invalidate ( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as requiring a redraw.
[more]virtual void _Validate ( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as not requiring a redraw.
[more]virtual void _SetCursorPos ( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the cursor.
[more]virtual void _SetCaretPos ( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the text caret within the interactor.
[more]virtual void SetFocusInteractor ( PInteractor * interactor )
Set the child interactor that has the focus in the PTitledWindow or PInteractorLayout.
[more]virtual PInteractor* GetFocusInteractor () const
Get the child interactor that has the focus in the PTitledWindow or PInteractorLayout.
[more]virtual void UpdateMyCommandSources ()
Scan through all child interactors and if they are a command source, execute their notification function to enable or disable the item.

Protected

[more] New functions for class
[more] Flag to indicate that the parent interactor layouts cursor should be used with this interactor.


Documentation

This class defines the common behaviour of all user interface interaction entity. This may or may not be a "Window" depending on the definition of that term in the target GUI.
o PInteractor( PInteractor * parent, BOOL hiddenChild = FALSE )
Create a a new interactor attaching it to the parent interactor.
Parameters:
parent - Interactor into which the interactor is placed.
hiddenChild - Whether the "hidden" from the application. If this is TRUE then the interactor is not added to the parents child interactor list, thus it will not be visible as a "child" interactor of the parent and will not be automatically deleted when the parent is deleted.

ovirtual ~PInteractor()
Destroy the interactor, and all its child interactors.

o Overrides from class PObject

ovirtual Comparison Compare( const PObject & obj ) const
Determine if the two interactors are the same. As two instances can never be the same interactor, this can never be EqualTo.

Returns:
Always GreaterThan.
Parameters:
obj - Interactor to compare against.

o New functions for class

oPInteractor* GetParent() const
Get the interactor layout that this interactor is contained in.

Returns:
pointer to parent interactor.

oBOOL IsChild( PInteractor * parent ) const
Determine if this interactor is a child or grandchild etc of the interactor layout specified.

Returns:
TRUE if interactor is a child of parent.
Parameters:
parent - Interactor to check for parenthood.

oPINDEX GetNumChildren()
Get the number of children the interactor currently contains.

Returns:
number of child interactors.

oPInteractor& operator[]( PINDEX index )
Get access to the child interactor at the specified index. The order in which child interactors are attached to a parent interactor is initially in their construction order.

Returns:
reference to child interactor.
Parameters:
index - Ordinal position of the child interactor.

ovirtual void UpdateCommandSources()
Update all command sources. This will go to the utimate parent, a PTopLevelWindow, and then recursively update every command source, menu item or control, for being enabled or disabled. This uses the PNotifier function for each source to get the new state.

The PCommandSource and PCommandSink classes are usually used in conjunction with this function to control commands such as menu items and tool bars etc.

ovirtual void SetFont( const PFont & newFont, BOOL toChildren = TRUE )
Set the font to be used by default by this interactor. A canvas created on this interactor will initially have this font selected.

This also determines the coordinate system to be used for laying out child interactors via the SetPosition() and SetDimensions() functions. The coordinates used are 1/4 average font width and 1/8 the font height.

If the toChildren parameter is TRUE then the font is propagated down to all child interactors and grandchild interactors etc.

Parameters:
newFont - New font specification fo rthe interactor.
toChildren - Flag to recursively change all child interactors.

oconst PRealFont& GetFont()
Get the font to be used by default in all child interactors. A canvas created on this interactor will initially have this font selected.

This also determines the coordinate system to be used for laying out child interactors via the SetPosition() and SetDimensions() functions. The coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
Pointer to a realised font on a canvas for this interactor.

oPDIMENSION ToPixelsDX( PDIMENSION x ) const
Convert the layout X coordinate value to screen pixels.
Parameters:
x - Horizontal dimension to convert.

oPDIMENSION ToPixelsDY( PDIMENSION y ) const
Convert the layout Y coordinate value to screen pixels.
Parameters:
y - Vertical dimension to convert.

oPORDINATE ToPixelsX( PORDINATE x ) const
Convert the layout X coordinate value to screen pixels.
Parameters:
x - Horizontal coordinate to convert.

oPORDINATE ToPixelsY( PORDINATE y ) const
Convert the layout Y coordinate value to screen pixels.
Parameters:
y - Vertical coordinate to convert.

oPDim ToPixels( const PDim & dim ) const
Convert the layout dimension value to screen pixels.
Parameters:
dim - Dimensions to convert.

oPPoint ToPixels( const PPoint & pt ) const
Convert the layout point value to screen pixels.
Parameters:
pt - Position to convvert.

oPRect ToPixels( const PRect & r ) const
Convert the layout rectange value to screen pixels.
Parameters:
r - Rectangle to convert.

oPDIMENSION FromPixelsDX( PDIMENSION x ) const
Convert the screen pixels to a layout X coordinate value.
Parameters:
x - Horizontal dimension to convert.

oPDIMENSION FromPixelsDY( PDIMENSION y ) const
Convert the screen pixels to a layout Y coordinate value.
Parameters:
y - Vertical dimension to convert.

oPORDINATE FromPixelsX( PORDINATE x ) const
Convert the screen pixels to a layout X coordinate value.
Parameters:
x - Horizontal coordinate to convert.

oPORDINATE FromPixelsY( PORDINATE y ) const
Convert the screen pixels to a layout Y coordinate value.
Parameters:
y - Vertical coordinate to convert.

oPDim FromPixels( const PDim & dim ) const
Convert the dimensions in screen pixels to layout coordinates.
Parameters:
dim - Dimensions to convert.

oPPoint FromPixels( const PPoint & pt ) const
Convert the point in screen pixels to layout coordinates.
Parameters:
pt - Position to convvert.

oPRect FromPixels( const PRect & r ) const
Convert the rectangle in screen pixels to layout coordinates.
Parameters:
r - Rectangle to convert.

oenum PositionOrigin
Origin specification for the SetPosition() function. This determines how the horizontal and vertical position is interpreted to the final placement of the interactor.

When scaling is used (eg xOrigin = TopLeftParent), the coordinates used are 1/4 average font width and 1/8 the font height.

Note that some child interactors are clipped to be within their parent. For these interactors, setting relative to the screen may cause the interactor to become invisible.

o TopLeftScreen
Position the left of the interactor relative to the left of the screen and the top of the interactor relative to the top of the screen.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the top left corner of the screen. Negative offsets will start to move the interactor off the screen.

o CentreScreen
Position the centre of the interactor relative to the centre of the screen in both the horizontal and vertical directions.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the centre of the screen.

o BottomRightScreen
Position the right of the interactor relative to the right of the screen and the bottom of the interactor relative to the bottom of the screen.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the bottom right corner of the screen. Positive offsets will start to move the interactor off the screen.

o TopLeftParent
Position the left of the interactor relative to the left of the parent internal area and the top of the interactor relative to the top of the parents internal area.

The coordinates are scaled according to the currently selected font for the interactor. Offsets of zero will place the interactor in the top left corner of the parent. Negative offsets will start to move the interactor off the parent interactor.

o CentreParent
Position the centre of the interactor relative to the centre of the parent internal area in both the horizontal and vertical directions.

The coordinates are scaled according to the currently selected font for the interactor. Offsets of zero will place the interactor in the centre of the parent.

o BottomRightParent
Position the right of the interactor relative to the right of the parent internal area and the bottom of the interactor relative to the bottom of the parents internal area.

The coordinates are scaled according to the currently selected font for the interactor. Offsets of zero will place the interactor in the bottom right corner of the parent. Positive offsets will start to move the interactor off the parent interactor.

o TopLeftPixels
Position the left of the interactor relative to the left of the parent internal area and the top of the interactor relative to the top of the parents internal area.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the top left corner of the parent. Negative offsets will start to move the interactor off the parent interactor.

o CentrePixels
Position the centre of the interactor relative to the centre of the parent internal area in both the horizontal and vertical directions.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the centre of the parent.

o BottomRightPixels
Position the right of the interactor relative to the right of the parent internal area and the bottom of the interactor relative to the bottom of the parents internal area.

No scaling factor will be applied and x and y offset will be applied in screen pixels. Offsets of zero will place the interactor in the bottom right corner of the parent. Positive offsets will start to move the interactor off the parent interactor.

ovoid SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
Set the position of the interactor. The xOrigin and yOrigin parameters indicate the coordinate system to be used for the offsets. If the font based layout coordinates are used they will use the font of the parents interactor. The interactors font is not used.

Note that this sets the position of the exterior of the interactor, including any decoration, eg title bars etc.

When scaling is used (eg xOrigin = TopLeftParent), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the interactors position then the _SetPosition() function should be overridden.

Parameters:
x - Horizontal offset to apply to interactor.
y - Vertical offset to apply to interactor.
xOrigin - Origin for horizontal offset.
yOrigin - Origin for verical offset.

oenum CoordinateSystem
Coordinate system used for position & dimensions

o LocalCoords
Use interactor relative, font scaled coordinates.

o PixelCoords
Use interactor relative coordinates in screen pixels.

o ScreenCoords
Use screen absolute coordinates

oPPoint GetPosition( CoordinateSystem coords ) const
Get the position of the interactor relative to its parent. If the interactor has no parent, ie is a descendent of PTopLevelWindow, then the position is always in absolute screen coordinates.

If the coords parameter is LocalCoords then the return value is in the coordinate system based in the interactors current font. Otherwise it is returned in screen pixels.

If the coords parameter is PixelCoords then the coordinates are still relative to its parent, while the ScreenCoords value will return realtive to the absolute screen origin.

Note that this gets the position of the exterior of the interactor, including any decoration, eg title bars etc.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
point for the interactors current position.
Parameters:
coords - Coordinate system to use.

oPPoint ToScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
Convert the point from the interactor relative coordinates to absolute screen coordinates.

If the coords parameter is LocalCoords then the return value is in the coordinate system based in the interactors current font. Otherwise it is returned in screen pixels.

If the coords parameter is PixelCoords then the coordinates are still relative to its parent, while the ScreenCoords value will return realtive to the absolute screen origin.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
point converted to absolute screen coordinates.

oPPoint FromScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
Convert the point from the absolute screen coordinates to interactor relative coordinates.

If the coords parameter is LocalCoords then the return value is in the coordinate system based in the interactors current font. Otherwise it is returned in screen pixels.

If the coords parameter is PixelCoords then the coordinates are still relative to its parent, while the ScreenCoords value will return realtive to the absolute screen origin.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
point converted from absolute screen coordinates.

ovoid SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the interactor. The new size is specified in either the font based layout coordinates or in screen pixels as specified by the coords parameter.

Note that this sets the dimension of the interior of the interactor, excluding any decoration, eg title bars etc.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the interactors size then the #_SetDimensions()# function should be overridden.

Parameters:
width - New width to apply to interactor.
height - New height to apply to interactor.
coords - Coordinate system to use.

oPDim GetDimensions( CoordinateSystem coords ) const
Get the dimensions of the interactor.

If the coords parameter is LocalCoords then the return value is in the coordinate system based in the interactors current font. Otherwise it is returned in screen pixels.

If the coords parameter is PixelCoords then the coordinates are still relative to its parent, while the ScreenCoords value will return realtive to the absolute screen origin.

Note that this gets the dimension of the interior of the interactor, excluding any decoration, eg title bars etc.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
dimensions for the interactors current size.
Parameters:
coords - Coordinate system to use.

oPRect GetStructureBounds( CoordinateSystem coords ) const
Get the external bounds of the interactor. This includes things such as title bars and borders etc. For most interactors this will be identical to a rectangle formed from GetPosition() and GetDimensions() as there are no external decorations to the interactor.

If the coordinate system used is in pixels (coords == ScreenCoords) then the position is in absolute screen coordinates. Otherwise it uses the interactors own coordinate system. This usually means negative values for the rectangles top left corner.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
bounds rectangle for the interactor.
Parameters:
coords - Coordinate system to use.

ovirtual PRect GetDrawingBounds( CoordinateSystem coords ) const
Get the drawing bounds for the interactor. This is usually the internal dimensions of the interactor. But could be other sizes depending on the semantics of the interator. See PScrollable for an example of the drawing bounds being larger than the size of the interactor.

This function is used by the PInteractorCanvas class to determine the drawing bounds for the canvas.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
drawing bounds rectangle for the interactor.
Parameters:
coords - Coordinate system to use.

oenum AutoAdjustType
Options for the AutoAdjustBounds() function. This controls how the interactor will be repositioned and resized given a bounds rectangle.

For all AdjustBounds option, the bounds rectangle is reduced by the size of the interactor just placed.

o AdjustBounds
Set the interactors position and dimensions to the value specified in the rectangle

o AdjustTop
Set the interactors position to the top left of the specified bounds rectangle. The width of the interactor is set to the width of the bounds rectangle and the height remains unchanged.

o AdjustBottom
Set the interactors position to the bottom left of the specified bounds rectangle. The width of the interactor is set to the width of the bounds rectangle and the height remains unchanged.

o AdjustLeft
Set the interactors position to the top left of the specified bounds rectangle. The height of the interactor is set to the height of the bounds rectangle and the width remains unchanged.

o AdjustRight
Set the interactors position to the bottom left of the specified bounds rectangle. The width of the interactor is set to the width of the bounds rectangle and the height remains unchanged.

o AdjustVScrollOnly
Set the interactors position to the top right of the specified bounds rectangle. The height of the interactor is set to the height of the bounds rectangle and the width is set to the standard width for a vertical scroll bar as defined by the PApplication::GetVScrollWidth() function.

o AdjustHScrollOnly
Set the interactors position to the bottom left of the specified bounds rectangle. The width of the interactor is set to the width of the bounds rectangle and the height is set to the standard height for a horizontal scroll bar as defined by the PApplication::GetHScrollHeight() function.

o AdjustVScrollBeforeHScroll
Set the interactors position to the top right of the specified bounds rectangle. The height of the interactor is set to the height of the bounds rectangle minus the height of a horizontal scroll bar. The width is set to the standard width for a vertical scroll bar.

This option is used when both scroll bars are to be used and they must be placed in the usual manner, with a small unused area in the bottom right corner of the parent interactor.

o AdjustHScrollAfterVScroll
Set the interactors position to the bottom left of the specified bounds rectangle. The width of the interactor is set to the width of the bounds rectangle minus the width of a vertical scroll bar. The height is set to the standard height for a horizontal scroll bar.

This option is used when both scroll bars are to be used and they must be placed in the usual manner, with a small unused area in the bottom right corner of the parent interactor.

ovoid AutoAdjustBounds( PRect & bounds, AutoAdjustType type = AdjustBounds )
Adjust the interactor relative to the specified bounds rect. The bounds rectangle is the modified to remove the space that the interactor takes up in the bounds. In this way successive calls to AutoAdjustBounds() on child interactors by a parent can "tile" the interactors to correct positions. For example, if a parent has a scroll bar, a button bar and a status bar thes can be placed with three calls to AutoAdjustBounds() in the PTitledWindow::OnResize() function.
Parameters:
bounds - Bounds rectangle in which the interactor is adjusted.
type - Option for adjustment to be made.

oBOOL ContainsPoint( const PPoint & pt, CoordinateSystem coords ) const
Determine if the point specified is inside the interactors area. Note that the border or other decorations in a window are included in the area that consitutes the interactor

The point is usually in absolute screen coordinates, ie when coords parameter is ScreenCoords, but may also be relative to the interactors origin or scaled to the interactors font based layout coordinates.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
TRUE if the point is within the interactor.
Parameters:
pt - Point in to check.
coords - Coordinate system to use.

oPInteractor* FindInteractor( const PPoint & pt, CoordinateSystem coords ) const
Find the interactor that is at the specified coordinates. The interactor must be owned by the application.

The point is usually in absolute screen coordinates, ie when coords parameter is ScreenCoords, but may also be relative to the interactors origin or scaled to the interactors font based layout coordinates.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
pointer to interactor at point or NULL if no interactor there.
Parameters:
pt - Point to check.
coords - Coordinate system to use.

ovirtual void Enable( BOOL enabled = TRUE )
Enable or disable the interactor. This will prevent all input from being processed by the interactor. In some cases the visual appearance of the interactor may change depending on the individual semantics of the interactor. For example the text for a PTextButton would appear "greyed" out.

Note if an PInteractor is disabled, all its children, grandchildren etc will be disabled.

Parameters:
enabled - New state for input processing of interactor.

ovoid Disable()
Disable the interactor, ignoring all input to it.

This is identical to calling Enable(FALSE).

oBOOL IsEnabled() const
Determine if the interactor is enabled and input may be processed.

Returns:
TRUE if input processing enabled.

ovirtual void ShowAll()
Show the interactor and all child and grandchild etc interactors.

This enabled the interactor tree in post order, ie all children have their ShowAll() function called and then the interactor itself is shown using the Show() function.

ovirtual void Show( BOOL visible = TRUE )
Show or hide the interactor. This will immediately remove the interactor from view. Showing an interactor will cause content update events to be queued for later call of the OnRedraw() function. The actual display may be delayed.
Parameters:
visible - New state for the visibility of the interactor.

ovoid Hide()
Hide the interactor from view.

This is identical to calling Show(FALSE).

oBOOL IsVisible() const
Determine if interactor may be visible. Note that this does not mean that it is not obscured by another window on the screen. It simply means that the interactor has had Show(TRUE) called last.

Returns:
TRUE if the interactor is shown.

ovirtual void BringToTop()
Bring the interactor to the top of any layering order for overlapping windows or interactors. This only affects sibling interactors at a particular level of the parent child hierarchy.

If the interactor is a PTopLevelWindow then the "siblings" it uses are other applications top level windows. This is equivalent to the äctivating" of an application that the user may do using mouse and keyboard in the platform dependent manner.

Note that this does not change the order of child interactors as returned by the \Ref{operator[]} function, only the screen appearence is altered.

ovirtual BOOL IsOnTop() const
Determine if the interactor is currently on top of any layering order for overlapping windows or interactors. This compares against sibling interactors at a particular level of the parent child hierarchy.

Returns:
TRUE if this interactor is the

ovoid Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as requiring a redraw. This adds the specified rectangular area to an update region. If this region is not empty then a request to redraw that area of the interactor is queued to be processed by the message handling system. At some time later the OnRedraw() function is called with its canvas clipping region set to the update region.

The parameterless form will invalidate the entire interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the interactors update region then the _Invalidate() function should be overridden.

Parameters:
x - X position of the top left corner of the rectangle to invalidate.
y - Y position of the top left corner of the rectangle to invalidate.
width - Width of the rectangle to invalidate.
height - Height of the rectangle to invalidate.
coords - Coordinate system to use.

ovoid Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as not requiring a redraw. This subtracts the specified rectangular area from an update region. If this region is not empty then a request to redraw that area of the interactor is queued to be processed by the message handling system. At some time later the OnRedraw() function is called with its canvas clipping region set to the update region.

The parameterless form will validate the entire interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the interactors update region then the _Validate() function should be overridden.

Parameters:
x - X position of the top left corner of the rectangle to validate.
y - Y position of the top left corner of the rectangle to validate.
width - Width of the rectangle to validate.
height - Height of the rectangle to validate.
coords - Coordinate system to use.

ovoid Update()
Force an immediate update of the window. This is used in conjuction with the Invalidate() and Validate() functions. If the update region specified by these functions is empty then this function does nothing, otherwise an update of the interactor contents is made.

This will do a synchronous OnRedraw() call and guarantees that the screen is updated before returning. It us used to speed up the interaction with the user by not waiting for the standard delayed screen update.

ovoid GrabMouse()
Grab the mouse for exclusive use by this interactor. All mouse input, clicks etc will be directed to this interactor only regardless of the position of the mouse cursor.

Note that the cursor grab is a system wide resource and must be released by the application or it is possible to lock up the user interface for all applications!

ovoid ReleaseMouse()
Relenquish the exclusive use of the mouse after a GrabMouse() call.

Note that the cursor grab is a system wide resource and must be released by the application or it is possible to lock up the user interface for all applications!

oBOOL HasMouse() const
Determine if this interactor currently has exclusive use of the mouse pointer.

Returns:
TRUE if has currently grabbed the mouse pointer.

ovoid GrabFocus()
Make this interactor have the user keyboard input focus. All keyboard input will now be directed to this interactor.

Appropriate messages are sent to interactors for the focus change. The previous interactor receives a call to OnLostFocus() and the new interactor receives a OnGainFocus() call.

oBOOL HasFocus() const
Determine if this interactor currently has the keyboard focus.

Return: TRUE if has the current focus.

ovirtual void SetCursor( const PCursor & newCursor )
Set the cursor to be used for this interactor. The cursor is automatically set to this shape while the mouse is anywhere over this interactors client area or while the mouse pointer has been "grabbed" by the GrabMouse() function.

A call to this function will reset the cursor to parent flag that may be set by the SetCursorToParent() function.

Parameters:
newCursor - New shape for mouse cursor.

oPCursor GetCursor() const
Get the current cursor shape that is being used whenever the mouse pointer is over this interactor. This will be the cursor last set by the SetCursor() function and is not subject to the SetCursorToParent() mode.

Returns:
current cursor object for interactor.

ovoid SetCursorToParent( BOOL useParent = TRUE )
Set the cursor to always be whatever the interactors parent is using as a cursor shape. If the parents cursor is subsequently changed then the child interactors cursor is also changed.

This does not change the current cursor as last set by the SetCursor() function.

Parameters:
useParent - Flag for interactor to use parents cursor.

ovoid SetAllCursors( const PCursor & newCursor )
Set the current cursor to the new shape and set all child interactors to temporarily use that cursor.

Note that subsequent calls to the SetAllCursors() and SetWaitCursor() functions are ignored until the corresponding RestoreAllCursors() function is called. That it these functions may not be nested.

Parameters:
newCursor - New shape for mouse cursor.

ovoid RestoreAllCursors()
Restore the current cursor and all child interactors cursor to parent flags to the state as of the previous call to SetAllCursors()

ovoid SetWaitCursor()
Set the cursor for this interactor and all child interactors to the platform dependent standard wait cursor. This may be a watch or and hourglass as determined by the platform.

This function is equivalent to calling SetAllCursors(PCursor(PSTD_ID_CURSOR_WAIT)).

ovoid SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the cursor. As there is only one cursor for the entire system this may affect other applications.

The point is usually in absolute screen coordinates, ie when coords parameter is ScreenCoords, but may also be relative to the interactors origin or scaled to the interactors font based layout coordinates.

Note, this may not be available on all platforms in which case it does nothing. For this and other reasons of user interfcace design, it is not recommended that this function be used.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the cursor position then the _SetCursorPos() function should be overridden.

Parameters:
x - New X position of cursor.
y - New Y position of cursor.
coords - Coordinate system to use.

oPPoint GetCursorPos( CoordinateSystem coords ) const
Get the current cursor position in the interactors coordinate system.

The point is usually in absolute screen coordinates, ie when coords parameter is ScreenCoords, but may also be relative to the interactors origin or scaled to the interactors font based layout coordinates.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
coords - Coordinate system to use.

ovirtual void ShowCursor( BOOL show = TRUE )
Show or hide the mouse cursor. To be able to nest calls to this function an internal count is used. Whenever show the display count is incremented otherwise it is decremented. The cursor is displayed only when the count is greater than or equal to zero. The count is initially zero.
Parameters:
show - Flag for showing or hiding the cursor.

ovoid HideCursor()
Hide the mouse cursor, this is equivalent to ShowCursor(FALSE)

ovoid SetCaret( const PCaret & newCaret )
Set the text caret shape to be as specified.

The text caret is a small rectangle used to indicate the current position for editing text strings. It should only be present in interactors that contain the current keyboard focus.

Parameters:
newCaret - New shape for the caret.

oPCaret GetCaret() const
Get the current text caret shape.

The text caret is a small rectangle used to indicate the current position for editing text strings. It should only be present in interactors that contain the current keyboard focus.

Returns:
current caret object for interactor.

ovoid SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the text caret within the interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

The user should not override this function. If some form of action is required on changing the interactors caret position then the _SetCaretPos() function should be overridden.

Parameters:
x - New X position of caret.
y - New Y position of caret.
coords - Coordinate system to use.

oPPoint GetCaretPos( CoordinateSystem coords ) const
Get the position of the text caret within the interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Returns:
current position of the text caret.
Parameters:
coords - Coordinate system to use.

ovirtual void ShowCaret(BOOL show = TRUE)
Show or hide the text caret. To be able to nest calls to this function an internal count is used. Whenever show the display count is incremented otherwise it is decremented. The caret is displayed only when the count is greater than or equal to zero. The count is initially zero.

ovoid HideCaret()
Hide the text caret, this is equivalent to ShowCaret(FALSE)

ovirtual void SetForegroundColour( const PColour & newColour )
Set the default foreground colour of the interactor.

This will be the initial colour set in the PInteractorCanvas instance created via a PDrawCanvas creation or via OnRedraw() function call by the system providing a PRedrawCanvas.

On creation of the interator this is set to the colour specified by the PApplication::GetWindowFgColour() function.

Parameters:
newColour - New foreground colour for interactor.

oconst PColour& GetForegroundColour() const
Get the default foreground colour of the interactor.

This will be the initial colour set in the PInteractorCanvas instance created via a PDrawCanvas creation or via OnRedraw() function call by the system providing a PRedrawCanvas.

On creation of the interator this is set to the colour specified by the PApplication::GetWindowFgColour() function.

Returns:
colour for foreground of interactor.

ovirtual void SetBackgroundColour( const PColour & newColour )
Set the default background colour of the interactor.

This will be the initial colour set in the PInteractorCanvas instance created via a PDrawCanvas creation or via OnRedraw() function call by the system providing a PRedrawCanvas.

On creation of the interator this is set to the colour specified by the PApplication::GetWindowBkColour() function.

Parameters:
newColour - New background colour for interactor.

oconst PColour& GetBackgroundColour() const
Get the default background colour of the interactor.

This will be the initial colour set in the PInteractorCanvas instance created via a PDrawCanvas creation or via OnRedraw() function call by the system providing a PRedrawCanvas.

On creation of the interator this is set to the colour specified by the PApplication::GetWindowBkColour() function.

Returns:
colour for background of interactor.

oPDim GetBorderSize() const
Get the width of vertical border and height of horizontal border for this interactor.

This may be one of several values depending on the type of the interactor. For example a PTitledWindow would return a value as in the PApplication::GetTitledBorderSize() function.

If the interactor does not have a border then PDim(0,0) is returned.

Returns:
current width of borders on interactor.

oconst PColour& GetBorderColour() const
Get the colour of the interactors border.

The actual colour returned is dependent on the type of interactor and the current mode of the interactor. For instance for a PTitledWindow that is active, the value returned would be as specified by the PApplication::GetActiveBorderColour() function.

Returns:
colour for the border of the interactor.

oPCanvas* StartMouseTrack( BOOL wantsCanvas = FALSE )
Begin a mouse track operation, calling the OnMouseTrack() function for each mouse move. The the object on which the OnMouseTrack() function is called.

The first form will start to track a drag using the current interactor as the OnMouseTrack() functions target object.

The mouse pointer is automatically grabbed (via GrabMouse()) and released (via ReleaseMouse()). A canvas may also be automatically created and deleted, and is provided to the OnMouseTrack() function.

Returns:
Canvas created for the track operation.
Parameters:
wantsCanvas - Create a canvas for the track operation.

o System callback functions.

ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
The system calls this whenever the mouse moves over the interactors usable area.
Parameters:
button - This key code is used to determine the modifiers (eg shift, control etc) that were active while the mouse was moved over the interactor. The value part of the key code is irrelevent.
where - The position of the mouse pointer provided in pixels with its origin at the top left of the interactor.

ovirtual void OnMouseDown( PKeyCode button, const PPoint & where, BOOL doubleClick )
The system calls this whenever a mouse button is pressed in the interactors usable area.

The two system parameters PApplication::GetDoubleClickRect() and PApplication::GetDoubleClickTime() control what constitutes a double click.

Parameters:
button - This key code is used to determine which mouse button was pressed and what modifiers that were active at that time. The mouse button that caused this call back is in the value part of the key code. The modifiers may indicate other mouse buttons being down at the same time.
where - The position of the mouse pointer provided in pixels with its origin at the top left of the interactor.
doubleClick - Is TRUE if the mouse down is the second click of a double click.

ovirtual void OnMouseUp( PKeyCode button, const PPoint & where )
The system calls this whenever a mouse button is released in the interactors usable area.
Parameters:
button - This key code is used to determine which mouse button was pressed and what modifiers that were active at that time. The mouse button that caused this call back is in the value part of the key code. The modifiers may indicate other mouse buttons being down at the same time.
where - The position of the mouse pointer provided in pixels with its origin at the top left of the interactor.

ovirtual BOOL OnKeyDown( PKeyCode key, unsigned repeat )
The system calls this whenever a keyboard key was pressed and this interactor had the focus.

The key code passed in this function is a platform independent representation of a key cap. No ASCII or ANSI translation is made.

It may be assumed that the OnKeyDown() function occurs before the OnKeyInput() function, but it should not be assumed that the OnKeyUp() function occurs after OnKeyInput() function.

Returns:
TRUE if the OnKeyInput() function is to be called with the translated key value.
Parameters:
key - Key code representation of key that was pressed.
repeat - Count for auto-repeat.

ovirtual void OnKeyUp( PKeyCode key )
The system calls this whenever a keyboard key was released and this interactor had the focus.

The key code passed in this function is a platform independent representation of a key cap. No ASCII or ANSI translation is made.

It may be assumed that the OnKeyDown() function occurs before the OnKeyInput() function, but it should not be assumed that the OnKeyUp() function occurs after OnKeyInput() function.

Parameters:
key - Key code representation of key that was released.

ovirtual void OnKeyInput( const PString & str )
The system calls this whenever a keyboard key was pressed and this interactor had the focus. The string is the translated ANSI representation of the key combination.

It may be assumed that the OnKeyDown() function occurs before the OnKeyInput() function, but it should not be assumed that the OnKeyUp() function occurs after OnKeyInput() function.

Parameters:
str - ANSI string representation for the key press.

ovirtual void OnGainFocus()
The system calls this whenever the interactor is given the focus from another window in the system.

This function is typically used to change the appearance of the interactor to indicate that it has the focus, for example in a PEditBox control the text caret is shown.

ovirtual void OnLostFocus()
The system calls this whenever the interactor had the focus and it has been changed to another window in the system.

This function is typically used to change the appearance of the interactor to indicate that it no longer has the focus, for example in a PEditBox control the text caret is hidden.

ovirtual void OnStartInput()
The system calls this whenever the interactor is given the focus the first time for a given PTitledWindow or PInteractorLayout.

The interactor may have focus changed to interactors in other titled windows or interactor layouts but not to another interactor in the same window or layout before being approved by a call to OnEndInput().

This is primarily used to do field level validation within dialogs etc.

ovirtual BOOL OnEndInput()
The system calls this whenever the system wishes to change focus to another interactor in a given PTitledWindow or PInteractorLayout.

This function in conjunction with the keyboard focus changing and the SetFocusInteractor() function controls the transfer of focus from one interactor in a logical group (eg dialog) to another. It is primarily used for field level validation. For example, the PIntegerEditBox control uses this to prevent the user from exiting the control until a valid entry hash been made.

Note that the focus does actually change with appropriate calls to the OnGainFocus() and OnLostFocus() functions. The focus gets set back to the original interactor when this function disallows the focus change.

Returns:
FALSE will prevent the focus change from occurring and TRUE allows the change.

ovirtual void OnRedraw( PCanvas & canvas )
The system calls this whenever it requires that the interactors usable area needs to be updated and redrawn.

The canvas is usually a PRedrawCanvas instance with its clip region set to the current update region as determined by the Invalidate() and Validate() functions as well as those areas that were obscured by overlapping windows.

Parameters:
canvas - Canvas to use when drawing the interactor contents.

ovirtual void OnControlNotify( PControl & control, int option )
This function is called whenever a control needs to notify its parent interactor that somthing has happened to it. The default behaviour of this function is is to call the notify function contained in the control object itself.
Parameters:
control - Control that provides the notification.
option - Options for the type of notification.

ovirtual void OnSelectHelp()
This function is called whenever a help select mode is activated and this interactor is selected

ovirtual PBalloon* OnBalloonHelp()
This function is called whenever a balloon help function for the interactor is required.

Returns:
Pointer to balloon window containing balloon help text.

ovirtual void OnMouseTrack( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
This function is called whenever a drag track is in progress. This is begun with a call to the StartMouseTrack() function, which is typically called from within the OnMouseDown() function.

The lastTrack parameter can be used to for special action at the end of the track operation.

The mouse pointer is automatically grabbed (via GrabMouse()) and released (via ReleaseMouse()). The canvas provided is also automatically created and deleted.

Parameters:
canvas - The canvas available while the drag operation is tracking.
where - The position of the mouse pointer provided in pixels with its origin at the top left of the interactor.
lastTrack - This is TRUE if the position is the last track of the drag operation.

o PInteractor()
Special constructor used with PTopLevelWindow.

o New functions for class

ovirtual void _SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )
Set the position of the interactor. The xOrigin and yOrigin parameters indicate the coordinate system to be used for the offsets. If the font based layout coordinates are used they will use the font of the parents interactor. The interactors font is not used.

Note that this sets the position of the exterior of the interactor, including any decoration, eg title bars etc.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
x - Horizontal offset to apply to interactor.
y - Vertical offset to apply to interactor.
xOrigin - Origin for horizontal offset.
yOrigin - Origin for verical offset.

ovirtual void _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the interactor. The new size is specified in either the font based layout coordinates or in screen pixels as specified by the coords parameter.

Note that this sets the dimension of the interior of the interactor, excluding any decoration, eg title bars etc.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
width - New width to apply to interactor.
height - New height to apply to interactor.
coords - Coordinate system to use.

ovirtual void _Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as requiring a redraw. This adds the specified rectangular area to an update region. If this region is not empty then a request to redraw that area of the interactor is queued to be processed by the message handling system. At some time later the OnRedraw() function is called with its canvas clipping region set to the update region.

The parameterless form will invalidate the entire interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
x - X position of the top left corner of the rectangle to invalidate.
y - Y position of the top left corner of the rectangle to invalidate.
width - Width of the rectangle to invalidate.
height - Height of the rectangle to invalidate.
coords - Coordinate system to use.

ovirtual void _Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Mark the area of the interactor as not requiring a redraw. This subtracts the specified rectangular area from an update region. If this region is not empty then a request to redraw that area of the interactor is queued to be processed by the message handling system. At some time later the OnRedraw() function is called with its canvas clipping region set to the update region.

The parameterless form will validate the entire interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
x - X position of the top left corner of the rectangle to validate.
y - Y position of the top left corner of the rectangle to validate.
width - Width of the rectangle to validate.
height - Height of the rectangle to validate.
coords - Coordinate system to use.

ovirtual void _SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the cursor. As there is only one cursor for the entire system this may affect other applications.

The point is usually in absolute screen coordinates, ie when coords parameter is ScreenCoords, but may also be relative to the interactors origin or scaled to the interactors font based layout coordinates.

Note, this may not be available on all platforms in which case it does nothing. For this and other reasons of user interfcace design, it is not recommended that this function be used.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
x - New X position of cursor.
y - New Y position of cursor.
coords - Coordinate system to use.

ovirtual void _SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
Set the position of the text caret within the interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
x - New X position of caret.
y - New Y position of caret.
coords - Coordinate system to use.

ovirtual void SetFocusInteractor( PInteractor * interactor )
Set the child interactor that has the focus in the PTitledWindow or PInteractorLayout.

The interactor set here may not actually have the focus. It is the interactor that will be given the focus if the parent interactor, eg a dialog, is given the focus. The dialog itself never requires the focus directly.

The default behaviour is to pass the interactor on to its parent using its SetFocusInteractor() function.

Parameters:
interactor - Interactor that received focus.

ovirtual PInteractor* GetFocusInteractor() const
Get the child interactor that has the focus in the PTitledWindow or PInteractorLayout.

The interactor returned here may not actually have the focus. It is the interactor that will be given the focus if the parent interactor, eg a dialog, is given the focus. The dialog itself never requires the focus directly.

The default behaviour is to get the interactor from its parent using its GetFocusInteractor() function.

Returns:
pointer to child or grandchild interactor that has focus.

ovirtual void UpdateMyCommandSources()
Scan through all child interactors and if they are a command source, execute their notification function to enable or disable the item.

The default behaviour is to call UpdateCommandSources() for all child interactors.

This function is used internally by the library. It would normally not be called directly.

oPApplication* owner
The interactors owner application

oPInteractor* parent
The interactor layout that contains this interactor.

oPInteractorList children
The list of children in this interactor layout.

oPRealFont font
The font used by the interactor.

o Flag to indicate that the parent interactor layouts cursor should be used with this interactor.
Flag to indicate that the parent interactor layouts cursor should be used with this interactor.

oPCursor cursor
The normal mouse cursor to be used in this interactor.

oPCursor savedCursor
The saved mouse cursor to be used in this interactor after a call to RestoreAllCursors().

oPCaret caret
The text caret to be used in this interactor.

oPPoint caretPosition
The current location of the caret (in pixels).

oint caretVisible
The current count for visibility of caret in interactor.

oPColour foregroundColour
The foreground colour used in this interactor

oPColour backgroundColour
The background colour used in this interactor

oPInteractor* mouseTrackInteractor
The interactor used in the dracking of a drag operation, if NULL no drag track is happening.

oPInteractorCanvas* mouseTrackCanvas
The canvas used in the dracking of a drag operation, if NULL no drag track is happening.


Direct child classes:
PSplitter
PScroller
PScrollable
PPopUp
PInteractorLayout
PControl

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.