X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesf.cc;h=5d316489ea00faf7faa46b59c5f0871bfb83715f;hp=7956054769f4c9e70808199ece62b311a16b2090;hb=95bcbd4bb8e933c86e6fc4aba9ea1c7fd3d30e3d;hpb=f3eb40315f9e5eff503a172aed6d325b4e1f20c6 diff --git a/c++/cursesf.cc b/c++/cursesf.cc index 79560547..5d316489 100644 --- a/c++/cursesf.cc +++ b/c++/cursesf.cc @@ -1,6 +1,7 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. * + * Copyright 2019-2020,2021 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.22 2011/09/17 22:12:10 tom Exp $") +MODULE_ID("$Id: cursesf.cc,v 1.26 2021/04/17 18:11:08 tom 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(::form_userptr(form)); delete hook; @@ -284,15 +285,15 @@ NCursesFormField* NCursesForm::operator()(void) { int drvCmnd; - int err; int c; post(); show(); refresh(); - while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { - switch((err=driver(drvCmnd))) { + while (((drvCmnd = virtualize((c = getKey()))) != CMD_QUIT)) { + int err; + switch((err = driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); break; @@ -405,10 +406,19 @@ 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; @@ -460,3 +470,5 @@ public: }; UDF_Init* UDF_Init::I = new UDF_Init(); + +