1 /**
2  *  Yudit Unicode Editor Source File
3  *
4  *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License, version 2,
8  *  dated June 1991. See file COPYYING for details.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef SDialog_h
21 #define SDialog_h
22 
23 #include "swidget/SFrame.h"
24 #include "swidget/SButton.h"
25 #include "swidget/SLabel.h"
26 
27 class SDialog : public SFrame, public SButtonListener,
28   public SFrameListener
29 {
30 public:
31   enum SType { SS_ERR=0, SS_WARN=1, SS_INFO=2, SS_QUESTION, SS_OK_CANCEL, SS_NONE=3 };
32   SDialog (SPanel* dialogPanel);
33   virtual ~SDialog ();
34   bool  getInput (SType  messageType);
35   virtual void setBackground (const SColor& bg);
36   virtual void setTitleForeground (const SColor& fg);
37   virtual void setFont (const SString& font, double fontSize=0.0);
38   virtual void setFontSize (double fontSize);
39 protected:
40   virtual void keyPressed (SWindow * w, SKey key, const SString& s,
41           bool ctrl, bool shift, bool meta);
42   virtual void buttonPressedAccel (void* source, const SAccelerator* acc);
43   virtual bool close (SPanel* comp);
44   SType    type;
45   SPanel*  dialogPanel;
46   void     recalc ();
47   bool     isCancel;
48   SButton* yesButton;
49   SButton* noButton;
50   bool     firstTimeShow;
51 };
52 
53 #endif /* SDialog_h */
54