Thread: [Plib-cvs] plib/demos/p-guide/src LoadSave.cxx,1.3,1.4 pGuide.cxx,1.4,1.5 PropertiesWindow.cxx,1.1,1
Brought to you by:
sjbaker
|
From: James J. <pu...@us...> - 2002-08-15 04:15:20
|
Update of /cvsroot/plib/plib/demos/p-guide/src
In directory usw-pr-cvs1:/tmp/cvs-serv9283
Modified Files:
LoadSave.cxx pGuide.cxx PropertiesWindow.cxx StatusWindow.cxx
WidgetWindow.cxx WriteCode.cxx
Log Message:
Linux fixes (load/save, compile warnings)
Index: LoadSave.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/LoadSave.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- LoadSave.cxx 4 Aug 2002 04:37:36 -0000 1.3
+++ LoadSave.cxx 15 Aug 2002 04:15:17 -0000 1.4
@@ -39,6 +39,12 @@
#define CALLBACK_ACTIVE 0x00000002
#define CALLBACK_DOWN 0x00000004
+#ifdef WIN32
+ #define PATH_SEPARATOR '\\'
+#else
+ #define PATH_SEPARATOR '/'
+#endif
+
// From the Main Window:
extern WidgetList *widgets ;
@@ -94,7 +100,7 @@
/* Save the new current directory */
strcpy(pguide_current_directory, filename) ;
int i = strlen(pguide_current_directory);
- while (pguide_current_directory[i] != '\\') {
+ while (pguide_current_directory[i] != PATH_SEPARATOR) {
if (i>0) i-- ;
else break ;
}
@@ -257,24 +263,6 @@
}
void loadProject ( puObject *ob ) {
- extern puInput *object_size_x ;
- extern puInput *object_size_y ;
- extern puInput *object_position_x ;
- extern puInput *object_position_y ;
-
- extern puInput *object_label ;
- extern puComboBox *object_vert_label_place ;
- extern puComboBox *object_horz_label_place ;
- extern puInput *object_legend ;
- extern puComboBox *object_vert_legend_place ;
- extern puComboBox *object_horz_legend_place ;
-
- extern puInput *object_name ;
- extern puButtonBox *object_callbacks ;
-
- extern puButtonBox *object_visible ;
- extern puSpinBox *object_layer ;
-
extern puInput *window_name ;
extern puInput *window_size_x ;
extern puInput *window_size_y ;
@@ -300,7 +288,7 @@
/* Save the new current directory */
strcpy(pguide_current_directory, filename) ;
int i = strlen(pguide_current_directory);
- while (pguide_current_directory[i] != '\\') {
+ while (pguide_current_directory[i] != PATH_SEPARATOR) {
if (i>0) i-- ;
else break ;
}
Index: pGuide.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pGuide.cxx 4 Aug 2002 04:37:36 -0000 1.4
+++ pGuide.cxx 15 Aug 2002 04:15:17 -0000 1.5
@@ -862,13 +862,17 @@
// If we're using windows, ignore the C: or whatnot
-#ifdef WIN32
+#ifdef WIN32
+ #define PATH_SEPARATOR '\\'
strcpy (pguide_current_directory, argv[0]+2);
#else
+ #define PATH_SEPARATOR '/'
strcpy (pguide_current_directory, argv[0]);
#endif
i = strlen(pguide_current_directory);
- while (pguide_current_directory[i] != '\\') {
+
+
+ while (pguide_current_directory[i] != PATH_SEPARATOR) {
if (i>0) i-- ;
else break ;
}
Index: PropertiesWindow.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/PropertiesWindow.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PropertiesWindow.cxx 3 Aug 2002 22:55:29 -0000 1.1
+++ PropertiesWindow.cxx 15 Aug 2002 04:15:17 -0000 1.2
@@ -229,7 +229,7 @@
// Set up the widgets
properties_group = new puGroup ( 0, 0 ) ;
- puFrame *properties_frame = new puFrame ( 0, 0, 500, 250 ) ;
+ new puFrame ( 0, 0, 500, 250 ) ;
puText *properties_instructions = new puText ( 250, 230 );
properties_instructions->setLabelPlace(PUPLACE_TOP_CENTERED);
Index: StatusWindow.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/StatusWindow.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- StatusWindow.cxx 3 Aug 2002 22:55:29 -0000 1.3
+++ StatusWindow.cxx 15 Aug 2002 04:15:17 -0000 1.4
@@ -886,7 +886,7 @@
// Set up the widgets
puGroup *status_group = new puGroup ( 0, 0 ) ;
- puFrame *status_frame = new puFrame ( 0, 0, 500, 380 ) ;
+ new puFrame ( 0, 0, 500, 380 ) ;
menubar = new puMenuBar () ;
{
Index: WidgetWindow.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/WidgetWindow.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- WidgetWindow.cxx 3 Aug 2002 22:55:29 -0000 1.3
+++ WidgetWindow.cxx 15 Aug 2002 04:15:17 -0000 1.4
@@ -277,7 +277,7 @@
puGroup *widget_group = new puGroup ( 0, 0 ) ;
- puFrame *widget_frame = new puFrame ( 0, 0, 4 * ln + 5 * sp, 5 * ht + 6 * sp ) ;
+ new puFrame ( 0, 0, 4 * ln + 5 * sp, 5 * ht + 6 * sp ) ;
puButton *button = (puButton *)NULL ;
button = new puButton ( sp, 5*sp+4*ht, sp+ln, 5*sp+5*ht ) ;
Index: WriteCode.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- WriteCode.cxx 4 Aug 2002 04:37:36 -0000 1.4
+++ WriteCode.cxx 15 Aug 2002 04:15:17 -0000 1.5
@@ -25,6 +25,12 @@
#include "WidgetList.h"
+#ifdef WIN32
+ #define PATH_SEPARATOR '\\'
+#else
+ #define PATH_SEPARATOR '/'
+#endif
+
// From the Main Window:
extern WidgetList *widgets ;
@@ -65,14 +71,14 @@
return ;
}
- /* Save the new current directory */
- strcpy(pguide_current_directory, filename) ;
- int i = strlen(pguide_current_directory);
- while (pguide_current_directory[i] != '\\') {
- if (i>0) i-- ;
- else break ;
- }
- pguide_current_directory[i+1] = '\0' ;
+ /* Save the new current directory */
+ strcpy(pguide_current_directory, filename) ;
+ int i = strlen(pguide_current_directory);
+ while (pguide_current_directory[i] != PATH_SEPARATOR) {
+ if (i>0) i-- ;
+ else break ;
+ }
+ pguide_current_directory[i+1] = '\0' ;
/* If they didn't give an extension, then tack ".cxx" onto the end. */
if(!strstr(filename, "."))
|