class PSplitter: public PInteractor

An interactor that allow the placement of two other interactors next to each other with a bar between them that allows the adjustment of the proportions that the two interactors take up.

Inheritance:


Public

[more] Construction
[more] New functions for class

Protected Fields

[more]PRect splitBar
Rectangle for the position of the bar between the interactors.
[more]PDrawCanvas* trackCanvas
Canvas used to draw the tracking of the movement of the bar between the interactors.

Protected

[more] Overrides from class PInteractor
[more] New functions for class


Inherited from PInteractor:

Public Classes

oenum PositionOrigin
oenum CoordinateSystem
oenum AutoAdjustType

Public Fields

oPCursor cursor

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
oPInteractor* GetParent() const
oBOOL IsChild( PInteractor * parent ) const
oPINDEX GetNumChildren()
oPInteractor& operator[]( PINDEX index )
ovirtual void UpdateCommandSources()
ovirtual void SetFont( const PFont & newFont, BOOL toChildren = TRUE )
oconst PRealFont& GetFont()
oPDIMENSION ToPixelsDX( PDIMENSION x ) const
oPDIMENSION ToPixelsDY( PDIMENSION y ) const
oPORDINATE ToPixelsX( PORDINATE x ) const
oPORDINATE ToPixelsY( PORDINATE y ) const
oPDim ToPixels( const PDim & dim ) const
oPPoint ToPixels( const PPoint & pt ) const
oPRect ToPixels( const PRect & r ) const
oPDIMENSION FromPixelsDX( PDIMENSION x ) const
oPDIMENSION FromPixelsDY( PDIMENSION y ) const
oPORDINATE FromPixelsX( PORDINATE x ) const
oPORDINATE FromPixelsY( PORDINATE y ) const
oPDim FromPixels( const PDim & dim ) const
oPPoint FromPixels( const PPoint & pt ) const
oPRect FromPixels( const PRect & r ) const
ovoid SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
oPPoint GetPosition( CoordinateSystem coords ) const
oPPoint ToScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
oPPoint FromScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
ovoid SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
oPDim GetDimensions( CoordinateSystem coords ) const
oPRect GetStructureBounds( CoordinateSystem coords ) const
ovirtual PRect GetDrawingBounds( CoordinateSystem coords ) const
ovoid AutoAdjustBounds( PRect & bounds, AutoAdjustType type = AdjustBounds )
oBOOL ContainsPoint( const PPoint & pt, CoordinateSystem coords ) const
oPInteractor* FindInteractor( const PPoint & pt, CoordinateSystem coords ) const
ovirtual void Enable( BOOL enabled = TRUE )
ovoid Disable()
oBOOL IsEnabled() const
ovirtual void ShowAll()
ovirtual void Show( BOOL visible = TRUE )
ovoid Hide()
oBOOL IsVisible() const
ovirtual void BringToTop()
ovirtual BOOL IsOnTop() const
ovoid Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Update()
ovoid GrabMouse()
ovoid ReleaseMouse()
oBOOL HasMouse() const
ovoid GrabFocus()
oBOOL HasFocus() const
ovirtual void SetCursor( const PCursor & newCursor )
oPCursor GetCursor() const
ovoid SetCursorToParent( BOOL useParent = TRUE )
ovoid SetAllCursors( const PCursor & newCursor )
ovoid RestoreAllCursors()
ovoid SetWaitCursor()
ovoid SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCursorPos( CoordinateSystem coords ) const
ovirtual void ShowCursor( BOOL show = TRUE )
ovoid HideCursor()
ovoid SetCaret( const PCaret & newCaret )
oPCaret GetCaret() const
ovoid SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCaretPos( CoordinateSystem coords ) const
ovirtual void ShowCaret(BOOL show = TRUE)
ovoid HideCaret()
ovirtual void SetForegroundColour( const PColour & newColour )
oconst PColour& GetForegroundColour() const
ovirtual void SetBackgroundColour( const PColour & newColour )
oconst PColour& GetBackgroundColour() const
oPDim GetBorderSize() const
oconst PColour& GetBorderColour() const
oPCanvas* StartMouseTrack( BOOL wantsCanvas = FALSE )
ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
ovirtual void OnMouseDown( PKeyCode button, const PPoint & where, BOOL doubleClick )
ovirtual void OnMouseUp( PKeyCode button, const PPoint & where )
ovirtual BOOL OnKeyDown( PKeyCode key, unsigned repeat )
ovirtual void OnKeyUp( PKeyCode key )
ovirtual void OnKeyInput( const PString & str )
ovirtual void OnGainFocus()
ovirtual void OnLostFocus()
ovirtual void OnStartInput()
ovirtual BOOL OnEndInput()
ovirtual void OnRedraw( PCanvas & canvas )
ovirtual void OnControlNotify( PControl & control, int option )
ovirtual void OnSelectHelp()
ovirtual PBalloon* OnBalloonHelp()
ovirtual void OnMouseTrack( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
ovirtual void _SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )

Public

Overrides from class PObject

System callback functions.

Protected Fields

oPApplication* owner
oPInteractor* parent
oPInteractorList children
oPRealFont font
oPCursor savedCursor
oPCaret caret
oPPoint caretPosition
oint caretVisible
oPColour foregroundColour
oPColour backgroundColour
oPInteractor* mouseTrackInteractor
oPInteractorCanvas* mouseTrackCanvas

Protected Methods

ovirtual void _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void _SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void SetFocusInteractor( PInteractor * interactor )
ovirtual PInteractor* GetFocusInteractor() const
ovirtual void UpdateMyCommandSources()

Protected

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


Documentation

An interactor that allow the placement of two other interactors next to each other with a bar between them that allows the adjustment of the proportions that the two interactors take up.

The last two child interactors of the splitter are used as the two interactors to "split".

This is an abstract class for horizontal and vertical versions.

o Construction

o PSplitter( PInteractor * parent )
Create a splitter interactor.
Parameters:
parent - Parent interactor for splitter.

o New functions for class

ovirtual void SetPercent( PDIMENSION percent )
This function sets the split to the specified percentage, adjusting the child windows accordingly.
Parameters:
percent - Percentage split.

o Overrides from class PInteractor

ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
The system calls this whenever the mouse moves over the interactors usable area.

This behaviour in a splitter is to track the movement of the "bar" between the two interactors.

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.

This behaviour in a splitter is to begin tracking the movement of the "bar" between the two interactors.

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.

This behaviour in a splitter is to finish tracking the movement of the "bar" between the two interactors. The two child interactors are then resized at this point via a call to the splitter \ref{PInteractor::SetDimensions()} function.

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 void OnRedraw( PCanvas & canvas )
The system calls this whenever it requires that the interactors usable area needs to be updated and redrawn.

This behaviour in a splitter is to draw the "bar" between the two interactors.

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

o New functions for class

ovirtual void TrackSplitter( const PPoint & where )
Track the adjustment of the splitter divider. This is called from the ancestor class during the mouse tracking operation. It determines whether the bar moves vertically or horzontally.
Parameters:
where - Mouse location during the track.

ovoid AdjustChildInteractors( PDIMENSION width1, PDIMENSION height1, PORDINATE x2, PORDINATE y2, PDIMENSION width2, PDIMENSION height2 )
Adjust the child interactors according to the split.
Parameters:
width1 - Width of first child interactor.
height1 - Height of first child interactor.
x2 - X position of second child interactor.
y2 - Y position of second child interactor.
width2 - Width of second child interactor.
height2 - Height of second child interactor.

oPRect splitBar
Rectangle for the position of the bar between the interactors.

oPDrawCanvas* trackCanvas
Canvas used to draw the tracking of the movement of the bar between the interactors. This is only non-null when the mouse was clicked in the interactor, ie via \ref{OnMouseDown()}.


Direct child classes:
PVerticalSplitter
PHorizontalSplitter

Alphabetic index HTML hierarchy of classes or Java



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