]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/prop_picker.cxx
XML-configurable menu support from Erik Hofman.
[flightgear.git] / src / GUI / prop_picker.cxx
index 13724ee6cae8f484e089d1b9c8120416ec9d539b..38002a0a6dd5a71c514351a77e0276514cb8bbc7 100755 (executable)
@@ -500,6 +500,11 @@ void fgPropPicker::find_props ()
             ++pi;
   }
 
+  // truncate entries to 80 characters (plib pui limit)
+  for (i = 0; i < num_files; i++) {
+    if (strlen(files[i]) > 80) files[i][79] = '\0';
+  }
+
   files [ num_files ] = NULL ;
 
   // leave the . and .. alone...
@@ -530,8 +535,8 @@ void fgPropPicker::find_props ()
 
   // if non-empty list, adjust the size of the slider...
   if (num_files > 1) {
-    if ((11.0f/(num_files-1)) < 1) {
-      slider->setSliderFraction (11.0f/(num_files-1)) ;
+    if ((11.0f/(num_files)) < 1) {
+      slider->setSliderFraction (11.0f/(num_files)) ;
       slider->reveal();
       up_arrow->reveal();
       down_arrow->reveal();
@@ -608,4 +613,3 @@ fgPropEdit::fgPropEdit ( char *name, char *value, char *proppath ) : puDialogBox
     FG_FINALIZE_PUI_DIALOG( this );
 }
 
-