ROOT
master
Reference Guide
Loading...
Searching...
No Matches
TStyleManager.cxx
Go to the documentation of this file.
1
// @(#)root/ged:$Id$
2
// Author: Denis Favre-Miville 08/09/05
3
4
/*************************************************************************
5
* Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
13
/** \class TStyleManager
14
\ingroup ged
15
16
This class provides a Graphical User Interface to manage styles
17
in ROOT. It allows the user to edit styles, import / export
18
them to macros, apply a style on the selected object or on
19
all canvases, change gStyle.
20
21
Activate the style manager by selecting Edit menu / Style...
22
in the canvas window.
23
24
The Style Manager interface is composed of two parts:
25
- the top level interface that manages a list of styles;
26
- the style editor, which deals with the current style settings.
27
28
29
The combo box 'Available Styles' contains the list of available
30
styles for the current ROOT session and shows the currently
31
selected one. The field on the right shows the setting of the gStyle.
32
You can set the global variable gStyle to the selected style by
33
clicking on the button in the middle.
34
The group frame 'Apply on' displays information for the currently
35
selected canvas and object in the ROOT session. This selection might
36
be changed by clicking on another object with the middle mouse
37
button. You have a choice to apply a style on the selected object or
38
on all available canvases.
39
WARNING: You cannot undo the changes after applying the style! If
40
you are not sure of that action, it may be better to see a preview
41
of what you are going to apply.
42
If the check button 'Preview' is selected, a preview of the selected
43
canvas according to the selected style will be shown. The selection
44
of the next check button 'Run Time Preview' will apply updates of
45
the preview any time a value of the selected style is changed. For
46
drawings that take a time it is better to disable this option.
47
48
Create a new style:
49
A new style can be created via the Style menu/New... or the toolbar.
50
A clone of the selected style will be used as a base of the new
51
style. All its values can be modified via the style editor later.
52
The dialog that appears will ask for the name and description of the
53
new style.
54
55
Import a style (from a macro):
56
A style macro can be imported at any time. The new imported style in
57
the ROOT session will become the selected one.
58
59
Import a style (from a canvas):
60
You can do that selecting the Style menu/Import from.../Canvas or
61
the corresponding Tool bar button. A new style will be created in the
62
ROOT session and will become the selected one. This style is a clone
63
of the gStyle with modified values as they are set in the currently
64
selected canvas. You can import a style from any canvas and apply it
65
later on some objects.
66
67
Export a style (in a C++ macro file):
68
To store a style longer than for the current ROOT session you can
69
save it in a C++ macro file. This can be done via the menu or the
70
tool bar button. There is a naming convention for the style macros:
71
the name must be 'Style_*.C', where * can be replaced by anything
72
you want.
73
74
Delete a style:
75
The selected style can be deleted from the list when you use the
76
Style menu/Delete or the corresponding tool bar button. The selected
77
style is removed from the list of all available styles for the
78
current ROOT session. WARRNING: it will be lost if you didn't saved
79
it in a C++ macro file before its deletion. Also, you cannot delete
80
the selected style if it is set to gStyle. A message 'Can not delete
81
gStyle' will be displayed on the CINT prompt.
82
83
Editor's buttons:
84
Open / close the style editor:
85
The button 'Edit >>' opens the style editor and its label changes to
86
'Close <<'. For all details of what can be changed and how please see
87
the provided Help.
88
89
Reset a style (to a previously saved state):
90
When the editor is opened, the 'Reset' button allows you to reset
91
the values of the selected style for editing. Doing that you cancel
92
all changes made since the last time you saved that style in a macro.
93
If the selected style is one of the five ROOT styles (Plain, Bold,
94
Video, Pub or Default), it will be recreated.
95
96
Update the preview:
97
The button 'Update Preview' is available when a preview is shown and
98
the run time option is not selected. This button allows you to
99
refresh the preview any time you want to see how the style you edit
100
looks like.
101
102
Help button:
103
Provides a help of the currently selected tab.
104
105
*/
106
107
108
#include "
TStyleManager.h
"
109
#include "
TStyleDialog.h
"
110
#include "
TStylePreview.h
"
111
#include "
HelpSMText.h
"
112
113
#include <
TCanvas.h
>
114
#include <
TColor.h
>
115
#include <
TG3DLine.h
>
116
#include <
TGButton.h
>
117
#include <
TGButtonGroup.h
>
118
#include <
TGColorSelect.h
>
119
#include <
TGComboBox.h
>
120
#include <
TGedMarkerSelect.h
>
121
#include <
TGedPatternSelect.h
>
122
#include <
TGFileDialog.h
>
123
#include <
TGLabel.h
>
124
#include <
TGLayout.h
>
125
#include <
TGMenu.h
>
126
#include <
TGNumberEntry.h
>
127
#include <
TGResourcePool.h
>
128
#include <
TGStatusBar.h
>
129
#include <
TGTab.h
>
130
#include <
TGToolBar.h
>
131
#include <
TROOT.h
>
132
#include <snprintf.h>
133
#include <
TRootHelpDialog.h
>
134
#include <
TStyle.h
>
135
#include <
TSystem.h
>
136
#include <
TVirtualPad.h
>
137
#include <
TVirtualX.h
>
138
139
TStyleManager
*
TStyleManager::fgStyleManager
=
nullptr
;
140
141
ClassImp
(
TStyleManager
);
142
143
enum
EStyleManagerWid
{
144
kMenuNew
,
145
kMenuDelete
,
146
kMenuRename
,
147
kMenuImportCanvas
,
148
kMenuImportMacro
,
149
kMenuExport
,
150
kMenuExit
,
151
kMenuHelp
,
152
kMenuHelpEditor
,
153
kMenuHelpGeneral
,
154
kMenuHelpCanvas
,
155
kMenuHelpPad
,
156
kMenuHelpHistos
,
157
kMenuHelpAxis
,
158
kMenuHelpTitle
,
159
kMenuHelpStats
,
160
kMenuHelpPSPDF
,
161
162
kToolbarNew
,
163
kToolbarDelete
,
164
kToolbarImportCanvas
,
165
kToolbarImportMacro
,
166
kToolbarExport
,
167
kToolbarHelp
,
168
169
kTopStylesList
,
170
kTopPreview
,
171
kTopPreviewRealTime
,
172
kTopMakeDefault
,
173
kTopCurStyle
,
174
kTopCurPad
,
175
kTopCurObj
,
176
kTopApplyOnAll
,
177
kTopApplyOnSel
,
178
kTopApplyOnBut
,
179
kTopMoreLess
,
180
181
kEditButHelp
,
182
kEditButUpPrev
,
183
kEditButReset
,
184
185
kGeneralFillColor
,
186
kGeneralFillStyle
,
187
kGeneralHatchesLineWidth
,
188
kGeneralHatchesSpacing
,
189
kGeneralTextColor
,
190
kGeneralTextSize
,
191
kGeneralTextSizeInPixels
,
192
kGeneralTextFont
,
193
kGeneralTextAlign
,
194
kGeneralTextAngle
,
195
kGeneralLineColor
,
196
kGeneralLineWidth
,
197
kGeneralLineStyle
,
198
kGeneralLineStyleEdit
,
199
kGeneralMarkerColor
,
200
kGeneralMarkerStyle
,
201
kGeneralMarkerSize
,
202
kGeneralScreenFactor
,
203
204
kCanvasColor
,
205
kCanvasDefX
,
206
kCanvasDefY
,
207
kCanvasDefW
,
208
kCanvasDefH
,
209
kCanvasBorderModeSunken
,
210
kCanvasBorderModeNone
,
211
kCanvasBorderModeRaised
,
212
kCanvasBorderSize
,
213
kCanvasOptDateBool
,
214
kCanvasAttDateTextColor
,
215
kCanvasAttDateTextSize
,
216
kCanvasAttDateTextSizeInPixels
,
217
kCanvasOptDateFormat
,
218
kCanvasAttDateTextFont
,
219
kCanvasAttDateTextAngle
,
220
kCanvasAttDateTextAlign
,
221
kCanvasDateX
,
222
kCanvasDateY
,
223
224
kPadLeftMargin
,
225
kPadRightMargin
,
226
kPadTopMargin
,
227
kPadBottomMargin
,
228
kPadBorderModeSunken
,
229
kPadBorderModeNone
,
230
kPadBorderModeRaised
,
231
kPadBorderSize
,
232
kPadColor
,
233
kPadTickX
,
234
kPadTickY
,
235
kPadGridX
,
236
kPadGridY
,
237
kPadGridColor
,
238
kPadGridWidth
,
239
kPadGridStyle
,
240
241
kHistFillColor
,
242
kHistFillStyle
,
243
kHistLineColor
,
244
kHistLineWidth
,
245
kHistLineStyle
,
246
kHistBarWidth
,
247
kHistBarOffset
,
248
kHistMinimumZero
,
249
kHistPaintTextFormat
,
250
kHistNumberContours
,
251
kHistLegoInnerR
,
252
253
kFrameFillColor
,
254
kFrameFillStyle
,
255
kFrameLineColor
,
256
kFrameLineWidth
,
257
kFrameLineStyle
,
258
kFramePaletteEdit
,
259
kFrameBorderModeSunken
,
260
kFrameBorderModeNone
,
261
kFrameBorderModeRaised
,
262
kFrameBorderSize
,
263
264
kGraphsFuncColor
,
265
kGraphsFuncWidth
,
266
kGraphsFuncStyle
,
267
kGraphsDrawBorder
,
268
kGraphsEndErrorSize
,
269
kGraphsErrorX
,
270
271
kAxisTimeOffsetDate
,
272
kAxisTimeOffsetTime
,
273
kAxisStripDecimals
,
274
kAxisApplyOnXYZ
,
275
276
kAxisXTitleSize
,
277
kAxisXTitleSizeInPixels
,
278
kAxisXTitleColor
,
279
kAxisXTitleOffset
,
280
kAxisXTitleFont
,
281
kAxisXLabelSize
,
282
kAxisXLabelSizeInPixels
,
283
kAxisXLabelColor
,
284
kAxisXLabelOffset
,
285
kAxisXLabelFont
,
286
kAxisXAxisColor
,
287
kAxisXTickLength
,
288
kAxisOptLogx
,
289
kAxisXNdivMain
,
290
kAxisXNdivSub
,
291
kAxisXNdivSubSub
,
292
kAxisXNdivisionsOptimize
,
293
294
kAxisYTitleSize
,
295
kAxisYTitleSizeInPixels
,
296
kAxisYTitleColor
,
297
kAxisYTitleOffset
,
298
kAxisYTitleFont
,
299
kAxisYLabelSize
,
300
kAxisYLabelSizeInPixels
,
301
kAxisYLabelColor
,
302
kAxisYLabelOffset
,
303
kAxisYLabelFont
,
304
kAxisYAxisColor
,
305
kAxisYTickLength
,
306
kAxisOptLogy
,
307
kAxisYNdivMain
,
308
kAxisYNdivSub
,
309
kAxisYNdivSubSub
,
310
kAxisYNdivisionsOptimize
,
311
312
kAxisZTitleSize
,
313
kAxisZTitleSizeInPixels
,
314
kAxisZTitleColor
,
315
kAxisZTitleOffset
,
316
kAxisZTitleFont
,
317
kAxisZLabelSize
,
318
kAxisZLabelSizeInPixels
,
319
kAxisZLabelColor
,
320
kAxisZLabelOffset
,
321
kAxisZLabelFont
,
322
kAxisZAxisColor
,
323
kAxisZTickLength
,
324
kAxisOptLogz
,
325
kAxisZNdivMain
,
326
kAxisZNdivSub
,
327
kAxisZNdivSubSub
,
328
kAxisZNdivisionsOptimize
,
329
330
kTitleOptTitle
,
331
kTitleFillColor
,
332
kTitleStyle
,
333
kTitleTextColor
,
334
kTitleFontSize
,
335
kTitleFontSizeInPixels
,
336
kTitleFont
,
337
kTitleAlign
,
338
kTitleBorderSize
,
339
kTitleX
,
340
kTitleY
,
341
kTitleW
,
342
kTitleH
,
343
kTitleLegendBorderSize
,
344
345
kStatColor
,
346
kStatStyle
,
347
kStatTextColor
,
348
kStatFontSize
,
349
kStatFontSizeInPixels
,
350
kStatFont
,
351
kStatX
,
352
kStatY
,
353
kStatW
,
354
kStatH
,
355
kStatBorderSize
,
356
kStatOptStatName
,
357
kStatOptStatEntries
,
358
kStatOptStatOverflow
,
359
kStatOptStatMean
,
360
kStatOptStatUnderflow
,
361
kStatOptStatRMS
,
362
kStatOptStatSkewness
,
363
kStatOptStatIntegral
,
364
kStatOptStatKurtosis
,
365
kStatOptStatErrors
,
366
kStatFormat
,
367
kStatOptFitValues
,
368
kStatOptFitErrors
,
369
kStatOptFitProbability
,
370
kStatOptFitChi
,
371
kStatFitFormat
,
372
373
kPSPDFHeaderPS
,
374
kPSPDFTitlePS
,
375
kPSPDFColorModelPS
,
376
kPSPDFColorModelPSRGB
,
377
kPSPDFColorModelPSCMYK
,
378
kPSPDFLineScalePS
,
379
kPSPDFPaperSizePredef
,
380
kPSPDFPaperSizeX
,
381
kPSPDFPaperSizeY
382
};
383
384
const
char
*
kFiletypes
[] = {
"ROOT macros"
,
"Style_*.C"
,
385
0, 0 };
386
387
////////////////////////////////////////////////////////////////////////////////
388
/// Constructor. Create the main window of the style manager.
389
390
TStyleManager::TStyleManager
(
const
TGWindow
*
p
) :
TGMainFrame
(
p
)
391
{
392
SetWindowName
(
"Style Manager"
);
393
SetCleanup
(
kNoCleanup
);
394
395
// Initialization: no selected style, no preview, no signal/slots,
396
// no selected object, no current macro file.
397
fCurSelStyle
= 0;
398
fCurMacro
= 0;
399
fCurPad
= 0;
400
fCurObj
= 0;
401
fPreviewWindow
= 0;
402
fRealTimePreview
=
kFALSE
;
403
fCurTabNum
= 0;
404
fCurTabAxisNum
= 0;
405
fMoreAndNotLess
=
kTRUE
;
406
fSigSlotConnected
=
kFALSE
;
407
fStyleChanged
=
kFALSE
;
408
409
// Create the trash lists to have an effective deletion of every object.
410
fTrashListLayout
=
new
TList
();
411
fTrashListFrame
=
new
TList
();
412
413
// To avoid to create a lot a copies of the often used layouts.
414
fLayoutExpandX
=
new
TGLayoutHints
(
kLHintsExpandX
);
415
fTrashListLayout
->
Add
(
fLayoutExpandX
);
416
fLayoutExpandXMargin
=
new
TGLayoutHints
(
kLHintsExpandX
, 5, 5, 5, 5);
417
fTrashListLayout
->
Add
(
fLayoutExpandXMargin
);
418
fLayoutExpandXY
=
new
TGLayoutHints
(
kLHintsExpandX
|
kLHintsExpandY
);
419
fTrashListLayout
->
Add
(
fLayoutExpandXY
);
420
fLayoutExpandXYMargin
=
new
TGLayoutHints
(
kLHintsExpandX
|
kLHintsExpandY
, 5, 5, 5, 5);
421
fTrashListLayout
->
Add
(
fLayoutExpandXYMargin
);
422
fLayoutExpandXCenterYMargin
=
new
TGLayoutHints
(
kLHintsExpandX
|
kLHintsCenterY
, 0, 0, 3, 3);
423
fTrashListLayout
->
Add
(
fLayoutExpandXCenterYMargin
);
424
425
// Build the graphical interface.
426
AddMenus
(
this
);
427
AddToolbar
(
this
);
428
AddTopLevelInterface
(
this
);
429
AddEdition
(
this
);
430
431
// Add status bar.
432
fStatusBar
=
new
TGStatusBar
(
this
, 50, 10,
kVerticalFrame
);
433
Int_t
parts
[] = { 20, 30, 50 };
434
fStatusBar
->
SetParts
(
parts
, 3);
435
fStatusBar
->
Draw3DCorner
(
kFALSE
);
436
AddFrame
(
fStatusBar
,
fLayoutExpandX
);
437
438
// Initialize the layout algorithm and map the main frame.
439
MapSubwindows
();
440
Resize
(
GetDefaultSize
());
441
MapWindow
();
442
443
// Ensure the editor will be visible (not out of the screen's range) when
444
// the user will press the 'More' button, if they didn't move the window.
445
Int_t
x
,
y
;
446
UInt_t
w
,
h
;
447
gVirtualX
->GetWindowSize(
GetId
(),
x
,
y
,
w
,
h
);
448
fSMWidth
=
w
;
449
fSMHeight
=
h
;
450
if
(
fSMWidth
< 467)
fSMWidth
= 467;
451
if
(
fSMHeight
< 708)
fSMHeight
= 708;
452
Window_t
win
;
453
gVirtualX
->TranslateCoordinates(
GetId
(),
GetParent
()->
GetId
(), 0, 0,
x
,
y
,
win
);
454
x
-= 6;
455
y
-= 21;
456
MoveResize
(
x
,
TMath::Max
(
TMath::Min
(
y
, (
Int_t
) (
gClient
->GetDisplayHeight() -
h
)), 0),
w
,
h
);
457
458
// Only the top level interface is shown, at the begining.
459
DoMoreLess
();
460
461
// Connect all widgets (excluding editor).
462
ConnectAll
();
463
464
Init
();
465
}
466
467
////////////////////////////////////////////////////////////////////////////////
468
/// Destructor.
469
470
TStyleManager::~TStyleManager
()
471
{
472
// Disconnect all widgets
473
DisconnectAll
();
474
DisconnectEditor
(
fCurTabNum
);
475
476
if
(
fPreviewWindow
) {
477
DoPreviewClosed
();
478
delete
fPreviewWindow
;
479
}
480
481
// Delete every graphical data member,
482
// excluding fPreviewWindow and fLayout[..].
483
gClient
->FreePicture(
fToolBarNewPic
);
484
gClient
->FreePicture(
fToolBarDeletePic
);
485
gClient
->FreePicture(
fToolBarImportCanvasPic
);
486
gClient
->FreePicture(
fToolBarImportMacroPic
);
487
gClient
->FreePicture(
fToolBarExportPic
);
488
gClient
->FreePicture(
fToolBarHelpPic
);
489
gClient
->FreePicture(
fMakeDefaultPic
);
490
491
delete
fImportCascade
;
492
delete
fMenuStyle
;
493
delete
fMenuHelp
;
494
delete
fMenuBar
;
495
496
delete
fToolBar
;
497
delete
fToolBarNew
;
498
delete
fToolBarDelete
;
499
delete
fToolBarImportCanvas
;
500
delete
fToolBarImportMacro
;
501
delete
fToolBarExport
;
502
delete
fToolBarHelp
;
503
delete
fHorizontal3DLine
;
504
505
delete
fListLabel
;
506
delete
fListComboBox
;
507
delete
fCurMacro
;
508
delete
fCurStylabel
;
509
delete
fCurStyle
;
510
delete
fCurPadLabel
;
511
delete
fCurPadTextEntry
;
512
delete
fCurObjLabel
;
513
delete
fCurObjTextEntry
;
514
delete
fPreviewButton
;
515
delete
fPreviewRealTime
;
516
delete
fMakeDefault
;
517
518
delete
fApplyOnGroup
;
519
delete
fApplyOnAll
;
520
delete
fApplyOnSel
;
521
delete
fApplyOnButton
;
522
delete
fMoreLess
;
523
524
delete
fFillColor
;
525
delete
fFillStyle
;
526
delete
fHatchesLineWidth
;
527
delete
fHatchesSpacing
;
528
delete
fTextColor
;
529
delete
fTextSize
;
530
delete
fTextSizeInPixels
;
531
delete
fTextFont
;
532
delete
fTextAlign
;
533
delete
fTextAngle
;
534
delete
fLineColor
;
535
delete
fLineWidth
;
536
delete
fLineStyle
;
537
delete
fLineStyleEdit
;
538
delete
fMarkerColor
;
539
delete
fMarkerStyle
;
540
delete
fMarkerSize
;
541
delete
fScreenFactor
;
542
delete
fCanvasColor
;
543
delete
fCanvasDefX
;
544
delete
fCanvasDefY
;
545
delete
fCanvasDefW
;
546
delete
fCanvasDefH
;
547
delete
fCanvasBorderMode
;
548
delete
fCanvasBorderSize
;
549
delete
fOptDateBool
;
550
delete
fAttDateTextColor
;
551
delete
fAttDateTextSize
;
552
delete
fAttDateTextSizeInPixels
;
553
delete
fOptDateFormat
;
554
delete
fAttDateTextFont
;
555
delete
fAttDateTextAngle
;
556
delete
fAttDateTextAlign
;
557
delete
fDateX
;
558
delete
fDateY
;
559
delete
fPadLeftMargin
;
560
delete
fPadRightMargin
;
561
delete
fPadTopMargin
;
562
delete
fPadBottomMargin
;
563
delete
fPadBorderMode
;
564
delete
fPadBorderSize
;
565
delete
fPadColor
;
566
delete
fPadTickX
;
567
delete
fPadTickY
;
568
delete
fPadGridX
;
569
delete
fPadGridY
;
570
delete
fGridColor
;
571
delete
fGridWidth
;
572
delete
fGridStyle
;
573
delete
fHistFillColor
;
574
delete
fHistFillStyle
;
575
delete
fHistLineColor
;
576
delete
fHistLineWidth
;
577
delete
fHistLineStyle
;
578
delete
fBarWidth
;
579
delete
fBarOffset
;
580
delete
fHistMinimumZero
;
581
delete
fPaintTextFormat
;
582
delete
fNumberContours
;
583
delete
fLegoInnerR
;
584
delete
fFrameFillColor
;
585
delete
fFrameFillStyle
;
586
delete
fFrameLineColor
;
587
delete
fFrameLineWidth
;
588
delete
fFrameLineStyle
;
589
delete
fPaletteEdit
;
590
delete
fFrameBorderMode
;
591
delete
fFrameBorderSize
;
592
delete
fFuncColor
;
593
delete
fFuncWidth
;
594
delete
fFuncStyle
;
595
delete
fDrawBorder
;
596
delete
fEndErrorSize
;
597
delete
fErrorX
;
598
delete
fTimeOffsetDate
;
599
delete
fTimeOffsetTime
;
600
delete
fStripDecimals
;
601
delete
fApplyOnXYZ
;
602
delete
fXTitleSize
;
603
delete
fXTitleSizeInPixels
;
604
delete
fXTitleColor
;
605
delete
fXTitleOffset
;
606
delete
fXTitleFont
;
607
delete
fXLabelSize
;
608
delete
fXLabelSizeInPixels
;
609
delete
fXLabelColor
;
610
delete
fXLabelOffset
;
611
delete
fXLabelFont
;
612
delete
fXAxisColor
;
613
delete
fXTickLength
;
614
delete
fOptLogx
;
615
delete
fXNdivMain
;
616
delete
fXNdivSub
;
617
delete
fXNdivSubSub
;
618
delete
fXNdivisionsOptimize
;
619
delete
fYTitleSize
;
620
delete
fYTitleSizeInPixels
;
621
delete
fYTitleColor
;
622
delete
fYTitleOffset
;
623
delete
fYTitleFont
;
624
delete
fYLabelSize
;
625
delete
fYLabelSizeInPixels
;
626
delete
fYLabelColor
;
627
delete
fYLabelOffset
;
628
delete
fYLabelFont
;
629
delete
fYAxisColor
;
630
delete
fYTickLength
;
631
delete
fOptLogy
;
632
delete
fYNdivMain
;
633
delete
fYNdivSub
;
634
delete
fYNdivSubSub
;
635
delete
fYNdivisionsOptimize
;
636
delete
fZTitleSize
;
637
delete
fZTitleSizeInPixels
;
638
delete
fZTitleColor
;
639
delete
fZTitleOffset
;
640
delete
fZTitleFont
;
641
delete
fZLabelSize
;
642
delete
fZLabelSizeInPixels
;
643
delete
fZLabelColor
;
644
delete
fZLabelOffset
;
645
delete
fZLabelFont
;
646
delete
fZAxisColor
;
647
delete
fZTickLength
;
648
delete
fOptLogz
;
649
delete
fZNdivMain
;
650
delete
fZNdivSub
;
651
delete
fZNdivSubSub
;
652
delete
fZNdivisionsOptimize
;
653
delete
fOptTitle
;
654
delete
fTitleColor
;
655
delete
fTitleStyle
;
656
delete
fTitleTextColor
;
657
delete
fTitleFontSize
;
658
delete
fTitleFontSizeInPixels
;
659
delete
fTitleFont
;
660
delete
fTitleAlign
;
661
delete
fTitleBorderSizeLabel
;
662
delete
fTitleBorderSize
;
663
delete
fTitleX
;
664
delete
fTitleY
;
665
delete
fTitleW
;
666
delete
fTitleH
;
667
delete
fLegendBorderSizeLabel
;
668
delete
fLegendBorderSize
;
669
delete
fStatColor
;
670
delete
fStatStyle
;
671
delete
fStatTextColor
;
672
delete
fStatFontSize
;
673
delete
fStatFontSizeInPixels
;
674
delete
fStatFont
;
675
delete
fStatX
;
676
delete
fStatY
;
677
delete
fStatW
;
678
delete
fStatH
;
679
delete
fStatBorderSizeLabel
;
680
delete
fStatBorderSize
;
681
delete
fOptStatName
;
682
delete
fOptStatEntries
;
683
delete
fOptStatOverflow
;
684
delete
fOptStatMean
;
685
delete
fOptStatUnderflow
;
686
delete
fOptStatRMS
;
687
delete
fOptStatSkewness
;
688
delete
fOptStatIntegral
;
689
delete
fOptStatKurtosis
;
690
delete
fOptStatErrors
;
691
delete
fStatFormatLabel
;
692
delete
fStatFormat
;
693
delete
fOptFitValues
;
694
delete
fOptFitErrors
;
695
delete
fOptFitProbability
;
696
delete
fOptFitChi
;
697
delete
fFitFormatLabel
;
698
delete
fFitFormat
;
699
delete
fHeaderPS
;
700
delete
fTitlePS
;
701
delete
fColorModelPS
;
702
delete
fColorModelPSRGB
;
703
delete
fColorModelPSCMYK
;
704
delete
fLineScalePS
;
705
delete
fPaperSizePredef
;
706
delete
fPaperSizeX
;
707
delete
fPaperSizeY
;
708
delete
fEditionHelp
;
709
delete
fEditionUpdatePreview
;
710
delete
fEditionReset
;
711
delete
fEditionButtonFrame
;
712
delete
fHistosTab
;
713
delete
fAxisTab
;
714
delete
fEditionTab
;
715
delete
fEditionFrame
;
716
717
delete
fStatusBar
;
718
719
// Delete the temporary frames and layout.
720
TObject
*
obj1
;
721
TObject
*
obj2
;
722
723
obj1
=
fTrashListFrame
->
First
();
724
while
(
obj1
) {
725
obj2
=
fTrashListFrame
->
After
(
obj1
);
726
fTrashListFrame
->
Remove
(
obj1
);
727
delete
obj1
;
728
obj1
=
obj2
;
729
}
730
delete
fTrashListFrame
;
731
732
obj1
=
fTrashListLayout
->
First
();
733
while
(
obj1
) {
734
obj2
=
fTrashListLayout
->
After
(
obj1
);
735
fTrashListLayout
->
Remove
(
obj1
);
736
delete
obj1
;
737
obj1
=
obj2
;
738
}
739
delete
fTrashListLayout
;
740
741
fgStyleManager
= 0;
742
}
743
744
////////////////////////////////////////////////////////////////////////////////
745
///static: return style manager
746
747
TStyleManager
*&
TStyleManager::GetSM
()
748
{
749
return
fgStyleManager
;
750
}
751
752
////////////////////////////////////////////////////////////////////////////////
753
/// Set up the interface. Called by the ctor or by the 'Show' method.
754
755
void
TStyleManager::Init
()
756
{
757
// Build the list of available styles and select gStyle.
758
BuildList
(
gStyle
);
759
760
// Show the current object.
761
if
((
gROOT
->GetSelectedPad()) && (
gROOT
->GetSelectedPad()->GetCanvas())) {
762
DoSelectCanvas
(
gROOT
->GetSelectedPad()->GetCanvas(),
763
gROOT
->GetSelectedPad()->GetCanvas(),
kButton2Down
);
764
}
else
{
765
DoSelectNoCanvas
();
766
}
767
}
768
769
////////////////////////////////////////////////////////////////////////////////
770
/// Called to hide the style manager.
771
772
void
TStyleManager::Hide
()
773
{
774
if
(
fgStyleManager
) {
775
fgStyleManager
->UnmapWindow();
776
}
777
}
778
779
////////////////////////////////////////////////////////////////////////////////
780
/// Called to show the style manager. Static method.
781
782
void
TStyleManager::Show
()
783
{
784
if
(
fgStyleManager
) {
785
fgStyleManager
->Init();
786
if
(!
fgStyleManager
->IsMapped()) {
787
fgStyleManager
->MapWindow();
788
}
789
}
else
{
790
TStyleManager::GetSM
() =
new
TStyleManager
(
gClient
->GetRoot());
791
}
792
}
793
794
////////////////////////////////////////////////////////////////////////////////
795
/// Called to delete the style manager. Called when the ROOT session is
796
/// closed via a canvas' menu.
797
798
void
TStyleManager::Terminate
()
799
{
800
delete
fgStyleManager
;
801
fgStyleManager
= 0;
802
}
803
804
////////////////////////////////////////////////////////////////////////////////
805
/// Add the menu bar to the frame 'p'.
806
807
void
TStyleManager::AddMenus
(
TGCompositeFrame
*
p
)
808
{
809
fMenuBar
=
new
TGMenuBar
(
p
);
810
811
fMenuStyle
=
new
TGPopupMenu
(
gClient
->GetRoot());
812
fMenuStyle
->
Associate
(
this
);
813
fMenuStyle
->
AddEntry
(
"&New..."
,
kMenuNew
);
814
fMenuStyle
->
AddEntry
(
"&Delete"
,
kMenuDelete
);
815
fMenuStyle
->
AddSeparator
();
816
fMenuStyle
->
AddEntry
(
"&Rename..."
,
kMenuRename
);
817
fMenuStyle
->
AddSeparator
();
818
fImportCascade
=
new
TGPopupMenu
(
gClient
->GetRoot());
819
fImportCascade
->
Associate
(
this
);
820
fImportCascade
->
AddEntry
(
"&Macro..."
,
kMenuImportMacro
);
821
fImportCascade
->
AddEntry
(
"&Canvas..."
,
kMenuImportCanvas
);
822
fMenuStyle
->
AddPopup
(
"&Import From..."
,
fImportCascade
);
823
824
fMenuStyle
->
AddEntry
(
"&Export..."
,
kMenuExport
);
825
fMenuStyle
->
AddSeparator
();
826
fMenuStyle
->
AddEntry
(
"&Close"
,
kMenuExit
);
827
TGLayoutHints
*
layout1
=
new
TGLayoutHints
(
kLHintsNormal
);
828
fTrashListLayout
->
Add
(
layout1
);
829
fMenuBar
->
AddPopup
(
"&Style"
,
fMenuStyle
,
layout1
);
830
831
fMenuHelp
=
new
TGPopupMenu
(
gClient
->GetRoot());
832
fMenuHelp
->
Associate
(
this
);
833
fMenuHelp
->
AddEntry
(
"Top &level"
,
kMenuHelp
);
834
fMenuHelp
->
AddSeparator
();
835
fMenuHelp
->
AddEntry
(
"&General"
,
kMenuHelpGeneral
);
836
fMenuHelp
->
AddEntry
(
"&Canvas"
,
kMenuHelpCanvas
);
837
fMenuHelp
->
AddEntry
(
"Pa&d"
,
kMenuHelpPad
);
838
fMenuHelp
->
AddEntry
(
"&Histograms"
,
kMenuHelpHistos
);
839
fMenuHelp
->
AddEntry
(
"&Axis"
,
kMenuHelpAxis
);
840
fMenuHelp
->
AddEntry
(
"&Title"
,
kMenuHelpTitle
);
841
fMenuHelp
->
AddEntry
(
"&Stats"
,
kMenuHelpStats
);
842
fMenuHelp
->
AddEntry
(
"&PS / PDF"
,
kMenuHelpPSPDF
);
843
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsRight
);
844
fTrashListLayout
->
Add
(
layout2
);
845
fMenuBar
->
AddPopup
(
"&Help"
,
fMenuHelp
,
layout2
);
846
847
p
->AddFrame(
fMenuBar
,
fLayoutExpandX
);
848
}
849
850
////////////////////////////////////////////////////////////////////////////////
851
/// Create a new style. Called via the menu bar or the tool bar.
852
853
void
TStyleManager::DoNew
()
854
{
855
// Open a message box to allow the user to create a new style.
856
new
TStyleDialog
(
this
,
fCurSelStyle
, 1, 0);
857
858
// Create the list of available styles, and select:
859
// - the new style, if it has been created (Ok).
860
// - the previous selected style, if no style has been created (Cancel).
861
if
(
fLastChoice
)
BuildList
();
862
else
BuildList
(
fCurSelStyle
);
863
}
864
865
////////////////////////////////////////////////////////////////////////////////
866
/// Delete the current selected style from the ROOT session.
867
/// Called via the menu or the tool bar.
868
869
void
TStyleManager::DoDelete
()
870
{
871
// Protection: the user is NOT allowed to delete gStyle.
872
// As a consequence, there is always at least one style in the ROOT session.
873
if
(
fCurSelStyle
==
gStyle
) {
874
printf
(
"Can not delete gStyle.\n"
);
875
return
;
876
}
877
878
delete
fCurSelStyle
;
879
fCurSelStyle
= 0;
880
881
BuildList
(
gStyle
);
882
}
883
884
////////////////////////////////////////////////////////////////////////////////
885
/// Rename the current selected style. Called via the menu bar.
886
887
void
TStyleManager::DoRename
()
888
{
889
new
TStyleDialog
(
this
,
fCurSelStyle
, 2, 0);
890
891
// Create the list of styles and select the previous selected style.
892
BuildList
(
fCurSelStyle
);
893
}
894
895
////////////////////////////////////////////////////////////////////////////////
896
/// Save the current selected style in a C++ macro file. Called via the menu
897
/// or the tool bar.
898
899
void
TStyleManager::DoExport
()
900
{
901
// Create an associated macro and propose a pertinent name to the user.
902
CreateMacro
();
903
TString
newName
;
904
newName
.Form(
"Style_%s.C"
,
fCurSelStyle
->
GetName
());
905
906
// Protection: The user isn't allowed to export a style if the output
907
// file name isn't based on the "Style_*.C" mask, without spaces.
908
char
*
tmpFileName
;
909
const
char
*
tmpBaseName
;
910
do
{
911
fCurMacro
->
SetFilename
(
newName
.Data());
912
913
// Open a dialog to ask the user to choose an output file.
914
new
TGFileDialog
(
gClient
->GetRoot(),
this
,
kFDSave
,
fCurMacro
);
915
tmpFileName
=
fCurMacro
->
fFilename
;
916
if
(
tmpFileName
)
tmpBaseName
=
gSystem
->
BaseName
(
tmpFileName
);
917
else
tmpBaseName
= 0;
918
}
while
(
tmpBaseName
&& (
strstr
(
tmpBaseName
,
"Style_"
) !=
tmpBaseName
)
919
&& (
strstr
(
tmpBaseName
,
" "
) != 0));
920
921
if
(
tmpBaseName
!= 0) {
922
// Export the style.
923
fCurSelStyle
->
SaveSource
(
gSystem
->
UnixPathName
(
tmpFileName
));
924
fCurMacro
->
SetFilename
(
tmpBaseName
);
925
fStyleChanged
=
kFALSE
;
926
}
927
928
UpdateStatusBar
();
929
}
930
931
////////////////////////////////////////////////////////////////////////////////
932
/// Close the style manager. Called via the menu bar.
933
934
void
TStyleManager::DoExit
()
935
{
936
// SendCloseMessage(); // Doesn't delete the StyleManager. Hides it.
937
delete
this
;
938
}
939
940
////////////////////////////////////////////////////////////////////////////////
941
/// Open an help window. Called via the menu bar or the tool bar.
942
943
void
TStyleManager::DoHelp
(
Int_t
i)
944
{
945
TRootHelpDialog
*
hd
;
946
switch
(i) {
947
case
0:
948
hd
=
new
TRootHelpDialog
(
this
,
"Help on General Tab"
, 600, 400);
949
hd
->SetText(
gHelpSMGeneral
);
950
break
;
951
case
1:
952
hd
=
new
TRootHelpDialog
(
this
,
"Help on Canvas Tab"
, 600, 400);
953
hd
->SetText(
gHelpSMCanvas
);
954
break
;
955
case
2:
956
hd
=
new
TRootHelpDialog
(
this
,
"Help on Pad Tab"
, 600, 400);
957
hd
->SetText(
gHelpSMPad
);
958
break
;
959
case
3:
960
hd
=
new
TRootHelpDialog
(
this
,
"Help on Histograms Tab"
, 600, 400);
961
hd
->SetText(
gHelpSMHistos
);
962
break
;
963
case
4:
964
hd
=
new
TRootHelpDialog
(
this
,
"Help on Axis Tab"
, 600, 400);
965
hd
->SetText(
gHelpSMAxis
);
966
break
;
967
case
5:
968
hd
=
new
TRootHelpDialog
(
this
,
"Help on Title Tab"
, 600, 400);
969
hd
->SetText(
gHelpSMTitle
);
970
break
;
971
case
6:
972
hd
=
new
TRootHelpDialog
(
this
,
"Help on Stats Tab"
, 600, 400);
973
hd
->SetText(
gHelpSMStats
);
974
break
;
975
case
7:
976
hd
=
new
TRootHelpDialog
(
this
,
"Help on PS / PDF Tab"
, 600, 400);
977
hd
->SetText(
gHelpSMPSPDF
);
978
break
;
979
default
:
980
hd
=
new
TRootHelpDialog
(
this
,
"Help on Top Level"
, 600, 400);
981
hd
->SetText(
gHelpSMTopLevel
);
982
}
983
hd
->Popup();
984
}
985
986
////////////////////////////////////////////////////////////////////////////////
987
/// Create a new style (a copy of gStyle) and import the properties of the
988
/// current canvas inside.
989
990
void
TStyleManager::DoImportCanvas
()
991
{
992
if
((!
fCurPad
) || (!
fCurObj
))
return
;
993
994
new
TStyleDialog
(
this
,
gStyle
, 3,
fCurPad
);
995
996
// Create the list of available style, and select:
997
// - the new style, if it has been created
998
// - the previous selected style, if no style has been created (Cancel)
999
if
(
fLastChoice
) {
1000
BuildList
();
1001
1002
// Auto export of the canvas' style.
1003
CreateMacro
();
1004
TString
newName
;
1005
newName
.Form(
"Style_%s.C"
,
fCurSelStyle
->
GetName
());
1006
fCurMacro
->
SetFilename
(
newName
.Data());
1007
fCurSelStyle
->
SaveSource
(
gSystem
->
UnixPathName
(
fCurMacro
->
fFilename
));
1008
}
else
{
1009
BuildList
(
fCurSelStyle
);
1010
}
1011
}
1012
1013
////////////////////////////////////////////////////////////////////////////////
1014
/// Create a TGFileInfo concerning a macro, if it doesn't exist already.
1015
1016
void
TStyleManager::CreateMacro
()
1017
{
1018
if
(
fCurMacro
)
delete
fCurMacro
;
1019
fCurMacro
=
new
TGFileInfo
();
1020
fCurMacro
->
fFileTypes
=
kFiletypes
;
1021
fCurMacro
->
SetIniDir
(
"."
);
1022
fCurMacro
->
SetFilename
(
nullptr
);
1023
}
1024
1025
////////////////////////////////////////////////////////////////////////////////
1026
/// Add the tool bar to the frame 'p'.
1027
1028
void
TStyleManager::AddToolbar
(
TGCompositeFrame
*
p
)
1029
{
1030
TGLayoutHints
*
layout1
=
new
TGLayoutHints
(
kLHintsNormal
, 3);
1031
fTrashListLayout
->
Add
(
layout1
);
1032
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsNormal
, 6);
1033
fTrashListLayout
->
Add
(
layout2
);
1034
1035
fToolBar
=
new
TGToolBar
(
p
);
1036
fToolBarNewPic
=
gClient
->GetPicture(
"sm_new.xpm"
);
1037
fToolBarNew
=
new
TGPictureButton
(
fToolBar
,
fToolBarNewPic
,
kToolbarNew
);
1038
fToolBarNew
->
SetStyle
(
gClient
->GetStyle());
1039
fToolBarNew
->
Associate
(
this
);
1040
fToolBar
->
AddFrame
(
fToolBarNew
);
1041
1042
fToolBarImportCanvasPic
=
gClient
->GetPicture(
"sm_import_canvas.xpm"
);
1043
fToolBarImportCanvas
=
new
TGPictureButton
(
fToolBar
,
fToolBarImportCanvasPic
,
kToolbarImportCanvas
);
1044
fToolBarImportCanvas
->
SetStyle
(
gClient
->GetStyle());
1045
fToolBarImportCanvas
->
Associate
(
this
);
1046
fToolBar
->
AddFrame
(
fToolBarImportCanvas
,
layout2
);
1047
1048
fToolBarImportMacroPic
=
gClient
->GetPicture(
"sm_import_macro.xpm"
);
1049
fToolBarImportMacro
=
new
TGPictureButton
(
fToolBar
,
fToolBarImportMacroPic
,
kToolbarImportMacro
);
1050
fToolBarImportMacro
->
SetStyle
(
gClient
->GetStyle());
1051
fToolBarImportMacro
->
Associate
(
this
);
1052
fToolBar
->
AddFrame
(
fToolBarImportMacro
);
1053
1054
fToolBarExportPic
=
gClient
->GetPicture(
"sm_export.xpm"
);
1055
fToolBarExport
=
new
TGPictureButton
(
fToolBar
,
fToolBarExportPic
,
kToolbarExport
);
1056
fToolBarExport
->
SetStyle
(
gClient
->GetStyle());
1057
fToolBarExport
->
Associate
(
this
);
1058
fToolBar
->
AddFrame
(
fToolBarExport
,
layout1
);
1059
1060
fToolBarDeletePic
=
gClient
->GetPicture(
"sm_delete.xpm"
);
1061
fToolBarDelete
=
new
TGPictureButton
(
fToolBar
,
fToolBarDeletePic
,
kToolbarDelete
);
1062
fToolBarDelete
->
SetStyle
(
gClient
->GetStyle());
1063
fToolBarDelete
->
Associate
(
this
);
1064
fToolBar
->
AddFrame
(
fToolBarDelete
,
layout2
);
1065
1066
fToolBarHelpPic
=
gClient
->GetPicture(
"sm_help.xpm"
);
1067
fToolBarHelp
=
new
TGPictureButton
(
fToolBar
,
fToolBarHelpPic
,
kToolbarHelp
);
1068
fToolBarHelp
->
SetStyle
(
gClient
->GetStyle());
1069
fToolBarHelp
->
Associate
(
this
);
1070
fToolBar
->
AddFrame
(
fToolBarHelp
,
layout2
);
1071
1072
p
->AddFrame(
fToolBar
,
fLayoutExpandX
);
1073
fHorizontal3DLine
=
new
TGHorizontal3DLine
(
p
);
1074
p
->AddFrame(
fHorizontal3DLine
,
fLayoutExpandX
);
1075
1076
fToolBarNew
->
SetToolTipText
(
"Create a new style"
);
1077
fToolBarDelete
->
SetToolTipText
(
"Delete the selected style"
);
1078
fToolBarImportCanvas
->
SetToolTipText
(
"Import a style from selected canvas"
);
1079
fToolBarImportMacro
->
SetToolTipText
(
"Import a style from a macro"
);
1080
fToolBarExport
->
SetToolTipText
(
"Export the selected style into a macro"
);
1081
fToolBarHelp
->
SetToolTipText
(
"Help about the top level interface"
);
1082
}
1083
1084
////////////////////////////////////////////////////////////////////////////////
1085
/// Add the top level interface to the frame 'cf'. This part of the
1086
/// interface will provide all enable functionalities, excluding the
1087
/// edition of styles.
1088
1089
void
TStyleManager::AddTopLevelInterface
(
TGCompositeFrame
*
cf
)
1090
{
1091
TGLayoutHints
*
layout1
=
new
TGLayoutHints
(
kLHintsExpandX
, 0, 0, 2, 2);
1092
fTrashListLayout
->
Add
(
layout1
);
1093
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsExpandX
|
kLHintsExpandY
, 10, 10, 10, 15);
1094
fTrashListLayout
->
Add
(
layout2
);
1095
TGLayoutHints
*
layout3
=
new
TGLayoutHints
(
kLHintsNormal
, 0, 0, 18);
1096
fTrashListLayout
->
Add
(
layout3
);
1097
TGLayoutHints
*
layout4
=
new
TGLayoutHints
(
kLHintsNormal
, 10, 10);
1098
fTrashListLayout
->
Add
(
layout4
);
1099
TGLayoutHints
*
layout5
=
new
TGLayoutHints
(
kLHintsExpandX
, 125);
1100
fTrashListLayout
->
Add
(
layout5
);
1101
TGLayoutHints
*
layout6
=
new
TGLayoutHints
(
kLHintsNormal
, 0, 10, 3);
1102
fTrashListLayout
->
Add
(
layout6
);
1103
TGLayoutHints
*
layout7
=
new
TGLayoutHints
(
kLHintsNormal
, 0, 16, 3);
1104
fTrashListLayout
->
Add
(
layout7
);
1105
TGLayoutHints
*
layout8
=
new
TGLayoutHints
(
kLHintsExpandX
, 0, 0, 10);
1106
fTrashListLayout
->
Add
(
layout8
);
1107
TGLayoutHints
*
layout9
=
new
TGLayoutHints
(
kLHintsNormal
, -15, 0, -5, -10);
1108
fTrashListLayout
->
Add
(
layout9
);
1109
TGLayoutHints
*
layout10
=
new
TGLayoutHints
(
kLHintsNormal
, 15, 0, -5, -10);
1110
fTrashListLayout
->
Add
(
layout10
);
1111
TGLayoutHints
*
layout11
=
new
TGLayoutHints
(
kLHintsExpandX
, 0, 0, 15);
1112
fTrashListLayout
->
Add
(
layout11
);
1113
TGLayoutHints
*
layout12
=
new
TGLayoutHints
(
kLHintsExpandX
, 0, 0, 10, 5);
1114
fTrashListLayout
->
Add
(
layout12
);
1115
TGLayoutHints
*
layout13
=
new
TGLayoutHints
(
kLHintsExpandX
, 20, 0, 7);
1116
fTrashListLayout
->
Add
(
layout13
);
1117
1118
TGVerticalFrame
*
topLevel
=
new
TGVerticalFrame
(
cf
);
1119
fTrashListFrame
->
AddFirst
(
topLevel
);
1120
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
topLevel
);
1121
fTrashListFrame
->
AddFirst
(
h1
);
1122
TGVerticalFrame
*
v11
=
new
TGVerticalFrame
(
h1
);
1123
fTrashListFrame
->
AddFirst
(
v11
);
1124
fListLabel
=
new
TGLabel
(
v11
,
"Available Styles:"
);
1125
v11
->AddFrame(
fListLabel
);
1126
fListComboBox
=
new
TGComboBox
(
v11
,
kTopStylesList
);
1127
fListComboBox
->
Associate
(
this
);
1128
fListComboBox
->
Resize
(200, 22);
1129
v11
->AddFrame(
fListComboBox
,
layout1
);
1130
h1
->AddFrame(
v11
,
fLayoutExpandX
);
1131
TGVerticalFrame
*
v12
=
new
TGVerticalFrame
(
h1
);
1132
fTrashListFrame
->
AddFirst
(
v12
);
1133
fMakeDefaultPic
=
gClient
->GetPicture(
"arrow_right2.xpm"
);
1134
fMakeDefault
=
new
TGPictureButton
(
v12
,
fMakeDefaultPic
,
kTopMakeDefault
);
1135
fMakeDefault
->
SetStyle
(
gClient
->GetStyle());
1136
fMakeDefault
->
Associate
(
this
);
1137
fMakeDefault
->
Resize
(40, 22);
1138
v12
->AddFrame(
fMakeDefault
,
layout3
);
1139
h1
->AddFrame(
v12
,
layout4
);
1140
TGVerticalFrame
*
v13
=
new
TGVerticalFrame
(
h1
);
1141
fTrashListFrame
->
AddFirst
(
v13
);
1142
fCurStylabel
=
new
TGLabel
(
v13
,
"gStyle is set to:"
);
1143
v13
->AddFrame(
fCurStylabel
);
1144
fCurStyle
=
new
TGTextEntry
(
v13
,
""
,
kTopCurStyle
);
1145
fCurStyle
->
Associate
(
this
);
1146
fCurStyle
->
SetEnabled
(
kFALSE
);
1147
v13
->AddFrame(
fCurStyle
,
layout1
);
1148
h1
->AddFrame(
v13
,
fLayoutExpandX
);
1149
topLevel
->AddFrame(
h1
,
fLayoutExpandX
);
1150
1151
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
topLevel
);
1152
fTrashListFrame
->
AddFirst
(h2);
1153
TGGroupFrame
*
gf
=
new
TGGroupFrame
(h2,
"Apply on"
);
1154
fTrashListFrame
->
AddFirst
(
gf
);
1155
TGVerticalFrame
*
vf
=
new
TGVerticalFrame
(
gf
);
1156
fTrashListFrame
->
AddFirst
(
vf
);
1157
Pixel_t
red
;
1158
gClient
->GetColorByName(
"#FF0000"
,
red
);
1159
TGHorizontalFrame
*
selCanvas
=
new
TGHorizontalFrame
(
vf
);
1160
fTrashListFrame
->
AddFirst
(
selCanvas
);
1161
fCurPadLabel
=
new
TGLabel
(
selCanvas
,
"Canvas:"
);
1162
selCanvas
->AddFrame(
fCurPadLabel
,
layout6
);
1163
fCurPadTextEntry
=
new
TGTextEntry
(
selCanvas
,
""
,
kTopCurPad
);
1164
fCurPadTextEntry
->
SetEnabled
(
kFALSE
);
1165
fCurPadTextEntry
->
SetTextColor
(
red
,
kFALSE
);
1166
selCanvas
->AddFrame(
fCurPadTextEntry
,
fLayoutExpandX
);
1167
vf
->AddFrame(
selCanvas
,
fLayoutExpandX
);
1168
TGHorizontalFrame
*
selObject
=
new
TGHorizontalFrame
(
vf
);
1169
fTrashListFrame
->
AddFirst
(
selObject
);
1170
fCurObjLabel
=
new
TGLabel
(
selObject
,
"Object:"
);
1171
selObject
->AddFrame(
fCurObjLabel
,
layout7
);
1172
fCurObjTextEntry
=
new
TGTextEntry
(
selObject
,
""
,
kTopCurObj
);
1173
fCurObjTextEntry
->
Associate
(
this
);
1174
fCurObjTextEntry
->
SetEnabled
(
kFALSE
);
1175
fCurObjTextEntry
->
SetTextColor
(
red
,
kFALSE
);
1176
selObject
->AddFrame(
fCurObjTextEntry
,
fLayoutExpandX
);
1177
vf
->AddFrame(
selObject
,
layout8
);
1178
TGHorizontalFrame
*
h4
=
new
TGHorizontalFrame
(
vf
);
1179
fTrashListFrame
->
AddFirst
(
h4
);
1180
fApplyOnGroup
=
new
TGHButtonGroup
(
h4
);
1181
fApplyOnAll
=
new
TGRadioButton
(
fApplyOnGroup
,
"All canvases"
,
kTopApplyOnAll
);
1182
fApplyOnAll
->
Associate
(
this
);
1183
fApplyOnSel
=
new
TGRadioButton
(
fApplyOnGroup
,
"Selected object"
,
kTopApplyOnSel
);
1184
fApplyOnSel
->
Associate
(
this
);
1185
fAllAndNotCurrent
=
kFALSE
;
1186
fApplyOnGroup
->
SetButton
(
kTopApplyOnSel
);
1187
fApplyOnGroup
->
Show
();
1188
fApplyOnGroup
->
SetLayoutHints
(
layout9
,
fApplyOnAll
);
1189
fApplyOnGroup
->
SetLayoutHints
(
layout10
,
fApplyOnSel
);
1190
h4
->AddFrame(
fApplyOnGroup
);
1191
fApplyOnButton
=
new
TGTextButton
(
h4
,
"&Apply"
,
kTopApplyOnBut
);
1192
fApplyOnButton
->
Associate
(
this
);
1193
fApplyOnButton
->
Resize
(100, 22);
1194
h4
->AddFrame(
fApplyOnButton
,
layout13
);
1195
vf
->AddFrame(
h4
,
fLayoutExpandX
);
1196
gf
->AddFrame(
vf
,
layout11
);
1197
h2->AddFrame(
gf
,
layout12
);
1198
topLevel
->AddFrame(h2,
fLayoutExpandX
);
1199
1200
TGHorizontalFrame
*h3 =
new
TGHorizontalFrame
(
topLevel
);
1201
fTrashListFrame
->
AddFirst
(h3);
1202
fPreviewButton
=
new
TGCheckButton
(h3,
"&Preview"
,
kTopPreview
);
1203
fPreviewButton
->
Associate
(
this
);
1204
h3->AddFrame(
fPreviewButton
,
layout6
);
1205
fPreviewRealTime
=
new
TGCheckButton
(h3,
"Run &Time Preview"
,
kTopPreviewRealTime
);
1206
fPreviewRealTime
->
Associate
(
this
);
1207
fPreviewRealTime
->
SetEnabled
(
kFALSE
);
1208
h3->AddFrame(
fPreviewRealTime
,
layout6
);
1209
fMoreLess
=
new
TGTextButton
(h3,
"&Close <<"
,
kTopMoreLess
);
1210
fMoreLess
->
Associate
(
this
);
1211
h3->AddFrame(
fMoreLess
,
layout5
);
1212
topLevel
->AddFrame(h3,
fLayoutExpandX
);
1213
1214
cf
->AddFrame(
topLevel
,
layout2
);
1215
1216
fApplyOnButton
->
SetToolTipText
(
"Apply the selected style on the selected object"
);
1217
fPreviewButton
->
SetToolTipText
(
"Show / Hide the preview window"
);
1218
fPreviewRealTime
->
SetToolTipText
(
"Continuous / Asynchronous update of the preview"
);
1219
}
1220
1221
////////////////////////////////////////////////////////////////////////////////
1222
/// Build the list of styles which will appear in the available styles
1223
/// combo box. The new style to select is mentioned. If no style has
1224
/// been specified, the last entry of the list is selected.
1225
1226
void
TStyleManager::BuildList
(
TStyle
*
style
)
1227
{
1228
// Empty the list.
1229
fListComboBox
->
RemoveEntries
(1,
fListComboBox
->
GetNumberOfEntries
());
1230
1231
// Build the list of all styles already created in the ROOT session.
1232
Int_t
i = 1;
1233
Int_t
styleID
= 0;
1234
TStyle
*
tmpStyle
= (
TStyle
*) (
gROOT
->GetListOfStyles()->First());
1235
while
(
tmpStyle
) {
1236
if
(
tmpStyle
==
style
)
styleID
= i;
1237
fListComboBox
->
AddEntry
(
tmpStyle
->GetName(), i++);
1238
tmpStyle
= (
TStyle
*) (
gROOT
->GetListOfStyles()->After(
tmpStyle
));
1239
}
1240
1241
// Select 'style' in the list of available styles.
1242
if
(
styleID
== 0)
styleID
= i - 1;
1243
fListComboBox
->
Select
(
styleID
);
1244
DoListSelect
();
1245
fCurStyle
->
SetText
(
gStyle
->
GetName
());
1246
}
1247
1248
////////////////////////////////////////////////////////////////////////////////
1249
/// Update the content of the status bar: show the name of the current
1250
/// selected style, its title and the macro from which it has been imported.
1251
1252
void
TStyleManager::UpdateStatusBar
()
1253
{
1254
fStatusBar
->
SetText
(
fCurSelStyle
->
GetName
(), 0);
1255
fStatusBar
->
SetText
(
fCurSelStyle
->
GetTitle
(), 2);
1256
1257
if
((!
strcmp
(
fCurSelStyle
->
GetName
(),
"Default"
))
1258
|| (!
strcmp
(
fCurSelStyle
->
GetName
(),
"Plain"
))
1259
|| (!
strcmp
(
fCurSelStyle
->
GetName
(),
"Bold"
))
1260
|| (!
strcmp
(
fCurSelStyle
->
GetName
(),
"Video"
))
1261
|| (!
strcmp
(
fCurSelStyle
->
GetName
(),
"Pub"
))) {
1262
fStatusBar
->
SetText
(
"ROOT style"
, 1);
1263
}
else
if
(
fStyleChanged
) {
1264
fStatusBar
->
SetText
(
"User Style _ Not Saved"
, 1);
1265
}
else
{
1266
fStatusBar
->
SetText
(
"User Style"
, 1);
1267
}
1268
}
1269
1270
////////////////////////////////////////////////////////////////////////////////
1271
/// Update the values of every widget entry in the editor. The new values
1272
/// are loaded from the current selected style.
1273
1274
void
TStyleManager::UpdateEditor
(
Int_t
tabNum
)
1275
{
1276
Double_t
delta;
1277
Int_t
year
;
1278
Int_t
month
;
1279
Int_t
day
;
1280
Int_t
oneYearInSecs
;
1281
Int_t
oneMonthInSecs
;
1282
Int_t
tmp;
1283
Int_t
tmp2
;
1284
switch
(
tabNum
) {
1285
case
0:
// GENERAL
1286
fFillColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetFillColor
()));
1287
fFillStyle
->
SetPattern
(
fCurSelStyle
->
GetFillStyle
());
1288
fHatchesLineWidth
->
Select
(
fCurSelStyle
->
GetHatchesLineWidth
());
1289
fHatchesSpacing
->
SetNumber
(
fCurSelStyle
->
GetHatchesSpacing
());
1290
fMarkerColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetMarkerColor
()));
1291
fMarkerStyle
->
SetMarkerStyle
(
fCurSelStyle
->
GetMarkerStyle
());
1292
fMarkerSize
->
Select
((
Int_t
)
fCurSelStyle
->
GetMarkerSize
() * 5);
1293
fScreenFactor
->
SetNumber
(
fCurSelStyle
->
GetScreenFactor
());
1294
fLineColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetLineColor
()));
1295
fLineWidth
->
Select
(
fCurSelStyle
->
GetLineWidth
());
1296
fLineStyle
->
Select
(
fCurSelStyle
->
GetLineStyle
());
1297
// Nothing to do with fLineStyleEdit.
1298
fTextColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTextColor
()));
1299
if
(
fCurSelStyle
->
GetTextFont
()%10 > 2) {
1300
fTextSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1301
ModTextSizeInPixels
(
kTRUE
);
1302
}
else
{
1303
fTextSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1304
ModTextSizeInPixels
(
kFALSE
);
1305
}
1306
fTextFont
->
Select
(
fCurSelStyle
->
GetTextFont
()/10);
1307
fTextAlign
->
Select
(
fCurSelStyle
->
GetTextAlign
());
1308
fTextAngle
->
SetNumber
(
fCurSelStyle
->
GetTextAngle
());
1309
break
;
1310
case
1:
// CANVAS
1311
fCanvasColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetCanvasColor
()));
1312
fCanvasDefX
->
SetIntNumber
(
fCurSelStyle
->
GetCanvasDefX
());
1313
fCanvasDefY
->
SetIntNumber
(
fCurSelStyle
->
GetCanvasDefY
());
1314
fCanvasDefW
->
SetIntNumber
(
fCurSelStyle
->
GetCanvasDefW
());
1315
fCanvasDefH
->
SetIntNumber
(
fCurSelStyle
->
GetCanvasDefH
());
1316
fCanvasBorderMode
->
SetButton
(
fCurSelStyle
->
GetCanvasBorderMode
() + 1 +
kCanvasBorderModeSunken
);
1317
fCanvasBorderSize
->
Select
(
fCurSelStyle
->
GetCanvasBorderSize
());
1318
fAttDateTextColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetAttDate
()->
GetTextColor
()));
1319
if
(
fCurSelStyle
->
GetAttDate
()->
GetTextFont
()%10 > 2) {
1320
fAttDateTextSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1321
ModAttDateTextSizeInPixels
(
kTRUE
);
1322
}
else
{
1323
fAttDateTextSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1324
ModAttDateTextSizeInPixels
(
kFALSE
);
1325
}
1326
fOptDateFormat
->
Select
(
fCurSelStyle
->
GetOptDate
()/10 + 1);
1327
fAttDateTextFont
->
Select
(
fCurSelStyle
->
GetAttDate
()->
GetTextFont
()/10);
1328
fAttDateTextAlign
->
Select
(
fCurSelStyle
->
GetAttDate
()->
GetTextAlign
());
1329
fAttDateTextAngle
->
SetNumber
(
fCurSelStyle
->
GetAttDate
()->
GetTextAngle
());
1330
fDateX
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetDateX
()*100 + 0.5));
1331
fDateY
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetDateY
()*100 + 0.5));
1332
1333
if
(
fCurSelStyle
->
GetOptDate
()) {
1334
fOptDateBool
->
SetState
(
kButtonDown
,
kFALSE
);
1335
fAttDateTextColor
->
Enable
();
1336
fAttDateTextSize
->
SetState
(
kTRUE
);
1337
if
(!
fAttDateTextSizeInPixels
->
IsDown
())
1338
fAttDateTextSizeInPixels
->
SetEnabled
(
kTRUE
);
1339
// TODO Just delete when ComboBox can be grayed
1340
//fOptDateFormat->SetState(kTRUE);
1341
//ModAttDateTextFont->SetState(kTRUE);
1342
//ModAttDateTextAlign->SetState(kTRUE);
1343
fAttDateTextAngle
->
SetState
(
kTRUE
);
1344
fDateX
->
SetState
(
kTRUE
);
1345
fDateY
->
SetState
(
kTRUE
);
1346
}
else
{
1347
fOptDateBool
->
SetState
(
kButtonUp
,
kFALSE
);
1348
fAttDateTextColor
->
Disable
();
1349
fAttDateTextSize
->
SetState
(
kFALSE
);
1350
fAttDateTextSizeInPixels
->
SetEnabled
(
kFALSE
);
1351
// TODO Just delete when ComboBox can be grayed
1352
//fOptDateFormat->SetState(kFALSE);
1353
//ModAttDateTextFont->SetState(kFALSE);
1354
//ModAttDateTextAlign->SetState(kFALSE);
1355
fAttDateTextAngle
->
SetState
(
kFALSE
);
1356
fDateX
->
SetState
(
kFALSE
);
1357
fDateY
->
SetState
(
kFALSE
);
1358
}
1359
break
;
1360
case
2:
// PAD
1361
fPadTopMargin
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetPadTopMargin
() * 100 + 0.5));
1362
fPadBottomMargin
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetPadBottomMargin
() * 100 + 0.5));
1363
fPadLeftMargin
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetPadLeftMargin
() * 100 + 0.5));
1364
fPadRightMargin
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetPadRightMargin
() * 100 + 0.5));
1365
fPadBorderMode
->
SetButton
(
fCurSelStyle
->
GetPadBorderMode
() + 1 +
kPadBorderModeSunken
);
1366
fPadBorderSize
->
Select
(
fCurSelStyle
->
GetPadBorderSize
());
1367
fPadColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetPadColor
()));
1368
if
(
fCurSelStyle
->
GetPadTickX
())
1369
fPadTickX
->
SetState
(
kButtonDown
,
kFALSE
);
1370
else
1371
fPadTickX
->
SetState
(
kButtonUp
,
kFALSE
);
1372
if
(
fCurSelStyle
->
GetPadTickY
())
1373
fPadTickY
->
SetState
(
kButtonDown
,
kFALSE
);
1374
else
1375
fPadTickY
->
SetState
(
kButtonUp
,
kFALSE
);
1376
if
(
fCurSelStyle
->
GetPadGridX
())
1377
fPadGridX
->
SetState
(
kButtonDown
,
kFALSE
);
1378
else
1379
fPadGridX
->
SetState
(
kButtonUp
,
kFALSE
);
1380
if
(
fCurSelStyle
->
GetPadGridY
())
1381
fPadGridY
->
SetState
(
kButtonDown
,
kFALSE
);
1382
else
1383
fPadGridY
->
SetState
(
kButtonUp
,
kFALSE
);
1384
fGridColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetGridColor
()));
1385
fGridWidth
->
Select
(
fCurSelStyle
->
GetGridWidth
());
1386
fGridStyle
->
Select
(
fCurSelStyle
->
GetGridStyle
());
1387
break
;
1388
case
3:
// HISTOS
1389
fHistFillColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetHistFillColor
()));
1390
fHistFillStyle
->
SetPattern
(
fCurSelStyle
->
GetHistFillStyle
());
1391
fHistLineColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetHistLineColor
()));
1392
fHistLineWidth
->
Select
(
fCurSelStyle
->
GetHistLineWidth
());
1393
fHistLineStyle
->
Select
(
fCurSelStyle
->
GetHistLineStyle
());
1394
fBarWidth
->
SetNumber
(
fCurSelStyle
->
GetBarWidth
());
1395
fBarOffset
->
SetNumber
(
fCurSelStyle
->
GetBarOffset
());
1396
if
(
fCurSelStyle
->
GetHistMinimumZero
())
1397
fHistMinimumZero
->
SetState
(
kButtonDown
,
kFALSE
);
1398
else
1399
fHistMinimumZero
->
SetState
(
kButtonUp
,
kFALSE
);
1400
fPaintTextFormat
->
SetText
(
fCurSelStyle
->
GetPaintTextFormat
());
1401
fNumberContours
->
SetIntNumber
(
fCurSelStyle
->
GetNumberContours
());
1402
fLegoInnerR
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetLegoInnerR
() * 100 + 0.5));
1403
fFrameFillColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetFrameFillColor
()));
1404
fFrameFillStyle
->
SetPattern
(
fCurSelStyle
->
GetFrameFillStyle
());
1405
fFrameLineColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetFrameLineColor
()));
1406
fFrameLineWidth
->
Select
(
fCurSelStyle
->
GetFrameLineWidth
());
1407
fFrameLineStyle
->
Select
(
fCurSelStyle
->
GetFrameLineStyle
());
1408
// Nothing to do with fPaletteEdit;
1409
fFrameBorderMode
->
SetButton
(
fCurSelStyle
->
GetFrameBorderMode
() + 1 +
kFrameBorderModeSunken
);
1410
fFrameBorderSize
->
Select
(
fCurSelStyle
->
GetFrameBorderSize
());
1411
fFuncColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetFuncColor
()));
1412
fFuncWidth
->
Select
(
fCurSelStyle
->
GetFuncWidth
());
1413
fFuncStyle
->
Select
(
fCurSelStyle
->
GetFuncStyle
());
1414
if
(
fCurSelStyle
->
GetDrawBorder
())
1415
fDrawBorder
->
SetState
(
kButtonDown
,
kFALSE
);
1416
else
1417
fDrawBorder
->
SetState
(
kButtonUp
,
kFALSE
);
1418
fEndErrorSize
->
SetNumber
(
fCurSelStyle
->
GetEndErrorSize
());
1419
fErrorX
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetErrorX
() * 100 + 0.5));
1420
break
;
1421
case
4:
// AXIS
1422
delta =
fCurSelStyle
->
GetTimeOffset
() - 788918400;
1423
year
= 1995;
1424
month
= 1;
1425
while
(delta < 0) {
1426
year
--;
1427
if
(
year
% 4)
oneYearInSecs
= 3600 * 24 * 365;
1428
else
oneYearInSecs
= 3600 * 24 * 366;
1429
delta +=
oneYearInSecs
;
1430
}
1431
oneYearInSecs
= 3600 * 24 * 365;
// because 365 days in 1995.
1432
while
(delta >=
oneYearInSecs
) {
1433
if
(
year
% 4)
oneYearInSecs
= 3600 * 24 * 365;
1434
else
oneYearInSecs
= 3600 * 24 * 366;
1435
delta -=
oneYearInSecs
;
1436
year
++;
1437
}
1438
oneMonthInSecs
= 3600 * 24 * 31;
// because 31 days in January.
1439
while
(delta >=
oneMonthInSecs
) {
1440
month
++;
1441
delta -=
oneMonthInSecs
;
1442
switch
(
month
) {
1443
case
2:
1444
if
(
year
% 4)
oneMonthInSecs
= 3600 * 24 * 28;
1445
else
oneMonthInSecs
= 3600 * 24 * 29;
1446
break
;
1447
case
3:
case
5:
case
7:
case
8:
case
10:
case
12:
1448
oneMonthInSecs
= 3600 * 24 * 31;
1449
break
;
1450
default
:
1451
oneMonthInSecs
= 3600 * 24 * 30;
1452
}
1453
}
1454
day
= (
Int_t
) delta / (3600 * 24) + 1;
1455
delta = ((
Int_t
) delta) % (3600 * 24);
1456
fTimeOffsetDate
->
SetNumber
(
year
*10000 +
month
*100 +
day
);
1457
fTimeOffsetTime
->
SetNumber
(delta);
1458
1459
if
(
fCurSelStyle
->
GetStripDecimals
())
1460
fStripDecimals
->
SetState
(
kButtonUp
,
kFALSE
);
1461
else
1462
fStripDecimals
->
SetState
(
kButtonDown
,
kFALSE
);
1463
fXTitleSize
->
SetNumber
(
fCurSelStyle
->
GetTitleSize
(
"X"
));
1464
if
(
fCurSelStyle
->
GetTitleFont
(
"X"
)%10 > 2) {
1465
fXTitleSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1466
ModXTitleSizeInPixels
(
kTRUE
);
1467
}
else
{
1468
fXTitleSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1469
ModXTitleSizeInPixels
(
kFALSE
);
1470
}
1471
fXTitleColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTitleColor
(
"X"
)));
1472
fXTitleOffset
->
SetNumber
(
fCurSelStyle
->
GetTitleOffset
(
"X"
));
1473
fXTitleFont
->
Select
(
fCurSelStyle
->
GetTitleFont
(
"X"
)/10);
1474
fXLabelSize
->
SetNumber
(
fCurSelStyle
->
GetLabelSize
(
"X"
));
1475
if
(
fCurSelStyle
->
GetLabelFont
(
"X"
)%10 > 2) {
1476
fXLabelSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1477
ModXLabelSizeInPixels
(
kTRUE
);
1478
}
else
{
1479
fXLabelSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1480
ModXLabelSizeInPixels
(
kFALSE
);
1481
}
1482
fXLabelColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetLabelColor
(
"X"
)));
1483
fXLabelOffset
->
SetNumber
(
fCurSelStyle
->
GetLabelOffset
(
"X"
));
1484
fXLabelFont
->
Select
(
fCurSelStyle
->
GetLabelFont
(
"X"
)/10);
1485
fXAxisColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetAxisColor
(
"X"
)));
1486
fXTickLength
->
SetNumber
(
fCurSelStyle
->
GetTickLength
(
"X"
));
1487
if
(
fCurSelStyle
->
GetOptLogx
())
1488
fOptLogx
->
SetState
(
kButtonDown
,
kFALSE
);
1489
else
1490
fOptLogx
->
SetState
(
kButtonUp
,
kFALSE
);
1491
fXNdivMain
->
SetIntNumber
(
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"X"
)) % 100);
1492
fXNdivSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"X"
)) % 10000)/100);
1493
fXNdivSubSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"X"
)) % 1000000)/10000);
1494
if
(
fCurSelStyle
->
GetNdivisions
(
"X"
) > 0)
1495
fXNdivisionsOptimize
->
SetState
(
kButtonDown
,
kFALSE
);
1496
else
1497
fXNdivisionsOptimize
->
SetState
(
kButtonUp
,
kFALSE
);
1498
fYTitleSize
->
SetNumber
(
fCurSelStyle
->
GetTitleSize
(
"Y"
));
1499
if
(
fCurSelStyle
->
GetTitleFont
(
"Y"
)%10 > 2) {
1500
fYTitleSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1501
ModYTitleSizeInPixels
(
kTRUE
);
1502
}
else
{
1503
fYTitleSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1504
ModYTitleSizeInPixels
(
kFALSE
);
1505
}
1506
fYTitleColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTitleColor
(
"Y"
)));
1507
fYTitleOffset
->
SetNumber
(
fCurSelStyle
->
GetTitleOffset
(
"Y"
));
1508
fYTitleFont
->
Select
(
fCurSelStyle
->
GetTitleFont
(
"Y"
)/10);
1509
fYLabelSize
->
SetNumber
(
fCurSelStyle
->
GetLabelSize
(
"Y"
));
1510
if
(
fCurSelStyle
->
GetLabelFont
(
"Y"
)%10 > 2) {
1511
fYLabelSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1512
ModYLabelSizeInPixels
(
kTRUE
);
1513
}
else
{
1514
fYLabelSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1515
ModYLabelSizeInPixels
(
kFALSE
);
1516
}
1517
fYLabelColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetLabelColor
(
"Y"
)));
1518
fYLabelOffset
->
SetNumber
(
fCurSelStyle
->
GetLabelOffset
(
"Y"
));
1519
fYLabelFont
->
Select
(
fCurSelStyle
->
GetLabelFont
(
"Y"
)/10);
1520
fYAxisColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetAxisColor
(
"Y"
)));
1521
fYTickLength
->
SetNumber
(
fCurSelStyle
->
GetTickLength
(
"Y"
));
1522
if
(
fCurSelStyle
->
GetOptLogy
())
1523
fOptLogy
->
SetState
(
kButtonDown
,
kFALSE
);
1524
else
1525
fOptLogy
->
SetState
(
kButtonUp
,
kFALSE
);
1526
fYNdivMain
->
SetIntNumber
(
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Y"
)) % 100);
1527
fYNdivSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Y"
)) % 10000)/100);
1528
fYNdivSubSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Y"
)) % 1000000)/10000);
1529
if
(
fCurSelStyle
->
GetNdivisions
(
"Y"
) > 0)
1530
fYNdivisionsOptimize
->
SetState
(
kButtonDown
,
kFALSE
);
1531
else
1532
fYNdivisionsOptimize
->
SetState
(
kButtonUp
,
kFALSE
);
1533
fZTitleSize
->
SetNumber
(
fCurSelStyle
->
GetTitleSize
(
"Z"
));
1534
if
(
fCurSelStyle
->
GetTitleFont
(
"Z"
)%10 > 2) {
1535
fZTitleSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1536
ModZTitleSizeInPixels
(
kTRUE
);
1537
}
else
{
1538
fZTitleSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1539
ModZTitleSizeInPixels
(
kFALSE
);
1540
}
1541
fZTitleColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTitleColor
(
"Z"
)));
1542
fZTitleOffset
->
SetNumber
(
fCurSelStyle
->
GetTitleOffset
(
"Z"
));
1543
fZTitleFont
->
Select
(
fCurSelStyle
->
GetTitleFont
(
"Z"
)/10);
1544
fZLabelSize
->
SetNumber
(
fCurSelStyle
->
GetLabelSize
(
"Z"
));
1545
if
(
fCurSelStyle
->
GetLabelFont
(
"Z"
)%10 > 2) {
1546
fZLabelSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1547
ModZLabelSizeInPixels
(
kTRUE
);
1548
}
else
{
1549
fZLabelSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1550
ModZLabelSizeInPixels
(
kFALSE
);
1551
}
1552
fZLabelColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetLabelColor
(
"Z"
)));
1553
fZLabelOffset
->
SetNumber
(
fCurSelStyle
->
GetLabelOffset
(
"Z"
));
1554
fZLabelFont
->
Select
(
fCurSelStyle
->
GetLabelFont
(
"Z"
)/10);
1555
fZAxisColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetAxisColor
(
"Z"
)));
1556
fZTickLength
->
SetNumber
(
fCurSelStyle
->
GetTickLength
(
"Z"
));
1557
1558
if
(
fCurSelStyle
->
GetOptLogz
())
1559
fOptLogz
->
SetState
(
kButtonDown
,
kFALSE
);
1560
else
1561
fOptLogz
->
SetState
(
kButtonUp
,
kFALSE
);
1562
1563
fZNdivMain
->
SetIntNumber
(
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Z"
)) % 100);
1564
fZNdivSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Z"
)) % 10000)/100);
1565
fZNdivSubSub
->
SetIntNumber
((
TMath::Abs
(
fCurSelStyle
->
GetNdivisions
(
"Z"
)) % 1000000)/10000);
1566
if
(
fCurSelStyle
->
GetNdivisions
(
"Z"
) > 0)
1567
fZNdivisionsOptimize
->
SetState
(
kButtonDown
,
kFALSE
);
1568
else
1569
fZNdivisionsOptimize
->
SetState
(
kButtonUp
,
kFALSE
);
1570
break
;
1571
case
5:
// TITLES
1572
fTitleColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTitleFillColor
()));
1573
fTitleStyle
->
SetPattern
(
fCurSelStyle
->
GetTitleStyle
());
1574
fTitleTextColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetTitleTextColor
()));
1575
fTitleFontSize
->
SetNumber
(
fCurSelStyle
->
GetTitleFontSize
());
1576
if
(
fCurSelStyle
->
GetTitleFont
()%10 > 2) {
1577
fTitleFontSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1578
ModTitleFontSizeInPixels
(
kTRUE
);
1579
}
else
{
1580
fTitleFontSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1581
ModTitleFontSizeInPixels
(
kFALSE
);
1582
}
1583
fTitleFont
->
Select
(
fCurSelStyle
->
GetTitleFont
()/10);
1584
fTitleAlign
->
Select
(
fCurSelStyle
->
GetTitleAlign
());
1585
fTitleBorderSize
->
Select
(
fCurSelStyle
->
GetTitleBorderSize
());
1586
fLegendBorderSize
->
Select
(
fCurSelStyle
->
GetLegendBorderSize
());
1587
fTitleX
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetTitleX
() * 100 + 0.5));
1588
fTitleY
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetTitleY
() * 100 + 0.5));
1589
fTitleW
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetTitleW
() * 100 + 0.5));
1590
fTitleH
->
SetIntNumber
((
Int_t
) (
fCurSelStyle
->
GetTitleH
() * 100 + 0.5));
1591
1592
if
(
fCurSelStyle
->
GetOptTitle
()) {
1593
fOptTitle
->
SetState
(
kButtonDown
,
kFALSE
);
1594
fTitleColor
->
Enable
();
1595
fTitleStyle
->
Enable
();
1596
fTitleTextColor
->
Enable
();
1597
fTitleFontSize
->
SetState
(
kTRUE
);
1598
if
(!
fTitleFontSizeInPixels
->
IsDown
())
1599
fTitleFontSizeInPixels
->
SetEnabled
(
kTRUE
);
1600
// TODO Just delete when ComboBox can be grayed
1601
//fTitleFont->SetState(kTRUE);
1602
//fTitleAlign->SetState(kTRUE);
1603
//fTitleBorderSize->SetState(kTRUE);
1604
//fLegendBorderSize->SetState(kTRUE);
1605
fTitleX
->
SetState
(
kTRUE
);
1606
fTitleY
->
SetState
(
kTRUE
);
1607
fTitleW
->
SetState
(
kTRUE
);
1608
fTitleH
->
SetState
(
kTRUE
);
1609
}
else
{
1610
fOptTitle
->
SetState
(
kButtonUp
,
kFALSE
);
1611
fTitleColor
->
Disable
();
1612
fTitleStyle
->
Disable
();
1613
fTitleTextColor
->
Disable
();
1614
fTitleFontSize
->
SetState
(
kFALSE
);
1615
fTitleFontSizeInPixels
->
SetEnabled
(
kFALSE
);
1616
// TODO Just delete when ComboBox can be grayed
1617
//fTitleFont->SetState(kFALSE);
1618
//fTitleAlign->SetState(kFALSE);
1619
//fTitleBorderSize->SetState(kFALSE);
1620
//fLegendBorderSize->SetState(kFALSE);
1621
fTitleX
->
SetState
(
kFALSE
);
1622
fTitleY
->
SetState
(
kFALSE
);
1623
fTitleW
->
SetState
(
kFALSE
);
1624
fTitleH
->
SetState
(
kFALSE
);
1625
}
1626
break
;
1627
case
6:
// STATS
1628
fStatColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetStatColor
()));
1629
fStatStyle
->
SetPattern
(
fCurSelStyle
->
GetStatStyle
());
1630
fStatTextColor
->
SetColor
(
TColor::Number2Pixel
(
fCurSelStyle
->
GetStatTextColor
()));
1631
fStatFont
->
Select
(
fCurSelStyle
->
GetStatFont
()/10);
1632
if
(
fCurSelStyle
->
GetStatFont
()%10 > 2) {
1633
fStatFontSizeInPixels
->
SetState
(
kButtonDown
,
kFALSE
);
1634
ModStatFontSizeInPixels
(
kTRUE
);
1635
}
else
{
1636
fStatFontSizeInPixels
->
SetState
(
kButtonUp
,
kFALSE
);
1637
ModStatFontSizeInPixels
(
kFALSE
);
1638
}
1639
fStatFontSize
->
SetNumber
(
fCurSelStyle
->
GetStatFontSize
());
1640
1641
fStatX
->
SetNumber
(
fCurSelStyle
->
GetStatX
());
1642
fStatY
->
SetNumber
(
fCurSelStyle
->
GetStatY
());
1643
fStatW
->
SetNumber
(
fCurSelStyle
->
GetStatW
());
1644
fStatH
->
SetNumber
(
fCurSelStyle
->
GetStatH
());
1645
fStatBorderSize
->
Select
(
fCurSelStyle
->
GetStatBorderSize
());
1646
tmp =
fCurSelStyle
->
GetOptStat
();
1647
1648
if
(tmp % 10)
fOptStatName
->
SetState
(
kButtonDown
,
kFALSE
);
1649
else
fOptStatName
->
SetState
(
kButtonUp
,
kFALSE
);
1650
1651
if
((tmp/10) % 10)
fOptStatEntries
->
SetState
(
kButtonDown
,
kFALSE
);
1652
else
fOptStatEntries
->
SetState
(
kButtonUp
,
kFALSE
);
1653
1654
if
((tmp/100) % 10)
fOptStatMean
->
SetState
(
kButtonDown
,
kFALSE
);
1655
else
fOptStatMean
->
SetState
(
kButtonUp
,
kFALSE
);
1656
1657
if
((tmp/1000) % 10)
fOptStatRMS
->
SetState
(
kButtonDown
,
kFALSE
);
1658
else
fOptStatRMS
->
SetState
(
kButtonUp
,
kFALSE
);
1659
1660
if
((tmp/10000) % 10)
fOptStatUnderflow
->
SetState
(
kButtonDown
,
kFALSE
);
1661
else
fOptStatUnderflow
->
SetState
(
kButtonUp
,
kFALSE
);
1662
1663
if
((tmp/100000) % 10)
fOptStatOverflow
->
SetState
(
kButtonDown
,
kFALSE
);
1664
else
fOptStatOverflow
->
SetState
(
kButtonUp
,
kFALSE
);
1665
1666
if
((tmp/1000000) % 10)
fOptStatIntegral
->
SetState
(
kButtonDown
,
kFALSE
);
1667
else
fOptStatIntegral
->
SetState
(
kButtonUp
,
kFALSE
);
1668
1669
if
((tmp/10000000) % 10)
fOptStatSkewness
->
SetState
(
kButtonDown
,
kFALSE
);
1670
else
fOptStatSkewness
->
SetState
(
kButtonUp
,
kFALSE
);
1671
1672
if
((tmp/100000000) % 10)
fOptStatKurtosis
->
SetState
(
kButtonDown
,
kFALSE
);
1673
else
fOptStatKurtosis
->
SetState
(
kButtonUp
,
kFALSE
);
1674
1675
if
((((tmp/100) % 10) == 2) || (((tmp/1000) % 10) == 2) ||
1676
(((tmp/10000000) % 10) == 2) || (((tmp/100000000) % 10) == 2))
1677
fOptStatErrors
->
SetState
(
kButtonDown
,
kFALSE
);
1678
else
fOptStatErrors
->
SetState
(
kButtonUp
,
kFALSE
);
1679
1680
fStatFormat
->
SetText
(
fCurSelStyle
->
GetStatFormat
());
1681
tmp2
=
fCurSelStyle
->
GetOptFit
();
1682
1683
if
(
tmp2
% 10)
fOptFitValues
->
SetState
(
kButtonDown
,
kFALSE
);
1684
else
fOptFitValues
->
SetState
(
kButtonUp
,
kFALSE
);
1685
1686
if
((
tmp2
/10) % 10) {
1687
fOptFitErrors
->
SetState
(
kButtonDown
,
kFALSE
);
1688
fOptFitValues
->
SetState
(
kButtonDown
,
kFALSE
);
1689
}
else
1690
fOptFitErrors
->
SetState
(
kButtonUp
,
kFALSE
);
1691
1692
if
((
tmp2
/100) % 10)
fOptFitChi
->
SetState
(
kButtonDown
,
kFALSE
);
1693
else
fOptFitChi
->
SetState
(
kButtonUp
,
kFALSE
);
1694
1695
if
((
tmp2
/1000) % 10)
fOptFitProbability
->
SetState
(
kButtonDown
,
kFALSE
);
1696
else
fOptFitProbability
->
SetState
(
kButtonUp
,
kFALSE
);
1697
1698
fFitFormat
->
SetText
(
fCurSelStyle
->
GetFitFormat
());
1699
break
;
1700
1701
case
7:
// PS / PDF
1702
fHeaderPS
->
SetText
(
fCurSelStyle
->
GetHeaderPS
());
1703
fTitlePS
->
SetText
(
fCurSelStyle
->
GetTitlePS
());
1704
fColorModelPS
->
SetButton
(
fCurSelStyle
->
GetColorModelPS
() +
kPSPDFColorModelPSRGB
);
1705
fLineScalePS
->
SetNumber
(
fCurSelStyle
->
GetLineScalePS
());
1706
Float_t
papSizeX
;
1707
Float_t
papSizeY
;
1708
fCurSelStyle
->
GetPaperSize
(
papSizeX
,
papSizeY
);
1709
if
((
papSizeX
== 20) && (
papSizeY
== 26)) {
1710
fPaperSizePredef
->
Select
(3);
1711
fPaperSizeEnCm
=
kTRUE
;
1712
fPaperSizeX
->
SetNumber
(
papSizeX
);
1713
fPaperSizeY
->
SetNumber
(
papSizeY
);
1714
}
else
if
((
papSizeX
== 20) && (
papSizeY
== 24)) {
1715
fPaperSizePredef
->
Select
(4);
1716
fPaperSizeEnCm
=
kFALSE
;
1717
fPaperSizeX
->
SetNumber
(
papSizeX
* 0.394);
1718
fPaperSizeY
->
SetNumber
(
papSizeY
* 0.394);
1719
}
else
{
1720
fPaperSizePredef
->
Select
(1);
1721
fPaperSizeEnCm
=
kTRUE
;
1722
fPaperSizeX
->
SetNumber
(
papSizeX
);
1723
fPaperSizeY
->
SetNumber
(
papSizeY
);
1724
}
1725
break
;
1726
}
1727
}
1728
1729
////////////////////////////////////////////////////////////////////////////////
1730
/// Connect every entry in the top level interface to the slot.
1731
1732
void
TStyleManager::ConnectAll
()
1733
{
1734
Connect
(
"CloseWindow()"
,
"TStyleManager"
,
this
,
"CloseWindow()"
);
1735
fMenuStyle
->
Connect
(
"Activated(Int_t)"
,
"TStyleManager"
,
this
,
"DoMenu(Int_t)"
);
1736
fMenuHelp
->
Connect
(
"Activated(Int_t)"
,
"TStyleManager"
,
this
,
"DoMenu(Int_t)"
);
1737
fToolBarNew
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuNew
));
1738
fToolBarDelete
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuDelete
));
1739
fToolBarImportCanvas
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuImportCanvas
));
1740
fToolBarImportMacro
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuImportMacro
));
1741
fToolBarExport
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuExport
));
1742
fToolBarHelp
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuHelp
));
1743
fListComboBox
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"DoListSelect()"
);
1744
fPreviewButton
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"DoPreview(Bool_t)"
);
1745
fPreviewRealTime
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"DoRealTime(Bool_t)"
);
1746
fMakeDefault
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"DoMakeDefault()"
);
1747
fApplyOnGroup
->
Connect
(
"Clicked(Int_t)"
,
"TStyleManager"
,
this
,
"DoApplyOnSelect(Int_t)"
);
1748
fApplyOnButton
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"DoApplyOn()"
);
1749
fMoreLess
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"DoMoreLess()"
);
1750
1751
fEditionHelp
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
TString::Format
(
"DoMenu(Int_t=%d)"
,
kMenuHelpEditor
));
1752
fEditionUpdatePreview
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"DoEditionUpdatePreview()"
);
1753
fEditionReset
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"DoImportMacro(Int_t=kFALSE)"
);
1754
fEditionTab
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"DoChangeTab(Int_t)"
);
1755
fAxisTab
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"DoChangeAxisTab(Int_t)"
);
1756
1757
// Connect signals emited when the current pad changed.
1758
TQObject::Connect
(
"TCanvas"
,
"Selected(TVirtualPad *, TObject *, Int_t)"
,
"TStyleManager"
,
1759
this
,
"DoSelectCanvas(TVirtualPad *, TObject *, Int_t)"
);
1760
TQObject::Connect
(
"TCanvas"
,
"Closed()"
,
"TStyleManager"
,
this
,
"DoSelectNoCanvas()"
);
1761
}
1762
1763
////////////////////////////////////////////////////////////////////////////////
1764
/// Disconnect every entry in the top level interface of the slot.
1765
1766
void
TStyleManager::DisconnectAll
()
1767
{
1768
Disconnect
(
"CloseWindow()"
);
1769
fMenuStyle
->
Disconnect
(
"Activated(Int_t)"
);
1770
fMenuHelp
->
Disconnect
(
"Activated(Int_t)"
);
1771
fToolBarNew
->
Disconnect
(
"Clicked()"
);
1772
fToolBarDelete
->
Disconnect
(
"Clicked()"
);
1773
fToolBarImportCanvas
->
Disconnect
(
"Clicked()"
);
1774
fToolBarImportMacro
->
Disconnect
(
"Clicked()"
);
1775
fToolBarExport
->
Disconnect
(
"Clicked()"
);
1776
fToolBarHelp
->
Disconnect
(
"Clicked()"
);
1777
fListComboBox
->
Disconnect
(
"Selected(Int_t)"
);
1778
fPreviewButton
->
Disconnect
(
"Toggled(Bool_t)"
);
1779
fMakeDefault
->
Disconnect
(
"Clicked()"
);
1780
fApplyOnGroup
->
Disconnect
(
"Clicked(Int_t)"
);
1781
fApplyOnButton
->
Disconnect
(
"Clicked()"
);
1782
fMoreLess
->
Disconnect
(
"Clicked()"
);
1783
1784
fEditionHelp
->
Disconnect
(
"Clicked()"
);
1785
fEditionUpdatePreview
->
Disconnect
(
"Clicked()"
);
1786
fEditionReset
->
Disconnect
(
"Clicked()"
);
1787
fEditionTab
->
Disconnect
(
"Selected(Int_t)"
);
1788
1789
TQObject::Disconnect
(
"TCanvas"
,
"Selected(TVirtualPad *, TObject *, Int_t)"
);
1790
TQObject::Disconnect
(
"TCanvas"
,
"Closed()"
);
1791
}
1792
1793
////////////////////////////////////////////////////////////////////////////////
1794
/// Connect every widget entry of the editor to its specific slot.
1795
1796
void
TStyleManager::ConnectEditor
(
Int_t
tabNum
)
1797
{
1798
if
(
fSigSlotConnected
)
return
;
1799
fSigSlotConnected
=
kTRUE
;
1800
1801
switch
(
tabNum
) {
1802
case
0:
// GENERAL
1803
fFillColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModFillColor()"
);
1804
fFillStyle
->
Connect
(
"PatternSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModFillStyle()"
);
1805
fHatchesLineWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModHatchesLineWidth()"
);
1806
fHatchesSpacing
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModHatchesSpacing()"
);
1807
fMarkerColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModMarkerColor()"
);
1808
fMarkerStyle
->
Connect
(
"MarkerSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModMarkerStyle()"
);
1809
fMarkerSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModMarkerSize()"
);
1810
fScreenFactor
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModScreenFactor()"
);
1811
fLineColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModLineColor()"
);
1812
fLineWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModLineWidth()"
);
1813
fLineStyle
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModLineStyle()"
);
1814
fLineStyleEdit
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"ModLineStyleEdit()"
);
1815
fTextColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModTextColor()"
);
1816
fTextSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTextSize()"
);
1817
fTextSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModTextSizeInPixels(Bool_t)"
);
1818
fTextFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModTextFont()"
);
1819
fTextAlign
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModTextAlign()"
);
1820
fTextAngle
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTextAngle()"
);
1821
break
;
1822
case
1:
// CANVAS
1823
fCanvasColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModCanvasColor()"
);
1824
fCanvasDefX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModCanvasDefX()"
);
1825
fCanvasDefY
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModCanvasDefY()"
);
1826
fCanvasDefW
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModCanvasDefW()"
);
1827
fCanvasDefH
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModCanvasDefH()"
);
1828
fCanvasBorderMode
->
Connect
(
"Clicked(Int_t)"
,
"TStyleManager"
,
this
,
"ModCanvasBorderMode()"
);
1829
fCanvasBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModCanvasBorderSize()"
);
1830
fOptDateBool
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptDateBool()"
);
1831
fAttDateTextColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextColor()"
);
1832
fAttDateTextSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextSize()"
);
1833
fAttDateTextSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextSizeInPixels(Bool_t)"
);
1834
fOptDateFormat
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModOptDateFormat()"
);
1835
fAttDateTextFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextFont()"
);
1836
fAttDateTextAngle
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextAngle()"
);
1837
fAttDateTextAlign
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModAttDateTextAlign()"
);
1838
fDateX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModDateX()"
);
1839
fDateY
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModDateY()"
);
1840
break
;
1841
case
2:
// PAD
1842
fPadTopMargin
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPadTopMargin()"
);
1843
fPadBottomMargin
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPadBottomMargin()"
);
1844
fPadLeftMargin
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPadLeftMargin()"
);
1845
fPadRightMargin
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPadRightMargin()"
);
1846
fPadBorderMode
->
Connect
(
"Clicked(Int_t)"
,
"TStyleManager"
,
this
,
"ModPadBorderMode()"
);
1847
fPadBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModPadBorderSize()"
);
1848
fPadColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModPadColor()"
);
1849
fPadTickX
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModPadTickX()"
);
1850
fPadTickY
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModPadTickY()"
);
1851
fPadGridX
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModPadGridX()"
);
1852
fPadGridY
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModPadGridY()"
);
1853
fGridColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModGridColor()"
);
1854
fGridWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModGridWidth()"
);
1855
fGridStyle
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModGridStyle()"
);
1856
break
;
1857
case
3:
// HISTOS
1858
fHistFillColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModHistFillColor()"
);
1859
fHistFillStyle
->
Connect
(
"PatternSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModHistFillStyle()"
);
1860
fHistLineColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModHistLineColor()"
);
1861
fHistLineWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModHistLineWidth()"
);
1862
fHistLineStyle
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModHistLineStyle()"
);
1863
fBarWidth
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModBarWidth()"
);
1864
fBarOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModBarOffset()"
);
1865
fHistMinimumZero
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModHistMinimumZero()"
);
1866
fPaintTextFormat
->
Connect
(
"TextChanged(const char *)"
,
"TStyleManager"
,
this
,
"ModPaintTextFormat()"
);
1867
fNumberContours
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModNumberContours()"
);
1868
fLegoInnerR
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModLegoInnerR()"
);
1869
fFrameFillColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModFrameFillColor()"
);
1870
fFrameFillStyle
->
Connect
(
"PatternSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModFrameFillStyle()"
);
1871
fFrameLineColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModFrameLineColor()"
);
1872
fFrameLineWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModFrameLineWidth()"
);
1873
fFrameLineStyle
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModFrameLineStyle()"
);
1874
fPaletteEdit
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"ModPaletteEdit()"
);
1875
fFrameBorderMode
->
Connect
(
"Clicked(Int_t)"
,
"TStyleManager"
,
this
,
"ModFrameBorderMode()"
);
1876
fFrameBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModFrameBorderSize()"
);
1877
fFuncColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModFuncColor()"
);
1878
fFuncWidth
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModFuncWidth()"
);
1879
fFuncStyle
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModFuncStyle()"
);
1880
fDrawBorder
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModDrawBorder()"
);
1881
fEndErrorSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModEndErrorSize()"
);
1882
fErrorX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModErrorX()"
);
1883
break
;
1884
case
4:
// AXIS
1885
fTimeOffsetDate
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTimeOffset()"
);
1886
fTimeOffsetTime
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTimeOffset()"
);
1887
fStripDecimals
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModStripDecimals()"
);
1888
fApplyOnXYZ
->
Connect
(
"Clicked()"
,
"TStyleManager"
,
this
,
"ModApplyOnXYZ()"
);
1889
fXTitleSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXTitleSize()"
);
1890
fXTitleSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModXTitleSizeInPixels(Bool_t)"
);
1891
fXTitleColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModXTitleColor()"
);
1892
fXTitleOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXTitleOffset()"
);
1893
fXTitleFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModXTitleFont()"
);
1894
fXLabelSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXLabelSize()"
);
1895
fXLabelSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModXLabelSizeInPixels(Bool_t)"
);
1896
fXLabelColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModXLabelColor()"
);
1897
fXLabelOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXLabelOffset()"
);
1898
fXLabelFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModXLabelFont()"
);
1899
fXAxisColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModXAxisColor()"
);
1900
fXTickLength
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXTickLength()"
);
1901
fOptLogx
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptLogx()"
);
1902
fXNdivMain
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXNdivisions()"
);
1903
fXNdivSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXNdivisions()"
);
1904
fXNdivSubSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModXNdivisions()"
);
1905
fXNdivisionsOptimize
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModXNdivisions()"
);
1906
fYTitleSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYTitleSize()"
);
1907
fYTitleSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModYTitleSizeInPixels(Bool_t)"
);
1908
fYTitleColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModYTitleColor()"
);
1909
fYTitleOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYTitleOffset()"
);
1910
fYTitleFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModYTitleFont()"
);
1911
fYLabelSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYLabelSize()"
);
1912
fYLabelSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModYLabelSizeInPixels(Bool_t)"
);
1913
fYLabelColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModYLabelColor()"
);
1914
fYLabelOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYLabelOffset()"
);
1915
fYLabelFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModYLabelFont()"
);
1916
fYAxisColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModYAxisColor()"
);
1917
fYTickLength
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYTickLength()"
);
1918
fOptLogy
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptLogy()"
);
1919
fYNdivMain
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYNdivisions()"
);
1920
fYNdivSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYNdivisions()"
);
1921
fYNdivSubSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModYNdivisions()"
);
1922
fYNdivisionsOptimize
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModYNdivisions()"
);
1923
fZTitleSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZTitleSize()"
);
1924
fZTitleSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModZTitleSizeInPixels(Bool_t)"
);
1925
fZTitleColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModZTitleColor()"
);
1926
fZTitleOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZTitleOffset()"
);
1927
fZTitleFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModZTitleFont()"
);
1928
fZLabelSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZLabelSize()"
);
1929
fZLabelSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModZLabelSizeInPixels(Bool_t)"
);
1930
fZLabelColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModZLabelColor()"
);
1931
fZLabelOffset
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZLabelOffset()"
);
1932
fZLabelFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModZLabelFont()"
);
1933
fZAxisColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModZAxisColor()"
);
1934
fZTickLength
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZTickLength()"
);
1935
fOptLogz
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptLogz()"
);
1936
fZNdivMain
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZNdivisions()"
);
1937
fZNdivSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZNdivisions()"
);
1938
fZNdivSubSub
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModZNdivisions()"
);
1939
fZNdivisionsOptimize
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModZNdivisions()"
);
1940
break
;
1941
case
5:
// TITLES
1942
fOptTitle
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptTitle()"
);
1943
fTitleColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModTitleFillColor()"
);
1944
fTitleStyle
->
Connect
(
"PatternSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModTitleStyle()"
);
1945
fTitleTextColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModTitleTextColor()"
);
1946
fTitleFontSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTitleFontSize()"
);
1947
fTitleFontSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModTitleFontSizeInPixels(Bool_t)"
);
1948
fTitleFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModTitleFont()"
);
1949
fTitleAlign
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModTitleAlign()"
);
1950
fTitleBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModTitleBorderSize()"
);
1951
fTitleX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTitleX()"
);
1952
fTitleY
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTitleY()"
);
1953
fTitleW
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTitleW()"
);
1954
fTitleH
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModTitleH()"
);
1955
fLegendBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModLegendBorderSize()"
);
1956
break
;
1957
case
6:
// STATS
1958
fStatColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModStatColor(Pixel_t)"
);
1959
fStatStyle
->
Connect
(
"PatternSelected(Style_t)"
,
"TStyleManager"
,
this
,
"ModStatStyle(Style_t)"
);
1960
fStatTextColor
->
Connect
(
"ColorSelected(Pixel_t)"
,
"TStyleManager"
,
this
,
"ModStatTextColor(Pixel_t)"
);
1961
fStatFontSize
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModStatFontSize()"
);
1962
fStatFontSizeInPixels
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModStatFontSizeInPixels(Bool_t)"
);
1963
fStatFont
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModStatFont()"
);
1964
fStatX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModStatX()"
);
1965
fStatY
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModStatY()"
);
1966
fStatW
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModStatW()"
);
1967
fStatH
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModStatH()"
);
1968
fStatBorderSize
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModStatBorderSize()"
);
1969
fOptStatName
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1970
fOptStatEntries
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1971
fOptStatOverflow
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1972
fOptStatMean
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1973
fOptStatUnderflow
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1974
fOptStatRMS
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1975
fOptStatSkewness
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1976
fOptStatIntegral
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1977
fOptStatKurtosis
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1978
fOptStatErrors
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptStat()"
);
1979
fStatFormat
->
Connect
(
"TextChanged(const char *)"
,
"TStyleManager"
,
this
,
"ModStatFormat(const char *)"
);
1980
fOptFitValues
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptFit()"
);
1981
fOptFitErrors
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptFit()"
);
1982
fOptFitProbability
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptFit()"
);
1983
fOptFitChi
->
Connect
(
"Toggled(Bool_t)"
,
"TStyleManager"
,
this
,
"ModOptFit()"
);
1984
fFitFormat
->
Connect
(
"TextChanged(const char *)"
,
"TStyleManager"
,
this
,
"ModFitFormat(const char *)"
);
1985
break
;
1986
case
7:
// PS / PDF
1987
fHeaderPS
->
Connect
(
"TextChanged(const char *)"
,
"TStyleManager"
,
this
,
"ModHeaderPS()"
);
1988
fTitlePS
->
Connect
(
"TextChanged(const char *)"
,
"TStyleManager"
,
this
,
"ModTitlePS()"
);
1989
fColorModelPS
->
Connect
(
"Clicked(Int_t)"
,
"TStyleManager"
,
this
,
"ModColorModelPS()"
);
1990
fLineScalePS
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModLineScalePS()"
);
1991
fPaperSizePredef
->
Connect
(
"Selected(Int_t)"
,
"TStyleManager"
,
this
,
"ModPaperSizePredef()"
);
1992
fPaperSizeX
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPaperSizeXY()"
);
1993
fPaperSizeY
->
Connect
(
"ValueSet(Long_t)"
,
"TStyleManager"
,
this
,
"ModPaperSizeXY()"
);
1994
break
;
1995
}
1996
}
1997
1998
////////////////////////////////////////////////////////////////////////////////
1999
/// Disconnect every widget entry of the editor from its slot. Must be
2000
/// called before UpdateEditor() to avoid recursive calls.
2001
2002
void
TStyleManager::DisconnectEditor
(
Int_t
tabNum
)
2003
{
2004
if
(!
fSigSlotConnected
)
return
;
2005
fSigSlotConnected
=
kFALSE
;
2006
2007
switch
(
tabNum
) {
2008
case
0:
// GENERAL
2009
fFillColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2010
fFillStyle
->
Disconnect
(
"PatternSelected(Style_t)"
);
2011
fHatchesLineWidth
->
Disconnect
(
"Selected(Int_t)"
);
2012
fHatchesSpacing
->
Disconnect
(
"ValueSet(Long_t)"
);
2013
fMarkerColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2014
fMarkerStyle
->
Disconnect
(
"MarkerSelected(Style_t)"
);
2015
fMarkerSize
->
Disconnect
(
"Selected(Int_t)"
);
2016
fScreenFactor
->
Disconnect
(
"ValueSet(Long_t)"
);
2017
fLineColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2018
fLineWidth
->
Disconnect
(
"Selected(Int_t)"
);
2019
fLineStyle
->
Disconnect
(
"Selected(Int_t)"
);
2020
fLineStyleEdit
->
Disconnect
(
"Clicked()"
);
2021
fTextColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2022
fTextSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2023
fTextFont
->
Disconnect
(
"Selected(Int_t)"
);
2024
fTextAlign
->
Disconnect
(
"Selected(Int_t)"
);
2025
fTextAngle
->
Disconnect
(
"ValueSet(Long_t)"
);
2026
break
;
2027
case
1:
// CANVAS
2028
fCanvasColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2029
fCanvasDefX
->
Disconnect
(
"ValueSet(Long_t)"
);
2030
fCanvasDefY
->
Disconnect
(
"ValueSet(Long_t)"
);
2031
fCanvasDefW
->
Disconnect
(
"ValueSet(Long_t)"
);
2032
fCanvasDefH
->
Disconnect
(
"ValueSet(Long_t)"
);
2033
fCanvasBorderMode
->
Disconnect
(
"Clicked(Int_t)"
);
2034
fCanvasBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2035
fOptDateBool
->
Disconnect
(
"Toggled(Bool_t)"
);
2036
fAttDateTextColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2037
fAttDateTextSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2038
fOptDateFormat
->
Disconnect
(
"Selected(Int_t)"
);
2039
fAttDateTextFont
->
Disconnect
(
"Selected(Int_t)"
);
2040
fAttDateTextAngle
->
Disconnect
(
"ValueSet(Long_t)"
);
2041
fAttDateTextAlign
->
Disconnect
(
"Selected(Int_t)"
);
2042
fDateX
->
Disconnect
(
"ValueSet(Long_t)"
);
2043
fDateY
->
Disconnect
(
"ValueSet(Long_t)"
);
2044
break
;
2045
case
2:
// PAD
2046
fPadTopMargin
->
Disconnect
(
"ValueSet(Long_t)"
);
2047
fPadBottomMargin
->
Disconnect
(
"ValueSet(Long_t)"
);
2048
fPadLeftMargin
->
Disconnect
(
"ValueSet(Long_t)"
);
2049
fPadRightMargin
->
Disconnect
(
"ValueSet(Long_t)"
);
2050
fPadBorderMode
->
Disconnect
(
"Clicked(Int_t)"
);
2051
fPadBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2052
fPadColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2053
fPadTickX
->
Disconnect
(
"Toggled(Bool_t)"
);
2054
fPadTickY
->
Disconnect
(
"Toggled(Bool_t)"
);
2055
fPadGridX
->
Disconnect
(
"Toggled(Bool_t)"
);
2056
fPadGridY
->
Disconnect
(
"Toggled(Bool_t)"
);
2057
fGridColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2058
fGridWidth
->
Disconnect
(
"Selected(Int_t)"
);
2059
fGridStyle
->
Disconnect
(
"Selected(Int_t)"
);
2060
break
;
2061
case
3:
// HISTOS
2062
fHistFillColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2063
fHistFillStyle
->
Disconnect
(
"PatternSelected(Style_t)"
);
2064
fHistLineColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2065
fHistLineWidth
->
Disconnect
(
"Selected(Int_t)"
);
2066
fHistLineStyle
->
Disconnect
(
"Selected(Int_t)"
);
2067
fBarWidth
->
Disconnect
(
"ValueSet(Long_t)"
);
2068
fBarOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2069
fHistMinimumZero
->
Disconnect
(
"Toggled(Bool_t)"
);
2070
fPaintTextFormat
->
Disconnect
(
"TextChanged(const char *)"
);
2071
fNumberContours
->
Disconnect
(
"ValueSet(Long_t)"
);
2072
fLegoInnerR
->
Disconnect
(
"ValueSet(Long_t)"
);
2073
fFrameFillColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2074
fFrameFillStyle
->
Disconnect
(
"PatternSelected(Style_t)"
);
2075
fFrameLineColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2076
fFrameLineWidth
->
Disconnect
(
"Selected(Int_t)"
);
2077
fFrameLineStyle
->
Disconnect
(
"Selected(Int_t)"
);
2078
fPaletteEdit
->
Disconnect
(
"Clicked()"
);
2079
fFrameBorderMode
->
Disconnect
(
"Clicked(Int_t)"
);
2080
fFrameBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2081
fFuncColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2082
fFuncWidth
->
Disconnect
(
"Selected(Int_t)"
);
2083
fFuncStyle
->
Disconnect
(
"Selected(Int_t)"
);
2084
fDrawBorder
->
Disconnect
(
"Toggled(Bool_t)"
);
2085
fEndErrorSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2086
fErrorX
->
Disconnect
(
"ValueSet(Long_t)"
);
2087
break
;
2088
case
4:
// AXIS
2089
fTimeOffsetDate
->
Disconnect
(
"ValueSet(Long_t)"
);
2090
fTimeOffsetTime
->
Disconnect
(
"ValueSet(Long_t)"
);
2091
fStripDecimals
->
Disconnect
(
"Toggled(Bool_t)"
);
2092
fApplyOnXYZ
->
Disconnect
(
"Clicked()"
);
2093
fXTitleSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2094
fXTitleColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2095
fXTitleOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2096
fXTitleFont
->
Disconnect
(
"Selected(Int_t)"
);
2097
fXLabelSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2098
fXLabelColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2099
fXLabelOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2100
fXLabelFont
->
Disconnect
(
"Selected(Int_t)"
);
2101
fXAxisColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2102
fXTickLength
->
Disconnect
(
"ValueSet(Long_t)"
);
2103
fOptLogx
->
Disconnect
(
"Toggled(Bool_t)"
);
2104
fXNdivMain
->
Disconnect
(
"ValueSet(Long_t)"
);
2105
fXNdivSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2106
fXNdivSubSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2107
fXNdivisionsOptimize
->
Disconnect
(
"Toggled(Bool_t)"
);
2108
fYTitleSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2109
fYTitleColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2110
fYTitleOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2111
fYTitleFont
->
Disconnect
(
"Selected(Int_t)"
);
2112
fYLabelSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2113
fYLabelColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2114
fYLabelOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2115
fYLabelFont
->
Disconnect
(
"Selected(Int_t)"
);
2116
fYAxisColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2117
fYTickLength
->
Disconnect
(
"ValueSet(Long_t)"
);
2118
fOptLogy
->
Disconnect
(
"Toggled(Bool_t)"
);
2119
fYNdivMain
->
Disconnect
(
"ValueSet(Long_t)"
);
2120
fYNdivSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2121
fYNdivSubSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2122
fYNdivisionsOptimize
->
Disconnect
(
"Toggled(Bool_t)"
);
2123
fZTitleSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2124
fZTitleColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2125
fZTitleOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2126
fZTitleFont
->
Disconnect
(
"Selected(Int_t)"
);
2127
fZLabelSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2128
fZLabelColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2129
fZLabelOffset
->
Disconnect
(
"ValueSet(Long_t)"
);
2130
fZLabelFont
->
Disconnect
(
"Selected(Int_t)"
);
2131
fZAxisColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2132
fZTickLength
->
Disconnect
(
"ValueSet(Long_t)"
);
2133
fOptLogz
->
Disconnect
(
"Toggled(Bool_t)"
);
2134
fZNdivMain
->
Disconnect
(
"ValueSet(Long_t)"
);
2135
fZNdivSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2136
fZNdivSubSub
->
Disconnect
(
"ValueSet(Long_t)"
);
2137
fZNdivisionsOptimize
->
Disconnect
(
"Toggled(Bool_t)"
);
2138
break
;
2139
case
5:
// TITLES
2140
fOptTitle
->
Disconnect
(
"Toggled(Bool_t)"
);
2141
fTitleColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2142
fTitleStyle
->
Disconnect
(
"PatternSelected(Style_t)"
);
2143
fTitleTextColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2144
fTitleFontSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2145
fTitleFont
->
Disconnect
(
"Selected(Int_t)"
);
2146
fTitleAlign
->
Disconnect
(
"Selected(Int_t)"
);
2147
fTitleBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2148
fTitleX
->
Disconnect
(
"ValueSet(Long_t)"
);
2149
fTitleY
->
Disconnect
(
"ValueSet(Long_t)"
);
2150
fTitleW
->
Disconnect
(
"ValueSet(Long_t)"
);
2151
fTitleH
->
Disconnect
(
"ValueSet(Long_t)"
);
2152
fLegendBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2153
break
;
2154
case
6:
// STATS
2155
fStatColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2156
fStatStyle
->
Disconnect
(
"PatternSelected(Style_t)"
);
2157
fStatTextColor
->
Disconnect
(
"ColorSelected(Pixel_t)"
);
2158
fStatFontSize
->
Disconnect
(
"ValueSet(Long_t)"
);
2159
fStatFont
->
Disconnect
(
"Selected(Int_t)"
);
2160
fStatX
->
Disconnect
(
"ValueSet(Long_t)"
);
2161
fStatY
->
Disconnect
(
"ValueSet(Long_t)"
);
2162
fStatW
->
Disconnect
(
"ValueSet(Long_t)"
);
2163
fStatH
->
Disconnect
(
"ValueSet(Long_t)"
);
2164
fStatBorderSize
->
Disconnect
(
"Selected(Int_t)"
);
2165
fOptStatName
->
Disconnect
(
"Toggled(Bool_t)"
);
2166
fOptStatEntries
->
Disconnect
(
"Toggled(Bool_t)"
);
2167
fOptStatOverflow
->
Disconnect
(
"Toggled(Bool_t)"
);
2168
fOptStatMean
->
Disconnect
(
"Toggled(Bool_t)"
);
2169
fOptStatUnderflow
->
Disconnect
(
"Toggled(Bool_t)"
);
2170
fOptStatRMS
->
Disconnect
(
"Toggled(Bool_t)"
);
2171
fOptStatSkewness
->
Disconnect
(
"Toggled(Bool_t)"
);
2172
fOptStatIntegral
->
Disconnect
(
"Toggled(Bool_t)"
);
2173
fOptStatKurtosis
->
Disconnect
(
"Toggled(Bool_t)"
);
2174
fOptStatErrors
->
Disconnect
(
"Toggled(Bool_t)"
);
2175
fStatFormat
->
Disconnect
(
"TextChanged(const char *)"
);
2176
fOptFitValues
->
Disconnect
(
"Toggled(Bool_t)"
);
2177
fOptFitErrors
->
Disconnect
(
"Toggled(Bool_t)"
);
2178
fOptFitProbability
->
Disconnect
(
"Toggled(Bool_t)"
);
2179
fOptFitChi
->
Disconnect
(
"Toggled(Bool_t)"
);
2180
fFitFormat
->
Disconnect
(
"TextChanged(const char *)"
);
2181
break
;
2182
case
7:
// PS / PDF
2183
fHeaderPS
->
Disconnect
(
"TextChanged(const char *)"
);
2184
fTitlePS
->
Disconnect
(
"TextChanged(const char *)"
);
2185
fColorModelPS
->
Disconnect
(
"Clicked(Int_t)"
);
2186
fLineScalePS
->
Disconnect
(
"ValueSet(Long_t)"
);
2187
fPaperSizePredef
->
Disconnect
(
"Selected(Int_t)"
);
2188
fPaperSizeX
->
Disconnect
(
"ValueSet(Long_t)"
);
2189
fPaperSizeY
->
Disconnect
(
"ValueSet(Long_t)"
);
2190
break
;
2191
}
2192
}
2193
2194
////////////////////////////////////////////////////////////////////////////////
2195
/// Called each time something is changed in the style editor. Thanks to
2196
/// this method, we can know if the style differs from the original style.
2197
2198
void
TStyleManager::DoEditor
()
2199
{
2200
fStyleChanged
=
kTRUE
;
2201
2202
// Update the status bar.
2203
UpdateStatusBar
();
2204
2205
// Update the preview if the real time mode is selected.
2206
if
(
fRealTimePreview
)
2207
DoEditionUpdatePreview
();
2208
}
2209
2210
////////////////////////////////////////////////////////////////////////////////
2211
/// Add the editor to the frame 'p'. It contains the tabs allowing the user
2212
/// to modify every data member of the current TStyle object.
2213
2214
void
TStyleManager::AddEdition
(
TGCompositeFrame
*
p
)
2215
{
2216
TGLayoutHints
*
layout1
=
new
TGLayoutHints
(
kLHintsExpandX
, 8, 8, 5, 5);
2217
fTrashListLayout
->
Add
(
layout1
);
2218
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsExpandX
, 10, 10);
2219
fTrashListLayout
->
Add
(
layout2
);
2220
2221
fEditionFrame
=
new
TGVerticalFrame
(
p
);
2222
fEditionFrame
->
ChangeOptions
(
kRaisedFrame
);
2223
2224
fEditionTab
=
new
TGTab
(
fEditionFrame
, 200, 150);
2225
fEditionTab
->
Associate
(
this
);
2226
CreateTabGeneral
(
fEditionTab
->
AddTab
(
"General"
));
2227
CreateTabCanvas
(
fEditionTab
->
AddTab
(
"Canvas"
));
2228
CreateTabPad
(
fEditionTab
->
AddTab
(
"Pad"
));
2229
CreateTabHistos
(
fEditionTab
->
AddTab
(
"Histograms"
));
2230
CreateTabAxis
(
fEditionTab
->
AddTab
(
"Axis"
));
2231
CreateTabTitle
(
fEditionTab
->
AddTab
(
"Title"
));
2232
CreateTabStats
(
fEditionTab
->
AddTab
(
"Stats"
));
2233
CreateTabPsPdf
(
fEditionTab
->
AddTab
(
"PS / PDF"
));
2234
fEditionFrame
->
AddFrame
(
fEditionTab
,
layout1
);
2235
2236
fEditionButtonFrame
=
new
TGHorizontalFrame
(
fEditionFrame
);
2237
fEditionHelp
=
new
TGTextButton
(
fEditionButtonFrame
,
"He&lp"
,
kEditButHelp
);
2238
fEditionHelp
->
Associate
(
this
);
2239
fEditionButtonFrame
->
AddFrame
(
fEditionHelp
,
layout1
);
2240
fEditionUpdatePreview
=
new
TGTextButton
(
fEditionButtonFrame
,
"&Update Preview"
,
kEditButUpPrev
);
2241
fEditionUpdatePreview
->
Associate
(
this
);
2242
fEditionUpdatePreview
->
SetEnabled
(
kFALSE
);
2243
fEditionButtonFrame
->
AddFrame
(
fEditionUpdatePreview
,
layout1
);
2244
fEditionReset
=
new
TGTextButton
(
fEditionButtonFrame
,
"&Reset"
,
kEditButReset
);
2245
fEditionReset
->
Associate
(
this
);
2246
fEditionButtonFrame
->
AddFrame
(
fEditionReset
,
layout1
);
2247
fEditionFrame
->
AddFrame
(
fEditionButtonFrame
,
layout1
);
2248
2249
p
->AddFrame(
fEditionFrame
,
layout1
);
2250
2251
fEditionHelp
->
SetToolTipText
(
"Help about the current tab"
);
2252
fEditionUpdatePreview
->
SetToolTipText
(
"Force the refresh of the preview window"
);
2253
fEditionReset
->
SetToolTipText
(
"Reset the selected style"
);
2254
}
2255
2256
////////////////////////////////////////////////////////////////////////////////
2257
/// Add the tab 'General' to the editor.
2258
2259
void
TStyleManager::CreateTabGeneral
(
TGCompositeFrame
*
tab
)
2260
{
2261
TGLayoutHints
*
layout
=
new
TGLayoutHints
(
kLHintsExpandX
, 10, 21, 5, 5);
2262
fTrashListLayout
->
Add
(
layout
);
2263
2264
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
tab
);
2265
fTrashListFrame
->
AddFirst
(
h1
);
2266
AddGeneralFill
(
h1
);
2267
AddGeneralLine
(
h1
);
2268
tab
->AddFrame(
h1
,
fLayoutExpandX
);
2269
2270
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
tab
);
2271
fTrashListFrame
->
AddFirst
(h2);
2272
AddGeneralText
(h2);
2273
TGVerticalFrame
*
v
=
new
TGVerticalFrame
(h2);
2274
fTrashListFrame
->
AddFirst
(
v
);
2275
AddGeneralMarker
(
v
);
2276
TGHorizontalFrame
*h3 =
new
TGHorizontalFrame
(
v
);
2277
fTrashListFrame
->
AddFirst
(h3);
2278
fScreenFactor
=
AddNumberEntry
(h3, 0, 0, 0,
kGeneralScreenFactor
,
2279
"Screen factor:"
, 0, 6,
TGNumberFormat::kNESRealOne
,
2280
TGNumberFormat::kNEAPositive
,
2281
TGNumberFormat::kNELLimitMinMax
, 0.2, 5);
2282
v
->AddFrame(h3,
layout
);
2283
h2->AddFrame(
v
,
fLayoutExpandXY
);
2284
tab
->AddFrame(h2,
fLayoutExpandX
);
2285
2286
fScreenFactor
->
GetNumberEntry
()->
SetToolTipText
(
"Coefficient for different screen's resolutions"
);
2287
}
2288
2289
////////////////////////////////////////////////////////////////////////////////
2290
/// Add the 'Fill' group frame to the 'General' tab.
2291
2292
void
TStyleManager::AddGeneralFill
(
TGCompositeFrame
*
f
)
2293
{
2294
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsExpandX
, 5, 0, 5, 5);
2295
fTrashListLayout
->
Add
(
layout2
);
2296
2297
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Fill"
);
2298
fTrashListFrame
->
AddFirst
(
gf
);
2299
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2300
fTrashListFrame
->
AddFirst
(
h1
);
2301
fFillColor
=
AddColorEntry
(
h1
,
kGeneralFillColor
);
2302
fFillStyle
=
AddFillStyleEntry
(
h1
,
kGeneralFillStyle
);
2303
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2304
AddTitle
(
gf
,
"Hatchings"
);
2305
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2306
fTrashListFrame
->
AddFirst
(h2);
2307
fHatchesLineWidth
=
AddLineWidthEntry
(h2,
kGeneralHatchesLineWidth
);
2308
fHatchesSpacing
=
AddNumberEntry
(h2, 0, 5, 0,
kGeneralHatchesSpacing
,
2309
""
, 0, 5,
TGNumberFormat::kNESRealOne
,
2310
TGNumberFormat::kNEAAnyNumber
,
2311
TGNumberFormat::kNELLimitMinMax
, 0.1, 5);
2312
gf
->AddFrame(h2,
layout2
);
2313
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2314
2315
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2316
// fFillColor->SetToolTipText("General fill color");
2317
// fFillStyle->SetToolTipText("General fill pattern");
2318
fHatchesSpacing
->
GetNumberEntry
()->
SetToolTipText
(
"Spacing between the hatching's lines"
);
2319
}
2320
2321
////////////////////////////////////////////////////////////////////////////////
2322
/// Add the 'Line' group frame to the 'General' tab.
2323
2324
void
TStyleManager::AddGeneralLine
(
TGCompositeFrame
*
f
)
2325
{
2326
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Line"
);
2327
fTrashListFrame
->
AddFirst
(
gf
);
2328
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2329
fTrashListFrame
->
AddFirst
(
h
);
2330
fLineColor
=
AddColorEntry
(
h
,
kGeneralLineColor
);
2331
fLineWidth
=
AddLineWidthEntry
(
h
,
kGeneralLineWidth
);
2332
gf
->AddFrame(
h
,
fLayoutExpandX
);
2333
fLineStyle
=
AddLineStyleEntry
(
gf
,
kGeneralLineStyle
);
2334
fLineStyleEdit
=
AddTextButton
(
gf
,
"Lines' Style Editor..."
,
kGeneralLineStyleEdit
);
2335
fLineStyleEdit
->
SetEnabled
(
kFALSE
);
2336
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2337
2338
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2339
// fLineColor->SetToolTipText("General line color");
2340
}
2341
2342
////////////////////////////////////////////////////////////////////////////////
2343
/// Add the 'Text' group frame to the 'General' tab.
2344
2345
void
TStyleManager::AddGeneralText
(
TGCompositeFrame
*
f
)
2346
{
2347
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Text"
);
2348
fTrashListFrame
->
AddFirst
(
gf
);
2349
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2350
fTrashListFrame
->
AddFirst
(
h1
);
2351
fTextColor
=
AddColorEntry
(
h1
,
kGeneralTextColor
);
2352
fTextFont
=
AddFontTypeEntry
(
h1
,
kGeneralTextFont
);
2353
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2354
fTextAlign
=
AddTextAlignEntry
(
gf
,
kGeneralTextAlign
);
2355
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2356
fTrashListFrame
->
AddFirst
(h2);
2357
fTextSizeInPixels
=
AddCheckButton
(h2,
"Pixels"
,
kGeneralTextSizeInPixels
);
2358
fTextSize
=
AddNumberEntry
(h2, 21, 10, 0,
kGeneralTextSize
,
"Size:"
, 0, 5,
2359
TGNumberFormat::kNESRealThree
,
2360
TGNumberFormat::kNEAAnyNumber
,
2361
TGNumberFormat::kNELLimitMinMax
, 0, 0.3);
2362
gf
->AddFrame(h2,
fLayoutExpandX
);
2363
fTextAngle
=
AddNumberEntry
(
gf
, 0, 0, 0,
kGeneralTextAngle
,
"Angle:"
,
2364
0, 5,
TGNumberFormat::kNESInteger
,
2365
TGNumberFormat::kNEAAnyNumber
,
2366
TGNumberFormat::kNELLimitMinMax
, -180, 180);
2367
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2368
2369
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2370
// fTextColor->SetToolTipText("General text color");
2371
fTextSizeInPixels
->
SetToolTipText
(
"Set the text size in pixels if selected, otherwise - in % of pad."
);
2372
fTextSize
->
GetNumberEntry
()->
SetToolTipText
(
"General text size (in pixels or in % of pad)"
);
2373
fTextAngle
->
GetNumberEntry
()->
SetToolTipText
(
"General text angle"
);
2374
}
2375
2376
////////////////////////////////////////////////////////////////////////////////
2377
/// Add the 'Marker' group frame to the 'General' tab.
2378
2379
void
TStyleManager::AddGeneralMarker
(
TGCompositeFrame
*
f
)
2380
{
2381
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Marker"
);
2382
fTrashListFrame
->
AddFirst
(
gf
);
2383
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2384
fTrashListFrame
->
AddFirst
(
h
);
2385
fMarkerColor
=
AddColorEntry
(
h
,
kGeneralMarkerColor
);
2386
fMarkerStyle
=
AddMarkerStyleEntry
(
h
,
kGeneralMarkerStyle
);
2387
fMarkerSize
=
AddMarkerSizeEntry
(
h
,
kGeneralMarkerSize
);
2388
gf
->AddFrame(
h
,
fLayoutExpandX
);
2389
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2390
2391
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2392
// fMarkerColor->SetToolTipText("Marker color");
2393
// fMarkerStyle->SetToolTipText("Marker shape");
2394
}
2395
2396
////////////////////////////////////////////////////////////////////////////////
2397
/// Add the tab 'Canvas' to the editor.
2398
2399
void
TStyleManager::CreateTabCanvas
(
TGCompositeFrame
*
tab
)
2400
{
2401
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
tab
);
2402
fTrashListFrame
->
AddFirst
(
h
);
2403
TGVerticalFrame
*
v1
=
new
TGVerticalFrame
(
h
);
2404
fTrashListFrame
->
AddFirst
(
v1
);
2405
AddCanvasFill
(
v1
);
2406
AddCanvasGeometry
(
v1
);
2407
AddCanvasBorder
(
v1
);
2408
h
->AddFrame(
v1
,
fLayoutExpandXY
);
2409
TGVerticalFrame
*
v2
=
new
TGVerticalFrame
(
h
);
2410
fTrashListFrame
->
AddFirst
(
v2
);
2411
AddCanvasDate
(
v2
);
2412
h
->AddFrame(
v2
,
fLayoutExpandXY
);
2413
tab
->AddFrame(
h
,
fLayoutExpandX
);
2414
}
2415
2416
////////////////////////////////////////////////////////////////////////////////
2417
/// Add the 'Fill' group frame to the 'Canvas' tab.
2418
2419
void
TStyleManager::AddCanvasFill
(
TGCompositeFrame
*
f
)
2420
{
2421
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Fill"
);
2422
fTrashListFrame
->
AddFirst
(
gf
);
2423
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2424
fTrashListFrame
->
AddFirst
(
h
);
2425
fCanvasColor
=
AddColorEntry
(
h
,
kCanvasColor
);
2426
gf
->AddFrame(
h
,
fLayoutExpandX
);
2427
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2428
2429
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2430
// fCanvasColor->SetToolTipText("Color used to fill canvases");
2431
}
2432
2433
////////////////////////////////////////////////////////////////////////////////
2434
/// Add the 'Geometry' group frame to the 'Canvas' tab.
2435
2436
void
TStyleManager::AddCanvasGeometry
(
TGCompositeFrame
*
f
)
2437
{
2438
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Geometry"
);
2439
fTrashListFrame
->
AddFirst
(
gf
);
2440
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2441
fTrashListFrame
->
AddFirst
(
h1
);
2442
fCanvasDefX
=
AddNumberEntry
(
h1
, 0, 9, 0,
kCanvasDefX
,
"X:"
,
2443
0, 5,
TGNumberFormat::kNESInteger
,
2444
TGNumberFormat::kNEAPositive
,
2445
TGNumberFormat::kNELLimitMinMax
, 0, 5000);
2446
fCanvasDefY
=
AddNumberEntry
(
h1
, 7, 8, 0,
kCanvasDefY
,
"Y:"
,
2447
0, 5,
TGNumberFormat::kNESInteger
,
2448
TGNumberFormat::kNEAPositive
,
2449
TGNumberFormat::kNELLimitMinMax
, 0, 5000);
2450
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2451
2452
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2453
fTrashListFrame
->
AddFirst
(h2);
2454
fCanvasDefW
=
AddNumberEntry
(h2, 0, 7, 0,
kCanvasDefW
,
"W:"
,
2455
0, 5,
TGNumberFormat::kNESInteger
,
2456
TGNumberFormat::kNEAPositive
,
2457
TGNumberFormat::kNELLimitMinMax
, 0, 5000);
2458
fCanvasDefH
=
AddNumberEntry
(h2, 7, 8, 0,
kCanvasDefH
,
"H:"
,
2459
0, 5,
TGNumberFormat::kNESInteger
,
2460
TGNumberFormat::kNEAPositive
,
2461
TGNumberFormat::kNELLimitMinMax
, 0, 5000);
2462
gf
->AddFrame(h2,
fLayoutExpandX
);
2463
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2464
2465
fCanvasDefX
->
GetNumberEntry
()->
SetToolTipText
(
"Canvases' default abscissa"
);
2466
fCanvasDefY
->
GetNumberEntry
()->
SetToolTipText
(
"Canvases' default ordinate"
);
2467
fCanvasDefW
->
GetNumberEntry
()->
SetToolTipText
(
"Canvases' default width"
);
2468
fCanvasDefH
->
GetNumberEntry
()->
SetToolTipText
(
"Canvases' default height"
);
2469
}
2470
2471
////////////////////////////////////////////////////////////////////////////////
2472
/// Add the 'Border' group frame to the 'Canvas' tab.
2473
2474
void
TStyleManager::AddCanvasBorder
(
TGCompositeFrame
*
f
)
2475
{
2476
fCanvasBorderMode
=
AddBorderModeEntry
(
f
,
kCanvasBorderModeSunken
,
kCanvasBorderModeNone
,
kCanvasBorderModeRaised
);
2477
fCanvasBorderSize
=
AddLineWidthEntry
(
fCanvasBorderMode
,
kCanvasBorderSize
);
2478
}
2479
2480
////////////////////////////////////////////////////////////////////////////////
2481
/// Add the 'Date' group frame to the 'Canvas' tab.
2482
2483
void
TStyleManager::AddCanvasDate
(
TGCompositeFrame
*
f
)
2484
{
2485
TGLayoutHints
*
layout2
=
new
TGLayoutHints
(
kLHintsExpandX
, 10);
2486
fTrashListLayout
->
Add
(
layout2
);
2487
2488
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Date"
);
2489
fTrashListFrame
->
AddFirst
(
gf
);
2490
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2491
fTrashListFrame
->
AddFirst
(
h1
);
2492
fOptDateBool
=
AddCheckButton
(
h1
,
"Show"
,
kCanvasOptDateBool
, 23);
2493
fAttDateTextColor
=
AddColorEntry
(
h1
,
kCanvasAttDateTextColor
);
2494
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2495
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2496
fTrashListFrame
->
AddFirst
(h2);
2497
fAttDateTextSizeInPixels
=
AddCheckButton
(h2,
"Pixels"
,
kCanvasAttDateTextSizeInPixels
);
2498
fAttDateTextSize
=
AddNumberEntry
(h2, 22, 10, 0,
kCanvasAttDateTextSize
,
"Size:"
, 0, 5,
2499
TGNumberFormat::kNESRealThree
,
2500
TGNumberFormat::kNEAAnyNumber
,
2501
TGNumberFormat::kNELLimitMinMax
, 0, 0.3);
2502
gf
->AddFrame(h2,
fLayoutExpandX
);
2503
fOptDateFormat
=
AddDateFormatEntry
(
gf
,
kCanvasOptDateFormat
);
2504
fAttDateTextFont
=
AddFontTypeEntry
(
gf
,
kCanvasAttDateTextFont
);
2505
fAttDateTextAlign
=
AddTextAlignEntry
(
gf
,
kCanvasAttDateTextAlign
);
2506
fAttDateTextAngle
=
AddNumberEntry
(
gf
, 0, 0, 0,
kCanvasAttDateTextAngle
,
2507
"Angle:"
, 0, 6,
TGNumberFormat::kNESInteger
,
2508
TGNumberFormat::kNEAAnyNumber
,
2509
TGNumberFormat::kNELLimitMinMax
, -180, 180);
2510
AddTitle
(
gf
,
"Position"
);
2511
TGVerticalFrame
*h3 =
new
TGVerticalFrame
(
gf
);
2512
fTrashListFrame
->
AddFirst
(h3);
2513
fDateX
=
AddNumberEntry
(h3, 0, 0, 0,
kCanvasDateX
,
"X (% of Pad):"
,
2514
0, 6,
TGNumberFormat::kNESInteger
,
2515
TGNumberFormat::kNEAAnyNumber
,
2516
TGNumberFormat::kNELLimitMinMax
, 0, 100);
2517
fDateY
=
AddNumberEntry
(h3, 0, 0, 0,
kCanvasDateY
,
"Y (% of Pad):"
,
2518
0, 6,
TGNumberFormat::kNESInteger
,
2519
TGNumberFormat::kNEAAnyNumber
,
2520
TGNumberFormat::kNELLimitMinMax
, 0, 100);
2521
gf
->AddFrame(h3,
layout2
);
2522
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2523
2524
fOptDateBool
->
SetToolTipText
(
"Show / Hide the date in canvases"
);
2525
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2526
// fAttDateTextColor->SetToolTipText("Color of the date text");
2527
fAttDateTextSizeInPixels
->
SetToolTipText
(
"Set the date text size in pixels if selected, otherwise - in % of pad"
);
2528
fAttDateTextSize
->
GetNumberEntry
()->
SetToolTipText
(
"Date text size (in pixels or in % of pad)"
);
2529
fAttDateTextAngle
->
GetNumberEntry
()->
SetToolTipText
(
"Date text angle"
);
2530
fDateX
->
GetNumberEntry
()->
SetToolTipText
(
"Date abscissa in percent of pad"
);
2531
fDateY
->
GetNumberEntry
()->
SetToolTipText
(
"Date ordinate in percent of pad"
);
2532
}
2533
2534
////////////////////////////////////////////////////////////////////////////////
2535
/// Add the tab 'Pad' to the editor.
2536
2537
void
TStyleManager::CreateTabPad
(
TGCompositeFrame
*
tab
)
2538
{
2539
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
tab
);
2540
fTrashListFrame
->
AddFirst
(
h1
);
2541
AddPadMargin
(
h1
);
2542
TGVerticalFrame
*
v
=
new
TGVerticalFrame
(
h1
);
2543
fTrashListFrame
->
AddFirst
(
v
);
2544
AddPadFill
(
v
);
2545
AddPadTicks
(
v
);
2546
h1
->AddFrame(
v
,
fLayoutExpandXY
);
2547
tab
->AddFrame(
h1
,
fLayoutExpandX
);
2548
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
tab
);
2549
fTrashListFrame
->
AddFirst
(h2);
2550
AddPadBorder
(h2);
2551
AddPadGrid
(h2);
2552
tab
->AddFrame(h2,
fLayoutExpandX
);
2553
}
2554
2555
////////////////////////////////////////////////////////////////////////////////
2556
/// Add the 'Margin' group frame to the 'Pad' tab.
2557
2558
void
TStyleManager::AddPadMargin
(
TGCompositeFrame
*
f
)
2559
{
2560
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Margin (% of Pad)"
);
2561
fTrashListFrame
->
AddFirst
(
gf
);
2562
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2563
fTrashListFrame
->
AddFirst
(
h1
);
2564
fPadLeftMargin
=
AddNumberEntry
(
h1
, 0, 5, 0,
kPadLeftMargin
,
"Left:"
,
2565
0, 3,
TGNumberFormat::kNESInteger
,
2566
TGNumberFormat::kNEAAnyNumber
,
2567
TGNumberFormat::kNELLimitMinMax
, 0, 99);
2568
fPadRightMargin
=
AddNumberEntry
(
h1
, 0, 0, 0,
kPadRightMargin
,
"Right:"
,
2569
0, 3,
TGNumberFormat::kNESInteger
,
2570
TGNumberFormat::kNEAAnyNumber
,
2571
TGNumberFormat::kNELLimitMinMax
, 0, 99);
2572
gf
->AddFrame(
h1
,
fLayoutExpandXY
);
2573
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2574
fTrashListFrame
->
AddFirst
(h2);
2575
fPadTopMargin
=
AddNumberEntry
(h2, 0, 5, 0,
kPadTopMargin
,
"Top:"
,
2576
0, 3,
TGNumberFormat::kNESInteger
,
2577
TGNumberFormat::kNEAAnyNumber
,
2578
TGNumberFormat::kNELLimitMinMax
, 0, 99);
2579
fPadBottomMargin
=
AddNumberEntry
(h2, 0, 0, 0,
kPadBottomMargin
,
"Bottom:"
,
2580
0, 3,
TGNumberFormat::kNESInteger
,
2581
TGNumberFormat::kNEAAnyNumber
,
2582
TGNumberFormat::kNELLimitMinMax
, 0, 99);
2583
gf
->AddFrame(h2,
fLayoutExpandXY
);
2584
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2585
2586
fPadLeftMargin
->
GetNumberEntry
()->
SetToolTipText
(
"Pads' left margin"
);
2587
fPadRightMargin
->
GetNumberEntry
()->
SetToolTipText
(
"Pads' right margin"
);
2588
fPadTopMargin
->
GetNumberEntry
()->
SetToolTipText
(
"Pads' top margin"
);
2589
fPadBottomMargin
->
GetNumberEntry
()->
SetToolTipText
(
"Pads' bottom margin"
);
2590
}
2591
2592
////////////////////////////////////////////////////////////////////////////////
2593
/// Add the 'Border' group frame to the 'Pad' tab.
2594
2595
void
TStyleManager::AddPadBorder
(
TGCompositeFrame
*
f
)
2596
{
2597
fPadBorderMode
=
AddBorderModeEntry
(
f
,
kPadBorderModeSunken
,
kPadBorderModeNone
,
kPadBorderModeRaised
);
2598
fPadBorderSize
=
AddLineWidthEntry
(
fPadBorderMode
,
kPadBorderSize
);
2599
}
2600
2601
////////////////////////////////////////////////////////////////////////////////
2602
/// Add the 'Fill' group frame to the 'Pad' tab.
2603
2604
void
TStyleManager::AddPadFill
(
TGCompositeFrame
*
f
)
2605
{
2606
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Fill"
);
2607
fTrashListFrame
->
AddFirst
(
gf
);
2608
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2609
fTrashListFrame
->
AddFirst
(
h
);
2610
fPadColor
=
AddColorEntry
(
h
,
kPadColor
);
2611
gf
->AddFrame(
h
,
fLayoutExpandX
);
2612
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2613
2614
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2615
// fPadColor->SetToolTipText("Color used to fill pads");
2616
}
2617
2618
////////////////////////////////////////////////////////////////////////////////
2619
/// Add the 'Ticks' group frame to the 'Pad' tab.
2620
2621
void
TStyleManager::AddPadTicks
(
TGCompositeFrame
*
f
)
2622
{
2623
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Ticks"
);
2624
fTrashListFrame
->
AddFirst
(
gf
);
2625
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2626
fTrashListFrame
->
AddFirst
(
h
);
2627
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
h
);
2628
fTrashListFrame
->
AddFirst
(
h1
);
2629
fPadTickX
=
AddCheckButton
(
h1
,
"Along X"
,
kPadTickX
);
2630
h
->AddFrame(
h1
,
fLayoutExpandX
);
2631
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
h
);
2632
fTrashListFrame
->
AddFirst
(h2);
2633
fPadTickY
=
AddCheckButton
(h2,
"Along Y"
,
kPadTickY
);
2634
h
->AddFrame(h2,
fLayoutExpandX
);
2635
gf
->AddFrame(
h
,
fLayoutExpandX
);
2636
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2637
2638
fPadTickX
->
SetToolTipText
(
"Show / Hide the ticks along X"
);
2639
fPadTickY
->
SetToolTipText
(
"Show / Hide the ticks along Y"
);
2640
}
2641
2642
////////////////////////////////////////////////////////////////////////////////
2643
/// Add the 'Grid' group frame to the 'Pad' tab.
2644
2645
void
TStyleManager::AddPadGrid
(
TGCompositeFrame
*
f
)
2646
{
2647
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Grid"
);
2648
fTrashListFrame
->
AddFirst
(
gf
);
2649
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2650
fTrashListFrame
->
AddFirst
(
h1
);
2651
TGHorizontalFrame
*
h10
=
new
TGHorizontalFrame
(
h1
);
2652
fTrashListFrame
->
AddFirst
(
h10
);
2653
fPadGridX
=
AddCheckButton
(
h10
,
"Along X"
,
kPadGridX
);
2654
h1
->AddFrame(
h10
,
fLayoutExpandX
);
2655
TGHorizontalFrame
*
h20
=
new
TGHorizontalFrame
(
h1
);
2656
fTrashListFrame
->
AddFirst
(
h20
);
2657
fPadGridY
=
AddCheckButton
(
h20
,
"Along Y"
,
kPadGridY
);
2658
h1
->AddFrame(
h20
,
fLayoutExpandX
);
2659
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2660
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2661
fTrashListFrame
->
AddFirst
(h2);
2662
fGridColor
=
AddColorEntry
(h2,
kPadGridColor
);
2663
fGridWidth
=
AddLineWidthEntry
(h2,
kPadGridWidth
);
2664
gf
->AddFrame(h2,
fLayoutExpandX
);
2665
fGridStyle
=
AddLineStyleEntry
(
gf
,
kPadGridStyle
);
2666
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2667
2668
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2669
// fGridColor->SetToolTipText("Line color for the grid");
2670
fPadGridX
->
SetToolTipText
(
"Show / Hide the grid along X"
);
2671
fPadGridY
->
SetToolTipText
(
"Show / Hide the grid along Y"
);
2672
}
2673
2674
////////////////////////////////////////////////////////////////////////////////
2675
/// Add the tab 'Histos' to the editor.
2676
2677
void
TStyleManager::CreateTabHistos
(
TGCompositeFrame
*
tab
)
2678
{
2679
fHistosTab
=
new
TGTab
(
tab
, 1, 1);
2680
fHistosTab
->
Associate
(
this
);
2681
CreateTabHistosHistos
(
fHistosTab
->
AddTab
(
"Histos"
));
2682
CreateTabHistosFrames
(
fHistosTab
->
AddTab
(
"Frames"
));
2683
CreateTabHistosGraphs
(
fHistosTab
->
AddTab
(
"Graphs"
));
2684
tab
->AddFrame(
fHistosTab
,
fLayoutExpandXY
);
2685
}
2686
2687
////////////////////////////////////////////////////////////////////////////////
2688
/// Add the sub-tab 'Histos' to the tab 'Histos'.
2689
2690
void
TStyleManager::CreateTabHistosHistos
(
TGCompositeFrame
*
tab
)
2691
{
2692
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
tab
);
2693
fTrashListFrame
->
AddFirst
(
h1
);
2694
AddHistosHistosFill
(
h1
);
2695
AddHistosHistosContours
(
h1
);
2696
tab
->AddFrame(
h1
,
fLayoutExpandX
);
2697
2698
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
tab
);
2699
fTrashListFrame
->
AddFirst
(h2);
2700
AddHistosHistosLine
(h2);
2701
AddHistosHistosAxis
(h2);
2702
tab
->AddFrame(h2,
fLayoutExpandX
);
2703
2704
TGHorizontalFrame
*h3 =
new
TGHorizontalFrame
(
tab
);
2705
fTrashListFrame
->
AddFirst
(h3);
2706
AddHistosHistosBar
(h3);
2707
AddHistosHistosLegoInnerR
(h3);
2708
tab
->AddFrame(h3,
fLayoutExpandX
);
2709
}
2710
2711
////////////////////////////////////////////////////////////////////////////////
2712
/// Add the 'Fill' group frame to the 'Histos - Histos' tab.
2713
2714
void
TStyleManager::AddHistosHistosFill
(
TGCompositeFrame
*
f
)
2715
{
2716
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Fill"
);
2717
fTrashListFrame
->
AddFirst
(
gf
);
2718
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2719
fTrashListFrame
->
AddFirst
(
h1
);
2720
fHistFillColor
=
AddColorEntry
(
h1
,
kHistFillColor
);
2721
fHistFillStyle
=
AddFillStyleEntry
(
h1
,
kHistFillStyle
);
2722
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2723
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2724
2725
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2726
// fHistFillColor->SetToolTipText("Color used to fill histograms");
2727
// fHistFillStyle->SetToolTipText("Pattern used to fill histograms");
2728
}
2729
2730
////////////////////////////////////////////////////////////////////////////////
2731
/// Add the 'Line' group frame to the 'Histos - Histos' tab.
2732
2733
void
TStyleManager::AddHistosHistosLine
(
TGCompositeFrame
*
f
)
2734
{
2735
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Line"
);
2736
fTrashListFrame
->
AddFirst
(
gf
);
2737
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2738
fTrashListFrame
->
AddFirst
(
h
);
2739
fHistLineColor
=
AddColorEntry
(
h
,
kHistLineColor
);
2740
fHistLineWidth
=
AddLineWidthEntry
(
h
,
kHistLineWidth
);
2741
gf
->AddFrame(
h
,
fLayoutExpandX
);
2742
fHistLineStyle
=
AddLineStyleEntry
(
gf
,
kHistLineStyle
);
2743
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2744
2745
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2746
// fHistLineColor->SetToolTipText("Color used for histograms' lines");
2747
}
2748
2749
////////////////////////////////////////////////////////////////////////////////
2750
/// Add the 'Bar' group frame to the 'Histos - Histos' tab.
2751
2752
void
TStyleManager::AddHistosHistosBar
(
TGCompositeFrame
*
f
)
2753
{
2754
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Bar"
);
2755
fTrashListFrame
->
AddFirst
(
gf
);
2756
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2757
fTrashListFrame
->
AddFirst
(
h
);
2758
fBarWidth
=
AddNumberEntry
(
h
, 0, 5, 0,
kHistBarWidth
,
"W:"
,
2759
0, 5,
TGNumberFormat::kNESRealTwo
,
2760
TGNumberFormat::kNEAAnyNumber
,
2761
TGNumberFormat::kNELLimitMinMax
, 0, 5);
2762
fBarOffset
=
AddNumberEntry
(
h
, 8, 5, 0,
kHistBarOffset
,
"O:"
,
2763
0, 5,
TGNumberFormat::kNESRealTwo
,
2764
TGNumberFormat::kNEAAnyNumber
,
2765
TGNumberFormat::kNELLimitMinMax
, 0, 5);
2766
gf
->AddFrame(
h
,
fLayoutExpandX
);
2767
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2768
2769
fBarWidth
->
GetNumberEntry
()->
SetToolTipText
(
"Width of bars"
);
2770
fBarOffset
->
GetNumberEntry
()->
SetToolTipText
(
"Offset of bars"
);
2771
}
2772
2773
////////////////////////////////////////////////////////////////////////////////
2774
/// Add the 'Contours' group frame to the 'Histos - Histos' tab.
2775
2776
void
TStyleManager::AddHistosHistosContours
(
TGCompositeFrame
*
f
)
2777
{
2778
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Contours"
);
2779
fTrashListFrame
->
AddFirst
(
gf
);
2780
fNumberContours
=
AddNumberEntry
(
gf
, 0, 0, 0,
kHistNumberContours
,
"Number:"
,
2781
0, 5,
TGNumberFormat::kNESInteger
,
2782
TGNumberFormat::kNEAAnyNumber
,
2783
TGNumberFormat::kNELLimitMinMax
, 0, 99);
2784
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2785
2786
fNumberContours
->
GetNumberEntry
()->
SetToolTipText
(
"Number of level lines to draw"
);
2787
}
2788
2789
////////////////////////////////////////////////////////////////////////////////
2790
/// Add the 'Axis' group frame to the 'Histos - Histos' tab.
2791
2792
void
TStyleManager::AddHistosHistosAxis
(
TGCompositeFrame
*
f
)
2793
{
2794
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Axis"
);
2795
fTrashListFrame
->
AddFirst
(
gf
);
2796
fHistMinimumZero
=
AddCheckButton
(
gf
,
"Minimum zero"
,
kHistMinimumZero
);
2797
fPaintTextFormat
=
AddTextEntry
(
gf
,
"Paint format:"
,
kHistPaintTextFormat
);
2798
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2799
2800
fHistMinimumZero
->
SetToolTipText
(
"Set to zero / Compute the minimum of axis range"
);
2801
fPaintTextFormat
->
SetToolTipText
(
"Paint format of the axis labels in histograms"
);
2802
}
2803
2804
////////////////////////////////////////////////////////////////////////////////
2805
/// Add the '3D Cylindrical' group frame to the 'Histos - Histos' tab.
2806
2807
void
TStyleManager::AddHistosHistosLegoInnerR
(
TGCompositeFrame
*
f
)
2808
{
2809
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"3D Cylindrical (%)"
);
2810
fTrashListFrame
->
AddFirst
(
gf
);
2811
fLegoInnerR
=
AddNumberEntry
(
gf
, 0, 0, 0,
kHistLegoInnerR
,
"Inner radius:"
,
2812
0, 5,
TGNumberFormat::kNESInteger
,
2813
TGNumberFormat::kNEAAnyNumber
,
2814
TGNumberFormat::kNELLimitMinMax
, 0, 100);
2815
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2816
2817
fLegoInnerR
->
GetNumberEntry
()->
SetToolTipText
(
"Percent of radius allocated to the tube"
);
2818
}
2819
2820
////////////////////////////////////////////////////////////////////////////////
2821
/// Add the sub-tab 'Frames' to the tab 'Histos'.
2822
2823
void
TStyleManager::CreateTabHistosFrames
(
TGCompositeFrame
*
tab
)
2824
{
2825
TGLayoutHints
*
layout
=
new
TGLayoutHints
(
kLHintsExpandX
, 10, 10, 0, 13);
2826
fTrashListLayout
->
Add
(
layout
);
2827
2828
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
tab
);
2829
fTrashListFrame
->
AddFirst
(
h1
);
2830
2831
TGVerticalFrame
*
v1
=
new
TGVerticalFrame
(
h1
);
2832
fTrashListFrame
->
AddFirst
(
v1
);
2833
AddHistosFramesFill
(
v1
);
2834
AddHistosFramesLine
(
v1
);
2835
h1
->AddFrame(
v1
,
fLayoutExpandXY
);
2836
2837
TGVerticalFrame
*
v2
=
new
TGVerticalFrame
(
h1
);
2838
fTrashListFrame
->
AddFirst
(
v2
);
2839
AddHistosFramesBorder
(
v2
);
2840
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
v2
);
2841
fTrashListFrame
->
AddFirst
(h2);
2842
fPaletteEdit
=
AddTextButton
(h2,
"Palette Editor..."
,
kFramePaletteEdit
);
2843
fPaletteEdit
->
SetEnabled
(
kFALSE
);
2844
v2
->AddFrame(h2,
layout
);
2845
h1
->AddFrame(
v2
,
fLayoutExpandXY
);
2846
2847
tab
->AddFrame(
h1
,
fLayoutExpandX
);
2848
}
2849
2850
////////////////////////////////////////////////////////////////////////////////
2851
/// Add the 'Fill' group frame to the 'Histos - Frames' tab.
2852
2853
void
TStyleManager::AddHistosFramesFill
(
TGCompositeFrame
*
f
)
2854
{
2855
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Fill"
);
2856
fTrashListFrame
->
AddFirst
(
gf
);
2857
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
2858
fTrashListFrame
->
AddFirst
(
h1
);
2859
fFrameFillColor
=
AddColorEntry
(
h1
,
kFrameFillColor
);
2860
fFrameFillStyle
=
AddFillStyleEntry
(
h1
,
kFrameFillStyle
);
2861
gf
->AddFrame(
h1
,
fLayoutExpandX
);
2862
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2863
2864
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2865
// fFrameFillColor->SetToolTipText("Color used to fill frames");
2866
// fFrameFillStyle->SetToolTipText("Pattern used to fill frames");
2867
}
2868
2869
////////////////////////////////////////////////////////////////////////////////
2870
/// Add the 'Line' group frame to the 'Histos - Frames' tab.
2871
2872
void
TStyleManager::AddHistosFramesLine
(
TGCompositeFrame
*
f
)
2873
{
2874
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Line"
);
2875
fTrashListFrame
->
AddFirst
(
gf
);
2876
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2877
fTrashListFrame
->
AddFirst
(
h
);
2878
fFrameLineColor
=
AddColorEntry
(
h
,
kFrameLineColor
);
2879
fFrameLineWidth
=
AddLineWidthEntry
(
h
,
kFrameLineWidth
);
2880
gf
->AddFrame(
h
,
fLayoutExpandX
);
2881
fFrameLineStyle
=
AddLineStyleEntry
(
gf
,
kFrameLineStyle
);
2882
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
2883
2884
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2885
// fFrameLineColor->SetToolTipText("Color of lines in frames");
2886
}
2887
2888
////////////////////////////////////////////////////////////////////////////////
2889
/// Add the 'Border' group frame to the 'Histos - Frames' tab.
2890
2891
void
TStyleManager::AddHistosFramesBorder
(
TGCompositeFrame
*
f
)
2892
{
2893
fFrameBorderMode
=
AddBorderModeEntry
(
f
,
kFrameBorderModeSunken
,
kFrameBorderModeNone
,
kFrameBorderModeRaised
);
2894
fFrameBorderSize
=
AddLineWidthEntry
(
fFrameBorderMode
,
kFrameBorderSize
);
2895
}
2896
2897
////////////////////////////////////////////////////////////////////////////////
2898
/// Add the sub-tab 'Graphs' to the tab 'Histos'.
2899
2900
void
TStyleManager::CreateTabHistosGraphs
(
TGCompositeFrame
*
tab
)
2901
{
2902
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
tab
);
2903
fTrashListFrame
->
AddFirst
(
h
);
2904
AddHistosGraphsLine
(
h
);
2905
AddHistosGraphsErrors
(
h
);
2906
tab
->AddFrame(
h
,
fLayoutExpandX
);
2907
AddHistosGraphsBorder
(
tab
);
2908
}
2909
2910
////////////////////////////////////////////////////////////////////////////////
2911
/// Add the 'Line' group frame to the 'Histos - Graphs' tab.
2912
2913
void
TStyleManager::AddHistosGraphsLine
(
TGCompositeFrame
*
f
)
2914
{
2915
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Line"
);
2916
fTrashListFrame
->
AddFirst
(
gf
);
2917
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
2918
fTrashListFrame
->
AddFirst
(
h
);
2919
fFuncColor
=
AddColorEntry
(
h
,
kGraphsFuncColor
);
2920
fFuncWidth
=
AddLineWidthEntry
(
h
,
kGraphsFuncWidth
);
2921
gf
->AddFrame(
h
,
fLayoutExpandX
);
2922
fFuncStyle
=
AddLineStyleEntry
(
gf
,
kGraphsFuncStyle
);
2923
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2924
2925
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2926
// fFuncColor->SetToolTipText("Color of curves in graphs");
2927
}
2928
2929
////////////////////////////////////////////////////////////////////////////////
2930
/// Add the 'Draw Border' check button to the 'Histos - Graphs' tab.
2931
2932
void
TStyleManager::AddHistosGraphsBorder
(
TGCompositeFrame
*
f
)
2933
{
2934
TGLayoutHints
*
layout
=
new
TGLayoutHints
(
kLHintsExpandX
, 10, 21, 5, 5);
2935
fTrashListLayout
->
Add
(
layout
);
2936
2937
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
f
);
2938
fTrashListFrame
->
AddFirst
(
h
);
2939
fDrawBorder
=
AddCheckButton
(
h
,
"Draw Border (for Filled Function)"
,
kGraphsDrawBorder
);
2940
f
->AddFrame(
h
,
layout
);
2941
2942
fDrawBorder
->
SetToolTipText
(
"Show / Hide the border of filled functions"
);
2943
}
2944
2945
////////////////////////////////////////////////////////////////////////////////
2946
/// Add the 'Errors' group frame to the 'Histos - Graphs' tab.
2947
2948
void
TStyleManager::AddHistosGraphsErrors
(
TGCompositeFrame
*
f
)
2949
{
2950
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Errors"
);
2951
fTrashListFrame
->
AddFirst
(
gf
);
2952
fEndErrorSize
=
AddNumberEntry
(
gf
, 0, 0, 0,
kGraphsEndErrorSize
,
2953
"End error size:"
, 0, 4,
TGNumberFormat::kNESRealOne
,
2954
TGNumberFormat::kNEAAnyNumber
,
2955
TGNumberFormat::kNELLimitMinMax
, 0, 5);
2956
fErrorX
=
AddNumberEntry
(
gf
, 0, 0, 0,
kGraphsErrorX
,
"Error X (% of bin):"
,
2957
0, 4,
TGNumberFormat::kNESInteger
,
2958
TGNumberFormat::kNEAAnyNumber
,
2959
TGNumberFormat::kNELLimitMinMax
, 0, 100);
2960
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
2961
2962
fEndErrorSize
->
GetNumberEntry
()->
SetToolTipText
(
"Size of lines drawn at the end of error bars"
);
2963
fErrorX
->
GetNumberEntry
()->
SetToolTipText
(
"Percent of the bin width to use for errors along X"
);
2964
}
2965
2966
////////////////////////////////////////////////////////////////////////////////
2967
/// Add the tab 'Axis' to the editor.
2968
2969
void
TStyleManager::CreateTabAxis
(
TGCompositeFrame
*
tab
)
2970
{
2971
TGLayoutHints
*
layout
=
2972
new
TGLayoutHints
(
kLHintsNormal
, 10, 13, 3);
2973
fTrashListLayout
->
Add
(
layout
);
2974
2975
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
tab
);
2976
fTrashListFrame
->
AddFirst
(
h
);
2977
2978
TGVerticalFrame
*h3 =
new
TGVerticalFrame
(
h
);
2979
fTrashListFrame
->
AddFirst
(h3);
2980
fStripDecimals
=
AddCheckButton
(h3,
"Decimal labels' part"
,
kAxisStripDecimals
, 0, 8);
2981
TGVerticalFrame
*space =
new
TGVerticalFrame
(h3);
2982
fTrashListFrame
->
AddFirst
(space);
2983
h3->AddFrame(space,
fLayoutExpandXY
);
2984
fApplyOnXYZ
=
AddTextButton
(h3,
"Apply on XYZ"
,
kAxisApplyOnXYZ
);
2985
h
->AddFrame(h3,
layout
);
2986
2987
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
h
,
"Date/Time Offset"
);
2988
fTrashListFrame
->
AddFirst
(
gf
);
2989
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
2990
fTrashListFrame
->
AddFirst
(h2);
2991
fTimeOffsetDate
=
AddNumberEntry
(h2, 0, 13, 10,
kAxisTimeOffsetDate
,
""
,
2992
0, 10,
TGNumberFormat::kNESDayMYear
,
2993
TGNumberFormat::kNEAAnyNumber
,
2994
TGNumberFormat::kNELNoLimits
, 0, 0);
2995
fTimeOffsetTime
=
AddNumberEntry
(h2, 0, 15, 0,
kAxisTimeOffsetTime
,
""
,
2996
0, 8,
TGNumberFormat::kNESHourMinSec
,
2997
TGNumberFormat::kNEAAnyNumber
,
2998
TGNumberFormat::kNELNoLimits
, 0, 0);
2999
gf
->AddFrame(h2,
fLayoutExpandX
);
3000
h
->AddFrame(
gf
,
fLayoutExpandXMargin
);
3001
tab
->AddFrame(
h
,
fLayoutExpandX
);
3002
3003
fAxisTab
=
new
TGTab
(
tab
);
3004
fAxisTab
->
Associate
(
this
);
3005
CreateTabAxisX
(
fAxisTab
->
AddTab
(
"X axis"
));
3006
CreateTabAxisY
(
fAxisTab
->
AddTab
(
"Y axis"
));
3007
CreateTabAxisZ
(
fAxisTab
->
AddTab
(
"Z axis"
));
3008
tab
->AddFrame(
fAxisTab
,
fLayoutExpandXY
);
3009
3010
fStripDecimals
->
SetToolTipText
(
"Draw / Hide the decimal part of labels"
);
3011
fApplyOnXYZ
->
SetToolTipText
(
"Apply settings of the currently selected axis on XYZ"
);
3012
fTimeOffsetDate
->
GetNumberEntry
()->
SetToolTipText
(
"Date offset for axis (dd/mm/yyyy)"
);
3013
fTimeOffsetTime
->
GetNumberEntry
()->
SetToolTipText
(
"Time offset for axis (hh/mm/ss)"
);
3014
}
3015
3016
////////////////////////////////////////////////////////////////////////////////
3017
/// Add the sub-tab 'X Axis' to the tab 'Axis'.
3018
3019
void
TStyleManager::CreateTabAxisX
(
TGCompositeFrame
*
tab
)
3020
{
3021
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
tab
);
3022
fTrashListFrame
->
AddFirst
(
h1
);
3023
AddAxisXLine
(
h1
);
3024
AddAxisXDivisions
(
h1
);
3025
tab
->AddFrame(
h1
,
fLayoutExpandX
);
3026
3027
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
tab
);
3028
fTrashListFrame
->
AddFirst
(h2);
3029
AddAxisXTitle
(h2);
3030
AddAxisXLabels
(h2);
3031
tab
->AddFrame(h2,
fLayoutExpandX
);
3032
}
3033
3034
////////////////////////////////////////////////////////////////////////////////
3035
/// Add the 'Line' group frame to the 'Axis - X Axis' tab.
3036
3037
void
TStyleManager::AddAxisXLine
(
TGCompositeFrame
*
f
)
3038
{
3039
TGLayoutHints
*
layout
=
new
TGLayoutHints
(
kLHintsExpandX
, 20);
3040
fTrashListLayout
->
Add
(
layout
);
3041
3042
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Line"
);
3043
fTrashListFrame
->
AddFirst
(
gf
);
3044
TGHorizontalFrame
*
h
=
new
TGHorizontalFrame
(
gf
);
3045
fTrashListFrame
->
AddFirst
(
h
);
3046
fXAxisColor
=
AddColorEntry
(
h
,
kAxisXAxisColor
);
3047
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
h
);
3048
fTrashListFrame
->
AddFirst
(h2);
3049
fXTickLength
=
AddNumberEntry
(h2, 3, 8, 0,
kAxisXTickLength
,
"Ticks:"
,
3050
0, 5,
TGNumberFormat::kNESRealThree
,
3051
TGNumberFormat::kNEAAnyNumber
,
3052
TGNumberFormat::kNELLimitMinMax
, 0, 5);
3053
h
->AddFrame(h2,
layout
);
3054
gf
->AddFrame(
h
,
fLayoutExpandX
);
3055
fOptLogx
=
AddCheckButton
(
gf
,
"Logarithmic scale"
,
kAxisOptLogx
);
3056
f
->AddFrame(
gf
,
fLayoutExpandXYMargin
);
3057
3058
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3059
// fXAxisColor->SetToolTipText("Color of axis' line");
3060
fXTickLength
->
GetNumberEntry
()->
SetToolTipText
(
"Set the ticks' length"
);
3061
fOptLogx
->
SetToolTipText
(
"Draw logarithmic scale"
);
3062
}
3063
3064
////////////////////////////////////////////////////////////////////////////////
3065
/// Add the 'Title' group frame to the 'Axis - X Axis' tab.
3066
3067
void
TStyleManager::AddAxisXTitle
(
TGCompositeFrame
*
f
)
3068
{
3069
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Title"
);
3070
fTrashListFrame
->
AddFirst
(
gf
);
3071
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
3072
fTrashListFrame
->
AddFirst
(
h1
);
3073
fXTitleColor
=
AddColorEntry
(
h1
,
kAxisXTitleColor
);
3074
fXTitleFont
=
AddFontTypeEntry
(
h1
,
kAxisXTitleFont
);
3075
gf
->AddFrame(
h1
,
fLayoutExpandX
);
3076
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
3077
fTrashListFrame
->
AddFirst
(h2);
3078
fXTitleSizeInPixels
=
AddCheckButton
(h2,
"Pixels"
,
kAxisXTitleSizeInPixels
);
3079
fXTitleSize
=
AddNumberEntry
(h2, 21, 8, 0,
kAxisXTitleSize
,
"Size:"
, 0, 5,
3080
TGNumberFormat::kNESRealThree
,
3081
TGNumberFormat::kNEAAnyNumber
,
3082
TGNumberFormat::kNELLimitMinMax
, 0, 0.3);
3083
gf
->AddFrame(h2,
fLayoutExpandX
);
3084
fXTitleOffset
=
AddNumberEntry
(
gf
, 68, 8, 0,
kAxisXTitleOffset
,
"Offset:"
,
3085
0, 5,
TGNumberFormat::kNESRealTwo
,
3086
TGNumberFormat::kNEAAnyNumber
,
3087
TGNumberFormat::kNELLimitMinMax
, 0, 1);
3088
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
3089
3090
// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3091
// fXTitleColor->SetToolTipText("Color of axis' title");
3092
fXTitleSizeInPixels
->
SetToolTipText
(
"Set the title size in pixels if selected, otherwise - in % of pad"
);
3093
fXTitleSize
->
GetNumberEntry
()->
SetToolTipText
(
"Title size (in pixels or in % of pad)"
);
3094
fXTitleOffset
->
GetNumberEntry
()->
SetToolTipText
(
"Offset between axis and title"
);
3095
}
3096
3097
////////////////////////////////////////////////////////////////////////////////
3098
/// Add the 'Divisions' group frame to the 'Axis - X Axis' tab.
3099
3100
void
TStyleManager::AddAxisXDivisions
(
TGCompositeFrame
*
f
)
3101
{
3102
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Divisions"
);
3103
fTrashListFrame
->
AddFirst
(
gf
);
3104
3105
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
3106
fTrashListFrame
->
AddFirst
(
h1
);
3107
fXNdivSubSub
=
AddNumberEntry
(
h1
, 0, 0, 0,
kAxisXNdivSubSub
,
""
,
3108
0, 3,
TGNumberFormat::kNESInteger
,
3109
TGNumberFormat::kNEAAnyNumber
,
3110
TGNumberFormat::kNELLimitMinMax
, 0, 99);
3111
fXNdivSub
=
AddNumberEntry
(
h1
, 0, 18, 0,
kAxisXNdivSub
,
""
,
3112
0, 3,
TGNumberFormat::kNESInteger
,
3113
TGNumberFormat::kNEAAnyNumber
,
3114
TGNumberFormat::kNELLimitMinMax
, 0, 99);
3115
fXNdivMain
=
AddNumberEntry
(
h1
, 0, 18, 0,
kAxisXNdivMain
,
""
,
3116
0, 3,
TGNumberFormat::kNESInteger
,
3117
TGNumberFormat::kNEAAnyNumber
,
3118
TGNumberFormat::kNELLimitMinMax
, 0, 99);
3119
gf
->AddFrame(
h1
,
fLayoutExpandX
);
3120
3121
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
3122
fTrashListFrame
->
AddFirst
(h2);
3123
fXNdivisionsOptimize
=
AddCheckButton
(h2,
"Optimize"
,
kAxisXNdivisionsOptimize
);
3124
gf
->AddFrame(h2,
fLayoutExpandX
);
3125
f
->AddFrame(
gf
,
fLayoutExpandXMargin
);
3126
3127
fXNdivMain
->
GetNumberEntry
()->
SetToolTipText
(
"Primary axis divisions"
);
3128
fXNdivSub
->
GetNumberEntry
()->
SetToolTipText
(
"Secondary axis divisions"
);
3129
fXNdivSubSub
->
GetNumberEntry
()->
SetToolTipText
(
"Tertiary axis divisions"
);
3130
fXNdivisionsOptimize
->
SetToolTipText
(
"Optimize the number of axis divisions if selected"
);
3131
}
3132
3133
////////////////////////////////////////////////////////////////////////////////
3134
/// Add the 'Labels' group frame to the 'Axis - X Axis' tab.
3135
3136
void
TStyleManager::AddAxisXLabels
(
TGCompositeFrame
*
f
)
3137
{
3138
TGGroupFrame
*
gf
=
new
TGGroupFrame
(
f
,
"Labels"
);
3139
fTrashListFrame
->
AddFirst
(
gf
);
3140
TGHorizontalFrame
*
h1
=
new
TGHorizontalFrame
(
gf
);
3141
fTrashListFrame
->
AddFirst
(
h1
);
3142
fXLabelColor
=
AddColorEntry
(
h1
,
kAxisXLabelColor
);
3143
fXLabelFont
=
AddFontTypeEntry
(
h1
,
kAxisXLabelFont
);
3144
gf
->AddFrame(
h1
,
fLayoutExpandX
);
3145
TGHorizontalFrame
*h2 =
new
TGHorizontalFrame
(
gf
);
3146
fTrashListFrame
->
AddFirst
(h2);
3147
fXLabelSizeInPixels
=
AddCheckButton
(h2,
"Pixels"
,
kAxisXLabelSizeInPixels
);
3148
fXLabelSize
=
AddNumberEntry
(h2, 22, 8, 0,
kAxisXLabelSize
,
"Size:"
, 0, 5,
3149
TGNumberFormat::kNESRealThree
,
3150
TGNumberFormat::kNEAAnyNumber
,
3151
TGNumberFormat::kNELLimitMinMax
, 0, 0.3);
3152
gf
->AddFrame(h2,