ROOT  6.06/09
Reference Guide
TGMsgBox.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 09/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGMsgBox
13 #define ROOT_TGMsgBox
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TMsgBox //
19 // //
20 // A message dialog box. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TGFrame
25 #include "TGFrame.h"
26 #endif
27 #ifndef ROOT_TGString
28 #include "TGString.h"
29 #endif
30 #ifndef ROOT_TGPicture
31 #include "TGPicture.h"
32 #endif
33 #ifndef ROOT_TGWidget
34 #include "TGWidget.h"
35 #endif
36 
37 
38 //--- Icon types
39 
45 };
46 
47 //--- Button types and return codes
48 
50  kMBYes = BIT(0),
51  kMBNo = BIT(1),
52  kMBOk = BIT(2),
53  kMBApply = BIT(3),
54  kMBRetry = BIT(4),
55  kMBIgnore = BIT(5),
56  kMBCancel = BIT(6),
57  kMBClose = BIT(7),
59  kMBYesAll = BIT(9),
60  kMBNoAll = BIT(10),
61  kMBAppend = BIT(11),
62  kMBNewer = BIT(12)
63 };
64 
65 
66 class TGButton;
67 class TGIcon;
68 class TGLabel;
69 
70 
71 class TGMsgBox : public TGTransientFrame {
72 
73 protected:
74  TGButton *fYes, *fNo, *fOK, *fApply; // buttons in dialog box
75  TGButton *fRetry, *fIgnore, *fCancel; // buttons in dialog box
76  TGButton *fClose, *fYesAll, *fNoAll; // buttons in dialog box
77  TGButton *fNewer, *fAppend, *fDismiss; // buttons in dialog box
78  TGIcon *fIcon; // icon
79  TGHorizontalFrame *fButtonFrame; // frame containing buttons
80  TGHorizontalFrame *fIconFrame; // frame containing icon and text
81  TGVerticalFrame *fLabelFrame; // frame containing text
82  TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fL5; // layout hints
83  TList *fMsgList; // text (list of TGLabels)
84  Int_t *fRetCode; // address to store return code
85 
86  void PMsgBox(const char *title, const char *msg, const TGPicture *icon,
87  Int_t buttons, Int_t *ret_code, Int_t text_align);
88 
89 private:
90  TGMsgBox(const TGMsgBox&); // not implemented
91  TGMsgBox& operator=(const TGMsgBox&); // not implemented
92 
93 public:
94  TGMsgBox(const TGWindow *p = 0, const TGWindow *main = 0,
95  const char *title = 0, const char *msg = 0, const TGPicture *icon = 0,
96  Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
97  UInt_t options = kVerticalFrame,
98  Int_t text_align = kTextCenterX | kTextCenterY);
99  TGMsgBox(const TGWindow *p, const TGWindow *main,
100  const char *title, const char *msg, EMsgBoxIcon icon,
101  Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
102  UInt_t options = kVerticalFrame,
103  Int_t text_align = kTextCenterX | kTextCenterY);
104  virtual ~TGMsgBox();
105 
106  virtual void CloseWindow();
107  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
108  virtual Bool_t HandleKey(Event_t* event);
109 
110  ClassDef(TGMsgBox,0) // A message dialog box
111 };
112 
113 #endif
TGMsgBox & operator=(const TGMsgBox &)
TGButton * fCancel
Definition: TGMsgBox.h:75
TGButton * fIgnore
Definition: TGMsgBox.h:75
#define BIT(n)
Definition: Rtypes.h:120
TGButton * fClose
Definition: TGMsgBox.h:76
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGButton * fOK
Definition: TGMsgBox.h:74
virtual Bool_t HandleKey(Event_t *event)
Handle enter and escape keys (used as Ok and Cancel for now).
Definition: TGMsgBox.cxx:381
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message dialog box event.
Definition: TGMsgBox.cxx:358
#define ClassDef(name, id)
Definition: Rtypes.h:254
TGLayoutHints * fL5
Definition: TGMsgBox.h:82
virtual void CloseWindow()
Close dialog box.
Definition: TGMsgBox.cxx:349
TGMsgBox(const TGMsgBox &)
TGButton * fApply
Definition: TGMsgBox.h:74
Definition: TGIcon.h:34
EMsgBoxIcon
Definition: TGMsgBox.h:40
TGLayoutHints * fL1
Definition: TGMsgBox.h:82
TList * fMsgList
Definition: TGMsgBox.h:83
void PMsgBox(const char *title, const char *msg, const TGPicture *icon, Int_t buttons, Int_t *ret_code, Int_t text_align)
Protected, common message dialog box initialization.
Definition: TGMsgBox.cxx:115
Definition: TGMsgBox.h:51
A doubly linked list.
Definition: TList.h:47
TGLayoutHints * fL4
Definition: TGMsgBox.h:82
Int_t * fRetCode
Definition: TGMsgBox.h:84
TGButton * fAppend
Definition: TGMsgBox.h:77
TGIcon * fIcon
Definition: TGMsgBox.h:78
TGButton * fNoAll
Definition: TGMsgBox.h:76
unsigned int UInt_t
Definition: RtypesCore.h:42
TGButton * fNewer
Definition: TGMsgBox.h:77
long Long_t
Definition: RtypesCore.h:50
int main(int argc, char *argv[])
Definition: python64.c:14
TGButton * fYesAll
Definition: TGMsgBox.h:76
TGButton * fNo
Definition: TGMsgBox.h:74
TGVerticalFrame * fLabelFrame
Definition: TGMsgBox.h:81
virtual ~TGMsgBox()
Destroy message dialog box.
Definition: TGMsgBox.cxx:319
TGHorizontalFrame * fIconFrame
Definition: TGMsgBox.h:80
TGHorizontalFrame * fButtonFrame
Definition: TGMsgBox.h:79
TGLayoutHints * fL3
Definition: TGMsgBox.h:82
EMsgBoxButton
Definition: TGMsgBox.h:49
TGButton * fYes
Definition: TGMsgBox.h:74
TGButton * fRetry
Definition: TGMsgBox.h:75
TGLayoutHints * fL2
Definition: TGMsgBox.h:82
TGButton * fDismiss
Definition: TGMsgBox.h:77
Definition: TGMsgBox.h:52