Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NDK_XX::MessageBox Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::MessageBox:

NDK_XX::DialogBox NDK_XX::Control NDK_XX::OkCancelBox NDK_XX::YesNoBox NDK_XX::YesNoCancelBox List of all members.

Public Methods

 MessageBox (const string &title, const string &message, int style=info)

Protected Methods

void on_dlg_init ()
 We redefine here so we get called on construction.

void show_message ()

Protected Attributes

string msg
 Prompt the user.


Constructor & Destructor Documentation

NDK_XX::MessageBox::MessageBox const string &    title,
const string &    message,
int    style = info
 

Definition at line 2567 of file ndk++.cc.

Referenced by NDK_XX::DialogBox::on_dlg_term().

02568     : DialogBox(10000,title,LINES-15,COLS-30,7,15,style),msg(message)
02569 {
02570 }


Member Function Documentation

void NDK_XX::MessageBox::on_dlg_init   [protected, virtual]
 

We redefine here so we get called on construction.

Reimplemented from NDK_XX::DialogBox.

Definition at line 2574 of file ndk++.cc.

References NDK_XX::DialogBox::create_buttons(), NDK_XX::Control::framed, NDK_XX::DialogBox::pBtnCancel, NDK_XX::DialogBox::pBtnNo, NDK_XX::DialogBox::set_focus_to(), NDK_XX::Control::set_style(), show_message(), NDK_XX::Control::styles, and NDK_XX::Control::title.

02575 {   
02576     set_style(styles(title|framed));
02577     DialogBox::on_dlg_init();
02578     show_message();
02579     create_buttons(); 
02580     if(pBtnCancel)
02581         set_focus_to(pBtnCancel);
02582     else if(pBtnNo)
02583         set_focus_to(pBtnNo);
02584 }

void NDK_XX::MessageBox::show_message   [protected]
 

Definition at line 2588 of file ndk++.cc.

References msg.

Referenced by on_dlg_init().

02589 {
02590     int max_row_size = width()-4;
02591     int rows = msg.size()/max_row_size;
02592     if(msg.size()%max_row_size)
02593         rows++;
02594     
02595     for(int i=0;i<rows && i< maxy()-3;i++){
02596         string what(msg.substr(max_row_size*i,max_row_size));
02597         centertext(i+2,what.c_str());
02598     }
02599 }


Member Data Documentation

string NDK_XX::MessageBox::msg [protected]
 

Prompt the user.

Definition at line 1792 of file ndk++.h.

Referenced by show_message().


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 16:02:20 2002 by doxygen1.2.17