Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::msgbox Class Reference

Prefabricated modal dialog box (with text, icon and actions buttons) that informs and instructs the user. More...

Public Types

enum  icon_t {
  icon_none, icon_information, icon_warning, icon_error,
  icon_question
}
 Identifiers of icons. More...
 
enum  button_t { ok, yes_no, yes_no_cancel }
 Identifiers of buttons. More...
 
enum  pick_t { pick_ok, pick_yes, pick_no, pick_cancel }
 Identifiers of buttons that a user clicked. More...
 

Public Member Functions

 msgbox ()
 Default constructor that creates a message box with default title and default button, the default button is OK. More...
 
 msgbox (const msgbox &)
 Copy constructor from an existing msgbox object. More...
 
msgboxoperator= (const msgbox &)
 Assign from an existing msgbox object. More...
 
 msgbox (const ::std::string &)
 Constructor that creates a message box with a specified title and default button. More...
 
 msgbox (window, const ::std::string &, button_t=ok)
 Constructor that creates a message box with an owner window, a specified title and buttons. More...
 
msgboxicon (icon_t)
 Sets an icon for informing user. More...
 
void clear ()
 Clears the text message buffer. More...
 
msgboxoperator<< (const std::wstring &)
 Writes a string to the buffer. More...
 
msgboxoperator<< (const wchar_t *)
 Writes a string to the buffer. More...
 
msgboxoperator<< (const std::string &)
 Writes a UTF-8 string to the buffer. More...
 
msgboxoperator<< (const char *)
 Writes a UTF-8 string to the buffer. More...
 
msgboxoperator<< (const nana::charset &)
 Writes a string to the buffer. More...
 
msgboxoperator<< (std::ostream &(*)(std::ostream &))
 
template<typename T >
msgboxoperator<< (const T &t)
 Write a streamable object to the buffer. More...
 
pick_t show () const
 Displays the message buffered in the stream. More...
 
pick_t operator() () const
 A function object method alternative to show() More...
 

Detailed Description

Prefabricated modal dialog box (with text, icon and actions buttons) that informs and instructs the user.

Examples:
categ.cpp, helloworld_demo.cpp, inputbox.cpp, label_listener.cpp, mbox.cpp, notepad.cpp, widget_show.cpp, and widget_show2.cpp.

Member Enumeration Documentation

Identifiers of buttons.

Enumerator
ok 
yes_no 
yes_no_cancel 

Identifiers of icons.

Enumerator
icon_none 
icon_information 
icon_warning 
icon_error 
icon_question 

Identifiers of buttons that a user clicked.

Enumerator
pick_ok 
pick_yes 
pick_no 
pick_cancel 

Constructor & Destructor Documentation

nana::msgbox::msgbox ( )

Default constructor that creates a message box with default title and default button, the default button is OK.

nana::msgbox::msgbox ( const msgbox rhs)

Copy constructor from an existing msgbox object.

nana::msgbox::msgbox ( const ::std::string )

Constructor that creates a message box with a specified title and default button.

nana::msgbox::msgbox ( window  ,
const ::std::string ,
button_t  = ok 
)

Constructor that creates a message box with an owner window, a specified title and buttons.

Member Function Documentation

void nana::msgbox::clear ( )

Clears the text message buffer.

Examples:
widget_show.cpp, and widget_show2.cpp.
msgbox & nana::msgbox::icon ( icon_t  ic)

Sets an icon for informing user.

Examples:
helloworld_demo.cpp, mbox.cpp, widget_show.cpp, and widget_show2.cpp.
pick_t nana::msgbox::operator() ( ) const
inline

A function object method alternative to show()

msgbox & nana::msgbox::operator<< ( const std::wstring str)

Writes a string to the buffer.

msgbox & nana::msgbox::operator<< ( const wchar_t *  str)

Writes a string to the buffer.

msgbox & nana::msgbox::operator<< ( const std::string u8str)

Writes a UTF-8 string to the buffer.

msgbox & nana::msgbox::operator<< ( const char *  u8str)

Writes a UTF-8 string to the buffer.

msgbox & nana::msgbox::operator<< ( const nana::charset cs)

Writes a string to the buffer.

msgbox& nana::msgbox::operator<< ( std::ostream *)(std::ostream &)
template<typename T >
msgbox& nana::msgbox::operator<< ( const T &  t)
inline

Write a streamable object to the buffer.

msgbox & nana::msgbox::operator= ( const msgbox rhs)

Assign from an existing msgbox object.

msgbox::pick_t nana::msgbox::show ( ) const

Displays the message buffered in the stream.

Returns
, the button the user clicked.
Examples:
inputbox.cpp, and notepad.cpp.