class PSimpleDialog: public PModalDialog

A class for displaying a simple, standard dialog for presenting short messages and asking simple questions.

Inheritance:


Public Classes

[more]enum IconToShow
Icon selection options for PSimpleDialog constructor.
[more]enum ButtonsToHave
Button selection options for PSimpleDialog constructor.
[more]enum ButtonType
Return values for PModalDialog::RunModal() function.

Public Fields

[more]PStaticText* text
Static text control for message.

Public Methods

[more] PSimpleDialog ( PInteractor * parent, const PString & str, ButtonsToHave btns = OkBtn, IconToShow icn = NoIcon )
Create a simple dialog for quick and easy user interface messages and questions.
[more]static void Info ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the information icon and the Ök" button only.
[more]static void Error ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the exclamation mark icon and the Ök" button only.
[more]static void FatalError ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the stop sign icon and the Ök" button only.
[more]static BOOL OkCancel ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the Ök" and "Cancel" buttons.
[more]static BOOL YesNo ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the "Yes" and "No" buttons.
[more]static ButtonType YesNoCancel ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the "Yes", "No" and "Cancel" buttons.
[more]static ButtonType AbortRetryIgnore ( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the exclamation icon and the Äbort", "Retry" and "Ignore" buttons.

Public

[more] New functions for class

Protected Fields

[more]PStaticIcon* icon
Static icon control for icon specified in constructor.
[more]PPushButton* btn1
First button, may be Ök", "Yes" or Äbort".
[more]PPushButton* btn2
Second button, may be "Cancel", "No" or "Retry".
[more]PPushButton* btn3
Third button, may be "Cancel" or "Ignore".
[more]ButtonType btn1val
Value to return if button 1 is pressed, eg WasOK.
[more]ButtonType btn2val
Value to return if button 2 is pressed, eg WasCancel.
[more]ButtonType btn3val
Value to return if button 3 is pressed, eg WasIgnore.

Protected

[more] Member variables


Inherited from PModalDialog:

Public Methods

ovirtual int RunModal()
ovoid EndModal( int retVal )
ovirtual void OnOk()
ovirtual void OnInit()

Protected Methods

ovirtual void OnCancel()
ovirtual void Save()
ovirtual void Restore()

Protected

Overrides from class PDialog


Inherited from PDialog:

Public Methods

ovirtual PString GetTitle() const
ovirtual void SetTitle( const PString & title )
ovirtual void Close()
ovoid SetStdButtons( PPushButton * okBtn, PPushButton * cancelBtn = NULL, PPushButton * helpBtn = NULL )

Protected Fields

oPPushButton* ok
oPPushButton* cancel
oPPushButton* help

Protected Methods

ovirtual void OnClose()


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

A class for displaying a simple, standard dialog for presenting short messages and asking simple questions.

A simple dialog consists of a static text item, an optional icon and up to three buttons with fixed names. What combination of icons and buttons is determined in the constructor parameters.

Even though a PSimpleDialog object can be created and treated in the same way as any other modal dialog, it is more usual to use one of the static functions provided. For example to ask a simple yes or not question the PSimpleDialog::YesNo() function would be used.

The value returned by the PModalDialog::RunModal() function indicates which button was pressed to terminate the modal dialog.

oenum IconToShow
Icon selection options for PSimpleDialog constructor.

o NoIcon
Do not display an icon.

o InformationIcon
Display system standard information (asterisk) icon. This is used when the message presented is not very important.

o QuestionIcon
Display system standard question mark icon. This is usually used when the simple dialog requires a decision to be made by the user.

o ExclamationIcon
Display system standard exclamation mark icon. This is used when the message is important, for example when an error occurs.

o StopSignIcon
Display system standard stop sign icon. This is used when the message is very important. For example when a fatal error that will terminate the application occurs.

oenum ButtonsToHave
Button selection options for PSimpleDialog constructor.

o OkBtn
Only display the Ök" button.

o OkCancelBtn
Display the Ök" and "Cancel" buttons.

o RetryCancelBtn
Display the "Retry" and "Cancel" buttons.

o YesNoBtn
Display the "Yes" and "No" buttons.

o YesNoCancelBtn
Display the "Yes", "No" and "Cancel" buttons.

o AbortRetryIgnoreBtn
Display the Äbort", "Retry" and "Ignore" buttons.

oenum ButtonType
Return values for PModalDialog::RunModal() function.

o WasOk
Dialog was terminated by pressing the Ök" button.

o WasCancel
Dialog was terminated by pressing the "Cancel" button.

o WasRetry
Dialog was terminated by pressing the "Retry" button.

o WasYes
Dialog was terminated by pressing the "Yes" button.

o WasNo
Dialog was terminated by pressing the "No" button.

o WasAbort
Dialog was terminated by pressing the Äbort" button.

o WasIgnore
Dialog was terminated by pressing the "Ignore" button.

o PSimpleDialog( PInteractor * parent, const PString & str, ButtonsToHave btns = OkBtn, IconToShow icn = NoIcon )
Create a simple dialog for quick and easy user interface messages and questions.

The default title for the dialog is as for the ultimate PTopLevelWindow parent interactor.

Parameters:
parent - Parent interactor for modal dialog.
str - Message to display in static text control.
btns - Which buttons to display.
icn - Which icon, if any, to display.

o New functions for class

ostatic void Info( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the information icon and the Ök" button only.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic void Error( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the exclamation mark icon and the Ök" button only.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic void FatalError( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the stop sign icon and the Ök" button only.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic BOOL OkCancel( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the Ök" and "Cancel" buttons.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic BOOL YesNo( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the "Yes" and "No" buttons.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic ButtonType YesNoCancel( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the question mark icon and the "Yes", "No" and "Cancel" buttons.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

ostatic ButtonType AbortRetryIgnore( PInteractor * parent, PRESOURCE_ID resID, ... )
Display the simple dialog using the exclamation icon and the Äbort", "Retry" and "Ignore" buttons.

The message text may be printf style formatted output unless a PString expression is used. Then the exact string is used in the static text control.

Parameters:
parent - Parent interactor for modal dialog.
resID - Unique id for resource string to be used a printf style format string.

o Member variables

oPStaticText* text
Static text control for message.

oPStaticIcon* icon
Static icon control for icon specified in constructor.

oPPushButton* btn1
First button, may be Ök", "Yes" or Äbort".

oPPushButton* btn2
Second button, may be "Cancel", "No" or "Retry".

oPPushButton* btn3
Third button, may be "Cancel" or "Ignore".

oButtonType btn1val
Value to return if button 1 is pressed, eg WasOK.

oButtonType btn2val
Value to return if button 2 is pressed, eg WasCancel.

oButtonType btn3val
Value to return if button 3 is pressed, eg WasIgnore.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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