]> Creatis software - bbtk.git/blob - packages/wx/bbs/appli/exampleComplexSlider.bbs
Feature #1774
[bbtk.git] / packages / wx / bbs / appli / exampleComplexSlider.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 "More complex test of wx::Slider widget"
28 author "jpr[at]creatis[dot]insa[dash]lyon[dot]fr"
29 category "example"
30
31 load wx
32 // std needed for <std::string> to <int> adaptor
33 load std
34
35 new LayoutLine main
36    set main.Orientation H
37 new LayoutLine left
38 new LayoutLine right
39    set right.Orientation H
40 connect left.Widget  main.Widget1
41 connect right.Widget main.Widget2
42
43 // =============================================================
44
45 new Slider s1
46    set s1.Title  "s1 : Simple Slider,  Init = 33, O.Text : Reactive"
47    set s1.In 33
48    
49 new OutputText o1
50    set o1.Title "Sortie s1"
51    set o1.BoxProcessMode Reactive
52    
53 connect s1.Widget left.Widget1
54 connect s1.Out o1.In 
55
56 // -----------------------------------
57 new Slider s2
58    set s2.Min -110
59    set s2.Max 140
60    set s2.In -1
61    set s2.Title "s2 : Slider with Min, Max, ReactiveOnTrack, O.Text : Reactive"
62    set s2.ReactiveOnTrack 1
63         
64 new OutputText o2
65    set o2.Title "Sortie s2"
66    set o2.BoxProcessMode Reactive
67 connect s2.Widget left.Widget2
68 connect s2.Out o2.In
69
70 // -----------------------------------
71 new Slider s3
72    set s3.Min 12
73    set s3.Max 123456
74    set s3.Title "s3 : Slider with ChangeResolution, Always, O.Text : Reactive"
75    set s3.ChangeResolution True
76         
77 new OutputText o3
78    set o3.Title "Sortie s3"
79    set o3.BoxProcessMode Reactive
80    
81 connect s3.Widget left.Widget3
82 connect s3.Out o3.In
83
84 // -----------------------------------
85
86 new Add a
87    connect s1.Out a.In1 
88    connect s2.Out a.In2
89    set a.BoxProcessMode Reactive
90
91 new Slider s4
92    set s4.Title "s4 : Slider pos s1+s2"
93    set s4.BoxProcessMode Reactive
94 connect a.Out s4.In
95 # Warning : 'In' is the initial position, nothing more
96 #            Don't try to modify it later!
97    
98 connect s4.Widget left.Widget4
99
100 new OutputText o4
101    set o4.Title "Entree s4 (Add s1, s2)"
102    set o4.BoxProcessMode Reactive
103 connect a.Out o4.In
104
105 // -----------------------------------
106 connect o1.Widget left.Widget5
107 connect o2.Widget left.Widget6
108 connect o3.Widget left.Widget7
109 connect o4.Widget left.Widget8
110
111 // =======================================================
112
113 new OutputText ot11
114    set ot11.In  "Simple Slider"
115 connect ot11.Widget right.Widget1
116 new Slider s11
117    set s11.Orientation V
118 connect s11.Widget right.Widget2
119
120 new OutputText ot12
121    set ot12.In "Slider with Min, Max"
122    connect ot12.Widget right.Widget3
123 new Slider s12
124    set s12.Orientation V
125    set s12.Min -110
126    set s12.Max 140   
127 connect s12.Widget right.Widget4
128
129 new OutputText ot13
130    set ot13.In "Slider with ChangeResolution"
131    connect ot13.Widget right.Widget5
132 new Slider s13
133    set s13.Orientation V
134    set s13.Min 230
135    set s13.Max 1140 
136    set s13.ChangeResolution True     
137 connect s13.Widget right.Widget6
138
139 // ---------------------------------------------------
140
141 new CommandButton cmdBtn
142    set cmdBtn.In "exec s4; exec main"
143    set cmdBtn.Label "Refresh main"
144 connect cmdBtn.Widget left.Widget9
145
146 exec main