summaryrefslogtreecommitdiff
path: root/test/native-filechooser.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-01 18:03:10 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-06 20:28:20 +0200
commitf09e17c3c564e8310125a10c03397cbf473ff643 (patch)
tree8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /test/native-filechooser.cxx
parentb0e0c355edaa2e23148cb0260ada907aec930f05 (diff)
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
Diffstat (limited to 'test/native-filechooser.cxx')
-rw-r--r--test/native-filechooser.cxx68
1 files changed, 31 insertions, 37 deletions
diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx
index 6730ab65e..dd0c4812d 100644
--- a/test/native-filechooser.cxx
+++ b/test/native-filechooser.cxx
@@ -1,6 +1,4 @@
//
-// "$Id$"
-//
// Simple test of the Fl_Native_File_Chooser.
//
// Copyright 1998-2016 by Bill Spitzak and others.
@@ -10,16 +8,16 @@
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
-// Please report all bugs and problems on the following page:
+// Please see the following page on how to report bugs and issues:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/bugs.php
//
#include <stdio.h>
-#include <string.h> /* strstr() */
+#include <string.h> /* strstr() */
#include <FL/Fl.H>
-#include <FL/fl_ask.H> /* fl_beep() */
+#include <FL/fl_ask.H> /* fl_beep() */
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
@@ -45,15 +43,15 @@ void PickFile_CB(Fl_Widget*, void*) {
native.preset_file(G_filename->value());
// Show native chooser
switch ( native.show() ) {
- case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR
- case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL
- default: // PICKED FILE
+ case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR
+ case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL
+ default: // PICKED FILE
if ( native.filename() ) {
G_filename->value(native.filename());
- G_tty->printf("filename='%s'\n", native.filename());
+ G_tty->printf("filename='%s'\n", native.filename());
} else {
- G_filename->value("NULL");
- G_tty->printf("filename='(null)'\n");
+ G_filename->value("NULL");
+ G_tty->printf("filename='(null)'\n");
}
break;
}
@@ -67,15 +65,15 @@ void PickDir_CB(Fl_Widget*, void*) {
native.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY);
// Show native chooser
switch ( native.show() ) {
- case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR
- case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL
- default: // PICKED DIR
+ case -1: G_tty->printf("ERROR: %s\n", native.errmsg()); break; // ERROR
+ case 1: G_tty->printf("*** CANCEL\n"); fl_beep(); break; // CANCEL
+ default: // PICKED DIR
if ( native.filename() ) {
G_filename->value(native.filename());
- G_tty->printf("dirname='%s'\n", native.filename());
+ G_tty->printf("dirname='%s'\n", native.filename());
} else {
- G_filename->value("NULL");
- G_tty->printf("dirname='(null)'\n");
+ G_filename->value("NULL");
+ G_tty->printf("dirname='(null)'\n");
}
break;
}
@@ -98,7 +96,7 @@ int main(int argc, char **argv) {
if (argc>argn && strncmp(argv[1], "-psn_", 5)==0)
argn++;
#endif
-
+
Fl_Window *win = new Fl_Window(640, 400+TERMINAL_HEIGHT, "Native File Chooser Test");
win->size_range(win->w(), win->h(), 0, 0);
win->begin();
@@ -115,7 +113,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");
+ "Apps\t*.app");
G_filter->tooltip("Filter to be used for browser.\n"
"An empty string may be used.\n");
@@ -127,19 +125,19 @@ int main(int argc, char **argv) {
view->textfont(FL_HELVETICA);
view->textsize(10);
view->value("The Filter can be one or more filter patterns, one per line.\n"
- "Patterns can be:<ul>\n"
- " <li>A single wildcard (e.g. <tt>\"*.txt\"</tt>)</li>\n"
- " <li>Multiple wildcards (e.g. <tt>\"*.{cxx,h,H}\"</tt>)</li>\n"
- " <li>A descriptive name followed by a " TAB " and a wildcard (e.g. <tt>\"Text Files" TAB "*.txt\"</tt>)</li>\n"
- "</ul>\n"
+ "Patterns can be:<ul>\n"
+ " <li>A single wildcard (e.g. <tt>\"*.txt\"</tt>)</li>\n"
+ " <li>Multiple wildcards (e.g. <tt>\"*.{cxx,h,H}\"</tt>)</li>\n"
+ " <li>A descriptive name followed by a " TAB " and a wildcard (e.g. <tt>\"Text Files" TAB "*.txt\"</tt>)</li>\n"
+ "</ul>\n"
"In the above \"Filter\" field, you can use <b><font color=#55f face=Courier>Ctrl-I</font></b> to enter " TAB " characters as needed.<br>\n"
- "Example:<pre>\n"
- "\n"
- " Text<font color=#55f>&lt;Ctrl-I&gt;</font>*.txt\n"
- " C Files<font color=#55f>&lt;Ctrl-I&gt;</font>*.{cxx,h,c,cpp}\n"
- " Tars<font color=#55f>&lt;Ctrl-I&gt;</font>*.{tar,tar.gz}\n"
- " Apps<font color=#55f>&lt;Ctrl-I&gt;</font>*.app\n"
- "</pre>\n");
+ "Example:<pre>\n"
+ "\n"
+ " Text<font color=#55f>&lt;Ctrl-I&gt;</font>*.txt\n"
+ " C Files<font color=#55f>&lt;Ctrl-I&gt;</font>*.{cxx,h,c,cpp}\n"
+ " Tars<font color=#55f>&lt;Ctrl-I&gt;</font>*.{tar,tar.gz}\n"
+ " Apps<font color=#55f>&lt;Ctrl-I&gt;</font>*.app\n"
+ "</pre>\n");
Fl_Button *but = new Fl_Button(win->w()-x-10, win->h()-TERMINAL_HEIGHT-25-10, 80, 25, "Pick File");
but->callback(PickFile_CB);
@@ -153,7 +151,3 @@ int main(int argc, char **argv) {
win->show(argc, argv);
return(Fl::run());
}
-
-//
-// End of "$Id$".
-//