File indexing completed on 2025-01-18 10:12:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGMsgBox
0013 #define ROOT_TGMsgBox
0014
0015
0016 #include "TGFrame.h"
0017 #include "TGWidget.h"
0018
0019
0020
0021 enum EMsgBoxIcon {
0022 kMBIconStop,
0023 kMBIconQuestion,
0024 kMBIconExclamation,
0025 kMBIconAsterisk
0026 };
0027
0028
0029
0030 enum EMsgBoxButton {
0031 kMBYes = BIT(0),
0032 kMBNo = BIT(1),
0033 kMBOk = BIT(2),
0034 kMBApply = BIT(3),
0035 kMBRetry = BIT(4),
0036 kMBIgnore = BIT(5),
0037 kMBCancel = BIT(6),
0038 kMBClose = BIT(7),
0039 kMBDismiss = BIT(8),
0040 kMBYesAll = BIT(9),
0041 kMBNoAll = BIT(10),
0042 kMBAppend = BIT(11),
0043 kMBNewer = BIT(12)
0044 };
0045
0046
0047 class TGButton;
0048 class TGIcon;
0049 class TGLabel;
0050
0051
0052 class TGMsgBox : public TGTransientFrame {
0053
0054 protected:
0055 TGButton *fYes, *fNo, *fOK, *fApply;
0056 TGButton *fRetry, *fIgnore, *fCancel;
0057 TGButton *fClose, *fYesAll, *fNoAll;
0058 TGButton *fNewer, *fAppend, *fDismiss;
0059 TGIcon *fIcon;
0060 TGHorizontalFrame *fButtonFrame;
0061 TGHorizontalFrame *fIconFrame;
0062 TGVerticalFrame *fLabelFrame;
0063 TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fL5;
0064 TList *fMsgList;
0065 Int_t *fRetCode;
0066
0067 void PMsgBox(const char *title, const char *msg, const TGPicture *icon,
0068 Int_t buttons, Int_t *ret_code, Int_t text_align);
0069
0070 private:
0071 TGMsgBox(const TGMsgBox&) = delete;
0072 TGMsgBox& operator=(const TGMsgBox&) = delete;
0073
0074 public:
0075 TGMsgBox(const TGWindow *p = nullptr, const TGWindow *main = nullptr,
0076 const char *title = nullptr, const char *msg = nullptr, const TGPicture *icon = nullptr,
0077 Int_t buttons = kMBDismiss, Int_t *ret_code = nullptr,
0078 UInt_t options = kVerticalFrame,
0079 Int_t text_align = kTextCenterX | kTextCenterY);
0080 TGMsgBox(const TGWindow *p, const TGWindow *main,
0081 const char *title, const char *msg, EMsgBoxIcon icon,
0082 Int_t buttons = kMBDismiss, Int_t *ret_code = nullptr,
0083 UInt_t options = kVerticalFrame,
0084 Int_t text_align = kTextCenterX | kTextCenterY);
0085 ~TGMsgBox() override;
0086
0087 void CloseWindow() override;
0088 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0089 Bool_t HandleKey(Event_t* event) override;
0090
0091 ClassDefOverride(TGMsgBox,0)
0092 };
0093
0094 #endif