Logo ROOT  
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 #include "TGFrame.h"
25 #include "TGString.h"
26 #include "TGPicture.h"
27 #include "TGWidget.h"
28 
29 
30 //--- Icon types
31 
37 };
38 
39 //--- Button types and return codes
40 
42  kMBYes = BIT(0),
43  kMBNo = BIT(1),
44  kMBOk = BIT(2),
45  kMBApply = BIT(3),
46  kMBRetry = BIT(4),
47  kMBIgnore = BIT(5),
48  kMBCancel = BIT(6),
49  kMBClose = BIT(7),
51  kMBYesAll = BIT(9),
52  kMBNoAll = BIT(10),
53  kMBAppend = BIT(11),
54  kMBNewer = BIT(12)
55 };
56 
57 
58 class TGButton;
59 class TGIcon;
60 class TGLabel;
61 
62 
63 class TGMsgBox : public TGTransientFrame {
64 
65 protected:
66  TGButton *fYes, *fNo, *fOK, *fApply; // buttons in dialog box
67  TGButton *fRetry, *fIgnore, *fCancel; // buttons in dialog box
68  TGButton *fClose, *fYesAll, *fNoAll; // buttons in dialog box
69  TGButton *fNewer, *fAppend, *fDismiss; // buttons in dialog box
70  TGIcon *fIcon; // icon
71  TGHorizontalFrame *fButtonFrame; // frame containing buttons
72  TGHorizontalFrame *fIconFrame; // frame containing icon and text
73  TGVerticalFrame *fLabelFrame; // frame containing text
74  TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fL5; // layout hints
75  TList *fMsgList; // text (list of TGLabels)
76  Int_t *fRetCode; // address to store return code
77 
78  void PMsgBox(const char *title, const char *msg, const TGPicture *icon,
79  Int_t buttons, Int_t *ret_code, Int_t text_align);
80 
81 private:
82  TGMsgBox(const TGMsgBox&); // not implemented
83  TGMsgBox& operator=(const TGMsgBox&); // not implemented
84 
85 public:
86  TGMsgBox(const TGWindow *p = 0, const TGWindow *main = 0,
87  const char *title = 0, const char *msg = 0, const TGPicture *icon = 0,
88  Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
89  UInt_t options = kVerticalFrame,
90  Int_t text_align = kTextCenterX | kTextCenterY);
91  TGMsgBox(const TGWindow *p, const TGWindow *main,
92  const char *title, const char *msg, EMsgBoxIcon icon,
93  Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
94  UInt_t options = kVerticalFrame,
95  Int_t text_align = kTextCenterX | kTextCenterY);
96  virtual ~TGMsgBox();
97 
98  virtual void CloseWindow();
99  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
100  virtual Bool_t HandleKey(Event_t* event);
101 
102  ClassDef(TGMsgBox,0) // A message dialog box
103 };
104 
105 #endif
TGMsgBox::fNewer
TGButton * fNewer
Definition: TGMsgBox.h:69
kMBIconQuestion
@ kMBIconQuestion
Definition: TGMsgBox.h:40
TGMsgBox::fRetry
TGButton * fRetry
Definition: TGMsgBox.h:67
TGMsgBox::fDismiss
TGButton * fDismiss
Definition: TGMsgBox.h:69
TGTransientFrame
Definition: TGFrame.h:553
TGMsgBox::fCancel
TGButton * fCancel
Definition: TGMsgBox.h:67
TGWindow
Definition: TGWindow.h:31
TGMsgBox::fMsgList
TList * fMsgList
Definition: TGMsgBox.h:75
TGPicture
Definition: TGPicture.h:36
TGMsgBox::fL4
TGLayoutHints * fL4
Definition: TGMsgBox.h:74
TGPicture.h
kMBCancel
@ kMBCancel
Definition: TGMsgBox.h:48
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGMsgBox
Definition: TGMsgBox.h:63
TGLabel
Definition: TGLabel.h:32
TGMsgBox::fAppend
TGButton * fAppend
Definition: TGMsgBox.h:69
TGMsgBox::fOK
TGButton * fOK
Definition: TGMsgBox.h:66
TGMsgBox::fNoAll
TGButton * fNoAll
Definition: TGMsgBox.h:68
TGMsgBox::fL2
TGLayoutHints * fL2
Definition: TGMsgBox.h:74
kMBYes
@ kMBYes
Definition: TGMsgBox.h:42
TGMsgBox::fIcon
TGIcon * fIcon
Definition: TGMsgBox.h:70
TGMsgBox::operator=
TGMsgBox & operator=(const TGMsgBox &)
kTextCenterX
@ kTextCenterX
Definition: TGWidget.h:42
TGMsgBox::PMsgBox
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:116
TGMsgBox::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message dialog box event.
Definition: TGMsgBox.cxx:359
TGMsgBox::TGMsgBox
TGMsgBox(const TGMsgBox &)
TGHorizontalFrame
Definition: TGFrame.h:423
kTextCenterY
@ kTextCenterY
Definition: TGWidget.h:45
kMBIgnore
@ kMBIgnore
Definition: TGMsgBox.h:47
kMBApply
@ kMBApply
Definition: TGMsgBox.h:45
kMBNo
@ kMBNo
Definition: TGMsgBox.h:43
kMBDismiss
@ kMBDismiss
Definition: TGMsgBox.h:50
TGMsgBox::fL1
TGLayoutHints * fL1
Definition: TGMsgBox.h:74
bool
TGMsgBox::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle enter and escape keys (used as Ok and Cancel for now).
Definition: TGMsgBox.cxx:382
kMBClose
@ kMBClose
Definition: TGMsgBox.h:49
TGMsgBox::fClose
TGButton * fClose
Definition: TGMsgBox.h:68
TGIcon
Definition: TGIcon.h:30
kMBNoAll
@ kMBNoAll
Definition: TGMsgBox.h:52
EMsgBoxButton
EMsgBoxButton
Definition: TGMsgBox.h:41
kMBNewer
@ kMBNewer
Definition: TGMsgBox.h:54
TGMsgBox::fNo
TGButton * fNo
Definition: TGMsgBox.h:66
TGVerticalFrame
Definition: TGFrame.h:412
TGMsgBox::fL5
TGLayoutHints * fL5
Definition: TGMsgBox.h:74
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:41
TGMsgBox::~TGMsgBox
virtual ~TGMsgBox()
Destroy message dialog box.
Definition: TGMsgBox.cxx:320
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
main
int main(int argc, char **argv)
Definition: histspeedtest.cxx:752
TGLayoutHints
Definition: TGLayout.h:57
BIT
#define BIT(n)
Definition: Rtypes.h:85
TGWidget.h
TGString.h
kMBAppend
@ kMBAppend
Definition: TGMsgBox.h:53
unsigned int
kMBOk
@ kMBOk
Definition: TGMsgBox.h:44
TGMsgBox::CloseWindow
virtual void CloseWindow()
Close dialog box.
Definition: TGMsgBox.cxx:350
TGMsgBox::fYesAll
TGButton * fYesAll
Definition: TGMsgBox.h:68
TGMsgBox::fIgnore
TGButton * fIgnore
Definition: TGMsgBox.h:67
TGMsgBox::fL3
TGLayoutHints * fL3
Definition: TGMsgBox.h:74
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
Event_t
Definition: GuiTypes.h:173
kMBIconAsterisk
@ kMBIconAsterisk
Definition: TGMsgBox.h:42
TGMsgBox::fButtonFrame
TGHorizontalFrame * fButtonFrame
Definition: TGMsgBox.h:71
TGMsgBox::fLabelFrame
TGVerticalFrame * fLabelFrame
Definition: TGMsgBox.h:73
EMsgBoxIcon
EMsgBoxIcon
Definition: TGMsgBox.h:32
TGButton
Definition: TGButton.h:68
TGMsgBox::fRetCode
Int_t * fRetCode
Definition: TGMsgBox.h:76
kMBRetry
@ kMBRetry
Definition: TGMsgBox.h:46
kMBIconStop
@ kMBIconStop
Definition: TGMsgBox.h:39
TGMsgBox::fApply
TGButton * fApply
Definition: TGMsgBox.h:66
TGMsgBox::fIconFrame
TGHorizontalFrame * fIconFrame
Definition: TGMsgBox.h:72
kMBYesAll
@ kMBYesAll
Definition: TGMsgBox.h:51
TList
Definition: TList.h:44
TGMsgBox::fYes
TGButton * fYes
Definition: TGMsgBox.h:66
int