]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/GUICreatePackage.bbs
8e006e9ebde0f7e48e4c5368f253cbdd803a1884
[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 "Package informations"
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;"
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 250 
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     connect dquote.Out                  concatStrCommand.In2
102     connect conf.BinPath                concatStrCommand.In3
103     connect conf.FileSeparator          concatStrCommand.In4
104     set                                 concatStrCommand.In5  "bbCreatePackage"
105     connect dquote.Out                  concatStrCommand.In6
106     set                                 concatStrCommand.In7  " "
107
108 new ConcatStrings concatStr
109     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     connect dquote.Out                  concatStr.In7
116
117
118 new ExecSystemCommand command
119     connect concatStr.Out command.In
120
121 /*
122 new OutputText FinalMessage
123 set FinalMessage.WinWidth 100
124 set FinalMessage.WinHeight 100
125 set FinalMessage.In "Done !"
126 */
127
128 exec dir
129 #message all 9
130 exec main
131