X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesp.cc;h=50095d3d21444d1f8b5b53315537fecca4b84957;hp=9b3b204cafa40c434493e1fbc7b7b7eacd5b0922;hb=c633e5103a29a38532cf1925257b91cea33fd090;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/c++/cursesp.cc b/c++/cursesp.cc index 9b3b204c..50095d3d 100644 --- a/c++/cursesp.cc +++ b/c++/cursesp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 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 * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1993,1997 * + * Author: Juergen Pfeifer 1993,1997 * ****************************************************************************/ #include "cursesp.h" #include "internal.h" +#include -MODULE_ID("$Id: cursesp.cc,v 1.11 1998/02/17 09:04:12 juergen Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.16 2000/07/15 21:08:13 tom Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -42,27 +43,26 @@ void NCursesPanel::init() { p = ::new_panel(w); if (!p) OnError(ERR); - + UserHook* hook = new UserHook; hook->m_user = NULL; hook->m_back = this; hook->m_owner = p; ::set_panel_userptr(p, (void *)hook); -} +} NCursesPanel::~NCursesPanel() { UserHook* hook = (UserHook*)::panel_userptr(p); - assert(hook && hook->m_back==this && hook->m_owner==p); + assert(hook != 0 && hook->m_back==this && hook->m_owner==p); delete hook; ::del_panel(p); ::update_panels(); - ::doupdate(); } void NCursesPanel::redraw() { PANEL *pan; - + pan = ::panel_above(NULL); while (pan) { ::touchwin(panel_window(pan)); @@ -96,20 +96,20 @@ NCursesPanel::frame(const char *title,const char *btitle) { int err = OK; if (!title && !btitle) { err = box(); - } + } else { err = box(); if (err==OK) - label(title,btitle); + label(title,btitle); } OnError(err); } void NCursesPanel::label(const char *tLabel, const char *bLabel) { - if (tLabel) + if (tLabel) centertext(0,tLabel); - if (bLabel) + if (bLabel) centertext(maxy(),bLabel); }