ENH: fix uppercase version so defines are not upper as well
[cmake.git] / Source / CursesDialog / cmCursesStringWidget.h
blob53f0f7bcb6218184e3122c7f0c2389a8a314b237
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCursesStringWidget.h,v $
5 Language: C++
6 Date: $Date: 2006-03-16 15:44:55 $
7 Version: $Revision: 1.6 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef __cmCursesStringWidget_h
18 #define __cmCursesStringWidget_h
20 #include "cmCursesWidget.h"
22 class cmCursesMainForm;
24 /** \class cmCursesStringWidget
25 * \brief A simple entry widget.
27 * cmCursesStringWdiget is a simple text entry widget.
30 class cmCursesStringWidget : public cmCursesWidget
32 public:
33 cmCursesStringWidget(int width, int height, int left, int top);
35 /**
36 * Handle user input. Called by the container of this widget
37 * when this widget has focus. Returns true if the input was
38 * handled.
40 virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
42 /**
43 * Set/Get the string.
45 void SetString(const char* value);
46 const char* GetString();
47 virtual const char* GetValue();
49 /**
50 * Set/Get InEdit flag. Can be used to tell the widget to leave
51 * edit mode (in case of a resize for example).
53 void SetInEdit(bool inedit) { this->InEdit = inedit; }
54 bool GetInEdit() { return this->InEdit; }
56 /**
57 * This method is called when different keys are pressed. The
58 * subclass can have a special implementation handler for this.
60 virtual void OnTab(cmCursesMainForm* fm, WINDOW* w);
61 virtual void OnReturn(cmCursesMainForm* fm, WINDOW* w);
62 virtual void OnType(int& key, cmCursesMainForm* fm, WINDOW* w);
64 /**
65 * If there are any, print the widget specific commands
66 * in the toolbar and return true. Otherwise, return false
67 * and the parent widget will print.
69 virtual bool PrintKeys();
71 protected:
72 cmCursesStringWidget(const cmCursesStringWidget& from);
73 void operator=(const cmCursesStringWidget&);
75 // true if the widget is in edit mode
76 bool InEdit;
77 char* OriginalString;
78 bool Done;
81 #endif // __cmCursesStringWidget_h