From 2bb91d900c822bec757108627af04b82b619ff46 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 13 Sep 2016 00:59:04 +0000 Subject: Fix native file chooser test program (STR #3326). Fix compilation error under Windows with MS compiler (Visual Studio) only. Also fix layout and resizing behavior. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11941 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/native-filechooser.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx index 349bb3bd8..360ee4c37 100644 --- a/test/native-filechooser.cxx +++ b/test/native-filechooser.cxx @@ -3,7 +3,7 @@ // // Simple test of the Fl_Native_File_Chooser. // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2016 by Bill Spitzak and others. // Copyright 2004 Greg Ercolano. // // This library is free software. Distribution and use rights are outlined in @@ -37,7 +37,7 @@ void PickFile_CB(Fl_Widget*, void*) { Fl_Native_File_Chooser native; native.title("Pick a file"); native.type(Fl_Native_File_Chooser::BROWSE_FILE); - native.filter(G_filter->value()); // TODO: need to add kNavSupportPackages to non-cocoa _MAC.cxx + native.filter(G_filter->value()); native.preset_file(G_filename->value()); // Show native chooser switch ( native.show() ) { @@ -91,8 +91,8 @@ int main(int argc, char **argv) { argn++; #endif - Fl_Window *win = new Fl_Window(680, 400, "Native File Chooser Test"); - win->size_range(300, 100, 0, 100); + Fl_Window *win = new Fl_Window(600, 380, "Native File Chooser Test"); + win->size_range(600, 380, 0, 0); win->begin(); { int x = 80, y = 10; @@ -105,7 +105,7 @@ int main(int argc, char **argv) { G_filter->value("Text\t*.txt\n" "C Files\t*.{cxx,h,c,cpp}\n" "Tars\t*.{tar,tar.gz}\n" - "Apps\t*.app"); // TODO: need to add kNavSupportPackages to non-cocoa _MAC.cxx + "Apps\t*.app"); G_filter->tooltip("Filter to be used for browser.\n" "An empty string may be used.\n"); @@ -120,9 +120,9 @@ int main(int argc, char **argv) { "Patterns can be:
    \n" "
  • A single wildcard (e.g. \"*.txt\")
  • \n" "
  • Multiple wildcards (e.g. \"*.{cxx,h,H}\")
  • \n" - "
  • A descriptive name followed by a "TAB" and a wildcard (e.g. \"Text Files"TAB"*.txt\")
  • \n" + "
  • A descriptive name followed by a " TAB " and a wildcard (e.g. \"Text Files" TAB "*.txt\")
  • \n" "
\n" - "In the above \"Filter\" field, you can use Ctrl-I to enter "TAB" characters as needed.
\n" + "In the above \"Filter\" field, you can use Ctrl-I to enter " TAB " characters as needed.
\n" "Example:
\n"
 		"\n"
 		"    Text<Ctrl-I>*.txt\n"
@@ -136,9 +136,7 @@ int main(int argc, char **argv) {
     Fl_Button *butdir = new Fl_Button(but->x()-x-10, win->h()-25-10, 80, 25, "Pick Dir");
     butdir->callback(PickDir_CB);
 
-    Fl_Box *dummy = new Fl_Box(80, 0, 430, 100);
-    dummy->hide();
-    win->resizable(dummy);
+    win->resizable(G_filter);
   }
   win->end();
   win->show(argc, argv);
-- 
cgit v1.2.3