1 // * This makes emacs happy -*-Mode: C++;-*-
2 /****************************************************************************
3 * Copyright 2019,2020 Thomas E. Dickey *
4 * Copyright 1998-2012,2014 Free Software Foundation, Inc. *
6 * Permission is hereby granted, free of charge, to any person obtaining a *
7 * copy of this software and associated documentation files (the *
8 * "Software"), to deal in the Software without restriction, including *
9 * without limitation the rights to use, copy, modify, merge, publish, *
10 * distribute, distribute with modifications, sublicense, and/or sell *
11 * copies of the Software, and to permit persons to whom the Software is *
12 * furnished to do so, subject to the following conditions: *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25 * Except as contained in this notice, the name(s) of the above copyright *
26 * holders shall not be used in advertising or otherwise to promote the *
27 * sale, use or other dealings in this Software without prior written *
29 ****************************************************************************/
31 /****************************************************************************
32 * Author: Juergen Pfeifer, 1997 *
33 ****************************************************************************/
35 // $Id: cursesf.h,v 1.36 2020/05/24 01:40:20 anonymous.maarten Exp $
37 #ifndef NCURSES_CURSESF_H_incl
38 #define NCURSES_CURSESF_H_incl 1
50 // -------------------------------------------------------------------------
51 // The abstract base class for builtin and user defined Fieldtypes.
52 // -------------------------------------------------------------------------
54 class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration
56 // Class to represent builtin field types as well as C++ written new
57 // fieldtypes (see classes UserDefineFieldType...
58 class NCURSES_CXX_IMPEXP NCursesFieldType
60 friend class NCursesFormField;
65 inline void OnError(int err) const THROW2(NCursesException const, NCursesFormException) {
67 THROW(new NCursesFormException (err));
70 NCursesFieldType(FIELDTYPE *f) : fieldtype(f) {
73 virtual ~NCursesFieldType() {}
75 // Set the fields f fieldtype to this one.
76 virtual void set(NCursesFormField& f) = 0;
80 : fieldtype(STATIC_CAST(FIELDTYPE*)(0))
84 NCursesFieldType& operator=(const NCursesFieldType& rhs)
92 NCursesFieldType(const NCursesFieldType& rhs)
93 : fieldtype(rhs.fieldtype)
100 // -------------------------------------------------------------------------
101 // The class representing a forms field, wrapping the lowlevel FIELD struct
102 // -------------------------------------------------------------------------
104 class NCURSES_CXX_IMPEXP NCursesFormField
106 friend class NCursesForm;
109 FIELD *field; // lowlevel structure
110 NCursesFieldType* ftype; // Associated field type
113 inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
115 THROW(new NCursesFormException (err));
119 // Create a 'Null' field. Can be used to delimit a field list
121 : field(STATIC_CAST(FIELD*)(0)),
122 ftype(STATIC_CAST(NCursesFieldType*)(0))
126 // Create a new field
127 NCursesFormField (int rows,
131 int offscreen_rows = 0,
132 int additional_buffers = 0)
134 ftype(STATIC_CAST(NCursesFieldType*)(0))
136 field = ::new_field(rows, ncols, first_row, first_col,
137 offscreen_rows, additional_buffers);
142 NCursesFormField& operator=(const NCursesFormField& rhs)
150 NCursesFormField(const NCursesFormField& rhs)
151 : field(rhs.field), ftype(rhs.ftype)
155 virtual ~NCursesFormField () THROWS(NCursesException);
157 // Duplicate the field at a new position
158 inline NCursesFormField* dup(int first_row, int first_col)
160 NCursesFormField* f = new NCursesFormField();
162 OnError(E_SYSTEM_ERROR);
165 f->field = ::dup_field(field,first_row,first_col);
172 // Link the field to a new location
173 inline NCursesFormField* link(int first_row, int first_col) {
174 NCursesFormField* f = new NCursesFormField();
176 OnError(E_SYSTEM_ERROR);
179 f->field = ::link_field(field,first_row,first_col);
186 // Get the lowlevel field representation
187 inline FIELD* get_field() const {
191 // Retrieve info about the field
192 inline void info(int& rows, int& ncols,
193 int& first_row, int& first_col,
194 int& offscreen_rows, int& additional_buffers) const {
195 OnError(::field_info(field, &rows, &ncols,
196 &first_row, &first_col,
197 &offscreen_rows, &additional_buffers));
200 // Retrieve info about the fields dynamic properties.
201 inline void dynamic_info(int& dynamic_rows, int& dynamic_cols,
202 int& max_growth) const {
203 OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols,
207 // For a dynamic field you may set the maximum growth limit.
208 // A zero means unlimited growth.
209 inline void set_maximum_growth(int growth = 0) {
210 OnError(::set_max_field(field,growth));
213 // Move the field to a new position
214 inline void move(int row, int col) {
215 OnError(::move_field(field,row,col));
218 // Mark the field to start a new page
219 inline void new_page(bool pageFlag = FALSE) {
220 OnError(::set_new_page(field,pageFlag));
223 // Retrieve whether or not the field starts a new page.
224 inline bool is_new_page() const {
225 return ::new_page(field);
228 // Set the justification for the field
229 inline void set_justification(int just) {
230 OnError(::set_field_just(field,just));
233 // Retrieve the fields justification
234 inline int justification() const {
235 return ::field_just(field);
237 // Set the foreground attribute for the field
238 inline void set_foreground(chtype foreground) {
239 OnError(::set_field_fore(field,foreground));
242 // Retrieve the fields foreground attribute
243 inline chtype fore() const {
244 return ::field_fore(field);
247 // Set the background attribute for the field
248 inline void set_background(chtype background) {
249 OnError(::set_field_back(field,background));
252 // Retrieve the fields background attribute
253 inline chtype back() const {
254 return ::field_back(field);
257 // Set the padding character for the field
258 inline void set_pad_character(int padding) {
259 OnError(::set_field_pad(field, padding));
262 // Retrieve the fields padding character
263 inline int pad() const {
264 return ::field_pad(field);
267 // Switch on the fields options
268 inline void options_on (Field_Options opts) {
269 OnError (::field_opts_on (field, opts));
272 // Switch off the fields options
273 inline void options_off (Field_Options opts) {
274 OnError (::field_opts_off (field, opts));
277 // Retrieve the fields options
278 inline Field_Options options () const {
279 return ::field_opts (field);
282 // Set the fields options
283 inline void set_options (Field_Options opts) {
284 OnError (::set_field_opts (field, opts));
287 // Mark the field as changed
288 inline void set_changed(bool changeFlag = TRUE) {
289 OnError(::set_field_status(field,changeFlag));
292 // Test whether or not the field is marked as changed
293 inline bool changed() const {
294 return ::field_status(field);
297 // Return the index of the field in the field array of a form
298 // or -1 if the field is not associated to a form
299 inline int (index)() const {
300 return ::field_index(field);
303 // Store a value in a fields buffer. The default buffer is nr. 0
304 inline void set_value(const char *val, int buffer = 0) {
305 OnError(::set_field_buffer(field,buffer,val));
308 // Retrieve the value of a fields buffer. The default buffer is nr. 0
309 inline char* value(int buffer = 0) const {
310 return ::field_buffer(field,buffer);
313 // Set the validation type of the field.
314 inline void set_fieldtype(NCursesFieldType& f) {
316 f.set(*this); // A good friend may do that...
319 // Retrieve the validation type of the field.
320 inline NCursesFieldType* fieldtype() const {
326 // This are the built-in hook functions in this C++ binding. In C++ we use
327 // virtual member functions (see below On_..._Init and On_..._Termination)
328 // to provide this functionality in an object oriented manner.
330 void _nc_xx_frm_init(FORM *);
331 void _nc_xx_frm_term(FORM *);
332 void _nc_xx_fld_init(FORM *);
333 void _nc_xx_fld_term(FORM *);
337 // -------------------------------------------------------------------------
338 // The class representing a form, wrapping the lowlevel FORM struct
339 // -------------------------------------------------------------------------
341 class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel
344 FORM* form; // the lowlevel structure
347 NCursesWindow* sub; // the subwindow object
348 bool b_sub_owner; // is this our own subwindow?
349 bool b_framed; // has the form a border?
350 bool b_autoDelete; // Delete fields when deleting form?
352 NCursesFormField** my_fields; // The array of fields for this form
354 // This structure is used for the form's user data field to link the
355 // FORM* to the C++ object and to provide extra space for a user pointer.
357 void* m_user; // the pointer for the user's data
358 const NCursesForm* m_back; // backward pointer to C++ object
362 // Get the backward pointer to the C++ object from a FORM
363 static inline NCursesForm* getHook(const FORM *f) {
364 UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
365 assert(hook != 0 && hook->m_owner==f);
366 return const_cast<NCursesForm*>(hook->m_back);
369 friend void _nc_xx_frm_init(FORM *);
370 friend void _nc_xx_frm_term(FORM *);
371 friend void _nc_xx_fld_init(FORM *);
372 friend void _nc_xx_fld_term(FORM *);
374 // Calculate FIELD* array for the menu
375 FIELD** mapFields(NCursesFormField* nfields[]);
379 inline void set_user(void *user) {
380 UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
381 assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
385 inline void *get_user() {
386 UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
387 assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
391 void InitForm (NCursesFormField* Fields[],
393 bool autoDeleteFields);
395 inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
397 THROW(new NCursesFormException (err));
400 // this wraps the form_driver call.
401 virtual int driver (int c) ;
403 // 'Internal' constructor, builds an object without association to a
405 NCursesForm( int nlines,
409 : NCursesPanel(nlines, ncols, begin_y, begin_x),
410 form (STATIC_CAST(FORM*)(0)),
420 // Create form for the default panel.
421 NCursesForm (NCursesFormField* Fields[],
422 bool with_frame=FALSE, // reserve space for a frame?
423 bool autoDelete_Fields=FALSE) // do automatic cleanup?
432 InitForm(Fields, with_frame, autoDelete_Fields);
435 // Create a form in a panel with the given position and size.
436 NCursesForm (NCursesFormField* Fields[],
441 bool with_frame=FALSE, // reserve space for a frame?
442 bool autoDelete_Fields=FALSE) // do automatic cleanup?
443 : NCursesPanel(nlines, ncols, begin_y, begin_x),
451 InitForm(Fields, with_frame, autoDelete_Fields);
454 NCursesForm& operator=(const NCursesForm& rhs)
458 NCursesPanel::operator=(rhs);
463 NCursesForm(const NCursesForm& rhs)
467 b_sub_owner(rhs.b_sub_owner),
468 b_framed(rhs.b_framed),
469 b_autoDelete(rhs.b_autoDelete),
470 my_fields(rhs.my_fields)
474 virtual ~NCursesForm() THROWS(NCursesException);
476 // Set the default attributes for the form
477 virtual void setDefaultAttributes();
479 // Retrieve current field of the form.
480 inline NCursesFormField* current_field() const {
481 return my_fields[::field_index(::current_field(form))];
484 // Set the forms subwindow
485 void setSubWindow(NCursesWindow& sub);
487 // Set these fields for the form
488 inline void setFields(NCursesFormField* Fields[]) {
489 OnError(::set_form_fields(form,mapFields(Fields)));
492 // Remove the form from the screen
493 inline void unpost (void) {
494 OnError (::unpost_form (form));
497 // Post the form to the screen if flag is true, unpost it otherwise
498 inline void post(bool flag = TRUE) {
499 OnError (flag ? ::post_form(form) : ::unpost_form (form));
503 inline void frame(const char *title=NULL, const char* btitle=NULL) {
505 NCursesPanel::frame(title,btitle);
507 OnError(E_SYSTEM_ERROR);
510 inline void boldframe(const char *title=NULL, const char* btitle=NULL) {
512 NCursesPanel::boldframe(title,btitle);
514 OnError(E_SYSTEM_ERROR);
517 inline void label(const char *topLabel, const char *bottomLabel) {
519 NCursesPanel::label(topLabel,bottomLabel);
521 OnError(E_SYSTEM_ERROR);
528 // Called after the form gets repositioned in its window.
529 // This is especially true if the form is posted.
530 virtual void On_Form_Init();
532 // Called before the form gets repositioned in its window.
533 // This is especially true if the form is unposted.
534 virtual void On_Form_Termination();
536 // Called after the field became the current field
537 virtual void On_Field_Init(NCursesFormField& field);
539 // Called before this field is left as current field.
540 virtual void On_Field_Termination(NCursesFormField& field);
542 // Calculate required window size for the form.
543 void scale(int& rows, int& ncols) const {
544 OnError(::scale_form(form,&rows,&ncols));
547 // Retrieve number of fields in the form.
549 return ::field_count(form);
552 // Make the page the current page of the form.
553 void set_page(int pageNum) {
554 OnError(::set_form_page(form, pageNum));
557 // Retrieve current page number
559 return ::form_page(form);
562 // Switch on the forms options
563 inline void options_on (Form_Options opts) {
564 OnError (::form_opts_on (form, opts));
567 // Switch off the forms options
568 inline void options_off (Form_Options opts) {
569 OnError (::form_opts_off (form, opts));
572 // Retrieve the forms options
573 inline Form_Options options () const {
574 return ::form_opts (form);
577 // Set the forms options
578 inline void set_options (Form_Options opts) {
579 OnError (::set_form_opts (form, opts));
582 // Are there more data in the current field after the data shown
583 inline bool data_ahead() const {
584 return ::data_ahead(form);
587 // Are there more data in the current field before the data shown
588 inline bool data_behind() const {
589 return ::data_behind(form);
592 // Position the cursor to the current field
593 inline void position_cursor () {
594 OnError (::pos_form_cursor (form));
596 // Set the current field
597 inline void set_current(NCursesFormField& F) {
598 OnError (::set_current_field(form, F.field));
601 // Provide a default key virtualization. Translate the keyboard
602 // code c into a form request code.
603 // The default implementation provides a hopefully straightforward
604 // mapping for the most common keystrokes and form requests.
605 virtual int virtualize(int c);
608 inline NCursesFormField* operator[](int i) const {
609 if ( (i < 0) || (i >= ::field_count (form)) )
610 OnError (E_BAD_ARGUMENT);
614 // Perform the menu's operation
615 // Return the field where you left the form.
616 virtual NCursesFormField* operator()(void);
618 // Exception handlers. The default is a Beep.
619 virtual void On_Request_Denied(int c) const;
620 virtual void On_Invalid_Field(int c) const;
621 virtual void On_Unknown_Command(int c) const;
626 // -------------------------------------------------------------------------
627 // This is the typical C++ typesafe way to allow to attach
628 // user data to a field of a form. Its assumed that the user
629 // data belongs to some class T. Use T as template argument
630 // to create a UserField.
631 // -------------------------------------------------------------------------
632 template<class T> class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField
635 NCursesUserField (int rows,
639 const T* p_UserData = STATIC_CAST(T*)(0),
640 int offscreen_rows = 0,
641 int additional_buffers = 0)
642 : NCursesFormField (rows, ncols,
643 first_row, first_col,
644 offscreen_rows, additional_buffers) {
646 OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData)));
649 virtual ~NCursesUserField() THROWS(NCursesException) {};
651 inline const T* UserData (void) const {
652 return reinterpret_cast<const T*>(::field_userptr (field));
655 inline virtual void setUserData(const T* p_UserData) {
657 OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData)));
661 // -------------------------------------------------------------------------
662 // The same mechanism is used to attach user data to a form
663 // -------------------------------------------------------------------------
665 template<class T> class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm
668 // 'Internal' constructor, builds an object without association to a
670 NCursesUserForm( int nlines,
674 const T* p_UserData = STATIC_CAST(T*)(0))
675 : NCursesForm(nlines,ncols,begin_y,begin_x) {
677 set_user (const_cast<void *>(reinterpret_cast<const void*>
682 NCursesUserForm (NCursesFormField* Fields[],
683 const T* p_UserData = STATIC_CAST(T*)(0),
684 bool with_frame=FALSE,
685 bool autoDelete_Fields=FALSE)
686 : NCursesForm (Fields, with_frame, autoDelete_Fields) {
688 set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
691 NCursesUserForm (NCursesFormField* Fields[],
696 const T* p_UserData = STATIC_CAST(T*)(0),
697 bool with_frame=FALSE,
698 bool autoDelete_Fields=FALSE)
699 : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
700 with_frame, autoDelete_Fields) {
702 set_user (const_cast<void *>(reinterpret_cast<const void*>
706 virtual ~NCursesUserForm() THROWS(NCursesException) {
709 inline T* UserData (void) {
710 return reinterpret_cast<T*>(get_user ());
713 inline virtual void setUserData (const T* p_UserData) {
715 set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
720 // -------------------------------------------------------------------------
721 // Builtin Fieldtypes
722 // -------------------------------------------------------------------------
724 class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType
729 void set(NCursesFormField& f) {
730 OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
734 Alpha_Field(int width)
735 : NCursesFieldType(TYPE_ALPHA),
736 min_field_width(width) {
740 class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType
745 void set(NCursesFormField& f) {
746 OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
750 Alphanumeric_Field(int width)
751 : NCursesFieldType(TYPE_ALNUM),
752 min_field_width(width) {
756 class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType
760 long lower_limit, upper_limit;
762 void set(NCursesFormField& f) {
763 OnError(::set_field_type(f.get_field(),fieldtype,
764 precision,lower_limit,upper_limit));
768 Integer_Field(int prec, long low=0L, long high=0L)
769 : NCursesFieldType(TYPE_INTEGER),
770 precision(prec), lower_limit(low), upper_limit(high) {
774 class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType
778 double lower_limit, upper_limit;
780 void set(NCursesFormField& f) {
781 OnError(::set_field_type(f.get_field(),fieldtype,
782 precision,lower_limit,upper_limit));
786 Numeric_Field(int prec, double low=0.0, double high=0.0)
787 : NCursesFieldType(TYPE_NUMERIC),
788 precision(prec), lower_limit(low), upper_limit(high) {
792 class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType
797 void set(NCursesFormField& f) {
798 OnError(::set_field_type(f.get_field(),fieldtype,regex));
801 void copy_regex(const char *source)
803 regex = new char[1 + ::strlen(source)];
804 (::strcpy)(regex, source);
808 Regular_Expression_Field(const char *expr)
809 : NCursesFieldType(TYPE_REGEXP),
815 Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs)
819 copy_regex(rhs.regex);
820 NCursesFieldType::operator=(rhs);
825 Regular_Expression_Field(const Regular_Expression_Field& rhs)
826 : NCursesFieldType(rhs),
829 copy_regex(rhs.regex);
832 ~Regular_Expression_Field() {
837 class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType
842 int non_unique_matches;
844 void set(NCursesFormField& f) {
845 OnError(::set_field_type(f.get_field(),fieldtype,
846 list,case_sensitive,non_unique_matches));
849 Enumeration_Field(const char* enums[],
850 bool case_sens=FALSE,
851 bool non_unique=FALSE)
852 : NCursesFieldType(TYPE_ENUM),
854 case_sensitive(case_sens ? -1 : 0),
855 non_unique_matches(non_unique ? -1 : 0) {
858 Enumeration_Field& operator=(const Enumeration_Field& rhs)
862 NCursesFieldType::operator=(rhs);
867 Enumeration_Field(const Enumeration_Field& rhs)
868 : NCursesFieldType(rhs),
870 case_sensitive(rhs.case_sensitive),
871 non_unique_matches(rhs.non_unique_matches)
876 class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType
879 void set(NCursesFormField& f) {
880 OnError(::set_field_type(f.get_field(),fieldtype));
884 IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) {
889 bool _nc_xx_fld_fcheck(FIELD *, const void*);
890 bool _nc_xx_fld_ccheck(int c, const void *);
891 void* _nc_xx_fld_makearg(va_list*);
895 // -------------------------------------------------------------------------
896 // Abstract base class for User-Defined Fieldtypes
897 // -------------------------------------------------------------------------
899 class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType
901 friend class UDF_Init; // Internal helper to set up statics
903 // For all C++ defined fieldtypes we need only one generic lowlevel
904 // FIELDTYPE* element.
905 static FIELDTYPE* generic_fieldtype;
908 // This are the functions required by the low level libforms functions
909 // to construct a fieldtype.
910 friend bool _nc_xx_fld_fcheck(FIELD *, const void*);
911 friend bool _nc_xx_fld_ccheck(int c, const void *);
912 friend void* _nc_xx_fld_makearg(va_list*);
914 void set(NCursesFormField& f) {
915 OnError(::set_field_type(f.get_field(),fieldtype,&f));
919 // Redefine this function to do a field validation. The argument
920 // is a reference to the field you should validate.
921 virtual bool field_check(NCursesFormField& f) = 0;
923 // Redefine this function to do a character validation. The argument
924 // is the character to be validated.
925 virtual bool char_check (int c) = 0;
928 UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) {
933 bool _nc_xx_next_choice(FIELD*, const void *);
934 bool _nc_xx_prev_choice(FIELD*, const void *);
938 // -------------------------------------------------------------------------
939 // Abstract base class for User-Defined Fieldtypes with Choice functions
940 // -------------------------------------------------------------------------
942 class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
944 friend class UDF_Init; // Internal helper to set up statics
946 // For all C++ defined fieldtypes with choice functions we need only one
947 // generic lowlevel FIELDTYPE* element.
948 static FIELDTYPE* generic_fieldtype_with_choice;
950 // This are the functions required by the low level libforms functions
951 // to construct a fieldtype with choice functions.
952 friend bool _nc_xx_next_choice(FIELD*, const void *);
953 friend bool _nc_xx_prev_choice(FIELD*, const void *);
956 // Redefine this function to do the retrieval of the next choice value.
957 // The argument is a reference to the field tobe examined.
958 virtual bool next (NCursesFormField& f) = 0;
960 // Redefine this function to do the retrieval of the previous choice value.
961 // The argument is a reference to the field tobe examined.
962 virtual bool previous(NCursesFormField& f) = 0;
965 UserDefinedFieldType_With_Choice() {
966 fieldtype = generic_fieldtype_with_choice;
970 #endif /* NCURSES_CURSESF_H_incl */