Author: bgbnbigben
Date: 2011-03-06 05:19:46 -0800 (Sun, 06 Mar 2011)
New Revision: 8508
Log:
Updated the FileChooser, yet again.
Fixed a bug I introduced into the preview window in the last revision.        
Now, if a user either selects a file or types in a filename, the FileChooser
will keep this name whilst navigating - in a similar fashion to the Win32 FC
but *NOT* the GNOME FC


Modified:
   trunk/src/FileChooser2.cxx

Modified: trunk/src/FileChooser2.cxx
===================================================================
--- trunk/src/FileChooser2.cxx  2011-03-06 10:18:05 UTC (rev 8507)
+++ trunk/src/FileChooser2.cxx  2011-03-06 13:19:46 UTC (rev 8508)
@@ -503,12 +503,11 @@
     // Strip any trailing slash from the directory name...
     if (*filename == '/') *filename = '\0';
 
-    filename = strrchr((char*)fileName->text(), '/');
-       puts(pathname);
-       puts((filename&&filename+1)? filename+1:"\0");
-    sprintf(pathname, "%s/%s", pathname, (filename && filename+1) ? filename+1 
: '\0'); 
-    if (*filename == '/') *filename = '\0';
-
+    if (!fltk::filename_isfile(pathname)) {
+      filename = strrchr((char*)fileName->text(), '/');
+      if (filename && filename+1) filename++;
+      sprintf(pathname, "%s%s%s", pathname, filename ? "/" : "", filename);
+    }
     fileName->value(pathname);
 
     // Update the preview box...

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to