mod/maxgui.mod/fltkmaxgui.mod/src/fl_file_dir.cxx
char *					// O - Directory or NULL
fl_dir_chooser(const char *message,	// I - Message for titlebar
               const char *fname,	// I - Initial directory name
	       int        relative)	// I - 0 for absolute
{
  static char	retname[1024];		// Returned directory name

  if (!fc) {
    if (!fname || !*fname) fname = ".";

    fc = new Fl_File_Chooser(fname, "*", Fl_File_Chooser::CREATE |
                                         Fl_File_Chooser::DIRECTORY, message);
    fc->callback(callback, 0);
  } else {
    fc->type(Fl_File_Chooser::CREATE | Fl_File_Chooser::DIRECTORY);
    fc->filter("*");
    if (fname && *fname) fc->value(fname);
    fc->label(message);
  }

  fc->show();

  while (fc->shown())
    Fl::wait();

  if (fc->value() && relative) {
    fl_filename_relative(retname, sizeof(retname), fc->value());

    return retname;
  } else if (fc->value()) return (char *)fc->value();
  else return 0;
}
/**  \relates Fl_File_Chooser
    Shows a file chooser dialog and gets a directory.
    \param[in] message title bar text
    \param[in] fname initial/default directory name
    \param[in] relative 0 for absolute path return, relative otherwise
    \return the directory path string chosen by the user or NULL if user cancels
*/
\relates Fl_File_Chooser
Shows a file chooser dialog and gets a directory.
\param[in] message title bar text
\param[in] fname initial/default directory name
\param[in] relative 0 for absolute path return, relative otherwise
\return the directory path string chosen by the user or NULL if user cancels
\ relates Fl_File_Chooser Shows a file chooser dialog and gets a directory . \ param [ in ] message title bar text \ param [ in ] fname initial / default directory name \ param [ in ] relative 0 for absolute path return relative otherwise \ return the directory path string chosen by the user or NULL if user cancels
char *					
fl_dir_chooser(const char *message,	
               const char *fname,	
	       int        relative)	
{
  static char	retname[1024];		
  if (!fc) {
    if (!fname || !*fname) fname = ".";
    fc = new Fl_File_Chooser(fname, "*", Fl_File_Chooser::CREATE |
                                         Fl_File_Chooser::DIRECTORY, message);
    fc->callback(callback, 0);
  } else {
    fc->type(Fl_File_Chooser::CREATE | Fl_File_Chooser::DIRECTORY);
    fc->filter("*");
    if (fname && *fname) fc->value(fname);
    fc->label(message);
  }
  fc->show();
  while (fc->shown())
    Fl::wait();
  if (fc->value() && relative) {
    fl_filename_relative(retname, sizeof(retname), fc->value());
    return retname;
  } else if (fc->value()) return (char *)fc->value();
  else return 0;
}
char * fl_dir_chooser ( const char * message , const char * fname , int relative ) { static char retname [ 1024 ] ; if ( ! fc ) { if ( ! fname || ! * fname ) fname = " " ; fc = new Fl_File_Chooser ( fname , " " , Fl_File_Chooser :: CREATE | Fl_File_Chooser :: DIRECTORY , message ) ; fc -> callback ( callback , 0 ) ; } else { fc -> type ( Fl_File_Chooser :: CREATE | Fl_File_Chooser :: DIRECTORY ) ; fc -> filter ( " " ) ; if ( fname && * fname ) fc -> value ( fname ) ; fc -> label ( message ) ; } fc -> show ( ) ; while ( fc -> shown ( ) ) Fl :: wait ( ) ; if ( fc -> value ( ) && relative ) { fl_filename_relative ( retname , sizeof ( retname ) , fc -> value ( ) ) ; return retname ; } else if ( fc -> value ( ) ) return ( char * ) fc -> value ( ) ; else return 0 ; }
\relates Fl_File_Chooser
Shows a file chooser dialog and gets a directory.
\ relates Fl_File_Chooser Shows a file chooser dialog and gets a directory .
// O - Directory or NULL // I - Message for titlebar // I - Initial directory name // I - 0 for absolute // Returned directory name