![]() |
MechSys
1.0
Computing library for simulations in continuum and discrete mechanics
|
00001 /************************************************************************ 00002 * MechSys - Open Library for Mechanical Systems * 00003 * Copyright (C) 2005 Dorival M. Pedroso * 00004 * * 00005 * This program is free software: you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation, either version 3 of the License, or * 00008 * any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00017 ************************************************************************/ 00018 00019 #ifndef MPM_INFOBOX_H 00020 #define MPM_INFOBOX_H 00021 00022 #include <FL/Fl.H> 00023 #include <FL/Fl_Box.H> 00024 #include <FL/Fl_Button.H> 00025 #include <FL/Fl_Double_Window.H> 00026 00027 namespace MPM { 00028 00029 void HideInfoBox (Fl_Widget * IB, void * Win) { ((Fl_Window*)Win)->hide(); } 00030 00031 void InfoBox (char const * Message) 00032 { 00033 Fl_Window * w = new Fl_Window (420,103,"Error"); 00034 w->begin(); 00035 Fl_Box * i = new Fl_Box (10,10, 50,50,"!"); 00036 Fl_Box * o = new Fl_Box (70,25,350,20,Message); 00037 Fl_Button * b = new Fl_Button(310,70,90,23,"Ok"); 00038 w->end(); 00039 i->box (FL_THIN_UP_BOX); 00040 i->labelfont (FL_TIMES_BOLD); 00041 i->labelsize (34); 00042 i->color (FL_WHITE); 00043 i->labelcolor (FL_BLUE); 00044 o->align (FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); 00045 b->callback (&HideInfoBox, w); 00046 b->color (0xefebe700); 00047 w->color (0xefebe700); 00048 w->set_modal (); 00049 w->show (); 00050 } 00051 00052 }; // namespace MPM 00053 00054 #endif // MPM_INFOBOX_H