1 | # This program is under CECILL_B licence. See footer for details. |
---|
2 | |
---|
3 | proc info_create { args } { |
---|
4 | set mandatory_arguments { path_father address } |
---|
5 | initWidget |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | set widgetInfo($address-status) 1 |
---|
10 | set widgetInfo($address-status_txt) "" |
---|
11 | set title [dTree_getAttribute $XMLtree $full_address_XML "title"] |
---|
12 | set widgetInfo($address-type) [dTree_tryGetAttribute $XMLtree $full_address_XML "type" "string"] |
---|
13 | set widgetInfo($address-visibility) [dTree_tryGetAttribute $XMLtree $full_address_XML "visibility" "visible"] |
---|
14 | |
---|
15 | ttk::frame $win |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | ttk::label $win.title -text $title -style "Multiple.TLabel" |
---|
22 | |
---|
23 | switch $widgetInfo($address-type) { |
---|
24 | "liststring" { |
---|
25 | ttk::frame $win.result |
---|
26 | listbox $win.result.lb -listvariable widgetInfo($address-content) -yscrollcommand [list $win.result.sby set] -height 5 -activestyle none -state disabled -background [ThemeColor 1.0] |
---|
27 | # avoid tab scrolling for mousewheel |
---|
28 | bind $win.result.lb <MouseWheel> {+set tabscroll 0} |
---|
29 | bind $win.result.lb <Leave> {+set tabscroll 1} |
---|
30 | |
---|
31 | ttk::scrollbar $win.result.sby -orient vertical -command [list $win.result.lb yview] |
---|
32 | grid $win.result.lb -sticky news -column 0 -row 0 |
---|
33 | grid $win.result.sby -sticky news -column 1 -row 0 |
---|
34 | # avoid tab scrolling for mousewheel |
---|
35 | bind $win.result.sby <MouseWheel> {+set tabscroll 0} |
---|
36 | bind $win.result.sby <Leave> {+set tabscroll 1} |
---|
37 | } |
---|
38 | default { |
---|
39 | ttk::label $win.result -textvariable widgetInfo($address-variable) -relief sunken -wraplength $widgetInfo(guiSmallWidgetWidth) |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | #ttk::label $win.status -textvariable widgetInfo($address-status_txt) -foreground red |
---|
44 | |
---|
45 | if {$widgetInfo($address-visibility) != "hidden"} { |
---|
46 | eval $widgetInfo(packme-$win) |
---|
47 | |
---|
48 | } else { |
---|
49 | set widgetInfo(packme-$win) "" |
---|
50 | eval $widgetInfo(packme-$win) |
---|
51 | } |
---|
52 | pack $win.title -side top |
---|
53 | pack $win.result -side top |
---|
54 | |
---|
55 | |
---|
56 | append widgetInfo($address-refresh) [subst { info_refresh $win $address }] |
---|
57 | append widgetInfo($address-check) [ subst { info_check $win $address }] |
---|
58 | |
---|
59 | finishWidget |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | # clean the widget callBack on dstruction |
---|
64 | bind $win <Destroy> [ subst {widget_destroy $win $address}] |
---|
65 | |
---|
66 | return $win |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | proc info_check {win address} { |
---|
71 | global widgetInfo |
---|
72 | |
---|
73 | if {$widgetInfo($address-type) == "liststring"} { |
---|
74 | set widgetInfo($address-variable) [join $widgetInfo($address-content) ";"] |
---|
75 | } |
---|
76 | } |
---|
77 | |
---|
78 | proc info_refresh {win address} { |
---|
79 | global widgetInfo |
---|
80 | if {$widgetInfo($address-type) == "liststring"} { |
---|
81 | set widgetInfo($address-content) [split $widgetInfo($address-variable) ";"] |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | # Copyright CERFACS 2014 |
---|
90 | # |
---|
91 | # antoine.dauptain@cerfacs.fr |
---|
92 | # |
---|
93 | # This software is a computer program whose purpose is to ensure technology |
---|
94 | # transfer between academia and industry. |
---|
95 | # |
---|
96 | # This software is governed by the CeCILL-B license under French law and |
---|
97 | # abiding by the rules of distribution of free software. You can use, |
---|
98 | # modify and/ or redistribute the software under the terms of the CeCILL-B |
---|
99 | # license as circulated by CEA, CNRS and INRIA at the following URL |
---|
100 | # "http://www.cecill.info". |
---|
101 | # |
---|
102 | # As a counterpart to the access to the source code and rights to copy, |
---|
103 | # modify and redistribute granted by the license, users are provided only |
---|
104 | # with a limited warranty and the software's author, the holder of the |
---|
105 | # economic rights, and the successive licensors have only limited |
---|
106 | # liability. |
---|
107 | # |
---|
108 | # In this respect, the user's attention is drawn to the risks associated |
---|
109 | # with loading, using, modifying and/or developing or reproducing the |
---|
110 | # software by the user in light of its specific status of free software, |
---|
111 | # that may mean that it is complicated to manipulate, and that also |
---|
112 | # therefore means that it is reserved for developers and experienced |
---|
113 | # professionals having in-depth computer knowledge. Users are therefore |
---|
114 | # encouraged to load and test the software's suitability as regards their |
---|
115 | # requirements in conditions enabling the security of their systems and/or |
---|
116 | # data to be ensured and, more generally, to use and operate it in the |
---|
117 | # same conditions as regards security. |
---|
118 | # |
---|
119 | # The fact that you are presently reading this means that you have had |
---|
120 | # knowledge of the CeCILL-B license and that you accept its terms. |
---|