class PDialog: public PInteractorLayout

This class defines a user inteface entity that consists of a collection of zero or more other interactors.

Inheritance:


Public Methods

[more] PDialog ( PInteractor * parent )
Create a new empty dialog.
[more] PDialog ( PInteractor * parent, PRESOURCE_ID resID )
Create a new dialog by loading it from a resource.
[more]virtual ~PDialog ()
Destroy the dialog, releasing its data and all of its associated controls
[more]virtual PString GetTitle () const
Get the current dialog title string.
[more]virtual void SetTitle ( const PString & title )
Set the new window title string.
[more]virtual void Close ()
Close the PDialog interactor.
[more]void SetStdButtons ( PPushButton * okBtn, PPushButton * cancelBtn = NULL, PPushButton * helpBtn = NULL )
Set the default OK, Cancel & Help buttons.

Public

[more] New functions for class

Protected Fields

[more]PPushButton* ok
The OK button.
[more]PPushButton* cancel
The Cancel button.
[more]PPushButton* help
The Help button.

Protected Methods

[more]virtual void OnClose ()
The system calls this whenever the window is being closed.
[more]virtual void OnOk ()
Function called when the dialog OK button has been pressed.
[more]virtual void OnCancel ()
Function called when the dialog Cancel button has been pressed.


Inherited from PInteractorLayout:

Public Methods

ovirtual void SetFocusInteractor( PInteractor * interactor )
ovirtual PInteractor* GetFocusInteractor() const
oPControl* GetControl( PRESOURCE_ID id )
ovoid UpdateControls()

Public

Overrides from class PInteractor

Protected Fields

oPInteractor* focusInteractor

Protected Methods

ovirtual void ConstructEnd( PRESOURCE_ID resID )


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 UpdateMyCommandSources()

Protected

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


Documentation

This class defines a user inteface entity that consists of a collection of zero or more other interactors. These interactors are expected to be descendents of the PControl class. Controls allow information to be transferred between the user and the application.

The external and internal layout of a dialog is usually described using application resources.

o PDialog( PInteractor * parent )
Create a new empty dialog. There are no controls contained within the dialog and it is expected that these are to added manually by the application.
Parameters:
parent - Interactor that owns the dialog.

o PDialog( PInteractor * parent, PRESOURCE_ID resID )
Create a new dialog by loading it from a resource. The resource description determines the position, dimensions and title of the dialog as well as the position, dimensions, title and other options for all of the controls in the dialog.
Parameters:
parent - Interactor that owns the dialog.
resID - Resource identifier for loading controls.

ovirtual ~PDialog()
Destroy the dialog, releasing its data and all of its associated controls

o New functions for class

ovirtual PString GetTitle() const
Get the current dialog title string. This usually appear ina caption at the top of the dialog.

Returns:
string for the dialog title.

ovirtual void SetTitle( const PString & title )
Set the new window title string. This will be updated on the screen immediately (subject to OS constraints).
Parameters:
title - New title string for dialog.

ovirtual void Close()
Close the PDialog interactor. This will do a "safe" delete of the PDialog object, ie after all the member functions on the object have returned and the programme is in the main message handling loop, then the delete operator is executed on the object. This will prevent problems with the "this" pointer being invalid when a PDialog is closed via a call back function such as OnCancel().

ovoid SetStdButtons( PPushButton * okBtn, PPushButton * cancelBtn = NULL, PPushButton * helpBtn = NULL )
Set the default OK, Cancel & Help buttons. The Ok button will call the OnOk() function, the Cancel button will call the OnCancel() function and the Help button will call the OnSelectHelp() function.
Parameters:
okBtn - The OK button for the dialog.
cancelBtn - The Cancel button for the dialog.
helpBtn - The Help button for the dialog.

ovirtual void OnClose()
The system calls this whenever the window is being closed. There is no way to prevent this action at this point. Override the OnCancel() function if you wish to control if the close operation proceeds.

The application writer may override this function to do any clean up or state saving operations.

The default action does nothing.

ovirtual void OnOk()
Function called when the dialog OK button has been pressed. The default behaviour is to close the dialog using Close().

ovirtual void OnCancel()
Function called when the dialog Cancel button has been pressed. The default behaviour is to close the dialog using Close().

oPPushButton* ok
The OK button.

oPPushButton* cancel
The Cancel button.

oPPushButton* help
The Help button.


Direct child classes:
PModalDialog
PFloatingDialog

Alphabetic index HTML hierarchy of classes or Java



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