#include <LgiClasses.h>
Public Member Functions | |
GAlert (GViewI *parent, const char *Title, const char *Text, const char *Btn1, const char *Btn2=0, const char *Btn3=0) | |
Constructor. | |
int | OnNotify (GViewI *Ctrl, int Flags) |
Called when a child view or view with it's SetNotify() set to this window changes. |
The best thing about this class is you can name the buttons very specifically. It's always non-intuitive to word a question to the user in such a way so thats it's obvious to answer with "Ok" or "Cancel". But if the user gets a question with customised "actions" as buttons they'll love you.
The button pressed is returned as a index from the DoModal() function. Starting at '1'. i.e. Btn2 -> returns 2.
GAlert::GAlert | ( | GViewI * | parent, | |
const char * | Title, | |||
const char * | Text, | |||
const char * | Btn1, | |||
const char * | Btn2 = 0 , |
|||
const char * | Btn3 = 0 | |||
) |
Constructor.
parent | The parent view |
Title | The dialog title |
Text | The body of the message |
Btn1 | The first button text |
Btn2 | The [optional] 2nd buttons text |
Btn3 | The [optional] 3rd buttons text |
References List< Type >::First(), GView::GetPos(), List< Type >::Insert(), LGI_MET_DECOR_X, LGI_MET_DECOR_Y, LgiApp, GView::MoveToCenter(), GWindow::Name(), List< Type >::Next(), GRect::Offset(), GView::SetParent(), GWindow::SetPos(), SysFont, GView::X(), GDisplayString::X(), GView::Y(), GRect::y2, and GRect::ZOff().
int GAlert::OnNotify | ( | GViewI * | Ctrl, | |
int | Flags | |||
) |
Called when a child view or view with it's SetNotify() set to this window changes.
The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.
Reimplemented from GView.
References GDialog::EndModal().