]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - c++/cursesf.cc
ncurses 6.2 - patch 20200831
[ncurses.git] / c++ / cursesf.cc
index aaf1202ca94e3c5fb7751ea60aa710bc9ec38a3c..fcf0080f9db5bfd1cdade3b4fa72a3455ccad2f5 100644 (file)
@@ -1,6 +1,7 @@
 // * this is for making emacs happy: -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 1998-2005,2011 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -35,9 +36,9 @@
 #include "cursesf.h"
 #include "cursesapp.h"
 
-MODULE_ID("$Id: cursesf.cc,v 1.21 2005/08/13 18:09:06 tom Exp $")
+MODULE_ID("$Id: cursesf.cc,v 1.25 2020/07/18 19:57:11 anonymous.maarten Exp $")
 
-NCursesFormField::~NCursesFormField ()
+NCursesFormField::~NCursesFormField () THROWS(NCursesException)
 {
   if (field)
     OnError(::free_field (field));
@@ -149,7 +150,7 @@ NCursesForm::InitForm(NCursesFormField* nfields[],
   setDefaultAttributes();
 }
 
-NCursesForm::~NCursesForm()
+NCursesForm::~NCursesForm() THROWS(NCursesException)
 {
   UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(form));
   delete hook;
@@ -234,11 +235,13 @@ NCursesForm::On_Form_Termination()
 void
 NCursesForm::On_Field_Init(NCursesFormField& field)
 {
+  (void) field;
 }
 
 void
 NCursesForm::On_Field_Termination(NCursesFormField& field)
 {
+  (void) field;
 }
 
 // call the form driver and do basic error checking.
@@ -260,16 +263,19 @@ NCursesForm::driver (int c)
 
 void NCursesForm::On_Request_Denied(int c) const
 {
+  (void) c;
   ::beep();
 }
 
 void NCursesForm::On_Invalid_Field(int c) const
 {
+  (void) c;
   ::beep();
 }
 
 void NCursesForm::On_Unknown_Command(int c) const
 {
+  (void) c;
   ::beep();
 }
 
@@ -373,6 +379,7 @@ NCursesForm::virtualize(int c)
 //
 bool _nc_xx_fld_fcheck(FIELD *f, const void *u)
 {
+  (void) f;
   NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
   assert(F != 0);
   UserDefinedFieldType* udf = reinterpret_cast<UserDefinedFieldType*>(F->fieldtype());
@@ -399,12 +406,22 @@ FIELDTYPE* UserDefinedFieldType::generic_fieldtype =
   ::new_fieldtype(_nc_xx_fld_fcheck,
                  _nc_xx_fld_ccheck);
 
+
+UserDefinedFieldType::UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) {
+}
+
 FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice =
   ::new_fieldtype(_nc_xx_fld_fcheck,
                  _nc_xx_fld_ccheck);
 
+
+UserDefinedFieldType_With_Choice::UserDefinedFieldType_With_Choice() {
+  fieldtype = generic_fieldtype_with_choice;
+}
+
 bool _nc_xx_next_choice(FIELD *f, const void *u)
 {
+  (void) f;
   NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
   assert(F != 0);
   UserDefinedFieldType_With_Choice* udf =
@@ -415,6 +432,7 @@ bool _nc_xx_next_choice(FIELD *f, const void *u)
 
 bool _nc_xx_prev_choice(FIELD *f, const void *u)
 {
+  (void) f;
   NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
   assert(F != 0);
   UserDefinedFieldType_With_Choice* udf =
@@ -452,3 +470,5 @@ public:
 };
 
 UDF_Init* UDF_Init::I = new UDF_Init();
+
+