12 #ifndef ROOT_TStyleManager
13 #define ROOT_TStyleManager
33 class TGCompositeFrame;
34 class TGedMarkerSelect;
35 class TGedPatternSelect;
37 class TGFontTypeComboBox;
39 class TGHorizontal3DLine;
40 class TGHorizontalFrame;
43 class TGLineStyleComboBox;
44 class TGLineWidthComboBox;
49 class TGPictureButton;
57 class TGVerticalFrame;
64 class TStyleManager :
public TGMainFrame {
67 static TStyleManager *fgStyleManager;
71 Bool_t fRealTimePreview;
78 Bool_t fMoreAndNotLess;
79 Bool_t fSigSlotConnected;
80 Bool_t fAllAndNotCurrent;
81 TList *fTrashListFrame;
82 TList *fTrashListLayout;
85 TGPopupMenu *fMenuStyle;
86 TGPopupMenu *fImportCascade;
87 TGPopupMenu *fMenuHelp;
90 TGPictureButton *fToolBarNew;
91 TGPictureButton *fToolBarDelete;
92 TGPictureButton *fToolBarImportCanvas;
93 TGPictureButton *fToolBarImportMacro;
94 TGPictureButton *fToolBarExport;
95 TGPictureButton *fToolBarHelp;
96 const TGPicture *fToolBarNewPic;
97 const TGPicture *fToolBarDeletePic;
98 const TGPicture *fToolBarImportCanvasPic;
99 const TGPicture *fToolBarImportMacroPic;
100 const TGPicture *fToolBarExportPic;
101 const TGPicture *fToolBarHelpPic;
102 TGHorizontal3DLine *fHorizontal3DLine;
105 TGComboBox *fListComboBox;
106 TGFileInfo *fCurMacro;
107 TGLabel *fCurStylabel;
108 TGTextEntry *fCurStyle;
109 TGLabel *fCurPadLabel;
110 TGTextEntry *fCurPadTextEntry;
111 TVirtualPad *fCurPad;
112 TGLabel *fCurObjLabel;
113 TGTextEntry *fCurObjTextEntry;
115 TGCheckButton *fPreviewButton;
116 TGCheckButton *fPreviewRealTime;
117 TStylePreview *fPreviewWindow;
118 TGPictureButton *fMakeDefault;
119 const TGPicture *fMakeDefaultPic;
121 TGHButtonGroup *fApplyOnGroup;
122 TGRadioButton *fApplyOnAll;
123 TGRadioButton *fApplyOnSel;
124 TGTextButton *fApplyOnButton;
126 TGTextButton *fMoreLess;
127 TGStatusBar *fStatusBar;
129 TGVerticalFrame *fEditionFrame;
133 TGHorizontalFrame *fEditionButtonFrame;
135 TGTextButton *fEditionHelp;
136 TGTextButton *fEditionUpdatePreview;
137 TGTextButton *fEditionReset;
139 TGColorSelect *fFillColor;
140 TGedPatternSelect *fFillStyle;
141 TGLineWidthComboBox *fHatchesLineWidth;
142 TGNumberEntry *fHatchesSpacing;
143 TGColorSelect *fTextColor;
144 TGNumberEntry *fTextSize;
145 TGCheckButton *fTextSizeInPixels;
146 TGFontTypeComboBox *fTextFont;
147 TGComboBox *fTextAlign;
148 TGNumberEntry *fTextAngle;
149 TGColorSelect *fLineColor;
150 TGLineWidthComboBox *fLineWidth;
151 TGLineStyleComboBox *fLineStyle;
152 TGTextButton *fLineStyleEdit;
153 TGColorSelect *fMarkerColor;
154 TGedMarkerSelect *fMarkerStyle;
155 TGComboBox *fMarkerSize;
156 TGNumberEntry *fScreenFactor;
157 TGColorSelect *fCanvasColor;
158 TGNumberEntry *fCanvasDefX;
159 TGNumberEntry *fCanvasDefY;
160 TGNumberEntry *fCanvasDefW;
161 TGNumberEntry *fCanvasDefH;
162 TGButtonGroup *fCanvasBorderMode;
163 TGLineWidthComboBox *fCanvasBorderSize;
164 TGCheckButton *fOptDateBool;
165 TGColorSelect *fAttDateTextColor;
166 TGNumberEntry *fAttDateTextSize;
167 TGCheckButton *fAttDateTextSizeInPixels;
168 TGComboBox *fOptDateFormat;
169 TGFontTypeComboBox *fAttDateTextFont;
170 TGNumberEntry *fAttDateTextAngle;
171 TGComboBox *fAttDateTextAlign;
172 TGNumberEntry *fDateX;
173 TGNumberEntry *fDateY;
174 TGNumberEntry *fPadLeftMargin;
175 TGNumberEntry *fPadRightMargin;
176 TGNumberEntry *fPadTopMargin;
177 TGNumberEntry *fPadBottomMargin;
178 TGButtonGroup *fPadBorderMode;
179 TGLineWidthComboBox *fPadBorderSize;
180 TGColorSelect *fPadColor;
181 TGCheckButton *fPadTickX;
182 TGCheckButton *fPadTickY;
183 TGCheckButton *fPadGridX;
184 TGCheckButton *fPadGridY;
185 TGColorSelect *fGridColor;
186 TGLineWidthComboBox *fGridWidth;
187 TGLineStyleComboBox *fGridStyle;
188 TGColorSelect *fHistFillColor;
189 TGedPatternSelect *fHistFillStyle;
190 TGColorSelect *fHistLineColor;
191 TGLineWidthComboBox *fHistLineWidth;
192 TGLineStyleComboBox *fHistLineStyle;
193 TGNumberEntry *fBarWidth;
194 TGNumberEntry *fBarOffset;
195 TGCheckButton *fHistMinimumZero;
196 TGTextEntry *fPaintTextFormat;
197 TGNumberEntry *fNumberContours;
198 TGNumberEntry *fLegoInnerR;
199 TGColorSelect *fFrameFillColor;
200 TGedPatternSelect *fFrameFillStyle;
201 TGColorSelect *fFrameLineColor;
202 TGLineWidthComboBox *fFrameLineWidth;
203 TGLineStyleComboBox *fFrameLineStyle;
204 TGTextButton *fPaletteEdit;
205 TGButtonGroup *fFrameBorderMode;
206 TGLineWidthComboBox *fFrameBorderSize;
207 TGColorSelect *fFuncColor;
208 TGLineWidthComboBox *fFuncWidth;
209 TGLineStyleComboBox *fFuncStyle;
210 TGCheckButton *fDrawBorder;
211 TGNumberEntry *fEndErrorSize;
212 TGNumberEntry *fErrorX;
213 TGNumberEntry *fTimeOffsetDate;
214 TGNumberEntry *fTimeOffsetTime;
215 TGCheckButton *fStripDecimals;
216 TGTextButton *fApplyOnXYZ;
217 TGNumberEntry *fXTitleSize;
218 TGCheckButton *fXTitleSizeInPixels;
219 TGColorSelect *fXTitleColor;
220 TGNumberEntry *fXTitleOffset;
221 TGFontTypeComboBox *fXTitleFont;
222 TGNumberEntry *fXLabelSize;
223 TGCheckButton *fXLabelSizeInPixels;
224 TGColorSelect *fXLabelColor;
225 TGNumberEntry *fXLabelOffset;
226 TGFontTypeComboBox *fXLabelFont;
227 TGColorSelect *fXAxisColor;
228 TGNumberEntry *fXTickLength;
229 TGCheckButton *fOptLogx;
230 TGNumberEntry *fXNdivMain;
231 TGNumberEntry *fXNdivSub;
232 TGNumberEntry *fXNdivSubSub;
233 TGCheckButton *fXNdivisionsOptimize;
234 TGNumberEntry *fYTitleSize;
235 TGCheckButton *fYTitleSizeInPixels;
236 TGColorSelect *fYTitleColor;
237 TGNumberEntry *fYTitleOffset;
238 TGFontTypeComboBox *fYTitleFont;
239 TGNumberEntry *fYLabelSize;
240 TGCheckButton *fYLabelSizeInPixels;
241 TGColorSelect *fYLabelColor;
242 TGNumberEntry *fYLabelOffset;
243 TGFontTypeComboBox *fYLabelFont;
244 TGColorSelect *fYAxisColor;
245 TGNumberEntry *fYTickLength;
246 TGCheckButton *fOptLogy;
247 TGNumberEntry *fYNdivMain;
248 TGNumberEntry *fYNdivSub;
249 TGNumberEntry *fYNdivSubSub;
250 TGCheckButton *fYNdivisionsOptimize;
251 TGNumberEntry *fZTitleSize;
252 TGCheckButton *fZTitleSizeInPixels;
253 TGColorSelect *fZTitleColor;
254 TGNumberEntry *fZTitleOffset;
255 TGFontTypeComboBox *fZTitleFont;
256 TGNumberEntry *fZLabelSize;
257 TGCheckButton *fZLabelSizeInPixels;
258 TGColorSelect *fZLabelColor;
259 TGNumberEntry *fZLabelOffset;
260 TGFontTypeComboBox *fZLabelFont;
261 TGColorSelect *fZAxisColor;
262 TGNumberEntry *fZTickLength;
263 TGCheckButton *fOptLogz;
264 TGNumberEntry *fZNdivMain;
265 TGNumberEntry *fZNdivSub;
266 TGNumberEntry *fZNdivSubSub;
267 TGCheckButton *fZNdivisionsOptimize;
268 TGCheckButton *fOptTitle;
269 TGColorSelect *fTitleColor;
270 TGedPatternSelect *fTitleStyle;
271 TGColorSelect *fTitleTextColor;
272 TGNumberEntry *fTitleFontSize;
273 TGCheckButton *fTitleFontSizeInPixels;
274 TGFontTypeComboBox *fTitleFont;
275 TGComboBox *fTitleAlign;
276 TGLabel *fTitleBorderSizeLabel;
277 TGLineWidthComboBox *fTitleBorderSize;
278 TGNumberEntry *fTitleX;
279 TGNumberEntry *fTitleY;
280 TGNumberEntry *fTitleW;
281 TGNumberEntry *fTitleH;
282 TGLabel *fLegendBorderSizeLabel;
283 TGLineWidthComboBox *fLegendBorderSize;
284 TGColorSelect *fStatColor;
285 TGedPatternSelect *fStatStyle;
286 TGColorSelect *fStatTextColor;
287 TGNumberEntry *fStatFontSize;
288 TGCheckButton *fStatFontSizeInPixels;
289 TGFontTypeComboBox *fStatFont;
290 TGNumberEntry *fStatX;
291 TGNumberEntry *fStatY;
292 TGNumberEntry *fStatW;
293 TGNumberEntry *fStatH;
294 TGLabel *fStatBorderSizeLabel;
295 TGLineWidthComboBox *fStatBorderSize;
296 TGCheckButton *fOptStatName;
297 TGCheckButton *fOptStatEntries;
298 TGCheckButton *fOptStatOverflow;
299 TGCheckButton *fOptStatMean;
300 TGCheckButton *fOptStatUnderflow;
301 TGCheckButton *fOptStatRMS;
302 TGCheckButton *fOptStatSkewness;
303 TGCheckButton *fOptStatIntegral;
304 TGCheckButton *fOptStatKurtosis;
305 TGCheckButton *fOptStatErrors;
306 TGLabel *fStatFormatLabel;
307 TGTextEntry *fStatFormat;
308 TGCheckButton *fOptFitValues;
309 TGCheckButton *fOptFitErrors;
310 TGCheckButton *fOptFitProbability;
311 TGCheckButton *fOptFitChi;
312 TGLabel *fFitFormatLabel;
313 TGTextEntry *fFitFormat;
314 TGTextEntry *fHeaderPS;
315 TGTextEntry *fTitlePS;
316 TGButtonGroup *fColorModelPS;
317 TGRadioButton *fColorModelPSRGB;
318 TGRadioButton *fColorModelPSCMYK;
319 TGNumberEntry *fLineScalePS;
320 TGComboBox *fPaperSizePredef;
321 Bool_t fPaperSizeEnCm;
322 TGNumberEntry *fPaperSizeX;
323 TGNumberEntry *fPaperSizeY;
325 TGLayoutHints *fLayoutExpandX;
326 TGLayoutHints *fLayoutExpandXMargin;
327 TGLayoutHints *fLayoutExpandXY;
328 TGLayoutHints *fLayoutExpandXYMargin;
329 TGLayoutHints *fLayoutExpandXCenterYMargin;
331 void AddMenus(TGCompositeFrame *p);
337 void DoHelp(Int_t i);
338 void DoImportCanvas();
341 void AddToolbar(TGCompositeFrame *p);
343 void AddTopLevelInterface(TGCompositeFrame *cf);
344 void UpdateStatusBar();
345 void UpdateEditor(Int_t tabNum);
347 void DisconnectAll();
348 void ConnectEditor(Int_t tabNum);
349 void DisconnectEditor(Int_t tabNum);
352 void AddEdition(TGCompositeFrame *p);
354 void CreateTabGeneral(TGCompositeFrame *tab);
355 void AddGeneralLine(TGCompositeFrame *f);
356 void AddGeneralFill(TGCompositeFrame *f);
357 void AddGeneralText(TGCompositeFrame *f);
358 void AddGeneralMarker(TGCompositeFrame *f);
360 void CreateTabCanvas(TGCompositeFrame *tab);
361 void AddCanvasFill(TGCompositeFrame *f);
362 void AddCanvasGeometry(TGCompositeFrame *f);
363 void AddCanvasBorder(TGCompositeFrame *f);
364 void AddCanvasDate(TGCompositeFrame *f);
366 void CreateTabPad(TGCompositeFrame *tab);
367 void AddPadMargin(TGCompositeFrame *f);
368 void AddPadBorder(TGCompositeFrame *f);
369 void AddPadFill(TGCompositeFrame *f);
370 void AddPadTicks(TGCompositeFrame *f);
371 void AddPadGrid(TGCompositeFrame *f);
373 void CreateTabHistos(TGCompositeFrame *tab);
374 void CreateTabHistosHistos(TGCompositeFrame *tab);
375 void AddHistosHistosFill(TGCompositeFrame *f);
376 void AddHistosHistosLine(TGCompositeFrame *f);
377 void AddHistosHistosBar(TGCompositeFrame *f);
378 void AddHistosHistosContours(TGCompositeFrame *f);
379 void AddHistosHistosAxis(TGCompositeFrame *f);
380 void AddHistosHistosLegoInnerR(TGCompositeFrame *f);
382 void CreateTabHistosFrames(TGCompositeFrame *tab);
383 void AddHistosFramesFill(TGCompositeFrame *f);
384 void AddHistosFramesLine(TGCompositeFrame *f);
385 void AddHistosFramesBorder(TGCompositeFrame *f);
387 void CreateTabHistosGraphs(TGCompositeFrame *tab);
388 void AddHistosGraphsLine(TGCompositeFrame *f);
389 void AddHistosGraphsBorder(TGCompositeFrame *f);
390 void AddHistosGraphsErrors(TGCompositeFrame *f);
392 void CreateTabAxis(TGCompositeFrame *tab);
393 void CreateTabAxisX(TGCompositeFrame *tab);
394 void AddAxisXTitle(TGCompositeFrame *f);
395 void AddAxisXLine(TGCompositeFrame *f);
396 void AddAxisXLabels(TGCompositeFrame *f);
397 void AddAxisXDivisions(TGCompositeFrame *f);
399 void CreateTabAxisY(TGCompositeFrame *tab);
400 void AddAxisYTitle(TGCompositeFrame *f);
401 void AddAxisYLine(TGCompositeFrame *f);
402 void AddAxisYLabels(TGCompositeFrame *f);
403 void AddAxisYDivisions(TGCompositeFrame *f);
405 void CreateTabAxisZ(TGCompositeFrame *tab);
406 void AddAxisZTitle(TGCompositeFrame *f);
407 void AddAxisZLine(TGCompositeFrame *f);
408 void AddAxisZLabels(TGCompositeFrame *f);
409 void AddAxisZDivisions(TGCompositeFrame *f);
411 void CreateTabTitle(TGCompositeFrame *tab);
412 void AddTitleFill(TGCompositeFrame *f);
413 void AddTitleBorderSize(TGCompositeFrame *f);
414 void AddTitleText(TGCompositeFrame *f);
415 void AddTitleGeometry(TGCompositeFrame *f);
417 void CreateTabStats(TGCompositeFrame *tab);
418 void AddStatsFill(TGCompositeFrame *f);
419 void AddStatsText(TGCompositeFrame *f);
420 void AddStatsGeometry(TGCompositeFrame *f);
421 void AddStatsStats(TGCompositeFrame *f);
422 void AddStatsFit(TGCompositeFrame *f);
424 void CreateTabPsPdf(TGCompositeFrame *tab);
425 void AddPsPdfHeader(TGCompositeFrame *f);
426 void AddPsPdfTitle(TGCompositeFrame *f);
427 void AddPsPdfColorModel(TGCompositeFrame *f);
428 void AddPsPdfPaperSize(TGCompositeFrame *f);
429 void AddPsPdfLineScale(TGCompositeFrame *f);
431 void AddTitle(TGCompositeFrame *f,
const char *s);
432 TGColorSelect *AddColorEntry(TGCompositeFrame *f, Int_t
id);
433 TGedPatternSelect *AddFillStyleEntry(TGCompositeFrame *f, Int_t
id);
434 TGedMarkerSelect *AddMarkerStyleEntry(TGCompositeFrame *f, Int_t
id);
435 TGComboBox *AddMarkerSizeEntry(TGCompositeFrame *f, Int_t
id);
436 TGNumberEntry *AddNumberEntry(TGCompositeFrame *f, Int_t e1, Int_t e2,
437 Int_t e3, Int_t
id,
const char *s, Double_t init, Int_t digits,
438 TGNumberFormat::EStyle nfS, TGNumberFormat::EAttribute nfA,
439 TGNumberFormat::ELimit nfL, Double_t min, Double_t max);
440 TGLineWidthComboBox *AddLineWidthEntry(TGCompositeFrame *f, Int_t
id);
441 TGLineStyleComboBox *AddLineStyleEntry(TGCompositeFrame *f, Int_t
id);
442 TGTextButton *AddTextButton(TGCompositeFrame *f,
const char *s, Int_t
id);
443 TGFontTypeComboBox *AddFontTypeEntry(TGCompositeFrame *f, Int_t
id);
444 TGComboBox *AddTextAlignEntry(TGCompositeFrame *f, Int_t
id);
445 TGButtonGroup *AddBorderModeEntry(TGCompositeFrame *f, Int_t id1, Int_t id2, Int_t id3);
446 TGComboBox *AddDateFormatEntry(TGCompositeFrame *f, Int_t
id);
447 TGCheckButton *AddCheckButton(TGCompositeFrame *f,
const char *s, Int_t
id, Int_t e1 = 0, Int_t e2 = 2);
448 TGTextEntry *AddTextEntry(TGCompositeFrame *f,
const char *s, Int_t
id);
449 TGComboBox *AddPaperSizeEntry(TGCompositeFrame *f, Int_t
id);
452 TStyleManager(
const TGWindow *);
453 virtual ~TStyleManager();
456 static void Terminate();
457 static TStyleManager *&GetSM();
462 void SetCurSelStyle(TStyle *style) { fCurSelStyle = style; }
463 void SetLastChoice(Bool_t choice) { fLastChoice = choice; }
465 void DoMenu(Int_t menuID);
466 void DoImportMacro(Bool_t create);
468 void DoRealTime(Bool_t b);
469 void DoPreview(Bool_t b);
470 void DoPreviewClosed();
471 void DoMakeDefault();
472 void DoApplyOnSelect(Int_t i);
475 void DoEditionUpdatePreview();
476 void DoChangeTab(Int_t i);
477 void DoChangeAxisTab(Int_t i);
478 void BuildList(TStyle *style = 0);
479 void DoSelectNoCanvas();
480 void DoSelectCanvas(TVirtualPad *pad,
481 TObject *obj, Int_t mouseButton);
487 void ModHatchesLineWidth();
488 void ModHatchesSpacing();
489 void ModMarkerColor();
490 void ModMarkerStyle();
491 void ModMarkerSize();
492 void ModScreenFactor();
496 void ModLineStyleEdit();
499 void ModTextSizeInPixels(Bool_t b);
505 void ModCanvasColor();
506 void ModCanvasDefX();
507 void ModCanvasDefY();
508 void ModCanvasDefW();
509 void ModCanvasDefH();
510 void ModCanvasBorderMode();
511 void ModCanvasBorderSize();
512 void ModOptDateBool();
513 void ModAttDateTextColor();
514 void ModAttDateTextSize();
515 void ModAttDateTextSizeInPixels(Bool_t b);
516 void ModOptDateFormat();
517 void ModAttDateTextFont();
518 void ModAttDateTextAngle();
519 void ModAttDateTextAlign();
524 void ModPadTopMargin();
525 void ModPadBottomMargin();
526 void ModPadLeftMargin();
527 void ModPadRightMargin();
528 void ModPadBorderMode();
529 void ModPadBorderSize();
540 void ModHistFillColor();
541 void ModHistFillStyle();
542 void ModHistLineColor();
543 void ModHistLineWidth();
544 void ModHistLineStyle();
547 void ModHistMinimumZero();
548 void ModPaintTextFormat();
549 void ModNumberContours();
550 void ModLegoInnerR();
553 void ModFrameFillColor();
554 void ModFrameFillStyle();
555 void ModFrameLineColor();
556 void ModFrameLineWidth();
557 void ModFrameLineStyle();
558 void ModPaletteEdit();
559 void ModFrameBorderMode();
560 void ModFrameBorderSize();
566 void ModDrawBorder();
567 void ModEndErrorSize();
571 void ModTimeOffset();
572 void ModStripDecimals();
573 void ModApplyOnXYZ();
576 void ModXTitleSize();
577 void ModXTitleSizeInPixels(Bool_t b);
578 void ModXTitleColor();
579 void ModXTitleOffset();
580 void ModXTitleFont();
581 void ModXLabelSize();
582 void ModXLabelSizeInPixels(Bool_t b);
583 void ModXLabelColor();
584 void ModXLabelOffset();
585 void ModXLabelFont();
586 void ModXAxisColor();
587 void ModXTickLength();
589 void ModXNdivisions();
592 void ModYTitleSize();
593 void ModYTitleSizeInPixels(Bool_t b);
594 void ModYTitleColor();
595 void ModYTitleOffset();
596 void ModYTitleFont();
597 void ModYLabelSize();
598 void ModYLabelSizeInPixels(Bool_t b);
599 void ModYLabelColor();
600 void ModYLabelOffset();
601 void ModYLabelFont();
602 void ModYAxisColor();
603 void ModYTickLength();
605 void ModYNdivisions();
608 void ModZTitleSize();
609 void ModZTitleSizeInPixels(Bool_t b);
610 void ModZTitleColor();
611 void ModZTitleOffset();
612 void ModZTitleFont();
613 void ModZLabelSize();
614 void ModZLabelSizeInPixels(Bool_t b);
615 void ModZLabelColor();
616 void ModZLabelOffset();
617 void ModZLabelFont();
618 void ModZAxisColor();
619 void ModZTickLength();
621 void ModZNdivisions();
625 void ModTitleFillColor();
626 void ModTitleStyle();
627 void ModTitleTextColor();
628 void ModTitleFontSize();
629 void ModTitleFontSizeInPixels(Bool_t b);
631 void ModTitleAlign();
632 void ModTitleBorderSize();
637 void ModLegendBorderSize();
640 void ModStatColor(Pixel_t color);
641 void ModStatStyle(Style_t pattern);
642 void ModStatTextColor(Pixel_t color);
643 void ModStatFontSize();
644 void ModStatFontSizeInPixels(Bool_t b);
650 void ModStatBorderSize();
652 void ModStatFormat(
const char *sformat);
654 void ModFitFormat(
const char *fitformat);
659 void ModColorModelPS();
660 void ModLineScalePS();
661 void ModPaperSizePredef();
662 void ModPaperSizeXY();
664 ClassDef(TStyleManager, 0)