Skip to content

Commit 29f7b46

Browse files
committed
Provide basic TButton support
It is derived class from TPad and can be painted by TPadPainter
1 parent 137657b commit 29f7b46

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

changes.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
5. Add more interactive features with `TWebCanvas`
99
6. 3-dimensional `TTree::Draw()` now produces `TPolyMarker3D` by default
1010
7. Force MathJax rendering when `\` symbol is found (#243)
11-
8. Fix - show correct bin index in `TH2` tooltips
12-
9. Fix - interactive move/resize on touch devices
13-
10. Fix - correctly handle axis zooming on lego plots
14-
11. Fix - histogram statistics calculation with negative bins
15-
12. Base version for ROOT 6.28 release
11+
8. Support `TButton` class
12+
9. Fix - show correct bin index in `TH2` tooltips
13+
10. Fix - interactive move/resize on touch devices
14+
11. Fix - correctly handle axis zooming on lego plots
15+
12. Fix - histogram statistics calculation with negative bins
16+
13. Base version for ROOT 6.28 release
1617

1718

1819
## Changes in 7.2.1

modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let version_id = '7.3.0';
55

66
/** @summary version date
77
* @desc Release date in format day/month/year like '14/04/2022' */
8-
let version_date = '13/12/2022';
8+
let version_date = '14/12/2022';
99

1010
/** @summary version id and date
1111
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

modules/draw.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const drawFuncs = { lst: [
3232
{ name: clTCanvas, icon: 'img_canvas', class: () => import('./gpad/TCanvasPainter.mjs').then(h => h.TCanvasPainter), opt: ';grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz', expand_item: 'fPrimitives' },
3333
{ name: clTPad, icon: 'img_canvas', class: () => import('./gpad/TPadPainter.mjs').then(h => h.TPadPainter), opt: ';grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz', expand_item: 'fPrimitives' },
3434
{ name: 'TSlider', icon: 'img_canvas', class: () => import('./gpad/TPadPainter.mjs').then(h => h.TPadPainter) },
35+
{ name: 'TButton', icon: 'img_canvas', class: () => import('./gpad/TPadPainter.mjs').then(h => h.TPadPainter) },
3536
{ name: 'TFrame', icon: 'img_frame', draw: () => import('./gpad/TCanvasPainter.mjs').then(h => h.drawTFrame) },
3637
{ name: clTPave, icon: 'img_pavetext', class: () => import('./hist/TPavePainter.mjs').then(h => h.TPavePainter) },
3738
{ name: clTPaveText, sameas: clTPave },

modules/gpad/TPadPainter.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class TPadPainter extends ObjectPainter {
178178
if (!this.iscan && pad?.fName) {
179179
this.this_pad_name = pad.fName.replace(' ', '_'); // avoid empty symbol in pad name
180180
let regexp = new RegExp('^[A-Za-z][A-Za-z0-9_]*$');
181-
if (!regexp.test(this.this_pad_name)) this.this_pad_name = 'jsroot_pad_' + internals.id_counter++;
181+
if (!regexp.test(this.this_pad_name) || ((this.this_pad_name == 'button') && (pad._typename == 'TButton')))
182+
this.this_pad_name = 'jsroot_pad_' + internals.id_counter++;
182183
}
183184
this.painters = []; // complete list of all painters in the pad
184185
this.has_canvas = true;

0 commit comments

Comments
 (0)