[Plib-cvs] plib/demos/p-guide/src CreateWidget.cxx,NONE,1.1 Makefile.am,NONE,1.1 StatusWindow.cxx,NO
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-05-08 22:49:58
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv16047/p-guide/src Added Files: CreateWidget.cxx Makefile.am StatusWindow.cxx WidgetList.h WidgetWindow.cxx WriteCode.cxx pGuide.cxx pGuide.dsp Log Message: John F. Fay: Introduced P-GUIDE --- NEW FILE: CreateWidget.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Create Widget function for GUI Builder #include <plib/pu.h> puObject *createWidget ( int type ) { static char *box_labels [] = { NULL } ; if ( type & PUCLASS_SELECTBOX ) return new puSelectBox ( 0, 0, 90, 20, box_labels ) ; if ( type & PUCLASS_COMBOBOX ) return new puComboBox ( 0, 0, 90, 40, box_labels ) ; if ( type & PUCLASS_LARGEINPUT ) return new puLargeInput ( 0, 0, 90, 40, 2, 20, FALSE ) ; if ( type & PUCLASS_VERTMENU ) return new puVerticalMenu ( 0, 0 ) ; if ( type & PUCLASS_TRISLIDER ) return new puTriSlider ( 0, 0, 90 ) ; if ( type & PUCLASS_BISLIDER ) return new puBiSlider ( 0, 0, 90 ) ; if ( type & PUCLASS_FILESELECTOR ) return new puFileSelector ( 0, 0, 90, 40, 2, "." ) ; if ( type & PUCLASS_DIAL ) return new puDial ( 0, 0, 40 ) ; if ( type & PUCLASS_LISTBOX ) return new puListBox ( 0, 0, 90, 40 ) ; if ( type & PUCLASS_ARROW ) return new puArrowButton ( 0, 0, 20, 20, PUARROW_UP ) ; if ( type & PUCLASS_DIALOGBOX ) return new puDialogBox ( 0, 0 ) ; if ( type & PUCLASS_SLIDER ) return new puSlider ( 0, 0, 90 ) ; if ( type & PUCLASS_BUTTONBOX ) return new puButtonBox ( 0, 0, 90, 50, box_labels, FALSE ) ; if ( type & PUCLASS_INPUT ) return new puInput ( 0, 0, 90, 20 ) ; if ( type & PUCLASS_MENUBAR ) return new puMenuBar () ; if ( type & PUCLASS_POPUPMENU ) return new puPopupMenu ( 0, 0 ) ; if ( type & PUCLASS_POPUP ) return new puPopup ( 0, 0 ) ; if ( type & PUCLASS_ONESHOT ) return new puOneShot ( 0, 0, 90, 20 ) ; if ( type & PUCLASS_BUTTON ) return new puButton ( 0, 0, 90, 20 ) ; if ( type & PUCLASS_TEXT ) return new puText ( 0, 0 ) ; if ( type & PUCLASS_FRAME ) return new puFrame ( 0, 0, 90, 50 ) ; if ( type & PUCLASS_INTERFACE ) return new puInterface ( 0, 0 ) ; if ( type & PUCLASS_GROUP ) return new puGroup ( 0, 0 ) ; return (puObject *)NULL ; } --- NEW FILE: Makefile.am --- bin_PROGRAMS = pguide pguide_SOURCES = CreateWidget.cxx pGuide.cxx StatusWindow.cxx WidgetList.h \ WidgetWindow.cxx WriteCode.cxx EXTRA_DIST = pGuide.dsp --- NEW FILE: StatusWindow.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ [...788 lines suppressed...] window_color_r = new puInput ( 120, 260, 160, 280 ) ; window_color_r->setLabel ( "Window Color:" ) ; window_color_r->setLabelPlace ( PUPLACE_CENTERED_LEFT ) ; window_color_r->setValuator ( &main_window_color_r ) ; window_color_g = new puInput ( 160, 260, 200, 280 ) ; window_color_g->setValuator ( &main_window_color_g ) ; window_color_b = new puInput ( 200, 260, 240, 280 ) ; window_color_b->setValuator ( &main_window_color_b ) ; window_color_a = new puInput ( 240, 260, 280, 280 ) ; window_color_a->setValuator ( &main_window_color_a ) ; status_group->close () ; return 0 ; } --- NEW FILE: WidgetList.h --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Data Structure Definition #ifndef WIDGET_LIST_H #define WIDGET_LIST_H #include <plib/pu.h> // PUI Widget List for Main Window struct WidgetList { puObject *obj ; char *object_type_name ; int object_type ; char *label_text ; char *legend_text ; short callbacks ; char object_name [ PUSTRING_MAX ] ; bool visible ; int layer ; // GUI layer: 0 - in back, positive nubmers - greater in front of lesser WidgetList *next ; } ; #endif // WIDGET_LIST_H --- NEW FILE: WidgetWindow.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ [...323 lines suppressed...] button = new puButton ( 4*sp+3*ln, 4*sp+3*ht, 4*sp+4*ln, 4*sp+4*ht ) ; button->setLegend ( "puSlider" ) ; button->setCallback ( slider_cb ) ; button = new puButton ( 4*sp+3*ln, 3*sp+2*ht, 4*sp+4*ln, 3*sp+3*ht ) ; button->setLegend ( "puBiSlider" ) ; button->setCallback ( bislider_cb ) ; button = new puButton ( 4*sp+3*ln, 2*sp+ht, 4*sp+4*ln, 2*sp+2*ht ) ; button->setLegend ( "puTriSlider" ) ; button->setCallback ( trislider_cb ) ; widget_group->close () ; return 0 ; } --- NEW FILE: WriteCode.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ [...255 lines suppressed...] wid = wid->next ; } } } fprintf ( out, "\n\n" ) ; fprintf ( out, " window_group->close () ;\n\n\n" ) ; fprintf ( out, " // GLUT Main Loop\n" ) ; fprintf ( out, " glutMainLoop () ;\n" ) ; fprintf ( out, " return ;\n" ) ; fprintf ( out, "}\n\n" ) ; // Close up shop fclose ( out ) ; main_window_changed = false ; } --- NEW FILE: pGuide.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ [...436 lines suppressed...] glutReshapeFunc ( main_window_reshapefn ) ; glutIdleFunc ( main_window_displayfn ) ; puInit () ; #ifdef VOODOO puShowCursor () ; #endif puSetDefaultStyle ( PUSTYLE_SMALL_SHADED ) ; puSetDefaultColourScheme ( 0.8, 0.8, 0.8, 1.0 ) ; // Set up the other windows define_widget_window () ; define_status_window () ; glutMainLoop () ; return 0 ; } --- NEW FILE: pGuide.dsp --- # Microsoft Developer Studio Project File - Name="pGuide" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=pGuide - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pGuide.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pGuide.mak" CFG="pGuide - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE [...78 lines suppressed...] # End Source File # Begin Source File SOURCE=.\WriteCode.cxx # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\WidgetList.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project |