class PInteractorCanvas: public PCanvas

A canvas that is attached to an interactor on the screen.

Inheritance:


Public Methods

[more] PInteractorCanvas ( PInteractor * theInteractor, BOOL inPixels )
Create a canvas associated with an interactor on the screen.
[more] ~PInteractorCanvas ()
Destroy the interactor canvas.
[more]virtual PRect GetDrawingBounds () const
Get the drawable area of the interactor, this would be the dimensions of the PInteractor class associated with the canvas.
[more]PInteractor* GetInteractor () const
Get the interactor that the canvas is attached to.
[more]void Scroll ( const PPoint & amt )
Scroll the contents of the canvas by the amount specified.
[more]void Copy ( const PRect & srcRect, PCanvas & dst, const PPoint & pt )
Copy the contents of the srcRect in this canvas to the destination canvas at the position specified or area rectangle.

Public

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

Protected Fields

[more]PInteractor* interactor
The interactor this canvas is attached to.


Inherited from PCanvas:

Public Classes

oenum DrawStringOptions

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
ovirtual PCanvasState& operator=( const PCanvasState & state )
oconst PRealFont& GetFont() const
ovirtual PFontFamilyList GetAvailableFonts() const
ovirtual void Save()
ovirtual void Restore()
ovirtual void SetCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( const PPoint & pos )
ovirtual PPoint GetCurrentPosition() const
ovirtual void DrawLine( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( const PPoint & pt )
ovirtual void DrawLineRelative( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( PORDINATE x1, PORDINATE y1, PORDINATE x2, PORDINATE y2 )
ovoid DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovoid FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void DrawFocusRect( const PRect & rect )
ovirtual void DrawBevelledRect( const PRect & rect, BOOL raised, BOOL deep )
ovirtual void DrawRoundRect( const PRect & rect, PDIMENSION cornerWidth, PDIMENSION cornerHeight )
ovirtual void DrawEllipse( const PRect & rect )
ovirtual void DrawArc( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPie( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawChord( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPolyLine( const PPointArray & ptArray )
ovirtual void DrawPolygon( const PPointArray & ptArray )
ovirtual void DrawImgIcon( PORDINATE x, PORDINATE y, const PImgIcon & icn )
ovirtual void DrawIcon( PORDINATE x, PORDINATE y, const PIcon & icn )
ovirtual void DrawPixels( PORDINATE x, PORDINATE y, const PPixelImage & pix )
ovirtual void DrawPixels( const PRect & rect, const PPixelImage & pix )
ovirtual void DrawPict( PORDINATE x, PORDINATE y, const PPictImage & pic )
ovirtual void DrawPict( const PRect & rect, const PPictImage & pic )
ovirtual void DrawString( PORDINATE x, PORDINATE y, const PString & str, int options = LeftAlign )
ovirtual PDIMENSION DrawString( const PRect & rect, const PString & str, int options = LeftAlign )
ovirtual PDim MeasureString( const PString & str )
ovirtual PDIMENSION MeasureString(const PString & str, PDIMENSION width)
ovirtual void DrawTextLine( PORDINATE x, PORDINATE y, const char * textChars, const PDIMENSION * charWidths, PINDEX len )
ovirtual PRect GetPhysicalBounds(BOOL inPixels = FALSE) const
ovirtual void SetClipRegion( const PRegion & rgn )
ovirtual PRegion GetClipRegion() const
ovirtual void SetClipRect( const PRect & rect )
ovirtual PRect GetClipRect() const
oBOOL IsInClipRegion( const PPoint & pt ) const
oPDIMENSION FromPixelsDX( PDIMENSION dx ) const
oPDIMENSION ToPixelsDX( PDIMENSION dx ) const
oPDIMENSION FromPointsX( PDIMENSION dx )
oPDIMENSION ToPointsX( PDIMENSION dx )

Protected Classes

oclass State: public PObject, public PCanvasState

Protected Fields

oPRealFont realFont

Protected Methods

ovirtual void _DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void _FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )

Protected

PORDINATE Member variables


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Inherited from PCanvasState:

Public Classes

oenum PenStyles
oenum DrawingModes
oenum PolyFillMode

Public Methods

ovirtual BOOL SetPenStyle( PenStyles style )
oPenStyles GetPenStyle() const
ovirtual BOOL SetPenWidth( int width )
oint GetPenWidth() const
ovirtual BOOL SetPenMode( DrawingModes mode )
oDrawingModes GetPenMode() const
ovirtual BOOL SetPenFgColour( const PColour & colour )
oconst PColour& GetPenFgColour() const
ovirtual BOOL SetPenBkColour( const PColour & colour )
oconst PColour& GetPenBkColour() const
ovirtual BOOL SetFillPattern( const PPattern & pattern )
oPPattern GetFillPattern() const
ovirtual BOOL SetPatternOrigin( const PPoint & pt )
oPPoint GetPatternOrigin() const
ovirtual BOOL SetFillMode(DrawingModes style)
oDrawingModes GetFillMode() const
ovirtual BOOL SetFillFgColour( const PColour & colour )
oconst PColour& GetFillFgColour() const
ovirtual BOOL SetFillBkColour( const PColour & colour )
oconst PColour& GetFillBkColour() const
ovirtual BOOL SetFont(const PFont & newFont)
ovirtual BOOL SetTextFgColour( const PColour & colour )
oconst PColour& GetTextFgColour() const
ovirtual BOOL SetTextBkColour( const PColour & colour )
oconst PColour& GetTextBkColour() const
ovirtual BOOL SetPolyFillMode( PolyFillMode newMode )
oPolyFillMode GetPolyFillMode() const
ovirtual BOOL SetPalette( const PPalette & newPal )
oPPalette GetPalette() const
ovirtual BOOL SetMappingRect( const PRect & rect )
oPRect GetMappingRect() const
ovirtual BOOL SetViewportRect( const PRect & rect )
oPRect GetViewportRect() const
ovoid SetOrigin(const PPoint & pt)
oPPoint GetOrigin() const


Documentation

A canvas that is attached to an interactor on the screen. This is an abstract class with two main descendents. If the application wants to draw into the interactor outside of the automatic update mechanism it must use PDrawCanvas, while the PInteractor::OnRedraw() function of an interactor receives an instance of the PRedrawCanvas class.

NOTE *********************************** On Some platforms, canvases are a limited resource. Do NOT create and leave them around for long periods. As soon as it is not required till the next user event, destroy it!

o PInteractorCanvas( PInteractor * theInteractor, BOOL inPixels )
Create a canvas associated with an interactor on the screen.
Parameters:
theInteractor - Interactor canvas is attached to.
inPixels - Set the initial canvas coordinates are in screen pixels. The default is for the coordinates to be set to one based on the current font for the interactor (1/4 the average character widthand 1/8 the height).

o ~PInteractorCanvas()
Destroy the interactor canvas.

o Overrides from class PCanvas

ovirtual PRect GetDrawingBounds() const
Get the drawable area of the interactor, this would be the dimensions of the PInteractor class associated with the canvas. A canvas associated with a PScrollable class, however, could return a drawable area much larger than the interactors size.

Returns:
rectangle for the maximum size of the drawable area.

o New functions for class

oPInteractor* GetInteractor() const
Get the interactor that the canvas is attached to.

Returns:
pointer to interactor drawn to by the canvas.

ovoid Scroll( const PPoint & amt )
Scroll the contents of the canvas by the amount specified. The entire contents of the interactor are moved. The area "left behind" by the move is unchanged. If a rectangle is specified then only that part of the canvas contents is scrolled.
Parameters:
amt - Amount to scroll.

ovoid Copy( const PRect & srcRect, PCanvas & dst, const PPoint & pt )
Copy the contents of the srcRect in this canvas to the destination canvas at the position specified or area rectangle. If a rectangle is specified then the image is stretched or compressed to fit.
Parameters:
srcRect - Area in canvas to copy.
dst - Canvas to copy area to.
pt - Position in canvas to copy the area to.

oPInteractor* interactor
The interactor this canvas is attached to.


Direct child classes:
PRedrawCanvas
PDrawCanvas

Alphabetic index HTML hierarchy of classes or Java



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