libyui-ncurses  2.44.1
 All Classes Functions Variables
NCPopupInfo.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: NCPopupInfo.h
20 
21  Author: Gabriele Strattner <gs@suse.de>
22 
23 /-*/
24 
25 #ifndef NCPopupInfo_h
26 #define NCPopupInfo_h
27 
28 #include <iosfwd>
29 
30 #include <vector>
31 #include <string>
32 
33 #include "NCPopup.h"
34 #include "NCComboBox.h"
35 #include "NCLabel.h"
36 #include "NCRichText.h"
37 #include "NCCheckBox.h"
38 #include "NCPushButton.h"
39 #include "NCi18n.h"
40 
41 
42 /*
43  Textdomain "ncurses"
44  */
45 
46 
47 
48 class NCPopupInfo : public NCPopup
49 {
50 private:
51 
52  NCPopupInfo & operator=( const NCPopupInfo & );
53  NCPopupInfo( const NCPopupInfo & );
54 
55 
56  NCRichText * helpText;
57  NCPushButton * okButton;
58  NCPushButton * cancelButton;
59 
60  int hDim;
61  int vDim;
62  bool visible;
63 
64 protected:
65 
66  virtual bool postAgain();
67 
68  virtual NCursesEvent wHandleInput( wint_t ch );
69 
70 public:
71 
72  NCPopupInfo( const wpos at,
73  const std::string & headline,
74  const std::string & text,
75  // the label of an OK button
76  std::string okButtonLabel = _( "&OK" ),
77  std::string cancelButtonLabel = "" );
78 
79  virtual ~NCPopupInfo();
80 
81  virtual int preferredWidth();
82  virtual int preferredHeight();
83 
84  void createLayout( const std::string & headline,
85  const std::string & text,
86  std::string okButtonLabel,
87  std::string cancelButtonLabel );
88 
89  NCursesEvent & showInfoPopup( );
90 
91  void popup();
92 
93  void popdown();
94 
95  bool isVisible() { return visible; }
96 
97  void setPreferredSize( int horiz, int vert ) { hDim = horiz; vDim = vert; }
98 
99  void focusOkButton() { okButton->setKeyboardFocus(); }
100 
101  void focusCancelButton() { cancelButton->setKeyboardFocus(); }
102 
103 };
104 
105 
106 
107 #endif // NCPopupInfo_h
Definition: position.h:109