GAlert Class Reference

A BeOS style alert window, kinda like a Win32 MessageBox. More...

#include <LgiClasses.h>

Inheritance diagram for GAlert:

GDialog GWindow GLgiRes GView GDragDropTarget

List of all members.

Public Member Functions

 GAlert (GViewI *parent, char *Title, char *Text, char *Btn1, char *Btn2=0, 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.


Detailed Description

A BeOS style alert window, kinda like a Win32 MessageBox.

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.


Constructor & Destructor Documentation

GAlert::GAlert ( GViewI *  parent,
char *  Title,
char *  Text,
char *  Btn1,
char *  Btn2 = 0,
char *  Btn3 = 0 
)

Constructor.

Parameters:
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().


Member Function Documentation

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


The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:02 2010 for Lgi by  doxygen 1.5.7.1