MythPopupBox Class Reference

Child of MythDialog used for most popup menus in MythTV. More...

#include <mythdialogs.h>

Inheritance diagram for MythPopupBox:
MythDialog

List of all members.

Public Types

enum  LabelSize { Large, Medium, Small }

Public Slots

virtual void AcceptItem (int)
virtual void accept (void)
virtual void reject (void)

Signals

void popupDone (int)

Public Member Functions

 MythPopupBox (MythMainWindow *parent, const char *name="MythPopupBox")
 MythPopupBox (MythMainWindow *parent, bool graphicPopup, QColor popupForeground, QColor popupBackground, QColor popupHighlight, const char *name="MythPopupBox")
void addWidget (QWidget *widget, bool setAppearance=true)
void addLayout (QLayout *layout, int stretch=0)
QLabel * addLabel (QString caption, LabelSize size=Medium, bool wrap=false)
QAbstractButton * addButton (QString caption, QObject *target=NULL, const char *slot=NULL)
void ShowPopup (QObject *target=NULL, const char *slot=NULL)
void ShowPopupAtXY (int destx, int desty, QObject *target=NULL, const char *slot=NULL)
DialogCode ExecPopup (QObject *target=NULL, const char *slot=NULL)
DialogCode ExecPopupAtXY (int destx, int desty, QObject *target=NULL, const char *slot=NULL)

Static Public Member Functions

static bool showOkPopup (MythMainWindow *parent, const QString &title, const QString &message, QString button_msg=QString())
static DialogCode Show2ButtonPopup (MythMainWindow *parent, const QString &title, const QString &message, const QString &button1msg, const QString &button2msg, DialogCode default_button)
static DialogCode ShowButtonPopup (MythMainWindow *parent, const QString &title, const QString &message, const QStringList &buttonmsgs, DialogCode default_button)
static bool showGetTextPopup (MythMainWindow *parent, QString title, QString message, QString &text)

Protected Slots

void defaultButtonPressedHandler (void)

Protected Member Functions

 ~MythPopupBox ()
bool focusNextPrevChild (bool next)
void keyPressEvent (QKeyEvent *e)

Private Attributes

QVBoxLayout * vbox
QColor popupForegroundColor
int hpadding
int wpadding

Detailed Description

Child of MythDialog used for most popup menus in MythTV.

Deprecated:
Due for removal, use libmythui's MythScreenType, MythDialogBox or MythConfirmationDialog instead

Most users of this class just call one of the static functions These create a dialog and block until it returns with a DialogCode.

When creating an instance yourself and using ExecPopup() or ShowPopup() you can optionally pass it a target and slot for the popupDone(int) signal. It will be sent with the DialogCode that the exec function returns, except it is cast to an int. This is most useful for ShowPopup() which doesn't block or return the result() when the popup is finished.

Definition at line 122 of file mythdialogs.h.


Member Enumeration Documentation

Enumerator:
Large 
Medium 
Small 

Definition at line 135 of file mythdialogs.h.


Constructor & Destructor Documentation

MythPopupBox::MythPopupBox ( MythMainWindow parent,
const char *  name = "MythPopupBox" 
)

Definition at line 257 of file mythdialogs.cpp.

Referenced by ShowButtonPopup(), showGetTextPopup(), and showOkPopup().

MythPopupBox::MythPopupBox ( MythMainWindow parent,
bool  graphicPopup,
QColor  popupForeground,
QColor  popupBackground,
QColor  popupHighlight,
const char *  name = "MythPopupBox" 
)

Definition at line 282 of file mythdialogs.cpp.

MythPopupBox::~MythPopupBox (  )  [inline, protected]

Definition at line 180 of file mythdialogs.h.


Member Function Documentation

void MythPopupBox::addWidget ( QWidget *  widget,
bool  setAppearance = true 
)
void MythPopupBox::addLayout ( QLayout *  layout,
int  stretch = 0 
)

Definition at line 472 of file mythdialogs.cpp.

QLabel * MythPopupBox::addLabel ( QString  caption,
LabelSize  size = Medium,
bool  wrap = false 
)
QAbstractButton * MythPopupBox::addButton ( QString  caption,
QObject *  target = NULL,
const char *  slot = NULL 
)
void MythPopupBox::ShowPopup ( QObject *  target = NULL,
const char *  slot = NULL 
)

Definition at line 477 of file mythdialogs.cpp.

Referenced by ExecPopup().

void MythPopupBox::ShowPopupAtXY ( int  destx,
int  desty,
QObject *  target = NULL,
const char *  slot = NULL 
)

Definition at line 482 of file mythdialogs.cpp.

Referenced by ExecPopupAtXY(), and ShowPopup().

DialogCode MythPopupBox::ExecPopup ( QObject *  target = NULL,
const char *  slot = NULL 
)
DialogCode MythPopupBox::ExecPopupAtXY ( int  destx,
int  desty,
QObject *  target = NULL,
const char *  slot = NULL 
)

Definition at line 615 of file mythdialogs.cpp.

bool MythPopupBox::showOkPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
QString  button_msg = QString() 
) [static]
DialogCode MythPopupBox::Show2ButtonPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
const QString &  button1msg,
const QString &  button2msg,
DialogCode  default_button 
) [static]
DialogCode MythPopupBox::ShowButtonPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
const QStringList &  buttonmsgs,
DialogCode  default_button 
) [static]
bool MythPopupBox::showGetTextPopup ( MythMainWindow parent,
QString  title,
QString  message,
QString &  text 
) [static]
void MythPopupBox::AcceptItem ( int  i  )  [virtual, slot]

Reimplemented from MythDialog.

Definition at line 587 of file mythdialogs.cpp.

Referenced by defaultButtonPressedHandler().

void MythPopupBox::accept ( void   )  [virtual, slot]

Reimplemented from MythDialog.

Definition at line 593 of file mythdialogs.cpp.

Referenced by showGetTextPopup(), and showOkPopup().

void MythPopupBox::reject ( void   )  [virtual, slot]

Reimplemented from MythDialog.

Definition at line 599 of file mythdialogs.cpp.

Referenced by keyPressEvent(), and showGetTextPopup().

void MythPopupBox::popupDone ( int   )  [signal]
bool MythPopupBox::focusNextPrevChild ( bool  next  )  [protected]

Definition at line 324 of file mythdialogs.cpp.

void MythPopupBox::keyPressEvent ( QKeyEvent *  e  )  [protected]

Reimplemented from MythDialog.

Definition at line 566 of file mythdialogs.cpp.

void MythPopupBox::defaultButtonPressedHandler ( void   )  [protected, slot]

Definition at line 626 of file mythdialogs.cpp.

Referenced by addButton().


Member Data Documentation

QVBoxLayout* MythPopupBox::vbox [private]

Definition at line 188 of file mythdialogs.h.

Referenced by addLayout(), addWidget(), and MythPopupBox().

Definition at line 189 of file mythdialogs.h.

Referenced by addWidget(), and MythPopupBox().

int MythPopupBox::hpadding [private]

Definition at line 190 of file mythdialogs.h.

Referenced by MythPopupBox(), and ShowPopupAtXY().

int MythPopupBox::wpadding [private]

Definition at line 190 of file mythdialogs.h.

Referenced by MythPopupBox(), and ShowPopupAtXY().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:16 2012 for MythTV by  doxygen 1.6.3