2001-08-02 23:43:49 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2001-09-29 18:38:59 +04:00
|
|
|
// Fl_Help_Dialog test program.
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2010-11-29 00:06:39 +03:00
|
|
|
// Copyright 1999-2010 by Easy Software Products.
|
2017-02-08 05:06:52 +03:00
|
|
|
// Copyright 2011-2017 by Bill Spitzak and others.
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// 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
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
|
|
|
// Contents:
|
|
|
|
//
|
|
|
|
// main() - Display the help GUI...
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// Include necessary headers...
|
|
|
|
//
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
#include <FL/Fl_Help_Dialog.H>
|
2017-11-19 04:18:16 +03:00
|
|
|
#include <FL/filename.H> /* FL_PATH_MAX */
|
|
|
|
#include <string.h> /* strcpy(), etc */
|
2011-01-04 03:53:13 +03:00
|
|
|
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
|
|
|
// 'main()' - Display the help GUI...
|
|
|
|
//
|
|
|
|
|
|
|
|
int // O - Exit status
|
|
|
|
main(int argc, // I - Number of command-line arguments
|
|
|
|
char *argv[]) // I - Command-line arguments
|
|
|
|
{
|
2016-05-15 16:52:17 +03:00
|
|
|
Fl_Help_Dialog *help = new Fl_Help_Dialog;
|
2017-11-19 04:18:16 +03:00
|
|
|
char htmlname[FL_PATH_MAX];
|
|
|
|
if (argc > 1) {
|
|
|
|
strcpy(htmlname, argv[1]);
|
|
|
|
} else {
|
2016-05-15 16:52:17 +03:00
|
|
|
#ifdef __APPLE__
|
2017-11-19 04:18:16 +03:00
|
|
|
// bundled apps do not set the current directory
|
|
|
|
strcpy(htmlname, argv[0]);
|
|
|
|
char *slash = strrchr(htmlname, '/');
|
|
|
|
if (slash) strcpy(slash, "/../Resources/help_dialog.html");
|
|
|
|
#else
|
|
|
|
strcpy(htmlname, "help_dialog.html");
|
2016-05-15 16:52:17 +03:00
|
|
|
#endif
|
2017-11-19 04:18:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
help->load(htmlname); // TODO: add error check (when load() returns int instead of void)
|
|
|
|
|
2004-07-27 00:52:52 +04:00
|
|
|
help->show(1, argv);
|
2001-08-02 23:43:49 +04:00
|
|
|
|
|
|
|
Fl::run();
|
|
|
|
|
|
|
|
delete help;
|
|
|
|
|
2016-05-15 16:52:17 +03:00
|
|
|
return 0;
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|