]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/CreatePackage.bbs
54fecd0e0b2e106a15ce08658a2906321384fbad
[bbtk.git] / packages / toolsbbtk / bbs / appli / CreatePackage.bbs
1 description "Creates a new bbtk package file structure on disk (Graphical user interface for the script bbCreatePackage)."
2 author "laurent.guigues at creatis.insa-lyon.fr"
3 category "bbtk tool"
4
5 load wx
6 load std 
7
8 new OutputText windowTitle
9   set windowTitle.In "Package informations"
10
11 new DirectorySelector dir
12     set dir.Message "Select the location of your new package"
13
14 new InputText name
15     set name.Title "Name         (1 word)"
16     set name.In "NEW_PACKAGE"
17
18 new InputText author
19     set author.Title "Author(s)           (caracters   '<',  '>' not accepted...)"
20     set author.In "_author_"
21
22 new InputText description
23     set description.Title "Description            (caracters   '<',  '>' not accepted...)"
24     set description.In "_description_"
25
26 #new CommandButton cancelButton
27 #    set cancelButton.In "quit"
28 #    set cancelButton.Label "Cancel"
29
30 new CommandButton createButton
31     set createButton.In "print $concatStr.Out$; exec command; "
32     set createButton.Label "Run"
33
34 new LayoutLine buttons
35     set buttons.Orientation Horizontal
36  #   connect cancelButton.Widget buttons.Widget1
37     connect createButton.Widget buttons.Widget2
38
39 new LayoutLine main
40     connect windowTitle.Widget main.Widget1
41     connect name.Widget main.Widget2
42     connect author.Widget main.Widget3
43     connect description.Widget main.Widget4
44     connect buttons.Widget main.Widget5
45     set main.WinTitle "Create new black box package"
46     set main.WinDialog true
47     set main.WinWidth 400 
48     set main.WinHeight 250 
49
50
51 new ASCII ascii
52   set ascii.In 34
53
54 new ConcatStrings dirStr
55  set dirStr.In1 " "
56  connect ascii.Out dirStr.In2
57  connect dir.Out dirStr.In3
58  connect ascii.Out dirStr.In4
59  set dirStr.In5 " "
60
61 new ConcatStrings nameStr
62  set nameStr.In1 "  "
63  connect name.Out nameStr.In2
64  set nameStr.In3 " "
65
66 new ConcatStrings authorStr
67  set authorStr.In1 " '"
68  connect author.Out authorStr.In2
69  set authorStr.In3 "' "
70
71 new ConcatStrings descriptionStr
72  set descriptionStr.In1 " '"
73  connect description.Out descriptionStr.In2
74  set descriptionStr.In3 "' "
75
76
77
78 new Configuration conf
79 new ConcatStrings concatStrCommand
80     set concatStrCommand.In1 " "
81     connect ascii.Out                   concatStrCommand.In2
82     connect conf.BinPath                concatStrCommand.In3
83     connect conf.FileSeparator  concatStrCommand.In4
84     set                                         concatStrCommand.In5  "bbCreatePackage"
85     connect ascii.Out                   concatStrCommand.In6
86     set                                         concatStrCommand.In7  " "
87
88 new ConcatStrings concatStr
89     connect ascii.Out                           concatStr.In1
90     connect  concatStrCommand.Out concatStr.In2
91     connect dirStr.Out                          concatStr.In3
92     connect nameStr.Out                 concatStr.In4 
93     connect authorStr.Out                       concatStr.In5 
94     connect descriptionStr.Out          concatStr.In6
95     connect ascii.Out                           concatStr.In7
96
97
98 new ExecSystemCommand command
99     connect concatStr.Out command.In
100
101 exec dir
102 exec main
103