libyui-mga  1.0.7
YMGAMessageBox Class Reference

Public Types

enum  DLG_BUTTON { B_ONE = 0, B_TWO = 1 }
 
enum  DLG_MODE { D_NORMAL, D_INFO, D_WARNING }
 

Public Member Functions

 YMGAMessageBox (DLG_BUTTON b_num=B_ONE, DLG_MODE dlg_mode=D_NORMAL)
 The constructor. More...
 
virtual ~YMGAMessageBox ()
 Destructor.
 
void setIcon (const std::string &icon)
 sets the message box icon (full path) More...
 
void setTitle (const std::string &title)
 sets the message box title More...
 
void setText (const std::string &text, bool useRichText=false)
 sets the message box text information More...
 
void setMinSize (YLayoutSize_t minWidth, YLayoutSize_t minHeight)
 sets the dilaog box minimum size according to YWidgetFactory::createMinSize() More...
 
void setButtonLabel (const std::string &label, DLG_BUTTON button=B_ONE)
 sets the message box button name (empty string is assigned by default) More...
 
void setDefaultButton (DLG_BUTTON button=B_ONE)
 sets the message box default button More...
 
DLG_BUTTON show ()
 it shows the message box dialog using data set by user. More...
 

Detailed Description

Definition at line 34 of file YMGAMsgBox.h.

Member Enumeration Documentation

◆ DLG_BUTTON

Enumerator
B_ONE 

One button dialog, or button one pressed.

B_TWO 

two buttons dialog, or button two pressed

Definition at line 37 of file YMGAMsgBox.h.

◆ DLG_MODE

Enumerator
D_NORMAL 

Normal dialog.

D_INFO 

Info dialog.

D_WARNING 

Warning dialog.

Definition at line 44 of file YMGAMsgBox.h.

Constructor & Destructor Documentation

◆ YMGAMessageBox()

YMGAMessageBox::YMGAMessageBox ( YMGAMessageBox::DLG_BUTTON  b_num = B_ONE,
YMGAMessageBox::DLG_MODE  dlg_mode = D_NORMAL 
)

The constructor.

Note that this object is not a widget, so you must deleted it, if allocated on the heap.

Parameters
b_numB_ONE: one button only, B_TWO Two buttons dialog.
dlg_modeNORMAL, INFO, WARNING dialog
See also
YMGAMessageBox::DLG_BUTTON
YMGAMessageBox::DLG_MODE

Definition at line 70 of file YMGAMsgBox.cc.

Member Function Documentation

◆ setButtonLabel()

void YMGAMessageBox::setButtonLabel ( const std::string &  label,
DLG_BUTTON  button = B_ONE 
)

sets the message box button name (empty string is assigned by default)

Parameters
labelbutton name
buttonbutton to set (B_ONE, or B_TWO if configured for two buttons)

Definition at line 118 of file YMGAMsgBox.cc.

◆ setDefaultButton()

void YMGAMessageBox::setDefaultButton ( DLG_BUTTON  button = B_ONE)

sets the message box default button

Parameters
buttonbutton to set (B_ONE, or B_TWO if configured for two buttons)

Definition at line 126 of file YMGAMsgBox.cc.

◆ setIcon()

void YMGAMessageBox::setIcon ( const std::string &  icon)

sets the message box icon (full path)

Parameters
iconicon pathname

Definition at line 89 of file YMGAMsgBox.cc.

◆ setMinSize()

void YMGAMessageBox::setMinSize ( YLayoutSize_t  minWidth,
YLayoutSize_t  minHeight 
)

sets the dilaog box minimum size according to YWidgetFactory::createMinSize()

Parameters
minWidthdialog min width
minHeightdialog min height

Definition at line 106 of file YMGAMsgBox.cc.

◆ setText()

void YMGAMessageBox::setText ( const std::string &  text,
bool  useRichText = false 
)

sets the message box text information

Parameters
textdialog content text
useRichTextset text using rich text if true

Definition at line 100 of file YMGAMsgBox.cc.

◆ setTitle()

void YMGAMessageBox::setTitle ( const std::string &  title)

sets the message box title

Parameters
titletitle text

Definition at line 95 of file YMGAMsgBox.cc.

◆ show()

YMGAMessageBox::DLG_BUTTON YMGAMessageBox::show ( )

it shows the message box dialog using data set by user.

Returns
which button has been pressed to leave the dialog (B_ONE or B_TWO)

Definition at line 135 of file YMGAMsgBox.cc.


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