12 // Forward Declarations
17 class NCursesException
23 NCursesException (const char* msg, int err)
24 : message(msg), errorno (err)
27 NCursesException (const char* msg)
28 : message(msg), errorno (E_SYSTEM_ERROR)
31 virtual const char *classname() const {
32 return "NCursesWindow";
36 class NCursesPanelException : public NCursesException
39 const NCursesPanel* p;
41 NCursesPanelException (const char *msg, int err) :
42 NCursesException (msg, err),
46 NCursesPanelException (const NCursesPanel* panel,
49 NCursesException (msg, err),
53 NCursesPanelException (int err) :
54 NCursesException ("panel library error", err),
58 NCursesPanelException (const NCursesPanel* panel,
60 NCursesException ("panel library error", err),
64 virtual const char *classname() const {
65 return "NCursesPanel";
70 class NCursesMenuException : public NCursesException
75 NCursesMenuException (const char *msg, int err) :
76 NCursesException (msg, err),
80 NCursesMenuException (const NCursesMenu* menu,
83 NCursesException (msg, err),
87 NCursesMenuException (int err) :
88 NCursesException ("menu library error", err),
92 NCursesMenuException (const NCursesMenu* menu,
94 NCursesException ("menu library error", err),
98 virtual const char *classname() const {
104 class NCursesFormException : public NCursesException
107 const NCursesForm* f;
109 NCursesFormException (const char *msg, int err) :
110 NCursesException (msg, err),
114 NCursesFormException (const NCursesForm* form,
117 NCursesException (msg, err),
121 NCursesFormException (int err) :
122 NCursesException ("form library error", err),
126 NCursesFormException (const NCursesForm* form,
128 NCursesException ("form library error", err),
132 virtual const char *classname() const {
133 return "NCursesForm";
138 inline void THROW(const NCursesException *e) {
139 #if defined(__GNUG__)
140 (*lib_error_handler)(e?e->classname():"",e?e->message:"");
141 #else // #elif defined(__SUNPRO_CC)
142 genericerror(1, ((e != 0) ? (char *)(e->message) : ""));