X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fdemo.cc;h=1a436b5e2197354053d7385b8751d475013f4593;hp=ffc46373b361d38f85b5f51cd86c94cc49424dce;hb=5a9c046f10f72b47ad32801a8e54fe3d05aa8051;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/c++/demo.cc b/c++/demo.cc index ffc46373..1a436b5e 100644 --- a/c++/demo.cc +++ b/c++/demo.cc @@ -1,3 +1,32 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2006,2007 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 * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + /* * Silly demo program for the NCursesPanel class. * @@ -6,7 +35,7 @@ * Demo code for NCursesMenu and NCursesForm written by * Juergen Pfeifer * - * $Id: demo.cc,v 1.32 2005/08/13 18:14:44 tom Exp $ + * $Id: demo.cc,v 1.35 2007/01/27 20:28:51 tom Exp $ */ #include "internal.h" @@ -282,7 +311,7 @@ public: TestForm F; Soft_Label_Key_Set* S = new Soft_Label_Key_Set; for(int i=1; i <= S->labels(); i++) { - char buf[5]; + char buf[8]; ::sprintf(buf,"Frm%02d",i); (*S)[i] = buf; // Text (*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification @@ -500,7 +529,7 @@ public: void TestApplication::init_labels(Soft_Label_Key_Set& S) const { for(int i=1; i <= S.labels(); i++) { - char buf[5]; + char buf[8]; ::sprintf(buf,"Key%02d",i); S[i] = buf; // Text S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification @@ -528,4 +557,4 @@ int TestApplication::run() // // ------------------------------------------------------------------------- // -static TestApplication Demo; +static TestApplication *Demo = new TestApplication();