]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/GUICreatePackage.bbs
no message
[bbtk.git] / packages / toolsbbtk / bbs / appli / GUICreatePackage.bbs
1 description "Creates a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)."
2 author "laurent.guigues@creatis.insa-lyon.fr"
3 category "toolsbbtk"
4
5 load wx
6 load std 
7
8
9 new DirectorySelector dir
10     set dir.Message "Select the location of your new package"
11
12 #-----------------------------------------------------------------------------
13 new OutputText dirOutput
14   connect dir.Out dirOutput.In
15
16 new OutputText windowTitle
17   set windowTitle.In "Create new package folder in :"
18
19 new InputText name
20     set name.Title "Name         (1 word)"
21     set name.In "PACKAGE_NAME"
22
23 new InputText author
24     set author.Title "Author(s)           "
25     set author.In "_author_"
26
27 new InputText description
28     set description.Title "Description            (html format)"
29     set description.In "_description_"
30
31 #new CommandButton cancelButton
32 #    set cancelButton.In "print **CANCEL**"
33 #    set cancelButton.Label "Cancel"
34
35 new CommandButton createButton
36     set createButton.In "print $concatStr.Out$; exec command; exec Box02;"
37     set createButton.Label "Run"
38     
39
40 new LayoutLine buttons
41     set buttons.Orientation Horizontal
42 #    connect cancelButton.Widget buttons.Widget1
43     connect createButton.Widget buttons.Widget2
44
45 new LayoutLine main
46     connect windowTitle.Widget main.Widget1
47     connect dirOutput.Widget main.Widget2
48     connect name.Widget main.Widget3
49     connect author.Widget main.Widget4
50     connect description.Widget main.Widget5
51     connect buttons.Widget main.Widget6
52     set main.WinTitle "Create new black box package"
53 #    set main.WinDialog true
54     set main.WinWidth 400 
55     set main.WinHeight 400 
56
57 new MultipleInputs close
58     connect close.Out main.WinClose
59 #    connect cancelButton.BoxChange close.In1
60     connect createButton.BoxChange close.In2
61
62 #-----------------------------------------------------------------------------
63 new Configuration conf
64 # on windows : enclose paths between double quotes 
65 # if system==0 (Linux) dquote=space (ascci code 32)
66 # if system==1 (Win) dquote==" (ascii code 34)
67 new StringSelect onsystem
68 set onsystem.In0 "32"
69 set onsystem.In1 "34"
70 new ASCII dquote
71 connect conf.SystemType onsystem.In
72 connect onsystem.Out dquote.In
73 #set dquote.In 34
74
75 new ConcatStrings dirStr
76  set dirStr.In1 " "
77  connect dquote.Out dirStr.In2
78  connect dir.Out dirStr.In3
79  connect dquote.Out dirStr.In4
80  set dirStr.In5 " "
81
82 new ConcatStrings nameStr
83  set nameStr.In1 "  "
84  connect name.Out nameStr.In2
85  set nameStr.In3 " "
86
87 new ConcatStrings authorStr
88  set authorStr.In1 " '"
89  connect author.Out authorStr.In2
90  set authorStr.In3 "' "
91
92 new ConcatStrings descriptionStr
93  set descriptionStr.In1 " '"
94  connect description.Out descriptionStr.In2
95  set descriptionStr.In3 "' "
96
97
98
99 new ConcatStrings concatStrCommand
100     set concatStrCommand.In1 " "
101 #EED-20-02-2012    connect dquote.Out                   concatStrCommand.In2
102 #EED-20-02-2012    connect conf.BinPath         concatStrCommand.In3
103 #EED-20-02-2012    connect conf.FileSeparator           concatStrCommand.In4
104     set                                 concatStrCommand.In5  "bbCreatePackage"
105 #EED-20-02-2012    connect dquote.Out                   concatStrCommand.In6
106     set                                 concatStrCommand.In7  " "
107
108 new ConcatStrings concatStr
109 #EED-20-02-2012    connect dquote.Out                   concatStr.In1
110     connect concatStrCommand.Out        concatStr.In2
111     connect dirStr.Out                  concatStr.In3
112     connect nameStr.Out                 concatStr.In4 
113     connect authorStr.Out               concatStr.In5 
114     connect descriptionStr.Out          concatStr.In6
115 #EED-20-02-2012    connect dquote.Out                   concatStr.In7
116
117 new ExecSystemCommand command
118     connect concatStr.Out command.In
119
120 /*
121 #new OutputText FinalMessage
122 #set FinalMessage.WinWidth 100
123 #set FinalMessage.WinHeight 100
124 #set FinalMessage.In "Done !"
125 */
126
127
128 ## ------------------------------------------------
129 new OutputText Box01
130    set Box01.In "            OK... Package created..."
131    set Box01.WinDialog true
132    set Box01.WinHeight 100
133    set Box01.WinTitle Confirmation
134    set Box01.WinWidth 400
135  
136 new LayoutLine Box02
137    set Box02.WinDialog true
138    set Box02.WinHeight 200
139    set Box02.WinTitle Confirmation
140    set Box02.WinWidth 400
141    connect Box01.Widget Box02.Widget2
142  
143  new OutputText Box03
144    connect Box03.Widget Box02.Widget1
145
146
147
148 exec dir
149 #message all 9
150 exec main
151