X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesm.cc;h=64f36358cd9980a0c649a718adf534d6d9239b6f;hp=c253a67999094d0e1a459f05378c9b2e33f3e801;hb=HEAD;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/c++/cursesm.cc b/c++/cursesm.cc index c253a679..64f36358 100644 --- a/c++/cursesm.cc +++ b/c++/cursesm.cc @@ -1,6 +1,7 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * Copyright 2019-2020,2021 Thomas E. Dickey * + * Copyright 1998-2011,2017 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 "cursesm.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesm.cc,v 1.22 2005/04/02 20:39:05 tom Exp $") +MODULE_ID("$Id: cursesm.cc,v 1.27 2021/04/17 18:11:08 tom Exp $") -NCursesMenuItem::~NCursesMenuItem() +NCursesMenuItem::~NCursesMenuItem() THROWS(NCursesException) { if (item) OnError(::free_item(item)); @@ -49,7 +50,7 @@ NCursesMenuItem::action() return FALSE; } -NCursesMenuCallbackItem::~NCursesMenuCallbackItem() +NCursesMenuCallbackItem::~NCursesMenuCallbackItem() THROWS(NCursesException) { } @@ -175,13 +176,13 @@ NCursesMenu::setDefaultAttributes() } } -NCursesMenu::~NCursesMenu() +NCursesMenu::~NCursesMenu() THROWS(NCursesException) { UserHook* hook = reinterpret_cast(::menu_userptr(menu)); delete hook; if (b_sub_owner) { - delete sub; ::set_menu_sub(menu, static_cast(0)); + delete sub; } if (menu) { ITEM** itms = ::menu_items(menu); @@ -300,7 +301,6 @@ NCursesMenuItem* NCursesMenu::operator()(void) { int drvCmnd; - int err; int c; bool b_action = FALSE; @@ -308,9 +308,10 @@ NCursesMenu::operator()(void) show(); refresh(); - while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + while (!b_action && ((drvCmnd = virtualize((c = getKey()))) != CMD_QUIT)) { + int err; - switch((err=driver(drvCmnd))) { + switch((err = driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); break; @@ -375,33 +376,39 @@ NCursesMenu::On_Menu_Termination() void NCursesMenu::On_Item_Init(NCursesMenuItem& item) { + (void) item; } void NCursesMenu::On_Item_Termination(NCursesMenuItem& item) { + (void) item; } void NCursesMenu::On_Request_Denied(int c) const { + (void) c; ::beep(); } void NCursesMenu::On_Not_Selectable(int c) const { + (void) c; ::beep(); } void NCursesMenu::On_No_Match(int c) const { + (void) c; ::beep(); } void NCursesMenu::On_Unknown_Command(int c) const { + (void) c; ::beep(); }