diff options
Diffstat (limited to 'src/frontend/dialog_newproject.fl')
-rwxr-xr-x | src/frontend/dialog_newproject.fl | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/frontend/dialog_newproject.fl b/src/frontend/dialog_newproject.fl new file mode 100755 index 0000000..2de1335 --- /dev/null +++ b/src/frontend/dialog_newproject.fl | |||
@@ -0,0 +1,86 @@ | |||
1 | # data file for the Fltk User Interface Designer (fluid) | ||
2 | version 1.0107 | ||
3 | header_name {.h} | ||
4 | code_name {.cxx} | ||
5 | decl {\#include <hd24fs.h>} {public | ||
6 | } | ||
7 | |||
8 | decl {\#include <convertlib.h>} {public | ||
9 | } | ||
10 | |||
11 | class dialog_newproject {open | ||
12 | } { | ||
13 | decl {int buttonclicked;} {public | ||
14 | } | ||
15 | decl {char projectname[65];} {public | ||
16 | } | ||
17 | Function {make_window()} {open | ||
18 | } { | ||
19 | Fl_Window {} { | ||
20 | label {New project} open | ||
21 | xywh {247 417 500 85} type Double color 52 | ||
22 | code0 {buttonclicked=0;} modal visible | ||
23 | } { | ||
24 | Fl_Button button_ok { | ||
25 | label OK | ||
26 | callback { | ||
27 | for (int i=0;i<65;i++) { | ||
28 | projectname[i]=0; | ||
29 | } | ||
30 | strncpy(projectname,currname->value(),64); | ||
31 | buttonclicked=1; //OK | ||
32 | Fl_Window * x = Fl::first_window(); | ||
33 | x->~Fl_Window();} selected | ||
34 | xywh {345 60 70 20} labelsize 12 | ||
35 | } | ||
36 | Fl_Button button_cancel { | ||
37 | label Cancel | ||
38 | callback {buttonclicked=2; //Cancel | ||
39 | Fl_Window * x = Fl::first_window(); | ||
40 | x->~Fl_Window();} | ||
41 | xywh {420 60 70 20} labelsize 12 | ||
42 | } | ||
43 | Fl_Input currname { | ||
44 | label {Project name:} | ||
45 | callback {char filteredname[65]; | ||
46 | int x=strlen(o->value()); | ||
47 | if (x>64) { x=64; } | ||
48 | int src=0; | ||
49 | int filtered=0; | ||
50 | for (int i=0;i<x;i++) { | ||
51 | if ( | ||
52 | (o->value()[i]=='\\\\') | ||
53 | || (o->value()[i]=='/') | ||
54 | || (o->value()[i]==':') | ||
55 | || (o->value()[i]=='*') | ||
56 | || (o->value()[i]=='?') | ||
57 | || (o->value()[i]=='"') | ||
58 | || (o->value()[i]=='<') | ||
59 | || (o->value()[i]=='>') | ||
60 | || (o->value()[i]=='\\\\') | ||
61 | || (o->value()[i]=='|')) | ||
62 | { | ||
63 | filtered=1; | ||
64 | continue; | ||
65 | } | ||
66 | filteredname[src]=o->value()[i]; | ||
67 | src++; | ||
68 | } | ||
69 | filteredname[src]='\\0'; | ||
70 | if (filtered==1) { | ||
71 | int pos=o->position()-1; | ||
72 | if (pos<0) pos=0; | ||
73 | o->value(filteredname); | ||
74 | o->position(pos,pos); | ||
75 | }} | ||
76 | xywh {100 35 390 20} labelsize 12 when 1 textsize 12 | ||
77 | code0 {o->maximum_size(64);} | ||
78 | code1 {o->value("Proj Name"); o->take_focus();} | ||
79 | } | ||
80 | Fl_Box {} { | ||
81 | label {Please specify the name for the new project below:} | ||
82 | xywh {5 8 485 19} labelfont 1 labelsize 12 align 20 | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | } | ||