CFx SDK Documentation  2020SP3
FxMessageBox.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "FxPragmaPush.h"
20 
21 #include "DDKERNEL.h"
22 
23 #include <QtWidgets/QMessageBox>
24 
25 #define MB_SAVEDISCARDCANCEL 0x00000009L
26 
32 class DDKERNEL_API CFxMessageBox : public QMessageBox
33 {
34  Q_OBJECT
35 
36 public:
37  explicit CFxMessageBox(QWidget *parent = 0);
38  CFxMessageBox(QMessageBox::Icon icon, const QString &title, const QString &text,
39  QMessageBox::StandardButtons buttons = NoButton, QWidget *parent = 0,
40  Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
41  CFxMessageBox(const QString &title, const QString &text, QMessageBox::Icon icon,
42  int button0, int button1, int button2,
43  QWidget *parent = 0,
44  Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
45  virtual ~CFxMessageBox();
46 
54  void addButton(QAbstractButton *button, QMessageBox::ButtonRole role);
55 
65  QPushButton *addButton(const QString &text, QMessageBox::ButtonRole role);
66 
75  QPushButton *addButton(QMessageBox::StandardButton button);
76 
84  void setStandardButtons(StandardButtons buttons, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
85 
98  static QMessageBox::StandardButton information(QWidget *parent, const QString &title,
99  const QString &text, QMessageBox::StandardButtons buttons = Ok,
100  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
101 
113  static QMessageBox::StandardButton question(QWidget *parent, const QString &title,
114  const QString &text, QMessageBox::StandardButtons buttons = Ok,
115  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
116 
129  static QMessageBox::StandardButton warning(QWidget *parent, const QString &title,
130  const QString &text, QMessageBox::StandardButtons buttons = Ok,
131  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
132 
145  static QMessageBox::StandardButton critical(QWidget *parent, const QString &title,
146  const QString &text, QMessageBox::StandardButtons buttons = Ok,
147  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
148 
154  virtual int exec();
155 
156 private:
157  static QMessageBox::StandardButton showMessageBox(QMessageBox::Icon icon, QString title, QString text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton, QWidget *parent);
158 
159  virtual void showEvent(QShowEvent *);
160  virtual void hideEvent(QHideEvent *);
161 
162  QCursor m_PreviousCursor;
163 };
164 
165 #include "FxPragmaPop.h"
FxPragmaPop.h
CFxMessageBox::information
static QMessageBox::StandardButton information(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=Ok, QMessageBox::StandardButton defaultButton=QMessageBox::NoButton)
CFxMessageBox::CFxMessageBox
CFxMessageBox(QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=NoButton, QWidget *parent=0, Qt::WindowFlags f=Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint)
DDKERNEL.h
CFxMessageBox::critical
static QMessageBox::StandardButton critical(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=Ok, QMessageBox::StandardButton defaultButton=QMessageBox::NoButton)
CFxMessageBox::exec
virtual int exec()
CFxMessageBox::warning
static QMessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=Ok, QMessageBox::StandardButton defaultButton=QMessageBox::NoButton)
CFxMessageBox::setStandardButtons
void setStandardButtons(StandardButtons buttons, QMessageBox::StandardButton defaultButton=QMessageBox::NoButton)
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxMessageBox::CFxMessageBox
CFxMessageBox(const QString &title, const QString &text, QMessageBox::Icon icon, int button0, int button1, int button2, QWidget *parent=0, Qt::WindowFlags f=Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint)
CFxMessageBox
Definition: FxMessageBox.h:33
f
GLfloat f
Definition: gles2_ext.h:564
CFxMessageBox::addButton
QPushButton * addButton(const QString &text, QMessageBox::ButtonRole role)
CFxMessageBox::addButton
void addButton(QAbstractButton *button, QMessageBox::ButtonRole role)
CFxMessageBox::~CFxMessageBox
virtual ~CFxMessageBox()
FxPragmaPush.h
CFxMessageBox::question
static QMessageBox::StandardButton question(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=Ok, QMessageBox::StandardButton defaultButton=QMessageBox::NoButton)
CFxMessageBox::addButton
QPushButton * addButton(QMessageBox::StandardButton button)
CFxMessageBox::CFxMessageBox
CFxMessageBox(QWidget *parent=0)