// @(#)root/gui:$Id$
// Author: Fons Rademakers   09/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGMsgBox
#define ROOT_TGMsgBox


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TMsgBox                                                              //
//                                                                      //
// A message dialog box.                                                //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGString
#include "TGString.h"
#endif
#ifndef ROOT_TGPicture
#include "TGPicture.h"
#endif
#ifndef ROOT_TGWidget
#include "TGWidget.h"
#endif


//--- Icon types

enum EMsgBoxIcon {
   kMBIconStop,
   kMBIconQuestion,
   kMBIconExclamation,
   kMBIconAsterisk
};

//--- Button types and return codes

enum EMsgBoxButton {
   kMBYes     = BIT(0),
   kMBNo      = BIT(1),
   kMBOk      = BIT(2),
   kMBApply   = BIT(3),
   kMBRetry   = BIT(4),
   kMBIgnore  = BIT(5),
   kMBCancel  = BIT(6),
   kMBClose   = BIT(7),
   kMBDismiss = BIT(8),
   kMBYesAll  = BIT(9),
   kMBNoAll   = BIT(10),
   kMBAppend  = BIT(11),
   kMBNewer   = BIT(12)
};


class TGButton;
class TGIcon;
class TGLabel;


class TGMsgBox : public TGTransientFrame {

protected:
   TGButton            *fYes, *fNo, *fOK, *fApply;   // buttons in dialog box
   TGButton            *fRetry, *fIgnore, *fCancel;  // buttons in dialog box
   TGButton            *fClose, *fYesAll, *fNoAll;   // buttons in dialog box
   TGButton            *fNewer, *fAppend, *fDismiss; // buttons in dialog box
   TGIcon              *fIcon;                       // icon
   TGHorizontalFrame   *fButtonFrame;                // frame containing buttons
   TGHorizontalFrame   *fIconFrame;                  // frame containing icon and text
   TGVerticalFrame     *fLabelFrame;                 // frame containing text
   TGLayoutHints       *fL1, *fL2, *fL3, *fL4, *fL5; // layout hints
   TList               *fMsgList;                    // text (list of TGLabels)
   Int_t               *fRetCode;                    // address to store return code

   void PMsgBox(const char *title, const char *msg, const TGPicture *icon,
                Int_t buttons, Int_t *ret_code, Int_t text_align);

private:
   TGMsgBox(const TGMsgBox&);              // not implemented
   TGMsgBox& operator=(const TGMsgBox&);   // not implemented

public:
   TGMsgBox(const TGWindow *p = 0, const TGWindow *main = 0,
            const char *title = 0, const char *msg = 0, const TGPicture *icon = 0,
            Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
            UInt_t options = kVerticalFrame,
            Int_t text_align = kTextCenterX | kTextCenterY);
   TGMsgBox(const TGWindow *p, const TGWindow *main,
            const char *title, const char *msg, EMsgBoxIcon icon,
            Int_t buttons = kMBDismiss, Int_t *ret_code = 0,
            UInt_t options = kVerticalFrame,
            Int_t text_align = kTextCenterX | kTextCenterY);
   virtual ~TGMsgBox();

   virtual void CloseWindow();
   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
   virtual Bool_t HandleKey(Event_t* event);

   ClassDef(TGMsgBox,0)  // A message dialog box
};

#endif
 TGMsgBox.h:1
 TGMsgBox.h:2
 TGMsgBox.h:3
 TGMsgBox.h:4
 TGMsgBox.h:5
 TGMsgBox.h:6
 TGMsgBox.h:7
 TGMsgBox.h:8
 TGMsgBox.h:9
 TGMsgBox.h:10
 TGMsgBox.h:11
 TGMsgBox.h:12
 TGMsgBox.h:13
 TGMsgBox.h:14
 TGMsgBox.h:15
 TGMsgBox.h:16
 TGMsgBox.h:17
 TGMsgBox.h:18
 TGMsgBox.h:19
 TGMsgBox.h:20
 TGMsgBox.h:21
 TGMsgBox.h:22
 TGMsgBox.h:23
 TGMsgBox.h:24
 TGMsgBox.h:25
 TGMsgBox.h:26
 TGMsgBox.h:27
 TGMsgBox.h:28
 TGMsgBox.h:29
 TGMsgBox.h:30
 TGMsgBox.h:31
 TGMsgBox.h:32
 TGMsgBox.h:33
 TGMsgBox.h:34
 TGMsgBox.h:35
 TGMsgBox.h:36
 TGMsgBox.h:37
 TGMsgBox.h:38
 TGMsgBox.h:39
 TGMsgBox.h:40
 TGMsgBox.h:41
 TGMsgBox.h:42
 TGMsgBox.h:43
 TGMsgBox.h:44
 TGMsgBox.h:45
 TGMsgBox.h:46
 TGMsgBox.h:47
 TGMsgBox.h:48
 TGMsgBox.h:49
 TGMsgBox.h:50
 TGMsgBox.h:51
 TGMsgBox.h:52
 TGMsgBox.h:53
 TGMsgBox.h:54
 TGMsgBox.h:55
 TGMsgBox.h:56
 TGMsgBox.h:57
 TGMsgBox.h:58
 TGMsgBox.h:59
 TGMsgBox.h:60
 TGMsgBox.h:61
 TGMsgBox.h:62
 TGMsgBox.h:63
 TGMsgBox.h:64
 TGMsgBox.h:65
 TGMsgBox.h:66
 TGMsgBox.h:67
 TGMsgBox.h:68
 TGMsgBox.h:69
 TGMsgBox.h:70
 TGMsgBox.h:71
 TGMsgBox.h:72
 TGMsgBox.h:73
 TGMsgBox.h:74
 TGMsgBox.h:75
 TGMsgBox.h:76
 TGMsgBox.h:77
 TGMsgBox.h:78
 TGMsgBox.h:79
 TGMsgBox.h:80
 TGMsgBox.h:81
 TGMsgBox.h:82
 TGMsgBox.h:83
 TGMsgBox.h:84
 TGMsgBox.h:85
 TGMsgBox.h:86
 TGMsgBox.h:87
 TGMsgBox.h:88
 TGMsgBox.h:89
 TGMsgBox.h:90
 TGMsgBox.h:91
 TGMsgBox.h:92
 TGMsgBox.h:93
 TGMsgBox.h:94
 TGMsgBox.h:95
 TGMsgBox.h:96
 TGMsgBox.h:97
 TGMsgBox.h:98
 TGMsgBox.h:99
 TGMsgBox.h:100
 TGMsgBox.h:101
 TGMsgBox.h:102
 TGMsgBox.h:103
 TGMsgBox.h:104
 TGMsgBox.h:105
 TGMsgBox.h:106
 TGMsgBox.h:107
 TGMsgBox.h:108
 TGMsgBox.h:109
 TGMsgBox.h:110
 TGMsgBox.h:111
 TGMsgBox.h:112
 TGMsgBox.h:113