1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCursesWidget.h,v $
6 Date: $Date: 2006/03/16 15:44:55 $
7 Version: $Revision: 1.8 $
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 __cmCursesWidget_h
18 #define __cmCursesWidget_h
20 #include "../cmCacheManager.h"
21 #include "cmCursesStandardIncludes.h"
23 class cmCursesMainForm
;
28 cmCursesWidget(int width
, int height
, int left
, int top
);
29 virtual ~cmCursesWidget();
32 * Handle user input. Called by the container of this widget
33 * when this widget has focus. Returns true if the input was
36 virtual bool HandleInput(int& key
, cmCursesMainForm
* fm
, WINDOW
* w
) = 0;
39 * Change the position of the widget. Set isNewPage to true
40 * if this widget marks the beginning of a new page.
42 virtual void Move(int x
, int y
, bool isNewPage
);
45 * Set/Get the value (setting the value also changes the contents
46 * of the field buffer).
48 virtual void SetValue(const char* value
);
49 virtual const char* GetValue();
52 * Get the type of the widget (STRING, PATH etc...)
54 cmCacheManager::CacheEntryType
GetType()
55 { return this->Type
; }
58 * If there are any, print the widget specific commands
59 * in the toolbar and return true. Otherwise, return false
60 * and the parent widget will print.
62 virtual bool PrintKeys()
68 * Set/Get the page this widget is in.
70 void SetPage(int page
)
79 friend class cmCursesMainForm
;
82 cmCursesWidget(const cmCursesWidget
& from
);
83 void operator=(const cmCursesWidget
&);
85 cmCacheManager::CacheEntryType Type
;
88 // The page in the main form this widget is in
92 #endif // __cmCursesWidget_h