|
3384 | 3384 | function AddStatOpt(pos, name) { |
3385 | 3385 | var opt = (pos<10) ? pthis.pavetext.fOptStat : pthis.pavetext.fOptFit; |
3386 | 3386 | opt = parseInt(parseInt(opt) / parseInt(Math.pow(10,pos % 10))) % 10; |
3387 | | - menu.add( (opt ? "chk:" : "unk:") + name, opt * 100 + pos, function(arg) { |
| 3387 | + menu.addchk(opt, name, opt * 100 + pos, function(arg) { |
3388 | 3388 | var newopt = (arg % 100 < 10) ? pthis.pavetext.fOptStat : pthis.pavetext.fOptFit; |
3389 | 3389 | var oldopt = parseInt(arg / 100); |
3390 | 3390 | newopt -= (oldopt>0 ? oldopt : -1) * parseInt(Math.pow(10, arg % 10)); |
|
5881 | 5881 | if (arg=="y") faxis = this.histo['fYaxis']; |
5882 | 5882 | menu.add("header: " + arg.toUpperCase() + " axis"); |
5883 | 5883 | menu.add("Unzoom", function() { this.Unzoom(arg=="x", arg=="y", arg=="z"); }); |
5884 | | - menu.add((this.options["Log" + kind] ? "chk:" : "unk:") + "SetLog"+arg, function() { this.ToggleLog(arg); }); |
| 5884 | + menu.addchk(this.options["Log" + kind], "SetLog"+arg, this.ToggleLog.bind(this, arg) ); |
5885 | 5885 | if (faxis != null) { |
5886 | | - menu.add((faxis.TestBit(JSROOT.EAxisBits.kCenterLabels) ? "chk:" : "unk:") + "CenterLabels", |
5887 | | - function() { faxis.InvertBit(JSROOT.EAxisBits.kCenterLabels); this.RedrawPad(); }); |
5888 | | - menu.add((faxis.TestBit(JSROOT.EAxisBits.kCenterTitle) ? "chk:" : "unk:") + "CenterTitle", |
5889 | | - function() { faxis.InvertBit(JSROOT.EAxisBits.kCenterTitle); this.RedrawPad(); }); |
5890 | | - menu.add((faxis.TestBit(JSROOT.EAxisBits.kRotateTitle) ? "chk:" : "unk:") + "RotateTitle", |
5891 | | - function() { faxis.InvertBit(JSROOT.EAxisBits.kRotateTitle); this.RedrawPad(); }); |
5892 | | - menu.add((faxis.TestBit(JSROOT.EAxisBits.kMoreLogLabels) ? "chk:" : "unk:") + "MoreLogLabels", |
5893 | | - function() { faxis.InvertBit(JSROOT.EAxisBits.kMoreLogLabels); this.RedrawPad(); }); |
5894 | | - menu.add((faxis.TestBit(JSROOT.EAxisBits.kNoExponent) ? "chk:" : "unk:") + "NoExponent", |
5895 | | - function() { faxis.InvertBit(JSROOT.EAxisBits.kNoExponent); this.RedrawPad(); }); |
| 5886 | + menu.addchk(faxis.TestBit(JSROOT.EAxisBits.kCenterLabels), "CenterLabels", |
| 5887 | + function() { faxis.InvertBit(JSROOT.EAxisBits.kCenterLabels); this.RedrawPad(); }); |
| 5888 | + menu.addchk(faxis.TestBit(JSROOT.EAxisBits.kCenterTitle), "CenterTitle", |
| 5889 | + function() { faxis.InvertBit(JSROOT.EAxisBits.kCenterTitle); this.RedrawPad(); }); |
| 5890 | + menu.addchk(faxis.TestBit(JSROOT.EAxisBits.kRotateTitle), "RotateTitle", |
| 5891 | + function() { faxis.InvertBit(JSROOT.EAxisBits.kRotateTitle); this.RedrawPad(); }); |
| 5892 | + menu.addchk(faxis.TestBit(JSROOT.EAxisBits.kMoreLogLabels), "MoreLogLabels", |
| 5893 | + function() { faxis.InvertBit(JSROOT.EAxisBits.kMoreLogLabels); this.RedrawPad(); }); |
| 5894 | + menu.addchk(faxis.TestBit(JSROOT.EAxisBits.kNoExponent), "NoExponent", |
| 5895 | + function() { faxis.InvertBit(JSROOT.EAxisBits.kNoExponent); this.RedrawPad(); }); |
5896 | 5896 | } |
5897 | 5897 | } else { |
5898 | 5898 | menu.add("header:"+ this.histo['fName']); |
|
5913 | 5913 | menu.add("Unzoom Z", function() { this.Unzoom(false, false, true); }); |
5914 | 5914 | menu.add("Unzoom", function() { this.Unzoom(true, true, true); }); |
5915 | 5915 |
|
5916 | | - menu.add((JSROOT.gStyle.Tooltip ? "chk:" : "unk:") + "Show tooltips", function() { |
| 5916 | + menu.addchk(JSROOT.gStyle.Tooltip, "Show tooltips", function() { |
5917 | 5917 | JSROOT.gStyle.Tooltip = !JSROOT.gStyle.Tooltip; |
5918 | 5918 | this.RedrawPad(); |
5919 | 5919 | }); |
5920 | 5920 |
|
5921 | 5921 | if (this.options) { |
5922 | | - var item = (this.options.Logx ? "chk:" : "unk:") + "SetLogx"; |
| 5922 | + menu.addchk(this.options.Logx, "SetLogx", function() { this.ToggleLog("x"); }); |
5923 | 5923 |
|
5924 | | - menu.add(item, function() { this.ToggleLog("x"); }); |
| 5924 | + menu.addchk(this.options.Logy, "SetLogy", function() { this.ToggleLog("y"); }); |
5925 | 5925 |
|
5926 | | - item = (this.options.Logy ? "chk:" : "unk:") +"SetLogy"; |
5927 | | - menu.add(item, function() { this.ToggleLog("y"); }); |
5928 | | - |
5929 | | - if (this.Dimension() == 2) { |
5930 | | - item = (this.options.Logz ? "chk:" : "unk:") + "SetLogz"; |
5931 | | - menu.add(item, function() { this.ToggleLog("z"); }); |
5932 | | - } |
| 5926 | + if (this.Dimension() == 2) |
| 5927 | + menu.addchk(this.options.Logz, "SetLogz", function() { this.ToggleLog("z"); }); |
5933 | 5928 | } |
5934 | 5929 | if (this.draw_content) |
5935 | | - menu.add((this.ToggleStat('only-check') ? "chk:" : "unk:") + "Show statbox", this.ToggleStat.bind(this)); |
| 5930 | + menu.addchk(this.ToggleStat('only-check'), "Show statbox", this.ToggleStat.bind(this)); |
5936 | 5931 | } |
5937 | 5932 |
|
5938 | 5933 | // ======= TH1 painter================================================ |
|
0 commit comments