@babylonjs/gui 5.21.0 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2D/adtInstrumentation.js +70 -90
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +6 -0
- package/2D/advancedDynamicTexture.js +554 -622
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js +76 -90
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js +86 -106
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js +395 -415
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.js +187 -230
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js +1067 -1353
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js +152 -196
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js +32 -40
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js +30 -35
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/grid.js +172 -212
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js +489 -592
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js +9 -16
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js +380 -467
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js +234 -273
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js +147 -198
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js +87 -113
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js +106 -127
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js +60 -72
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js +439 -543
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js +241 -329
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +182 -230
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js +86 -109
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +148 -178
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js +64 -80
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js +91 -115
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js +114 -135
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.js +5 -5
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.js +322 -384
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.js +27 -41
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.js +105 -121
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js +101 -123
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/math2D.js +62 -70
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js +30 -32
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.js +71 -89
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.js +55 -73
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.js +71 -104
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.js +70 -84
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.js +40 -59
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/abstractButton3D.js +8 -12
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.js +30 -35
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js +57 -71
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +47 -60
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js +123 -158
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.js +28 -38
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/handMenu.js +20 -29
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.js +52 -72
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js +160 -200
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js +176 -206
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js +24 -30
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js +57 -71
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.js +6 -13
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.js +43 -54
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js +168 -222
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.js +29 -39
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.js +36 -49
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js +126 -154
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +223 -272
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js +55 -66
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js +24 -30
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js +85 -107
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.js +68 -103
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/slateGizmo.js +165 -182
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js +76 -101
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js +110 -119
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
- package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
- package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js +56 -69
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/shaders/handle.fragment.js +3 -3
- package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
- package/3D/materials/handle/shaders/handle.vertex.js +3 -3
- package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
- package/3D/vector3WithInfo.js +6 -12
- package/3D/vector3WithInfo.js.map +1 -1
- package/legacy/legacy.js +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +2 -5
package/2D/controls/selector.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
1
|
import { Rectangle } from "./rectangle.js";
|
|
3
2
|
import { StackPanel } from "./stackPanel.js";
|
|
4
3
|
import { Control } from "./control.js";
|
|
@@ -10,12 +9,12 @@ import { Container } from "./container.js";
|
|
|
10
9
|
/** Class used to create a RadioGroup
|
|
11
10
|
* which contains groups of radio buttons
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
export class SelectorGroup {
|
|
14
13
|
/**
|
|
15
14
|
* Creates a new SelectorGroup
|
|
16
15
|
* @param name of group, used as a group heading
|
|
17
16
|
*/
|
|
18
|
-
|
|
17
|
+
constructor(
|
|
19
18
|
/** name of SelectorGroup */
|
|
20
19
|
name) {
|
|
21
20
|
this.name = name;
|
|
@@ -25,42 +24,30 @@ var SelectorGroup = /** @class */ (function () {
|
|
|
25
24
|
this._groupPanel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
26
25
|
this._groupHeader = this._addGroupHeader(name);
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
get: function () {
|
|
47
|
-
return this._groupHeader.text;
|
|
48
|
-
},
|
|
49
|
-
set: function (label) {
|
|
50
|
-
if (this._groupHeader.text === "label") {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this._groupHeader.text = label;
|
|
54
|
-
},
|
|
55
|
-
enumerable: false,
|
|
56
|
-
configurable: true
|
|
57
|
-
});
|
|
27
|
+
/** Gets the groupPanel of the SelectorGroup */
|
|
28
|
+
get groupPanel() {
|
|
29
|
+
return this._groupPanel;
|
|
30
|
+
}
|
|
31
|
+
/** Gets the selectors array */
|
|
32
|
+
get selectors() {
|
|
33
|
+
return this._selectors;
|
|
34
|
+
}
|
|
35
|
+
/** Gets and sets the group header */
|
|
36
|
+
get header() {
|
|
37
|
+
return this._groupHeader.text;
|
|
38
|
+
}
|
|
39
|
+
set header(label) {
|
|
40
|
+
if (this._groupHeader.text === "label") {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._groupHeader.text = label;
|
|
44
|
+
}
|
|
58
45
|
/**
|
|
59
46
|
* @param text
|
|
60
47
|
* @hidden
|
|
61
48
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
_addGroupHeader(text) {
|
|
50
|
+
const groupHeading = new TextBlock("groupHead", text);
|
|
64
51
|
groupHeading.width = 0.9;
|
|
65
52
|
groupHeading.height = "30px";
|
|
66
53
|
groupHeading.textWrapping = true;
|
|
@@ -70,49 +57,41 @@ var SelectorGroup = /** @class */ (function () {
|
|
|
70
57
|
groupHeading.left = "2px";
|
|
71
58
|
this._groupPanel.addControl(groupHeading);
|
|
72
59
|
return groupHeading;
|
|
73
|
-
}
|
|
60
|
+
}
|
|
74
61
|
/**
|
|
75
62
|
* @param selectorNb
|
|
76
63
|
* @hidden
|
|
77
64
|
*/
|
|
78
|
-
|
|
65
|
+
_getSelector(selectorNb) {
|
|
79
66
|
if (selectorNb < 0 || selectorNb >= this._selectors.length) {
|
|
80
67
|
return;
|
|
81
68
|
}
|
|
82
69
|
return this._selectors[selectorNb];
|
|
83
|
-
}
|
|
70
|
+
}
|
|
84
71
|
/** Removes the selector at the given position
|
|
85
72
|
* @param selectorNb the position of the selector within the group
|
|
86
73
|
*/
|
|
87
|
-
|
|
74
|
+
removeSelector(selectorNb) {
|
|
88
75
|
if (selectorNb < 0 || selectorNb >= this._selectors.length) {
|
|
89
76
|
return;
|
|
90
77
|
}
|
|
91
78
|
this._groupPanel.removeControl(this._selectors[selectorNb]);
|
|
92
79
|
this._selectors.splice(selectorNb, 1);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
}());
|
|
96
|
-
export { SelectorGroup };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
97
82
|
/** Class used to create a CheckboxGroup
|
|
98
83
|
* which contains groups of checkbox buttons
|
|
99
84
|
*/
|
|
100
|
-
|
|
101
|
-
__extends(CheckboxGroup, _super);
|
|
102
|
-
function CheckboxGroup() {
|
|
103
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
104
|
-
}
|
|
85
|
+
export class CheckboxGroup extends SelectorGroup {
|
|
105
86
|
/** Adds a checkbox as a control
|
|
106
87
|
* @param text is the label for the selector
|
|
107
88
|
* @param func is the function called when the Selector is checked
|
|
108
89
|
* @param checked is true when Selector is checked
|
|
109
90
|
*/
|
|
110
91
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
111
|
-
|
|
112
|
-
if (func === void 0) { func = function (s) { }; }
|
|
113
|
-
if (checked === void 0) { checked = false; }
|
|
92
|
+
addCheckbox(text, func = (s) => { }, checked = false) {
|
|
114
93
|
checked = checked || false;
|
|
115
|
-
|
|
94
|
+
const button = new Checkbox();
|
|
116
95
|
button.width = "20px";
|
|
117
96
|
button.height = "20px";
|
|
118
97
|
button.color = "#364249";
|
|
@@ -121,7 +100,7 @@ var CheckboxGroup = /** @class */ (function (_super) {
|
|
|
121
100
|
button.onIsCheckedChangedObservable.add(function (state) {
|
|
122
101
|
func(state);
|
|
123
102
|
});
|
|
124
|
-
|
|
103
|
+
const _selector = Control.AddHeader(button, text, "200px", { isHorizontal: true, controlFirst: true });
|
|
125
104
|
_selector.height = "30px";
|
|
126
105
|
_selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
127
106
|
_selector.left = "4px";
|
|
@@ -132,51 +111,47 @@ var CheckboxGroup = /** @class */ (function (_super) {
|
|
|
132
111
|
button.color = this.groupPanel.parent.parent.buttonColor;
|
|
133
112
|
button.background = this.groupPanel.parent.parent.buttonBackground;
|
|
134
113
|
}
|
|
135
|
-
}
|
|
114
|
+
}
|
|
136
115
|
/**
|
|
137
116
|
* @param selectorNb
|
|
138
117
|
* @param label
|
|
139
118
|
* @hidden
|
|
140
119
|
*/
|
|
141
|
-
|
|
120
|
+
_setSelectorLabel(selectorNb, label) {
|
|
142
121
|
this.selectors[selectorNb].children[1].text = label;
|
|
143
|
-
}
|
|
122
|
+
}
|
|
144
123
|
/**
|
|
145
124
|
* @param selectorNb
|
|
146
125
|
* @param color
|
|
147
126
|
* @hidden
|
|
148
127
|
*/
|
|
149
|
-
|
|
128
|
+
_setSelectorLabelColor(selectorNb, color) {
|
|
150
129
|
this.selectors[selectorNb].children[1].color = color;
|
|
151
|
-
}
|
|
130
|
+
}
|
|
152
131
|
/**
|
|
153
132
|
* @param selectorNb
|
|
154
133
|
* @param color
|
|
155
134
|
* @hidden
|
|
156
135
|
*/
|
|
157
|
-
|
|
136
|
+
_setSelectorButtonColor(selectorNb, color) {
|
|
158
137
|
this.selectors[selectorNb].children[0].color = color;
|
|
159
|
-
}
|
|
138
|
+
}
|
|
160
139
|
/**
|
|
161
140
|
* @param selectorNb
|
|
162
141
|
* @param color
|
|
163
142
|
* @hidden
|
|
164
143
|
*/
|
|
165
|
-
|
|
144
|
+
_setSelectorButtonBackground(selectorNb, color) {
|
|
166
145
|
this.selectors[selectorNb].children[0].background = color;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
}(SelectorGroup));
|
|
170
|
-
export { CheckboxGroup };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
171
148
|
/** Class used to create a RadioGroup
|
|
172
149
|
* which contains groups of radio buttons
|
|
173
150
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
_this._selectNb = 0;
|
|
179
|
-
return _this;
|
|
151
|
+
export class RadioGroup extends SelectorGroup {
|
|
152
|
+
constructor() {
|
|
153
|
+
super(...arguments);
|
|
154
|
+
this._selectNb = 0;
|
|
180
155
|
}
|
|
181
156
|
/** Adds a radio button as a control
|
|
182
157
|
* @param label is the label for the selector
|
|
@@ -184,11 +159,9 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
184
159
|
* @param checked is true when Selector is checked
|
|
185
160
|
*/
|
|
186
161
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
var nb = this._selectNb++;
|
|
191
|
-
var button = new RadioButton();
|
|
162
|
+
addRadio(label, func = (n) => { }, checked = false) {
|
|
163
|
+
const nb = this._selectNb++;
|
|
164
|
+
const button = new RadioButton();
|
|
192
165
|
button.name = label;
|
|
193
166
|
button.width = "20px";
|
|
194
167
|
button.height = "20px";
|
|
@@ -201,7 +174,7 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
201
174
|
func(nb);
|
|
202
175
|
}
|
|
203
176
|
});
|
|
204
|
-
|
|
177
|
+
const _selector = Control.AddHeader(button, label, "200px", { isHorizontal: true, controlFirst: true });
|
|
205
178
|
_selector.height = "30px";
|
|
206
179
|
_selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
207
180
|
_selector.left = "4px";
|
|
@@ -212,50 +185,44 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
212
185
|
button.color = this.groupPanel.parent.parent.buttonColor;
|
|
213
186
|
button.background = this.groupPanel.parent.parent.buttonBackground;
|
|
214
187
|
}
|
|
215
|
-
}
|
|
188
|
+
}
|
|
216
189
|
/**
|
|
217
190
|
* @param selectorNb
|
|
218
191
|
* @param label
|
|
219
192
|
* @hidden
|
|
220
193
|
*/
|
|
221
|
-
|
|
194
|
+
_setSelectorLabel(selectorNb, label) {
|
|
222
195
|
this.selectors[selectorNb].children[1].text = label;
|
|
223
|
-
}
|
|
196
|
+
}
|
|
224
197
|
/**
|
|
225
198
|
* @param selectorNb
|
|
226
199
|
* @param color
|
|
227
200
|
* @hidden
|
|
228
201
|
*/
|
|
229
|
-
|
|
202
|
+
_setSelectorLabelColor(selectorNb, color) {
|
|
230
203
|
this.selectors[selectorNb].children[1].color = color;
|
|
231
|
-
}
|
|
204
|
+
}
|
|
232
205
|
/**
|
|
233
206
|
* @param selectorNb
|
|
234
207
|
* @param color
|
|
235
208
|
* @hidden
|
|
236
209
|
*/
|
|
237
|
-
|
|
210
|
+
_setSelectorButtonColor(selectorNb, color) {
|
|
238
211
|
this.selectors[selectorNb].children[0].color = color;
|
|
239
|
-
}
|
|
212
|
+
}
|
|
240
213
|
/**
|
|
241
214
|
* @param selectorNb
|
|
242
215
|
* @param color
|
|
243
216
|
* @hidden
|
|
244
217
|
*/
|
|
245
|
-
|
|
218
|
+
_setSelectorButtonBackground(selectorNb, color) {
|
|
246
219
|
this.selectors[selectorNb].children[0].background = color;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
}(SelectorGroup));
|
|
250
|
-
export { RadioGroup };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
251
222
|
/** Class used to create a SliderGroup
|
|
252
223
|
* which contains groups of slider buttons
|
|
253
224
|
*/
|
|
254
|
-
|
|
255
|
-
__extends(SliderGroup, _super);
|
|
256
|
-
function SliderGroup() {
|
|
257
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
258
|
-
}
|
|
225
|
+
export class SliderGroup extends SelectorGroup {
|
|
259
226
|
/**
|
|
260
227
|
* Adds a slider to the SelectorGroup
|
|
261
228
|
* @param label is the label for the SliderBar
|
|
@@ -266,18 +233,12 @@ var SliderGroup = /** @class */ (function (_super) {
|
|
|
266
233
|
* @param value is the start value for the Slider between min and max
|
|
267
234
|
* @param onValueChange is the function used to format the value displayed, eg radians to degrees
|
|
268
235
|
*/
|
|
269
|
-
|
|
236
|
+
addSlider(label,
|
|
270
237
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
271
|
-
func, unit, min, max, value, onValueChange) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (max === void 0) { max = 0; }
|
|
276
|
-
if (value === void 0) { value = 0; }
|
|
277
|
-
if (onValueChange === void 0) { onValueChange = function (v) {
|
|
278
|
-
return v | 0;
|
|
279
|
-
}; }
|
|
280
|
-
var button = new Slider();
|
|
238
|
+
func = (v) => { }, unit = "Units", min = 0, max = 0, value = 0, onValueChange = (v) => {
|
|
239
|
+
return v | 0;
|
|
240
|
+
}) {
|
|
241
|
+
const button = new Slider();
|
|
281
242
|
button.name = unit;
|
|
282
243
|
button.value = value;
|
|
283
244
|
button.minimum = min;
|
|
@@ -294,7 +255,7 @@ var SliderGroup = /** @class */ (function (_super) {
|
|
|
294
255
|
button.parent.children[0].text = button.parent.children[0].name + ": " + onValueChange(value) + " " + button.name;
|
|
295
256
|
func(value);
|
|
296
257
|
});
|
|
297
|
-
|
|
258
|
+
const _selector = Control.AddHeader(button, label + ": " + onValueChange(value) + " " + unit, "30px", { isHorizontal: false, controlFirst: false });
|
|
298
259
|
_selector.height = "60px";
|
|
299
260
|
_selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
300
261
|
_selector.left = "4px";
|
|
@@ -305,252 +266,215 @@ var SliderGroup = /** @class */ (function (_super) {
|
|
|
305
266
|
button.color = this.groupPanel.parent.parent.buttonColor;
|
|
306
267
|
button.background = this.groupPanel.parent.parent.buttonBackground;
|
|
307
268
|
}
|
|
308
|
-
}
|
|
269
|
+
}
|
|
309
270
|
/**
|
|
310
271
|
* @param selectorNb
|
|
311
272
|
* @param label
|
|
312
273
|
* @hidden
|
|
313
274
|
*/
|
|
314
|
-
|
|
275
|
+
_setSelectorLabel(selectorNb, label) {
|
|
315
276
|
this.selectors[selectorNb].children[0].name = label;
|
|
316
277
|
this.selectors[selectorNb].children[0].text =
|
|
317
278
|
label + ": " + this.selectors[selectorNb].children[1].value + " " + this.selectors[selectorNb].children[1].name;
|
|
318
|
-
}
|
|
279
|
+
}
|
|
319
280
|
/**
|
|
320
281
|
* @param selectorNb
|
|
321
282
|
* @param color
|
|
322
283
|
* @hidden
|
|
323
284
|
*/
|
|
324
|
-
|
|
285
|
+
_setSelectorLabelColor(selectorNb, color) {
|
|
325
286
|
this.selectors[selectorNb].children[0].color = color;
|
|
326
|
-
}
|
|
287
|
+
}
|
|
327
288
|
/**
|
|
328
289
|
* @param selectorNb
|
|
329
290
|
* @param color
|
|
330
291
|
* @hidden
|
|
331
292
|
*/
|
|
332
|
-
|
|
293
|
+
_setSelectorButtonColor(selectorNb, color) {
|
|
333
294
|
this.selectors[selectorNb].children[1].color = color;
|
|
334
|
-
}
|
|
295
|
+
}
|
|
335
296
|
/**
|
|
336
297
|
* @param selectorNb
|
|
337
298
|
* @param color
|
|
338
299
|
* @hidden
|
|
339
300
|
*/
|
|
340
|
-
|
|
301
|
+
_setSelectorButtonBackground(selectorNb, color) {
|
|
341
302
|
this.selectors[selectorNb].children[1].background = color;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
}(SelectorGroup));
|
|
345
|
-
export { SliderGroup };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
346
305
|
/** Class used to hold the controls for the checkboxes, radio buttons and sliders
|
|
347
306
|
* @see https://doc.babylonjs.com/how_to/selector
|
|
348
307
|
*/
|
|
349
|
-
|
|
350
|
-
__extends(SelectionPanel, _super);
|
|
308
|
+
export class SelectionPanel extends Rectangle {
|
|
351
309
|
/**
|
|
352
310
|
* Creates a new SelectionPanel
|
|
353
311
|
* @param name of SelectionPanel
|
|
354
312
|
* @param groups is an array of SelectionGroups
|
|
355
313
|
*/
|
|
356
|
-
|
|
314
|
+
constructor(
|
|
357
315
|
/** name of SelectionPanel */
|
|
358
316
|
name,
|
|
359
317
|
/** an array of SelectionGroups */
|
|
360
|
-
groups) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
_this._panel.width = 0.95;
|
|
318
|
+
groups = []) {
|
|
319
|
+
super(name);
|
|
320
|
+
this.name = name;
|
|
321
|
+
this.groups = groups;
|
|
322
|
+
this._buttonColor = "#364249";
|
|
323
|
+
this._buttonBackground = "#CCCCCC";
|
|
324
|
+
this._headerColor = "black";
|
|
325
|
+
this._barColor = "white";
|
|
326
|
+
this._barHeight = "2px";
|
|
327
|
+
this._spacerHeight = "20px";
|
|
328
|
+
this._bars = new Array();
|
|
329
|
+
this._groups = groups;
|
|
330
|
+
this.thickness = 2;
|
|
331
|
+
this._panel = new StackPanel();
|
|
332
|
+
this._panel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
333
|
+
this._panel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
334
|
+
this._panel.top = 5;
|
|
335
|
+
this._panel.left = 5;
|
|
336
|
+
this._panel.width = 0.95;
|
|
380
337
|
if (groups.length > 0) {
|
|
381
|
-
for (
|
|
382
|
-
|
|
383
|
-
|
|
338
|
+
for (let i = 0; i < groups.length - 1; i++) {
|
|
339
|
+
this._panel.addControl(groups[i].groupPanel);
|
|
340
|
+
this._addSpacer();
|
|
384
341
|
}
|
|
385
|
-
|
|
342
|
+
this._panel.addControl(groups[groups.length - 1].groupPanel);
|
|
386
343
|
}
|
|
387
|
-
|
|
388
|
-
return _this;
|
|
344
|
+
this.addControl(this._panel);
|
|
389
345
|
}
|
|
390
|
-
|
|
346
|
+
_getTypeName() {
|
|
391
347
|
return "SelectionPanel";
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
this._headerColor = color;
|
|
411
|
-
this._setHeaderColor();
|
|
412
|
-
},
|
|
413
|
-
enumerable: false,
|
|
414
|
-
configurable: true
|
|
415
|
-
});
|
|
416
|
-
SelectionPanel.prototype._setHeaderColor = function () {
|
|
417
|
-
for (var i = 0; i < this._groups.length; i++) {
|
|
348
|
+
}
|
|
349
|
+
/** Gets the (stack) panel of the SelectionPanel */
|
|
350
|
+
get panel() {
|
|
351
|
+
return this._panel;
|
|
352
|
+
}
|
|
353
|
+
/** Gets or sets the headerColor */
|
|
354
|
+
get headerColor() {
|
|
355
|
+
return this._headerColor;
|
|
356
|
+
}
|
|
357
|
+
set headerColor(color) {
|
|
358
|
+
if (this._headerColor === color) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
this._headerColor = color;
|
|
362
|
+
this._setHeaderColor();
|
|
363
|
+
}
|
|
364
|
+
_setHeaderColor() {
|
|
365
|
+
for (let i = 0; i < this._groups.length; i++) {
|
|
418
366
|
this._groups[i].groupPanel.children[0].color = this._headerColor;
|
|
419
367
|
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
});
|
|
436
|
-
SelectionPanel.prototype._setbuttonColor = function () {
|
|
437
|
-
for (var i = 0; i < this._groups.length; i++) {
|
|
438
|
-
for (var j = 0; j < this._groups[i].selectors.length; j++) {
|
|
368
|
+
}
|
|
369
|
+
/** Gets or sets the button color */
|
|
370
|
+
get buttonColor() {
|
|
371
|
+
return this._buttonColor;
|
|
372
|
+
}
|
|
373
|
+
set buttonColor(color) {
|
|
374
|
+
if (this._buttonColor === color) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
this._buttonColor = color;
|
|
378
|
+
this._setbuttonColor();
|
|
379
|
+
}
|
|
380
|
+
_setbuttonColor() {
|
|
381
|
+
for (let i = 0; i < this._groups.length; i++) {
|
|
382
|
+
for (let j = 0; j < this._groups[i].selectors.length; j++) {
|
|
439
383
|
this._groups[i]._setSelectorButtonColor(j, this._buttonColor);
|
|
440
384
|
}
|
|
441
385
|
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
});
|
|
458
|
-
SelectionPanel.prototype._setLabelColor = function () {
|
|
459
|
-
for (var i = 0; i < this._groups.length; i++) {
|
|
460
|
-
for (var j = 0; j < this._groups[i].selectors.length; j++) {
|
|
386
|
+
}
|
|
387
|
+
/** Gets or sets the label color */
|
|
388
|
+
get labelColor() {
|
|
389
|
+
return this._labelColor;
|
|
390
|
+
}
|
|
391
|
+
set labelColor(color) {
|
|
392
|
+
if (this._labelColor === color) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
this._labelColor = color;
|
|
396
|
+
this._setLabelColor();
|
|
397
|
+
}
|
|
398
|
+
_setLabelColor() {
|
|
399
|
+
for (let i = 0; i < this._groups.length; i++) {
|
|
400
|
+
for (let j = 0; j < this._groups[i].selectors.length; j++) {
|
|
461
401
|
this._groups[i]._setSelectorLabelColor(j, this._labelColor);
|
|
462
402
|
}
|
|
463
403
|
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
});
|
|
480
|
-
SelectionPanel.prototype._setButtonBackground = function () {
|
|
481
|
-
for (var i = 0; i < this._groups.length; i++) {
|
|
482
|
-
for (var j = 0; j < this._groups[i].selectors.length; j++) {
|
|
404
|
+
}
|
|
405
|
+
/** Gets or sets the button background */
|
|
406
|
+
get buttonBackground() {
|
|
407
|
+
return this._buttonBackground;
|
|
408
|
+
}
|
|
409
|
+
set buttonBackground(color) {
|
|
410
|
+
if (this._buttonBackground === color) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
this._buttonBackground = color;
|
|
414
|
+
this._setButtonBackground();
|
|
415
|
+
}
|
|
416
|
+
_setButtonBackground() {
|
|
417
|
+
for (let i = 0; i < this._groups.length; i++) {
|
|
418
|
+
for (let j = 0; j < this._groups[i].selectors.length; j++) {
|
|
483
419
|
this._groups[i]._setSelectorButtonBackground(j, this._buttonBackground);
|
|
484
420
|
}
|
|
485
421
|
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
configurable: true
|
|
501
|
-
});
|
|
502
|
-
SelectionPanel.prototype._setBarColor = function () {
|
|
503
|
-
for (var i = 0; i < this._bars.length; i++) {
|
|
422
|
+
}
|
|
423
|
+
/** Gets or sets the color of separator bar */
|
|
424
|
+
get barColor() {
|
|
425
|
+
return this._barColor;
|
|
426
|
+
}
|
|
427
|
+
set barColor(color) {
|
|
428
|
+
if (this._barColor === color) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
this._barColor = color;
|
|
432
|
+
this._setBarColor();
|
|
433
|
+
}
|
|
434
|
+
_setBarColor() {
|
|
435
|
+
for (let i = 0; i < this._bars.length; i++) {
|
|
504
436
|
this._bars[i].children[0].background = this._barColor;
|
|
505
437
|
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
configurable: true
|
|
521
|
-
});
|
|
522
|
-
SelectionPanel.prototype._setBarHeight = function () {
|
|
523
|
-
for (var i = 0; i < this._bars.length; i++) {
|
|
438
|
+
}
|
|
439
|
+
/** Gets or sets the height of separator bar */
|
|
440
|
+
get barHeight() {
|
|
441
|
+
return this._barHeight;
|
|
442
|
+
}
|
|
443
|
+
set barHeight(value) {
|
|
444
|
+
if (this._barHeight === value) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this._barHeight = value;
|
|
448
|
+
this._setBarHeight();
|
|
449
|
+
}
|
|
450
|
+
_setBarHeight() {
|
|
451
|
+
for (let i = 0; i < this._bars.length; i++) {
|
|
524
452
|
this._bars[i].children[0].height = this._barHeight;
|
|
525
453
|
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
configurable: true
|
|
541
|
-
});
|
|
542
|
-
SelectionPanel.prototype._setSpacerHeight = function () {
|
|
543
|
-
for (var i = 0; i < this._bars.length; i++) {
|
|
454
|
+
}
|
|
455
|
+
/** Gets or sets the height of spacers*/
|
|
456
|
+
get spacerHeight() {
|
|
457
|
+
return this._spacerHeight;
|
|
458
|
+
}
|
|
459
|
+
set spacerHeight(value) {
|
|
460
|
+
if (this._spacerHeight === value) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
this._spacerHeight = value;
|
|
464
|
+
this._setSpacerHeight();
|
|
465
|
+
}
|
|
466
|
+
_setSpacerHeight() {
|
|
467
|
+
for (let i = 0; i < this._bars.length; i++) {
|
|
544
468
|
this._bars[i].height = this._spacerHeight;
|
|
545
469
|
}
|
|
546
|
-
}
|
|
470
|
+
}
|
|
547
471
|
/** Adds a bar between groups */
|
|
548
|
-
|
|
549
|
-
|
|
472
|
+
_addSpacer() {
|
|
473
|
+
const separator = new Container();
|
|
550
474
|
separator.width = 1;
|
|
551
475
|
separator.height = this._spacerHeight;
|
|
552
476
|
separator.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
553
|
-
|
|
477
|
+
const bar = new Rectangle();
|
|
554
478
|
bar.width = 1;
|
|
555
479
|
bar.height = this._barHeight;
|
|
556
480
|
bar.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
@@ -560,107 +484,103 @@ var SelectionPanel = /** @class */ (function (_super) {
|
|
|
560
484
|
separator.addControl(bar);
|
|
561
485
|
this._panel.addControl(separator);
|
|
562
486
|
this._bars.push(separator);
|
|
563
|
-
}
|
|
487
|
+
}
|
|
564
488
|
/** Add a group to the selection panel
|
|
565
489
|
* @param group is the selector group to add
|
|
566
490
|
*/
|
|
567
|
-
|
|
491
|
+
addGroup(group) {
|
|
568
492
|
if (this._groups.length > 0) {
|
|
569
493
|
this._addSpacer();
|
|
570
494
|
}
|
|
571
495
|
this._panel.addControl(group.groupPanel);
|
|
572
496
|
this._groups.push(group);
|
|
573
497
|
group.groupPanel.children[0].color = this._headerColor;
|
|
574
|
-
for (
|
|
498
|
+
for (let j = 0; j < group.selectors.length; j++) {
|
|
575
499
|
group._setSelectorButtonColor(j, this._buttonColor);
|
|
576
500
|
group._setSelectorButtonBackground(j, this._buttonBackground);
|
|
577
501
|
}
|
|
578
|
-
}
|
|
502
|
+
}
|
|
579
503
|
/** Remove the group from the given position
|
|
580
504
|
* @param groupNb is the position of the group in the list
|
|
581
505
|
*/
|
|
582
|
-
|
|
506
|
+
removeGroup(groupNb) {
|
|
583
507
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
584
508
|
return;
|
|
585
509
|
}
|
|
586
|
-
|
|
510
|
+
const group = this._groups[groupNb];
|
|
587
511
|
this._panel.removeControl(group.groupPanel);
|
|
588
512
|
this._groups.splice(groupNb, 1);
|
|
589
513
|
if (groupNb < this._bars.length) {
|
|
590
514
|
this._panel.removeControl(this._bars[groupNb]);
|
|
591
515
|
this._bars.splice(groupNb, 1);
|
|
592
516
|
}
|
|
593
|
-
}
|
|
517
|
+
}
|
|
594
518
|
/** Change a group header label
|
|
595
519
|
* @param label is the new group header label
|
|
596
520
|
* @param groupNb is the number of the group to relabel
|
|
597
521
|
* */
|
|
598
|
-
|
|
522
|
+
setHeaderName(label, groupNb) {
|
|
599
523
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
600
524
|
return;
|
|
601
525
|
}
|
|
602
|
-
|
|
526
|
+
const group = this._groups[groupNb];
|
|
603
527
|
group.groupPanel.children[0].text = label;
|
|
604
|
-
}
|
|
528
|
+
}
|
|
605
529
|
/** Change selector label to the one given
|
|
606
530
|
* @param label is the new selector label
|
|
607
531
|
* @param groupNb is the number of the groupcontaining the selector
|
|
608
532
|
* @param selectorNb is the number of the selector within a group to relabel
|
|
609
533
|
* */
|
|
610
|
-
|
|
534
|
+
relabel(label, groupNb, selectorNb) {
|
|
611
535
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
612
536
|
return;
|
|
613
537
|
}
|
|
614
|
-
|
|
538
|
+
const group = this._groups[groupNb];
|
|
615
539
|
if (selectorNb < 0 || selectorNb >= group.selectors.length) {
|
|
616
540
|
return;
|
|
617
541
|
}
|
|
618
542
|
group._setSelectorLabel(selectorNb, label);
|
|
619
|
-
}
|
|
543
|
+
}
|
|
620
544
|
/** For a given group position remove the selector at the given position
|
|
621
545
|
* @param groupNb is the number of the group to remove the selector from
|
|
622
546
|
* @param selectorNb is the number of the selector within the group
|
|
623
547
|
*/
|
|
624
|
-
|
|
548
|
+
removeFromGroupSelector(groupNb, selectorNb) {
|
|
625
549
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
626
550
|
return;
|
|
627
551
|
}
|
|
628
|
-
|
|
552
|
+
const group = this._groups[groupNb];
|
|
629
553
|
if (selectorNb < 0 || selectorNb >= group.selectors.length) {
|
|
630
554
|
return;
|
|
631
555
|
}
|
|
632
556
|
group.removeSelector(selectorNb);
|
|
633
|
-
}
|
|
557
|
+
}
|
|
634
558
|
/** For a given group position of correct type add a checkbox button
|
|
635
559
|
* @param groupNb is the number of the group to remove the selector from
|
|
636
560
|
* @param label is the label for the selector
|
|
637
561
|
* @param func is the function called when the Selector is checked
|
|
638
562
|
* @param checked is true when Selector is checked
|
|
639
563
|
*/
|
|
640
|
-
|
|
641
|
-
if (func === void 0) { func = function () { }; }
|
|
642
|
-
if (checked === void 0) { checked = false; }
|
|
564
|
+
addToGroupCheckbox(groupNb, label, func = () => { }, checked = false) {
|
|
643
565
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
644
566
|
return;
|
|
645
567
|
}
|
|
646
|
-
|
|
568
|
+
const group = this._groups[groupNb];
|
|
647
569
|
group.addCheckbox(label, func, checked);
|
|
648
|
-
}
|
|
570
|
+
}
|
|
649
571
|
/** For a given group position of correct type add a radio button
|
|
650
572
|
* @param groupNb is the number of the group to remove the selector from
|
|
651
573
|
* @param label is the label for the selector
|
|
652
574
|
* @param func is the function called when the Selector is checked
|
|
653
575
|
* @param checked is true when Selector is checked
|
|
654
576
|
*/
|
|
655
|
-
|
|
656
|
-
if (func === void 0) { func = function () { }; }
|
|
657
|
-
if (checked === void 0) { checked = false; }
|
|
577
|
+
addToGroupRadio(groupNb, label, func = () => { }, checked = false) {
|
|
658
578
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
659
579
|
return;
|
|
660
580
|
}
|
|
661
|
-
|
|
581
|
+
const group = this._groups[groupNb];
|
|
662
582
|
group.addRadio(label, func, checked);
|
|
663
|
-
}
|
|
583
|
+
}
|
|
664
584
|
/**
|
|
665
585
|
* For a given slider group add a slider
|
|
666
586
|
* @param groupNb is the number of the group to add the slider to
|
|
@@ -672,22 +592,14 @@ var SelectionPanel = /** @class */ (function (_super) {
|
|
|
672
592
|
* @param value is the start value for the Slider between min and max
|
|
673
593
|
* @param onVal is the function used to format the value displayed, eg radians to degrees
|
|
674
594
|
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
if (min === void 0) { min = 0; }
|
|
679
|
-
if (max === void 0) { max = 0; }
|
|
680
|
-
if (value === void 0) { value = 0; }
|
|
681
|
-
if (onVal === void 0) { onVal = function (v) {
|
|
682
|
-
return v | 0;
|
|
683
|
-
}; }
|
|
595
|
+
addToGroupSlider(groupNb, label, func = () => { }, unit = "Units", min = 0, max = 0, value = 0, onVal = (v) => {
|
|
596
|
+
return v | 0;
|
|
597
|
+
}) {
|
|
684
598
|
if (groupNb < 0 || groupNb >= this._groups.length) {
|
|
685
599
|
return;
|
|
686
600
|
}
|
|
687
|
-
|
|
601
|
+
const group = this._groups[groupNb];
|
|
688
602
|
group.addSlider(label, func, unit, min, max, value, onVal);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
}(Rectangle));
|
|
692
|
-
export { SelectionPanel };
|
|
603
|
+
}
|
|
604
|
+
}
|
|
693
605
|
//# sourceMappingURL=selector.js.map
|