TGMsgBox.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGMsgBox.h 23115 2008-04-10 13:35:37Z rdm $
00002 // Author: Fons Rademakers   09/01/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGMsgBox
00013 #define ROOT_TGMsgBox
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TMsgBox                                                              //
00019 //                                                                      //
00020 // A message dialog box.                                                //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGFrame
00025 #include "TGFrame.h"
00026 #endif
00027 #ifndef ROOT_TGString
00028 #include "TGString.h"
00029 #endif
00030 #ifndef ROOT_TGPicture
00031 #include "TGPicture.h"
00032 #endif
00033 #ifndef ROOT_TGWidget
00034 #include "TGWidget.h"
00035 #endif
00036 
00037 
00038 //--- Icon types
00039 
00040 enum EMsgBoxIcon {
00041    kMBIconStop,
00042    kMBIconQuestion,
00043    kMBIconExclamation,
00044    kMBIconAsterisk
00045 };
00046 
00047 //--- Button types and return codes
00048 
00049 enum EMsgBoxButton {
00050    kMBYes     = BIT(0),
00051    kMBNo      = BIT(1),
00052    kMBOk      = BIT(2),
00053    kMBApply   = BIT(3),
00054    kMBRetry   = BIT(4),
00055    kMBIgnore  = BIT(5),
00056    kMBCancel  = BIT(6),
00057    kMBClose   = BIT(7),
00058    kMBDismiss = BIT(8),
00059    kMBYesAll  = BIT(9),
00060    kMBNoAll   = BIT(10),
00061    kMBAppend  = BIT(11),
00062    kMBNewer   = BIT(12)
00063 };
00064 
00065 
00066 class TGButton;
00067 class TGIcon;
00068 class TGLabel;
00069 
00070 
00071 class TGMsgBox : public TGTransientFrame {
00072 
00073 protected:
00074    TGButton            *fYes, *fNo, *fOK, *fApply;   // buttons in dialog box
00075    TGButton            *fRetry, *fIgnore, *fCancel;  // buttons in dialog box
00076    TGButton            *fClose, *fYesAll, *fNoAll;   // buttons in dialog box
00077    TGButton            *fNewer, *fAppend, *fDismiss; // buttons in dialog box
00078    TGIcon              *fIcon;                       // icon
00079    TGHorizontalFrame   *fButtonFrame;                // frame containing buttons
00080    TGHorizontalFrame   *fIconFrame;                  // frame containing icon and text
00081    TGVerticalFrame     *fLabelFrame;                 // frame containing text
00082    TGLayoutHints       *fL1, *fL2, *fL3, *fL4, *fL5; // layout hints
00083    TList               *fMsgList;                    // text (list of TGLabels)
00084    Int_t               *fRetCode;                    // address to store return code
00085 
00086    void PMsgBox(const char *title, const char *msg, const TGPicture *icon,
00087                 Int_t buttons, Int_t *ret_code, Int_t text_align);
00088 
00089 private:
00090    TGMsgBox(const TGMsgBox&);              // not implemented
00091    TGMsgBox& operator=(const TGMsgBox&);   // not implemented
00092 
00093 public:
00094    TGMsgBox(const TGWindow *p = 0, const TGWindow *main = 0,
00095             const char *title = 0, const char *msg = 0, const TGPicture *icon = 0,
00096             Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
00097             UInt_t options = kVerticalFrame,
00098             Int_t text_align = kTextCenterX | kTextCenterY);
00099    TGMsgBox(const TGWindow *p, const TGWindow *main,
00100             const char *title, const char *msg, EMsgBoxIcon icon,
00101             Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
00102             UInt_t options = kVerticalFrame,
00103             Int_t text_align = kTextCenterX | kTextCenterY);
00104    virtual ~TGMsgBox();
00105 
00106    virtual void CloseWindow();
00107    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00108 
00109    ClassDef(TGMsgBox,0)  // A message dialog box
00110 };
00111 
00112 #endif

Generated on Tue Jul 5 14:20:06 2011 for ROOT_528-00b_version by  doxygen 1.5.1