]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/GUICreatePackage.bbs
Feature #1774
[bbtk.git] / packages / toolsbbtk / bbs / appli / GUICreatePackage.bbs
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la SantÈ)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26
27 description "Creates a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)."
28 author "laurent.guigues@creatis.insa-lyon.fr"
29 category "toolsbbtk"
30
31 load wx
32 load std 
33
34
35 new DirectorySelector dir
36     set dir.Message "Select the location of your new package"
37
38 #-----------------------------------------------------------------------------
39 new OutputText dirOutput
40   connect dir.Out dirOutput.In
41
42 new OutputText windowTitle
43   set windowTitle.In "Create new package folder in :"
44
45 new InputText name
46     set name.Title "Name         (1 word)"
47     set name.In "PACKAGE_NAME"
48
49 new InputText author
50     set author.Title "Author(s)           "
51     set author.In "_author_"
52
53 new InputText description
54     set description.Title "Description            (html format)"
55     set description.In "_description_"
56
57 #new CommandButton cancelButton
58 #    set cancelButton.In "print **CANCEL**"
59 #    set cancelButton.Label "Cancel"
60
61 new CommandButton createButton
62     set createButton.In "print $concatStr.Out$; exec command; exec Box02;"
63     set createButton.Label "Run"
64     
65
66 new LayoutLine buttons
67     set buttons.Orientation Horizontal
68 #    connect cancelButton.Widget buttons.Widget1
69     connect createButton.Widget buttons.Widget2
70
71 new LayoutLine main
72     connect windowTitle.Widget main.Widget1
73     connect dirOutput.Widget main.Widget2
74     connect name.Widget main.Widget3
75     connect author.Widget main.Widget4
76     connect description.Widget main.Widget5
77     connect buttons.Widget main.Widget6
78     set main.WinTitle "Create new black box package"
79 #    set main.WinDialog true
80     set main.WinWidth 400 
81     set main.WinHeight 400 
82
83 new MultipleInputs close
84     connect close.Out main.WinClose
85 #    connect cancelButton.BoxChange close.In1
86     connect createButton.BoxChange close.In2
87
88 #-----------------------------------------------------------------------------
89 new Configuration conf
90 # on windows : enclose paths between double quotes 
91 # if system==0 (Linux) dquote=space (ascci code 32)
92 # if system==1 (Win) dquote==" (ascii code 34)
93 new StringSelect onsystem
94 set onsystem.In0 "32"
95 set onsystem.In1 "34"
96 new ASCII dquote
97 connect conf.SystemType onsystem.In
98 connect onsystem.Out dquote.In
99 #set dquote.In 34
100
101 new ConcatStrings dirStr
102  set dirStr.In1 " "
103  connect dquote.Out dirStr.In2
104  connect dir.Out dirStr.In3
105  connect dquote.Out dirStr.In4
106  set dirStr.In5 " "
107
108 new ConcatStrings nameStr
109  set nameStr.In1 "  "
110  connect name.Out nameStr.In2
111  set nameStr.In3 " "
112
113 new ConcatStrings authorStr
114  set authorStr.In1 " '"
115  connect author.Out authorStr.In2
116  set authorStr.In3 "' "
117
118 new ConcatStrings descriptionStr
119  set descriptionStr.In1 " '"
120  connect description.Out descriptionStr.In2
121  set descriptionStr.In3 "' "
122
123
124
125 new ConcatStrings concatStrCommand
126     set concatStrCommand.In1 " "
127 #EED-20-02-2012    connect dquote.Out                   concatStrCommand.In2
128 #EED-20-02-2012    connect conf.BinPath         concatStrCommand.In3
129 #EED-20-02-2012    connect conf.FileSeparator           concatStrCommand.In4
130     set                                 concatStrCommand.In5  "bbCreatePackage"
131 #EED-20-02-2012    connect dquote.Out                   concatStrCommand.In6
132     set                                 concatStrCommand.In7  " "
133
134 new ConcatStrings concatStr
135 #EED-20-02-2012    connect dquote.Out                   concatStr.In1
136     connect concatStrCommand.Out        concatStr.In2
137     connect dirStr.Out                  concatStr.In3
138     connect nameStr.Out                 concatStr.In4 
139     connect authorStr.Out               concatStr.In5 
140     connect descriptionStr.Out          concatStr.In6
141 #EED-20-02-2012    connect dquote.Out                   concatStr.In7
142
143 new ExecSystemCommand command
144     connect concatStr.Out command.In
145
146 /*
147 #new OutputText FinalMessage
148 #set FinalMessage.WinWidth 100
149 #set FinalMessage.WinHeight 100
150 #set FinalMessage.In "Done !"
151 */
152
153
154 ## ------------------------------------------------
155 new OutputText Box01
156    set Box01.In "            OK... Package created..."
157    set Box01.WinDialog true
158    set Box01.WinHeight 100
159    set Box01.WinTitle Confirmation
160    set Box01.WinWidth 400
161  
162 new LayoutLine Box02
163    set Box02.WinDialog true
164    set Box02.WinHeight 200
165    set Box02.WinTitle Confirmation
166    set Box02.WinWidth 400
167    connect Box01.Widget Box02.Widget2
168  
169  new OutputText Box03
170    connect Box03.Widget Box02.Widget1
171
172
173
174 exec dir
175 #message all 9
176 exec main
177