2010-01-18 07:02:26 +01:00
|
|
|
# data file for the Fltk User Interface Designer (fluid)
|
2012-02-24 04:32:49 +01:00
|
|
|
version 1.0300
|
2010-01-18 07:02:26 +01:00
|
|
|
header_name {.H}
|
|
|
|
code_name {.C}
|
|
|
|
comment {//
|
|
|
|
// Copyright (C) 2008 Jonathan Moore Liles
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
} {in_source in_header
|
|
|
|
}
|
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
decl {\#include <stdlib.h>} {private local
|
|
|
|
}
|
2010-01-18 07:02:26 +01:00
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
decl {\#include <string.h>} {private local
|
|
|
|
}
|
2010-01-18 07:02:26 +01:00
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
decl {\#include <stdio.h>} {private local
|
|
|
|
}
|
2010-01-18 07:02:26 +01:00
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
decl {\#include <FL/Fl_File_Chooser.H>} {private local
|
|
|
|
}
|
2010-01-18 07:02:26 +01:00
|
|
|
|
|
|
|
class New_Project_Dialog {open
|
|
|
|
} {
|
|
|
|
Function {New_Project_Dialog()} {open
|
|
|
|
} {
|
2010-01-24 22:54:53 +01:00
|
|
|
code {_default_path = 0;
|
2012-02-24 04:32:49 +01:00
|
|
|
path = 0;
|
|
|
|
make_window();} {}
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|
|
|
|
Function {run()} {open return_type void
|
|
|
|
} {
|
2012-02-24 04:32:49 +01:00
|
|
|
code {_directory->value( _default_path );
|
2010-01-24 22:54:53 +01:00
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
_window->show();
|
2010-01-18 07:02:26 +01:00
|
|
|
|
|
|
|
while ( _window->shown() )
|
|
|
|
Fl::wait();} {}
|
|
|
|
}
|
|
|
|
Function {make_window()} {open
|
|
|
|
} {
|
|
|
|
Fl_Window _window {
|
2013-05-14 02:21:50 +02:00
|
|
|
label {New Project} open selected
|
|
|
|
xywh {743 696 550 105} type Double modal visible
|
2010-01-18 07:02:26 +01:00
|
|
|
} {
|
|
|
|
Fl_File_Input _name {
|
|
|
|
label {Named:}
|
2013-05-14 02:21:50 +02:00
|
|
|
xywh {75 55 375 35}
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|
|
|
|
Fl_Button {} {
|
|
|
|
label Browse
|
|
|
|
callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
|
2013-05-14 02:21:50 +02:00
|
|
|
xywh {455 15 80 35}
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|
|
|
|
Fl_Return_Button {} {
|
|
|
|
label Create
|
|
|
|
callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
|
|
|
|
{
|
|
|
|
char pat[1024];
|
|
|
|
|
|
|
|
snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
|
|
|
|
|
|
|
|
path = strdup( pat );
|
|
|
|
|
2010-01-24 22:54:53 +01:00
|
|
|
_default_path = _directory->value() ? strdup( _directory->value() ) : 0;
|
2010-01-18 07:02:26 +01:00
|
|
|
|
|
|
|
//if ( ! Project::create( pat, _template->text( _template->value() ) ) )
|
|
|
|
// fl_alert( "Error creating project!" );
|
|
|
|
|
|
|
|
_window->hide();
|
|
|
|
}}
|
2013-05-14 02:21:50 +02:00
|
|
|
xywh {455 55 80 35}
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|
|
|
|
Fl_File_Input _directory {
|
|
|
|
label {Where:}
|
|
|
|
callback {if ( ! fl_filename_isdir( o->value() ) )
|
|
|
|
{
|
|
|
|
fl_alert( "Must be a directory" );
|
|
|
|
o->value( "" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// write_line( user_config_dir, "default_path", o->value() );}
|
2013-05-14 02:21:50 +02:00
|
|
|
xywh {75 15 375 35}
|
2010-01-18 07:02:26 +01:00
|
|
|
code0 {\#include <FL/filename.H>}
|
2012-02-24 04:32:49 +01:00
|
|
|
code1 {char *v = NULL;}
|
2010-01-18 07:02:26 +01:00
|
|
|
code2 {// read_line( user_config_dir, "default_path", &v );}
|
|
|
|
code3 {o->value( v );}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-02-24 04:32:49 +01:00
|
|
|
decl {char *path;} {public local
|
|
|
|
}
|
|
|
|
decl {char *_default_path} {private local
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|
|
|
|
Function {default_path( char *s )} {open return_type void
|
|
|
|
} {
|
|
|
|
code {_default_path = s;} {}
|
|
|
|
}
|
|
|
|
Function {default_path()} {open return_type {char *}
|
|
|
|
} {
|
|
|
|
code {return _default_path;} {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-14 02:21:50 +02:00
|
|
|
Function {new_project_chooser( char **default_path)} {open C return_type {char*}
|
2010-01-18 07:02:26 +01:00
|
|
|
} {
|
|
|
|
code {New_Project_Dialog nsd;
|
|
|
|
|
|
|
|
nsd.default_path( *default_path );
|
|
|
|
|
|
|
|
nsd.run();
|
|
|
|
|
2013-05-14 02:21:50 +02:00
|
|
|
if ( nsd.default_path() )
|
2013-07-31 06:36:35 +02:00
|
|
|
*default_path = nsd.default_path();
|
2010-01-18 07:02:26 +01:00
|
|
|
|
2012-02-24 04:32:49 +01:00
|
|
|
return nsd.path;} {}
|
2010-01-18 07:02:26 +01:00
|
|
|
}
|