Logo ROOT  
Reference Guide
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// //
14// TStyleManager //
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//Begin_Html
29/*
30<img src="gif/StyleManager.gif">
31*/
32//End_Html
33// //
34// The combo box 'Available Styles' contains the list of available //
35// styles for the current ROOT session and shows the currently //
36// selected one. The field on the right shows the setting of the gStyle.//
37// You can set the global variable gStyle to the selected style by //
38// clicking on the button in the middle. //
39// The group frame 'Apply on' displays information for the currently //
40// selected canvas and object in the ROOT session. This selection might //
41// be changed by clicking on another object with the middle mouse //
42// button. You have a choice to apply a style on the selected object or //
43// on all available canvases. //
44// WARNING: You cannot undo the changes after applying the style! If //
45// you are not sure of that action, it may be better to see a preview //
46// of what you are going to apply. //
47// If the check button 'Preview' is selected, a preview of the selected //
48// canvas according to the selected style will be shown. The selection //
49// of the next check button 'Run Time Preview' will apply updates of //
50// the preview any time a value of the selected style is changed. For //
51// drawings that take a time it is better to disable this option. //
52// //
53// Create a new style: //
54// A new style can be created via the Style menu/New... or the toolbar. //
55// A clone of the selected style will be used as a base of the new //
56// style. All its values can be modified via the style editor later. //
57// The dialog that appears will ask for the name and description of the //
58// new style. //
59// //
60// Import a style (from a macro): //
61// A style macro can be imported at any time. The new imported style in //
62// the ROOT session will become the selected one. //
63// //
64// Import a style (from a canvas): //
65// You can do that selecting the Style menu/Import from.../Canvas or //
66// the corresponding Tool bar button. A new style will be created in the//
67// ROOT session and will become the selected one. This style is a clone //
68// of the gStyle with modified values as they are set in the currently //
69// selected canvas. You can import a style from any canvas and apply it //
70// later on some objects. //
71// //
72// Export a style (in a C++ macro file): //
73// To store a style longer than for the current ROOT session you can //
74// save it in a C++ macro file. This can be done via the menu or the //
75// tool bar button. There is a naming convention for the style macros: //
76// the name must be 'Style_*.C', where * can be replaced by anything //
77// you want. //
78// //
79// Delete a style: //
80// The selected style can be deleted from the list when you use the //
81// Style menu/Delete or the corresponding tool bar button. The selected //
82// style is removed from the list of all available styles for the //
83// current ROOT session. WARRNING: it will be lost if you didn't saved //
84// it in a C++ macro file before its deletion. Also, you cannot delete //
85// the selected style if it is set to gStyle. A message 'Can not delete //
86// gStyle' will be displayed on the CINT prompt. //
87// //
88//Begin_Html
89/*
90<img src="gif/StyleEditor.gif">
91*/
92//End_Html
93// //
94// Editor's buttons: //
95// Open / close the style editor: //
96// The button 'Edit >>' opens the style editor and its label changes to //
97// 'Close <<'. For all details of what can be changed and how please see//
98// the provided Help. //
99// //
100// Reset a style (to a previously saved state): //
101// When the editor is opened, the 'Reset' button allows you to reset //
102// the values of the selected style for editing. Doing that you cancel //
103// all changes made since the last time you saved that style in a macro.//
104// If the selected style is one of the five ROOT styles (Plain, Bold, //
105// Video, Pub or Default), it will be recreated. //
106// //
107// Update the preview: //
108// The button 'Update Preview' is available when a preview is shown and //
109// the run time option is not selected. This button allows you to //
110// refresh the preview any time you want to see how the style you edit //
111// looks like. //
112// //
113// Help button: //
114// Provides a help of the currently selected tab. //
115// //
116//////////////////////////////////////////////////////////////////////////
117
118#include "TStyleManager.h"
119#include "TStyleDialog.h"
120#include "TStylePreview.h"
121#include "HelpSMText.h"
122
123#include <TCanvas.h>
124#include <TColor.h>
125#include <TG3DLine.h>
126#include <TGButton.h>
127#include <TGButtonGroup.h>
128#include <TGColorSelect.h>
129#include <TGComboBox.h>
130#include <TGedMarkerSelect.h>
131#include <TGedPatternSelect.h>
132#include <TGFileDialog.h>
133#include <TGFrame.h>
134#include <TGLabel.h>
135#include <TGLayout.h>
136#include <TGMenu.h>
137#include <TGMsgBox.h>
138#include <TGNumberEntry.h>
139#include <TGResourcePool.h>
140#include <TGStatusBar.h>
141#include <TGTab.h>
142#include <TGToolBar.h>
143#include <TROOT.h>
144#include <TRootHelpDialog.h>
145#include <TStyle.h>
146#include <TSystem.h>
147#include <TVirtualPad.h>
148#include <TVirtualX.h>
149
151
153
172
179
191
195
214
234
251
263
274
281
286
304
322
340
355
383
394
395const char *kFiletypes[] = { "ROOT macros", "Style_*.C",
396 0, 0 };
397
398////////////////////////////////////////////////////////////////////////////////
399/// Constructor. Create the main window of the style manager.
400
402{
403 SetWindowName("Style Manager");
405
406 // Initialization: no selected style, no preview, no signal/slots,
407 // no selected object, no current macro file.
408 fCurSelStyle = 0;
409 fCurMacro = 0;
410 fCurPad = 0;
411 fCurObj = 0;
412 fPreviewWindow = 0;
414 fCurTabNum = 0;
415 fCurTabAxisNum = 0;
419
420 // Create the trash lists to have an effective deletion of every object.
421 fTrashListLayout = new TList();
422 fTrashListFrame = new TList();
423
424 // To avoid to create a lot a copies of the often used layouts.
435
436 // Build the graphical interface.
437 AddMenus(this);
438 AddToolbar(this);
440 AddEdition(this);
441
442 // Add status bar.
443 fStatusBar = new TGStatusBar(this, 50, 10, kVerticalFrame);
444 Int_t parts[] = { 20, 30, 50 };
445 fStatusBar->SetParts(parts, 3);
448
449 // Initialize the layout algorithm and map the main frame.
452 MapWindow();
453
454 // Ensure the editor will be visible (not out of the screen's range) when
455 // the user will press the 'More' button, if they didn't move the window.
456 Int_t x, y;
457 UInt_t w, h;
458 gVirtualX->GetWindowSize(GetId(), x, y, w, h);
459 fSMWidth = w;
460 fSMHeight = h;
461 if (fSMWidth < 467) fSMWidth = 467;
462 if (fSMHeight < 708) fSMHeight = 708;
463 Window_t win;
464 gVirtualX->TranslateCoordinates(GetId(), GetParent()->GetId(), 0, 0, x, y, win);
465 x -= 6;
466 y -= 21;
467 MoveResize(x, TMath::Max(TMath::Min(y, (Int_t) (gClient->GetDisplayHeight() - h)), 0), w, h);
468
469 // Only the top level interface is shown, at the begining.
470 DoMoreLess();
471
472 // Connect all widgets (excluding editor).
473 ConnectAll();
474
475 Init();
476}
477
478////////////////////////////////////////////////////////////////////////////////
479/// Destructor.
480
482{
483 // Disconnect all widgets
486
487 if (fPreviewWindow) {
489 delete fPreviewWindow;
490 }
491
492 // Delete every graphical data member,
493 // excluding fPreviewWindow and fLayout[..].
494 gClient->FreePicture(fToolBarNewPic);
495 gClient->FreePicture(fToolBarDeletePic);
496 gClient->FreePicture(fToolBarImportCanvasPic);
497 gClient->FreePicture(fToolBarImportMacroPic);
498 gClient->FreePicture(fToolBarExportPic);
499 gClient->FreePicture(fToolBarHelpPic);
500 gClient->FreePicture(fMakeDefaultPic);
501
502 delete fImportCascade;
503 delete fMenuStyle;
504 delete fMenuHelp;
505 delete fMenuBar;
506
507 delete fToolBar;
508 delete fToolBarNew;
509 delete fToolBarDelete;
511 delete fToolBarImportMacro;
512 delete fToolBarExport;
513 delete fToolBarHelp;
514 delete fHorizontal3DLine;
515
516 delete fListLabel;
517 delete fListComboBox;
518 delete fCurMacro;
519 delete fCurStylabel;
520 delete fCurStyle;
521 delete fCurPadLabel;
522 delete fCurPadTextEntry;
523 delete fCurObjLabel;
524 delete fCurObjTextEntry;
525 delete fPreviewButton;
526 delete fPreviewRealTime;
527 delete fMakeDefault;
528
529 delete fApplyOnGroup;
530 delete fApplyOnAll;
531 delete fApplyOnSel;
532 delete fApplyOnButton;
533 delete fMoreLess;
534
535 delete fFillColor;
536 delete fFillStyle;
537 delete fHatchesLineWidth;
538 delete fHatchesSpacing;
539 delete fTextColor;
540 delete fTextSize;
541 delete fTextSizeInPixels;
542 delete fTextFont;
543 delete fTextAlign;
544 delete fTextAngle;
545 delete fLineColor;
546 delete fLineWidth;
547 delete fLineStyle;
548 delete fLineStyleEdit;
549 delete fMarkerColor;
550 delete fMarkerStyle;
551 delete fMarkerSize;
552 delete fScreenFactor;
553 delete fCanvasColor;
554 delete fCanvasDefX;
555 delete fCanvasDefY;
556 delete fCanvasDefW;
557 delete fCanvasDefH;
558 delete fCanvasBorderMode;
559 delete fCanvasBorderSize;
560 delete fOptDateBool;
561 delete fAttDateTextColor;
562 delete fAttDateTextSize;
564 delete fOptDateFormat;
565 delete fAttDateTextFont;
566 delete fAttDateTextAngle;
567 delete fAttDateTextAlign;
568 delete fDateX;
569 delete fDateY;
570 delete fPadLeftMargin;
571 delete fPadRightMargin;
572 delete fPadTopMargin;
573 delete fPadBottomMargin;
574 delete fPadBorderMode;
575 delete fPadBorderSize;
576 delete fPadColor;
577 delete fPadTickX;
578 delete fPadTickY;
579 delete fPadGridX;
580 delete fPadGridY;
581 delete fGridColor;
582 delete fGridWidth;
583 delete fGridStyle;
584 delete fHistFillColor;
585 delete fHistFillStyle;
586 delete fHistLineColor;
587 delete fHistLineWidth;
588 delete fHistLineStyle;
589 delete fBarWidth;
590 delete fBarOffset;
591 delete fHistMinimumZero;
592 delete fPaintTextFormat;
593 delete fNumberContours;
594 delete fLegoInnerR;
595 delete fFrameFillColor;
596 delete fFrameFillStyle;
597 delete fFrameLineColor;
598 delete fFrameLineWidth;
599 delete fFrameLineStyle;
600 delete fPaletteEdit;
601 delete fFrameBorderMode;
602 delete fFrameBorderSize;
603 delete fFuncColor;
604 delete fFuncWidth;
605 delete fFuncStyle;
606 delete fDrawBorder;
607 delete fEndErrorSize;
608 delete fErrorX;
609 delete fTimeOffsetDate;
610 delete fTimeOffsetTime;
611 delete fStripDecimals;
612 delete fApplyOnXYZ;
613 delete fXTitleSize;
614 delete fXTitleSizeInPixels;
615 delete fXTitleColor;
616 delete fXTitleOffset;
617 delete fXTitleFont;
618 delete fXLabelSize;
619 delete fXLabelSizeInPixels;
620 delete fXLabelColor;
621 delete fXLabelOffset;
622 delete fXLabelFont;
623 delete fXAxisColor;
624 delete fXTickLength;
625 delete fOptLogx;
626 delete fXNdivMain;
627 delete fXNdivSub;
628 delete fXNdivSubSub;
630 delete fYTitleSize;
631 delete fYTitleSizeInPixels;
632 delete fYTitleColor;
633 delete fYTitleOffset;
634 delete fYTitleFont;
635 delete fYLabelSize;
636 delete fYLabelSizeInPixels;
637 delete fYLabelColor;
638 delete fYLabelOffset;
639 delete fYLabelFont;
640 delete fYAxisColor;
641 delete fYTickLength;
642 delete fOptLogy;
643 delete fYNdivMain;
644 delete fYNdivSub;
645 delete fYNdivSubSub;
647 delete fZTitleSize;
648 delete fZTitleSizeInPixels;
649 delete fZTitleColor;
650 delete fZTitleOffset;
651 delete fZTitleFont;
652 delete fZLabelSize;
653 delete fZLabelSizeInPixels;
654 delete fZLabelColor;
655 delete fZLabelOffset;
656 delete fZLabelFont;
657 delete fZAxisColor;
658 delete fZTickLength;
659 delete fOptLogz;
660 delete fZNdivMain;
661 delete fZNdivSub;
662 delete fZNdivSubSub;
664 delete fOptTitle;
665 delete fTitleColor;
666 delete fTitleStyle;
667 delete fTitleTextColor;
668 delete fTitleFontSize;
670 delete fTitleFont;
671 delete fTitleAlign;
673 delete fTitleBorderSize;
674 delete fTitleX;
675 delete fTitleY;
676 delete fTitleW;
677 delete fTitleH;
679 delete fLegendBorderSize;
680 delete fStatColor;
681 delete fStatStyle;
682 delete fStatTextColor;
683 delete fStatFontSize;
685 delete fStatFont;
686 delete fStatX;
687 delete fStatY;
688 delete fStatW;
689 delete fStatH;
691 delete fStatBorderSize;
692 delete fOptStatName;
693 delete fOptStatEntries;
694 delete fOptStatOverflow;
695 delete fOptStatMean;
696 delete fOptStatUnderflow;
697 delete fOptStatRMS;
698 delete fOptStatSkewness;
699 delete fOptStatIntegral;
700 delete fOptStatKurtosis;
701 delete fOptStatErrors;
702 delete fStatFormatLabel;
703 delete fStatFormat;
704 delete fOptFitValues;
705 delete fOptFitErrors;
706 delete fOptFitProbability;
707 delete fOptFitChi;
708 delete fFitFormatLabel;
709 delete fFitFormat;
710 delete fHeaderPS;
711 delete fTitlePS;
712 delete fColorModelPS;
713 delete fColorModelPSRGB;
714 delete fColorModelPSCMYK;
715 delete fLineScalePS;
716 delete fPaperSizePredef;
717 delete fPaperSizeX;
718 delete fPaperSizeY;
719 delete fEditionHelp;
721 delete fEditionReset;
722 delete fEditionButtonFrame;
723 delete fHistosTab;
724 delete fAxisTab;
725 delete fEditionTab;
726 delete fEditionFrame;
727
728 delete fStatusBar;
729
730 // Delete the temporary frames and layout.
731 TObject *obj1;
732 TObject *obj2;
733
734 obj1 = fTrashListFrame->First();
735 while (obj1) {
736 obj2 = fTrashListFrame->After(obj1);
737 fTrashListFrame->Remove(obj1);
738 delete obj1;
739 obj1 = obj2;
740 }
741 delete fTrashListFrame;
742
743 obj1 = fTrashListLayout->First();
744 while (obj1) {
745 obj2 = fTrashListLayout->After(obj1);
747 delete obj1;
748 obj1 = obj2;
749 }
750 delete fTrashListLayout;
751
752 fgStyleManager = 0;
753}
754
755////////////////////////////////////////////////////////////////////////////////
756///static: return style manager
757
759{
760 return fgStyleManager;
761}
762
763////////////////////////////////////////////////////////////////////////////////
764/// Set up the interface. Called by the ctor or by the 'Show' method.
765
767{
768 // Build the list of available styles and select gStyle.
770
771 // Show the current object.
772 if ((gROOT->GetSelectedPad()) && (gROOT->GetSelectedPad()->GetCanvas())) {
773 DoSelectCanvas(gROOT->GetSelectedPad()->GetCanvas(),
774 gROOT->GetSelectedPad()->GetCanvas(), kButton2Down);
775 } else {
777 }
778}
779
780////////////////////////////////////////////////////////////////////////////////
781/// Called to hide the style manager.
782
784{
785 if (fgStyleManager) {
787 }
788}
789
790////////////////////////////////////////////////////////////////////////////////
791/// Called to show the style manager. Static method.
792
794{
795 if (fgStyleManager) {
797 if (!fgStyleManager->IsMapped()) {
799 }
800 } else {
801 TStyleManager::GetSM() = new TStyleManager(gClient->GetRoot());
802 }
803}
804
805////////////////////////////////////////////////////////////////////////////////
806/// Called to delete the style manager. Called when the ROOT session is
807/// closed via a canvas' menu.
808
810{
811 delete fgStyleManager;
812 fgStyleManager = 0;
813}
814
815////////////////////////////////////////////////////////////////////////////////
816/// Add the menu bar to the frame 'p'.
817
819{
820 fMenuBar = new TGMenuBar(p);
821
822 fMenuStyle = new TGPopupMenu(gClient->GetRoot());
823 fMenuStyle->Associate(this);
824 fMenuStyle->AddEntry("&New...", kMenuNew);
825 fMenuStyle->AddEntry("&Delete", kMenuDelete);
827 fMenuStyle->AddEntry("&Rename...", kMenuRename);
829 fImportCascade = new TGPopupMenu(gClient->GetRoot());
833 fMenuStyle->AddPopup("&Import From...", fImportCascade);
834
835 fMenuStyle->AddEntry("&Export...", kMenuExport);
837 fMenuStyle->AddEntry("&Close", kMenuExit);
839 fTrashListLayout->Add(layout1);
840 fMenuBar->AddPopup("&Style", fMenuStyle, layout1);
841
842 fMenuHelp = new TGPopupMenu(gClient->GetRoot());
843 fMenuHelp->Associate(this);
844 fMenuHelp->AddEntry("Top &level", kMenuHelp);
846 fMenuHelp->AddEntry("&General", kMenuHelpGeneral);
849 fMenuHelp->AddEntry("&Histograms", kMenuHelpHistos);
853 fMenuHelp->AddEntry("&PS / PDF", kMenuHelpPSPDF);
855 fTrashListLayout->Add(layout2);
856 fMenuBar->AddPopup("&Help", fMenuHelp, layout2);
857
859}
860
861////////////////////////////////////////////////////////////////////////////////
862/// Create a new style. Called via the menu bar or the tool bar.
863
865{
866 // Open a message box to allow the user to create a new style.
867 new TStyleDialog(this, fCurSelStyle, 1, 0);
868
869 // Create the list of available styles, and select:
870 // - the new style, if it has been created (Ok).
871 // - the previous selected style, if no style has been created (Cancel).
872 if (fLastChoice) BuildList();
874}
875
876////////////////////////////////////////////////////////////////////////////////
877/// Delete the current selected style from the ROOT session.
878/// Called via the menu or the tool bar.
879
881{
882 // Protection: the user is NOT allowed to delete gStyle.
883 // As a consequence, there is always at least one style in the ROOT session.
884 if (fCurSelStyle == gStyle) {
885 printf("Can not delete gStyle.\n");
886 return;
887 }
888
889 delete fCurSelStyle;
890 fCurSelStyle = 0;
891
893}
894
895////////////////////////////////////////////////////////////////////////////////
896/// Rename the current selected style. Called via the menu bar.
897
899{
900 new TStyleDialog(this, fCurSelStyle, 2, 0);
901
902 // Create the list of styles and select the previous selected style.
904}
905
906////////////////////////////////////////////////////////////////////////////////
907/// Save the current selected style in a C++ macro file. Called via the menu
908/// or the tool bar.
909
911{
912 // Create an associated macro and propose a pertinent name to the user.
913 CreateMacro();
914 TString newName;
915 newName.Form("Style_%s.C", fCurSelStyle->GetName());
916
917 // Protection: The user isn't allowed to export a style if the output
918 // file name isn't based on the "Style_*.C" mask, without spaces.
919 char* tmpFileName;
920 const char* tmpBaseName;
921 do {
922 fCurMacro->SetFilename(newName.Data());
923
924 // Open a dialog to ask the user to choose an output file.
925 new TGFileDialog(gClient->GetRoot(), this, kFDSave, fCurMacro);
926 tmpFileName = fCurMacro->fFilename;
927 if (tmpFileName) tmpBaseName = gSystem->BaseName(tmpFileName);
928 else tmpBaseName = 0;
929 } while (tmpBaseName && (strstr(tmpBaseName, "Style_") != tmpBaseName)
930 && (strstr(tmpBaseName, " ") != 0));
931
932 if (tmpBaseName != 0) {
933 // Export the style.
935 fCurMacro->SetFilename(tmpBaseName);
937 }
938
940}
941
942////////////////////////////////////////////////////////////////////////////////
943/// Close the style manager. Called via the menu bar.
944
946{
947// SendCloseMessage(); // Doesn't delete the StyleManager. Hides it.
948 delete this;
949}
950
951////////////////////////////////////////////////////////////////////////////////
952/// Open an help window. Called via the menu bar or the tool bar.
953
955{
956 TRootHelpDialog *hd;
957 switch (i) {
958 case 0:
959 hd = new TRootHelpDialog(this, "Help on General Tab", 600, 400);
961 break;
962 case 1:
963 hd = new TRootHelpDialog(this, "Help on Canvas Tab", 600, 400);
965 break;
966 case 2:
967 hd = new TRootHelpDialog(this, "Help on Pad Tab", 600, 400);
968 hd->SetText(gHelpSMPad);
969 break;
970 case 3:
971 hd = new TRootHelpDialog(this, "Help on Histograms Tab", 600, 400);
973 break;
974 case 4:
975 hd = new TRootHelpDialog(this, "Help on Axis Tab", 600, 400);
976 hd->SetText(gHelpSMAxis);
977 break;
978 case 5:
979 hd = new TRootHelpDialog(this, "Help on Title Tab", 600, 400);
981 break;
982 case 6:
983 hd = new TRootHelpDialog(this, "Help on Stats Tab", 600, 400);
985 break;
986 case 7:
987 hd = new TRootHelpDialog(this, "Help on PS / PDF Tab", 600, 400);
989 break;
990 default:
991 hd = new TRootHelpDialog(this, "Help on Top Level", 600, 400);
993 }
994 hd->Popup();
995}
996
997////////////////////////////////////////////////////////////////////////////////
998/// Create a new style (a copy of gStyle) and import the properties of the
999/// current canvas inside.
1000
1002{
1003 if ((!fCurPad) || (!fCurObj)) return;
1004
1005 new TStyleDialog(this, gStyle, 3, fCurPad);
1006
1007 // Create the list of available style, and select:
1008 // - the new style, if it has been created
1009 // - the previous selected style, if no style has been created (Cancel)
1010 if (fLastChoice) {
1011 BuildList();
1012
1013 // Auto export of the canvas' style.
1014 CreateMacro();
1015 TString newName;
1016 newName.Form("Style_%s.C", fCurSelStyle->GetName());
1017 fCurMacro->SetFilename(newName.Data());
1019 } else {
1021 }
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Create a TGFileInfo concerning a macro, if it doesn't exist already.
1026
1028{
1029 if (fCurMacro) delete fCurMacro;
1030 fCurMacro = new TGFileInfo();
1032 fCurMacro->SetIniDir(".");
1033 fCurMacro->SetFilename(nullptr);
1034}
1035
1036////////////////////////////////////////////////////////////////////////////////
1037/// Add the tool bar to the frame 'p'.
1038
1040{
1041 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 3);
1042 fTrashListLayout->Add(layout1);
1043 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsNormal, 6);
1044 fTrashListLayout->Add(layout2);
1045
1046 fToolBar = new TGToolBar(p);
1047 fToolBarNewPic = gClient->GetPicture("sm_new.xpm");
1049 fToolBarNew->SetStyle(gClient->GetStyle());
1050 fToolBarNew->Associate(this);
1052
1053 fToolBarImportCanvasPic = gClient->GetPicture("sm_import_canvas.xpm");
1058
1059 fToolBarImportMacroPic = gClient->GetPicture("sm_import_macro.xpm");
1061 fToolBarImportMacro->SetStyle(gClient->GetStyle());
1064
1065 fToolBarExportPic = gClient->GetPicture("sm_export.xpm");
1067 fToolBarExport->SetStyle(gClient->GetStyle());
1069 fToolBar->AddFrame(fToolBarExport, layout1);
1070
1071 fToolBarDeletePic = gClient->GetPicture("sm_delete.xpm");
1073 fToolBarDelete->SetStyle(gClient->GetStyle());
1075 fToolBar->AddFrame(fToolBarDelete, layout2);
1076
1077 fToolBarHelpPic = gClient->GetPicture("sm_help.xpm");
1079 fToolBarHelp->SetStyle(gClient->GetStyle());
1080 fToolBarHelp->Associate(this);
1081 fToolBar->AddFrame(fToolBarHelp, layout2);
1082
1086
1087 fToolBarNew->SetToolTipText("Create a new style");
1088 fToolBarDelete->SetToolTipText("Delete the selected style");
1089 fToolBarImportCanvas->SetToolTipText("Import a style from selected canvas");
1090 fToolBarImportMacro->SetToolTipText("Import a style from a macro");
1091 fToolBarExport->SetToolTipText("Export the selected style into a macro");
1092 fToolBarHelp->SetToolTipText("Help about the top level interface");
1093}
1094
1095////////////////////////////////////////////////////////////////////////////////
1096/// Add the top level interface to the frame 'cf'. This part of the
1097/// interface will provide all enable functionalities, excluding the
1098/// edition of styles.
1099
1101{
1102 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2);
1103 fTrashListLayout->Add(layout1);
1104 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 15);
1105 fTrashListLayout->Add(layout2);
1106 TGLayoutHints *layout3 = new TGLayoutHints(kLHintsNormal, 0, 0, 18);
1107 fTrashListLayout->Add(layout3);
1108 TGLayoutHints *layout4 = new TGLayoutHints(kLHintsNormal, 10, 10);
1109 fTrashListLayout->Add(layout4);
1110 TGLayoutHints *layout5 = new TGLayoutHints(kLHintsExpandX, 125);
1111 fTrashListLayout->Add(layout5);
1112 TGLayoutHints *layout6 = new TGLayoutHints(kLHintsNormal, 0, 10, 3);
1113 fTrashListLayout->Add(layout6);
1114 TGLayoutHints *layout7 = new TGLayoutHints(kLHintsNormal, 0, 16, 3);
1115 fTrashListLayout->Add(layout7);
1116 TGLayoutHints *layout8 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10);
1117 fTrashListLayout->Add(layout8);
1118 TGLayoutHints *layout9 = new TGLayoutHints(kLHintsNormal, -15, 0, -5, -10);
1119 fTrashListLayout->Add(layout9);
1120 TGLayoutHints *layout10 = new TGLayoutHints(kLHintsNormal, 15, 0, -5, -10);
1121 fTrashListLayout->Add(layout10);
1122 TGLayoutHints *layout11 = new TGLayoutHints(kLHintsExpandX, 0, 0, 15);
1123 fTrashListLayout->Add(layout11);
1124 TGLayoutHints *layout12 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 5);
1125 fTrashListLayout->Add(layout12);
1126 TGLayoutHints *layout13 = new TGLayoutHints(kLHintsExpandX, 20, 0, 7);
1127 fTrashListLayout->Add(layout13);
1128
1129 TGVerticalFrame *topLevel = new TGVerticalFrame(cf);
1130 fTrashListFrame->AddFirst(topLevel);
1131 TGHorizontalFrame *h1 = new TGHorizontalFrame(topLevel);
1135 fListLabel = new TGLabel(v11, "Available Styles:");
1136 v11->AddFrame(fListLabel);
1138 fListComboBox->Associate(this);
1139 fListComboBox->Resize(200, 22);
1140 v11->AddFrame(fListComboBox, layout1);
1141 h1->AddFrame(v11, fLayoutExpandX);
1144 fMakeDefaultPic = gClient->GetPicture("arrow_right2.xpm");
1146 fMakeDefault->SetStyle(gClient->GetStyle());
1147 fMakeDefault->Associate(this);
1148 fMakeDefault->Resize(40, 22);
1149 v12->AddFrame(fMakeDefault, layout3);
1150 h1->AddFrame(v12, layout4);
1153 fCurStylabel = new TGLabel(v13, "gStyle is set to:");
1154 v13->AddFrame(fCurStylabel);
1155 fCurStyle = new TGTextEntry(v13, "", kTopCurStyle);
1156 fCurStyle->Associate(this);
1158 v13->AddFrame(fCurStyle, layout1);
1159 h1->AddFrame(v13, fLayoutExpandX);
1160 topLevel->AddFrame(h1, fLayoutExpandX);
1161
1162 TGHorizontalFrame *h2 = new TGHorizontalFrame(topLevel);
1164 TGGroupFrame *gf = new TGGroupFrame(h2, "Apply on");
1166 TGVerticalFrame *vf = new TGVerticalFrame(gf);
1168 Pixel_t red;
1169 gClient->GetColorByName("#FF0000", red);
1170 TGHorizontalFrame *selCanvas = new TGHorizontalFrame(vf);
1171 fTrashListFrame->AddFirst(selCanvas);
1172 fCurPadLabel = new TGLabel(selCanvas, "Canvas:");
1173 selCanvas->AddFrame(fCurPadLabel, layout6);
1174 fCurPadTextEntry = new TGTextEntry(selCanvas, "", kTopCurPad);
1178 vf->AddFrame(selCanvas, fLayoutExpandX);
1179 TGHorizontalFrame *selObject = new TGHorizontalFrame(vf);
1180 fTrashListFrame->AddFirst(selObject);
1181 fCurObjLabel = new TGLabel(selObject, "Object:");
1182 selObject->AddFrame(fCurObjLabel, layout7);
1183 fCurObjTextEntry = new TGTextEntry(selObject, "", kTopCurObj);
1188 vf->AddFrame(selObject, layout8);
1191 fApplyOnGroup = new TGHButtonGroup(h4);
1192 fApplyOnAll = new TGRadioButton(fApplyOnGroup, "All canvases", kTopApplyOnAll);
1193 fApplyOnAll->Associate(this);
1194 fApplyOnSel = new TGRadioButton(fApplyOnGroup, "Selected object", kTopApplyOnSel);
1195 fApplyOnSel->Associate(this);
1202 fApplyOnButton = new TGTextButton(h4, "&Apply", kTopApplyOnBut);
1204 fApplyOnButton->Resize(100, 22);
1205 h4->AddFrame(fApplyOnButton, layout13);
1206 vf->AddFrame(h4, fLayoutExpandX);
1207 gf->AddFrame(vf, layout11);
1208 h2->AddFrame(gf, layout12);
1209 topLevel->AddFrame(h2, fLayoutExpandX);
1210
1211 TGHorizontalFrame *h3 = new TGHorizontalFrame(topLevel);
1213 fPreviewButton = new TGCheckButton(h3, "&Preview", kTopPreview);
1215 h3->AddFrame(fPreviewButton, layout6);
1216 fPreviewRealTime = new TGCheckButton(h3, "Run &Time Preview", kTopPreviewRealTime);
1219 h3->AddFrame(fPreviewRealTime, layout6);
1220 fMoreLess = new TGTextButton(h3, "&Close <<", kTopMoreLess);
1221 fMoreLess->Associate(this);
1222 h3->AddFrame(fMoreLess, layout5);
1223 topLevel->AddFrame(h3, fLayoutExpandX);
1224
1225 cf->AddFrame(topLevel, layout2);
1226
1227 fApplyOnButton->SetToolTipText("Apply the selected style on the selected object");
1228 fPreviewButton->SetToolTipText("Show / Hide the preview window");
1229 fPreviewRealTime->SetToolTipText("Continuous / Asynchronous update of the preview");
1230}
1231
1232////////////////////////////////////////////////////////////////////////////////
1233/// Build the list of styles which will appear in the available styles
1234/// combo box. The new style to select is mentioned. If no style has
1235/// been specified, the last entry of the list is selected.
1236
1238{
1239 // Empty the list.
1241
1242 // Build the list of all styles already created in the ROOT session.
1243 Int_t i = 1;
1244 Int_t styleID = 0;
1245 TStyle *tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->First());
1246 while (tmpStyle) {
1247 if (tmpStyle == style) styleID = i;
1248 fListComboBox->AddEntry(tmpStyle->GetName(), i++);
1249 tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->After(tmpStyle));
1250 }
1251
1252 // Select 'style' in the list of available styles.
1253 if (styleID == 0) styleID = i - 1;
1254 fListComboBox->Select(styleID);
1255 DoListSelect();
1257}
1258
1259////////////////////////////////////////////////////////////////////////////////
1260/// Update the content of the status bar: show the name of the current
1261/// selected style, its title and the macro from which it has been imported.
1262
1264{
1267
1268 if ((!strcmp(fCurSelStyle->GetName(), "Default"))
1269 || (!strcmp(fCurSelStyle->GetName(), "Plain" ))
1270 || (!strcmp(fCurSelStyle->GetName(), "Bold" ))
1271 || (!strcmp(fCurSelStyle->GetName(), "Video" ))
1272 || (!strcmp(fCurSelStyle->GetName(), "Pub" ))) {
1273 fStatusBar->SetText("ROOT style", 1);
1274 } else if (fStyleChanged) {
1275 fStatusBar->SetText("User Style _ Not Saved", 1);
1276 } else {
1277 fStatusBar->SetText("User Style", 1);
1278 }
1279}
1280
1281////////////////////////////////////////////////////////////////////////////////
1282/// Update the values of every widget entry in the editor. The new values
1283/// are loaded from the current selected style.
1284
1286{
1287 Double_t delta;
1288 Int_t year;
1289 Int_t month;
1290 Int_t day;
1291 Int_t oneYearInSecs;
1292 Int_t oneMonthInSecs;
1293 Int_t tmp;
1294 Int_t tmp2;
1295 switch (tabNum) {
1296 case 0: // GENERAL
1308 // Nothing to do with fLineStyleEdit.
1310 if (fCurSelStyle->GetTextFont()%10 > 2) {
1313 } else {
1316 }
1320 break;
1321 case 1: // CANVAS
1330 if (fCurSelStyle->GetAttDate()->GetTextFont()%10 > 2) {
1333 } else {
1336 }
1341 fDateX->SetIntNumber((Int_t) (fCurSelStyle->GetDateX()*100 + 0.5));
1342 fDateY->SetIntNumber((Int_t) (fCurSelStyle->GetDateY()*100 + 0.5));
1343
1344 if (fCurSelStyle->GetOptDate()) {
1350// TODO Just delete when ComboBox can be grayed
1351 //fOptDateFormat->SetState(kTRUE);
1352 //ModAttDateTextFont->SetState(kTRUE);
1353 //ModAttDateTextAlign->SetState(kTRUE);
1357 } else {
1362// TODO Just delete when ComboBox can be grayed
1363 //fOptDateFormat->SetState(kFALSE);
1364 //ModAttDateTextFont->SetState(kFALSE);
1365 //ModAttDateTextAlign->SetState(kFALSE);
1369 }
1370 break;
1371 case 2: // PAD
1381 else
1385 else
1389 else
1393 else
1398 break;
1399 case 3: // HISTOS
1409 else
1419 // Nothing to do with fPaletteEdit;
1427 else
1430 fErrorX->SetIntNumber((Int_t) (fCurSelStyle->GetErrorX() * 100 + 0.5));
1431 break;
1432 case 4: // AXIS
1433 delta = fCurSelStyle->GetTimeOffset() - 788918400;
1434 year = 1995;
1435 month = 1;
1436 day = 1;
1437 while (delta < 0) {
1438 year--;
1439 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
1440 else oneYearInSecs = 3600 * 24 * 366;
1441 delta += oneYearInSecs;
1442 }
1443 oneYearInSecs = 3600 * 24 * 365; // because 365 days in 1995.
1444 while (delta >= oneYearInSecs) {
1445 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
1446 else oneYearInSecs = 3600 * 24 * 366;
1447 delta -= oneYearInSecs;
1448 year++;
1449 }
1450 oneMonthInSecs = 3600 * 24 * 31; // because 31 days in January.
1451 while (delta >= oneMonthInSecs) {
1452 month++;
1453 delta -= oneMonthInSecs;
1454 switch (month) {
1455 case 2:
1456 if (year % 4) oneMonthInSecs = 3600 * 24 * 28;
1457 else oneMonthInSecs = 3600 * 24 * 29;
1458 break;
1459 case 3: case 5: case 7: case 8: case 10: case 12:
1460 oneMonthInSecs = 3600 * 24 * 31;
1461 break;
1462 default:
1463 oneMonthInSecs = 3600 * 24 * 30;
1464 }
1465 }
1466 day = (Int_t) delta / (3600 * 24) + 1;
1467 delta = ((Int_t) delta) % (3600 * 24);
1468 fTimeOffsetDate->SetNumber(year*10000 + month*100 + day);
1469 fTimeOffsetTime->SetNumber(delta);
1470
1473 else
1476 if (fCurSelStyle->GetTitleFont("X")%10 > 2) {
1479 } else {
1482 }
1487 if (fCurSelStyle->GetLabelFont("X")%10 > 2) {
1490 } else {
1493 }
1499 if (fCurSelStyle->GetOptLogx())
1501 else
1506 if (fCurSelStyle->GetNdivisions("X") > 0)
1508 else
1511 if (fCurSelStyle->GetTitleFont("Y")%10 > 2) {
1514 } else {
1517 }
1522 if (fCurSelStyle->GetLabelFont("Y")%10 > 2) {
1525 } else {
1528 }
1534 if (fCurSelStyle->GetOptLogy())
1536 else
1541 if (fCurSelStyle->GetNdivisions("Y") > 0)
1543 else
1546 if (fCurSelStyle->GetTitleFont("Z")%10 > 2) {
1549 } else {
1552 }
1557 if (fCurSelStyle->GetLabelFont("Z")%10 > 2) {
1560 } else {
1563 }
1569
1570 if (fCurSelStyle->GetOptLogz())
1572 else
1574
1578 if (fCurSelStyle->GetNdivisions("Z") > 0)
1580 else
1582 break;
1583 case 5: // TITLES
1588 if (fCurSelStyle->GetTitleFont()%10 > 2) {
1591 } else {
1594 }
1599 fTitleX->SetIntNumber((Int_t) (fCurSelStyle->GetTitleX() * 100 + 0.5));
1600 fTitleY->SetIntNumber((Int_t) (fCurSelStyle->GetTitleY() * 100 + 0.5));
1601 fTitleW->SetIntNumber((Int_t) (fCurSelStyle->GetTitleW() * 100 + 0.5));
1602 fTitleH->SetIntNumber((Int_t) (fCurSelStyle->GetTitleH() * 100 + 0.5));
1603
1604 if (fCurSelStyle->GetOptTitle()) {
1612// TODO Just delete when ComboBox can be grayed
1613 //fTitleFont->SetState(kTRUE);
1614 //fTitleAlign->SetState(kTRUE);
1615 //fTitleBorderSize->SetState(kTRUE);
1616 //fLegendBorderSize->SetState(kTRUE);
1621 } else {
1628// TODO Just delete when ComboBox can be grayed
1629 //fTitleFont->SetState(kFALSE);
1630 //fTitleAlign->SetState(kFALSE);
1631 //fTitleBorderSize->SetState(kFALSE);
1632 //fLegendBorderSize->SetState(kFALSE);
1637 }
1638 break;
1639 case 6: // STATS
1644 if (fCurSelStyle->GetStatFont()%10 > 2) {
1647 } else {
1650 }
1652
1658 tmp = fCurSelStyle->GetOptStat();
1659
1660 if (tmp % 10) fOptStatName->SetState(kButtonDown, kFALSE);
1662
1663 if ((tmp/10) % 10) fOptStatEntries->SetState(kButtonDown, kFALSE);
1665
1666 if ((tmp/100) % 10) fOptStatMean->SetState(kButtonDown, kFALSE);
1668
1669 if ((tmp/1000) % 10) fOptStatRMS->SetState(kButtonDown, kFALSE);
1671
1672 if ((tmp/10000) % 10) fOptStatUnderflow->SetState(kButtonDown, kFALSE);
1674
1675 if ((tmp/100000) % 10) fOptStatOverflow->SetState(kButtonDown, kFALSE);
1677
1678 if ((tmp/1000000) % 10) fOptStatIntegral->SetState(kButtonDown, kFALSE);
1680
1681 if ((tmp/10000000) % 10) fOptStatSkewness->SetState(kButtonDown, kFALSE);
1683
1684 if ((tmp/100000000) % 10) fOptStatKurtosis->SetState(kButtonDown, kFALSE);
1686
1687 if ((((tmp/100) % 10) == 2) || (((tmp/1000) % 10) == 2) ||
1688 (((tmp/10000000) % 10) == 2) || (((tmp/100000000) % 10) == 2))
1691
1693 tmp2 = fCurSelStyle->GetOptFit();
1694
1695 if (tmp2 % 10) fOptFitValues->SetState(kButtonDown, kFALSE);
1697
1698 if ((tmp2/10) % 10) {
1701 } else
1703
1704 if ((tmp2/100) % 10) fOptFitChi->SetState(kButtonDown, kFALSE);
1706
1707 if ((tmp2/1000) % 10) fOptFitProbability->SetState(kButtonDown, kFALSE);
1709
1711 break;
1712
1713 case 7: // PS / PDF
1718 Float_t papSizeX;
1719 Float_t papSizeY;
1720 fCurSelStyle->GetPaperSize(papSizeX, papSizeY);
1721 if ((papSizeX == 20) && (papSizeY == 26)) {
1724 fPaperSizeX->SetNumber(papSizeX);
1725 fPaperSizeY->SetNumber(papSizeY);
1726 } else if ((papSizeX == 20) && (papSizeY == 24)) {
1729 fPaperSizeX->SetNumber(papSizeX * 0.394);
1730 fPaperSizeY->SetNumber(papSizeY * 0.394);
1731 } else {
1734 fPaperSizeX->SetNumber(papSizeX);
1735 fPaperSizeY->SetNumber(papSizeY);
1736 }
1737 break;
1738 }
1739}
1740
1741////////////////////////////////////////////////////////////////////////////////
1742/// Connect every entry in the top level interface to the slot.
1743
1745{
1746 Connect("CloseWindow()", "TStyleManager", this, "CloseWindow()");
1747 fMenuStyle->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
1748 fMenuHelp->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
1749 fToolBarNew->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuNew));
1750 fToolBarDelete->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuDelete));
1751 fToolBarImportCanvas->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportCanvas));
1752 fToolBarImportMacro->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportMacro));
1753 fToolBarExport->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuExport));
1754 fToolBarHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelp));
1755 fListComboBox->Connect("Selected(Int_t)", "TStyleManager", this, "DoListSelect()");
1756 fPreviewButton->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoPreview(Bool_t)");
1757 fPreviewRealTime->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoRealTime(Bool_t)");
1758 fMakeDefault->Connect("Clicked()", "TStyleManager", this, "DoMakeDefault()");
1759 fApplyOnGroup->Connect("Clicked(Int_t)", "TStyleManager", this, "DoApplyOnSelect(Int_t)");
1760 fApplyOnButton->Connect("Clicked()", "TStyleManager", this, "DoApplyOn()");
1761 fMoreLess->Connect("Clicked()", "TStyleManager", this, "DoMoreLess()");
1762
1763 fEditionHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelpEditor));
1764 fEditionUpdatePreview->Connect("Clicked()", "TStyleManager", this, "DoEditionUpdatePreview()");
1765 fEditionReset->Connect("Clicked()", "TStyleManager", this, "DoImportMacro(Int_t=kFALSE)");
1766 fEditionTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeTab(Int_t)");
1767 fAxisTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeAxisTab(Int_t)");
1768
1769 // Connect signals emited when the current pad changed.
1770 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)", "TStyleManager",
1771 this, "DoSelectCanvas(TVirtualPad *, TObject *, Int_t)");
1772 TQObject::Connect("TCanvas", "Closed()", "TStyleManager", this, "DoSelectNoCanvas()");
1773}
1774
1775////////////////////////////////////////////////////////////////////////////////
1776/// Disconnect every entry in the top level interface of the slot.
1777
1779{
1780 Disconnect("CloseWindow()");
1781 fMenuStyle->Disconnect("Activated(Int_t)");
1782 fMenuHelp->Disconnect("Activated(Int_t)");
1783 fToolBarNew->Disconnect("Clicked()");
1784 fToolBarDelete->Disconnect("Clicked()");
1785 fToolBarImportCanvas->Disconnect("Clicked()");
1786 fToolBarImportMacro->Disconnect("Clicked()");
1787 fToolBarExport->Disconnect("Clicked()");
1788 fToolBarHelp->Disconnect("Clicked()");
1789 fListComboBox->Disconnect("Selected(Int_t)");
1790 fPreviewButton->Disconnect("Toggled(Bool_t)");
1791 fMakeDefault->Disconnect("Clicked()");
1792 fApplyOnGroup->Disconnect("Clicked(Int_t)");
1793 fApplyOnButton->Disconnect("Clicked()");
1794 fMoreLess->Disconnect("Clicked()");
1795
1796 fEditionHelp->Disconnect("Clicked()");
1797 fEditionUpdatePreview->Disconnect("Clicked()");
1798 fEditionReset->Disconnect("Clicked()");
1799 fEditionTab->Disconnect("Selected(Int_t)");
1800
1801 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
1802 TQObject::Disconnect("TCanvas", "Closed()");
1803}
1804
1805////////////////////////////////////////////////////////////////////////////////
1806/// Connect every widget entry of the editor to its specific slot.
1807
1809{
1810 if (fSigSlotConnected) return;
1812
1813 switch (tabNum) {
1814 case 0: // GENERAL
1815 fFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFillColor()");
1816 fFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFillStyle()");
1817 fHatchesLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHatchesLineWidth()");
1818 fHatchesSpacing->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModHatchesSpacing()");
1819 fMarkerColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModMarkerColor()");
1820 fMarkerStyle->Connect("MarkerSelected(Style_t)", "TStyleManager", this, "ModMarkerStyle()");
1821 fMarkerSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModMarkerSize()");
1822 fScreenFactor->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModScreenFactor()");
1823 fLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModLineColor()");
1824 fLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineWidth()");
1825 fLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineStyle()");
1826 fLineStyleEdit->Connect("Clicked()", "TStyleManager", this, "ModLineStyleEdit()");
1827 fTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTextColor()");
1828 fTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextSize()");
1829 fTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTextSizeInPixels(Bool_t)");
1830 fTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextFont()");
1831 fTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextAlign()");
1832 fTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextAngle()");
1833 break;
1834 case 1: // CANVAS
1835 fCanvasColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModCanvasColor()");
1836 fCanvasDefX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefX()");
1837 fCanvasDefY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefY()");
1838 fCanvasDefW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefW()");
1839 fCanvasDefH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefH()");
1840 fCanvasBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModCanvasBorderMode()");
1841 fCanvasBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModCanvasBorderSize()");
1842 fOptDateBool->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptDateBool()");
1843 fAttDateTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModAttDateTextColor()");
1844 fAttDateTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextSize()");
1845 fAttDateTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModAttDateTextSizeInPixels(Bool_t)");
1846 fOptDateFormat->Connect("Selected(Int_t)", "TStyleManager", this, "ModOptDateFormat()");
1847 fAttDateTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextFont()");
1848 fAttDateTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextAngle()");
1849 fAttDateTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextAlign()");
1850 fDateX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateX()");
1851 fDateY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateY()");
1852 break;
1853 case 2: // PAD
1854 fPadTopMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadTopMargin()");
1855 fPadBottomMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadBottomMargin()");
1856 fPadLeftMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadLeftMargin()");
1857 fPadRightMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadRightMargin()");
1858 fPadBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModPadBorderMode()");
1859 fPadBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModPadBorderSize()");
1860 fPadColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModPadColor()");
1861 fPadTickX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickX()");
1862 fPadTickY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickY()");
1863 fPadGridX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridX()");
1864 fPadGridY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridY()");
1865 fGridColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModGridColor()");
1866 fGridWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridWidth()");
1867 fGridStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridStyle()");
1868 break;
1869 case 3: // HISTOS
1870 fHistFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistFillColor()");
1871 fHistFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModHistFillStyle()");
1872 fHistLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistLineColor()");
1873 fHistLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineWidth()");
1874 fHistLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineStyle()");
1875 fBarWidth->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarWidth()");
1876 fBarOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarOffset()");
1877 fHistMinimumZero->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModHistMinimumZero()");
1878 fPaintTextFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModPaintTextFormat()");
1879 fNumberContours->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModNumberContours()");
1880 fLegoInnerR->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLegoInnerR()");
1881 fFrameFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameFillColor()");
1882 fFrameFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFrameFillStyle()");
1883 fFrameLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameLineColor()");
1884 fFrameLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineWidth()");
1885 fFrameLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineStyle()");
1886 fPaletteEdit->Connect("Clicked()", "TStyleManager", this, "ModPaletteEdit()");
1887 fFrameBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModFrameBorderMode()");
1888 fFrameBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameBorderSize()");
1889 fFuncColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFuncColor()");
1890 fFuncWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncWidth()");
1891 fFuncStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncStyle()");
1892 fDrawBorder->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModDrawBorder()");
1893 fEndErrorSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModEndErrorSize()");
1894 fErrorX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModErrorX()");
1895 break;
1896 case 4: // AXIS
1897 fTimeOffsetDate->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
1898 fTimeOffsetTime->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
1899 fStripDecimals->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStripDecimals()");
1900 fApplyOnXYZ->Connect("Clicked()", "TStyleManager", this, "ModApplyOnXYZ()");
1901 fXTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleSize()");
1902 fXTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXTitleSizeInPixels(Bool_t)");
1903 fXTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXTitleColor()");
1904 fXTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleOffset()");
1905 fXTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXTitleFont()");
1906 fXLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelSize()");
1907 fXLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXLabelSizeInPixels(Bool_t)");
1908 fXLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXLabelColor()");
1909 fXLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelOffset()");
1910 fXLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXLabelFont()");
1911 fXAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXAxisColor()");
1912 fXTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTickLength()");
1913 fOptLogx->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogx()");
1914 fXNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1915 fXNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1916 fXNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1917 fXNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXNdivisions()");
1918 fYTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleSize()");
1919 fYTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYTitleSizeInPixels(Bool_t)");
1920 fYTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYTitleColor()");
1921 fYTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleOffset()");
1922 fYTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYTitleFont()");
1923 fYLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelSize()");
1924 fYLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYLabelSizeInPixels(Bool_t)");
1925 fYLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYLabelColor()");
1926 fYLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelOffset()");
1927 fYLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYLabelFont()");
1928 fYAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYAxisColor()");
1929 fYTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTickLength()");
1930 fOptLogy->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogy()");
1931 fYNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1932 fYNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1933 fYNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1934 fYNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYNdivisions()");
1935 fZTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleSize()");
1936 fZTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZTitleSizeInPixels(Bool_t)");
1937 fZTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZTitleColor()");
1938 fZTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleOffset()");
1939 fZTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZTitleFont()");
1940 fZLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelSize()");
1941 fZLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZLabelSizeInPixels(Bool_t)");
1942 fZLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZLabelColor()");
1943 fZLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelOffset()");
1944 fZLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZLabelFont()");
1945 fZAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZAxisColor()");
1946 fZTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTickLength()");
1947 fOptLogz->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogz()");
1948 fZNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1949 fZNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1950 fZNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1951 fZNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZNdivisions()");
1952 break;
1953 case 5: // TITLES
1954 fOptTitle->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptTitle()");
1955 fTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleFillColor()");
1956 fTitleStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModTitleStyle()");
1957 fTitleTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleTextColor()");
1958 fTitleFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleFontSize()");
1959 fTitleFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTitleFontSizeInPixels(Bool_t)");
1960 fTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleFont()");
1961 fTitleAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleAlign()");
1962 fTitleBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleBorderSize()");
1963 fTitleX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleX()");
1964 fTitleY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleY()");
1965 fTitleW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleW()");
1966 fTitleH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleH()");
1967 fLegendBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModLegendBorderSize()");
1968 break;
1969 case 6: // STATS
1970 fStatColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatColor(Pixel_t)");
1971 fStatStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModStatStyle(Style_t)");
1972 fStatTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatTextColor(Pixel_t)");
1973 fStatFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatFontSize()");
1974 fStatFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStatFontSizeInPixels(Bool_t)");
1975 fStatFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatFont()");
1976 fStatX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatX()");
1977 fStatY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatY()");
1978 fStatW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatW()");
1979 fStatH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatH()");
1980 fStatBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatBorderSize()");
1981 fOptStatName->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1982 fOptStatEntries->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1983 fOptStatOverflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1984 fOptStatMean->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1985 fOptStatUnderflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1986 fOptStatRMS->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1987 fOptStatSkewness->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1988 fOptStatIntegral->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1989 fOptStatKurtosis->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1990 fOptStatErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1991 fStatFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModStatFormat(const char *)");
1992 fOptFitValues->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1993 fOptFitErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1994 fOptFitProbability->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1995 fOptFitChi->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1996 fFitFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModFitFormat(const char *)");
1997 break;
1998 case 7: // PS / PDF
1999 fHeaderPS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModHeaderPS()");
2000 fTitlePS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModTitlePS()");
2001 fColorModelPS->Connect("Clicked(Int_t)", "TStyleManager", this, "ModColorModelPS()");
2002 fLineScalePS->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLineScalePS()");
2003 fPaperSizePredef->Connect("Selected(Int_t)", "TStyleManager", this, "ModPaperSizePredef()");
2004 fPaperSizeX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
2005 fPaperSizeY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
2006 break;
2007 }
2008}
2009
2010////////////////////////////////////////////////////////////////////////////////
2011/// Disconnect every widget entry of the editor from its slot. Must be
2012/// called before UpdateEditor() to avoid recursive calls.
2013
2015{
2016 if (!fSigSlotConnected) return;
2018
2019 switch (tabNum) {
2020 case 0: // GENERAL
2021 fFillColor->Disconnect("ColorSelected(Pixel_t)");
2022 fFillStyle->Disconnect("PatternSelected(Style_t)");
2023 fHatchesLineWidth->Disconnect("Selected(Int_t)");
2024 fHatchesSpacing->Disconnect("ValueSet(Long_t)");
2025 fMarkerColor->Disconnect("ColorSelected(Pixel_t)");
2026 fMarkerStyle->Disconnect("MarkerSelected(Style_t)");
2027 fMarkerSize->Disconnect("Selected(Int_t)");
2028 fScreenFactor->Disconnect("ValueSet(Long_t)");
2029 fLineColor->Disconnect("ColorSelected(Pixel_t)");
2030 fLineWidth->Disconnect("Selected(Int_t)");
2031 fLineStyle->Disconnect("Selected(Int_t)");
2032 fLineStyleEdit->Disconnect("Clicked()");
2033 fTextColor->Disconnect("ColorSelected(Pixel_t)");
2034 fTextSize->Disconnect("ValueSet(Long_t)");
2035 fTextFont->Disconnect("Selected(Int_t)");
2036 fTextAlign->Disconnect("Selected(Int_t)");
2037 fTextAngle->Disconnect("ValueSet(Long_t)");
2038 break;
2039 case 1: // CANVAS
2040 fCanvasColor->Disconnect("ColorSelected(Pixel_t)");
2041 fCanvasDefX->Disconnect("ValueSet(Long_t)");
2042 fCanvasDefY->Disconnect("ValueSet(Long_t)");
2043 fCanvasDefW->Disconnect("ValueSet(Long_t)");
2044 fCanvasDefH->Disconnect("ValueSet(Long_t)");
2045 fCanvasBorderMode->Disconnect("Clicked(Int_t)");
2046 fCanvasBorderSize->Disconnect("Selected(Int_t)");
2047 fOptDateBool->Disconnect("Toggled(Bool_t)");
2048 fAttDateTextColor->Disconnect("ColorSelected(Pixel_t)");
2049 fAttDateTextSize->Disconnect("ValueSet(Long_t)");
2050 fOptDateFormat->Disconnect("Selected(Int_t)");
2051 fAttDateTextFont->Disconnect("Selected(Int_t)");
2052 fAttDateTextAngle->Disconnect("ValueSet(Long_t)");
2053 fAttDateTextAlign->Disconnect("Selected(Int_t)");
2054 fDateX->Disconnect("ValueSet(Long_t)");
2055 fDateY->Disconnect("ValueSet(Long_t)");
2056 break;
2057 case 2: // PAD
2058 fPadTopMargin->Disconnect("ValueSet(Long_t)");
2059 fPadBottomMargin->Disconnect("ValueSet(Long_t)");
2060 fPadLeftMargin->Disconnect("ValueSet(Long_t)");
2061 fPadRightMargin->Disconnect("ValueSet(Long_t)");
2062 fPadBorderMode->Disconnect("Clicked(Int_t)");
2063 fPadBorderSize->Disconnect("Selected(Int_t)");
2064 fPadColor->Disconnect("ColorSelected(Pixel_t)");
2065 fPadTickX->Disconnect("Toggled(Bool_t)");
2066 fPadTickY->Disconnect("Toggled(Bool_t)");
2067 fPadGridX->Disconnect("Toggled(Bool_t)");
2068 fPadGridY->Disconnect("Toggled(Bool_t)");
2069 fGridColor->Disconnect("ColorSelected(Pixel_t)");
2070 fGridWidth->Disconnect("Selected(Int_t)");
2071 fGridStyle->Disconnect("Selected(Int_t)");
2072 break;
2073 case 3: // HISTOS
2074 fHistFillColor->Disconnect("ColorSelected(Pixel_t)");
2075 fHistFillStyle->Disconnect("PatternSelected(Style_t)");
2076 fHistLineColor->Disconnect("ColorSelected(Pixel_t)");
2077 fHistLineWidth->Disconnect("Selected(Int_t)");
2078 fHistLineStyle->Disconnect("Selected(Int_t)");
2079 fBarWidth->Disconnect("ValueSet(Long_t)");
2080 fBarOffset->Disconnect("ValueSet(Long_t)");
2081 fHistMinimumZero->Disconnect("Toggled(Bool_t)");
2082 fPaintTextFormat->Disconnect("TextChanged(const char *)");
2083 fNumberContours->Disconnect("ValueSet(Long_t)");
2084 fLegoInnerR->Disconnect("ValueSet(Long_t)");
2085 fFrameFillColor->Disconnect("ColorSelected(Pixel_t)");
2086 fFrameFillStyle->Disconnect("PatternSelected(Style_t)");
2087 fFrameLineColor->Disconnect("ColorSelected(Pixel_t)");
2088 fFrameLineWidth->Disconnect("Selected(Int_t)");
2089 fFrameLineStyle->Disconnect("Selected(Int_t)");
2090 fPaletteEdit->Disconnect("Clicked()");
2091 fFrameBorderMode->Disconnect("Clicked(Int_t)");
2092 fFrameBorderSize->Disconnect("Selected(Int_t)");
2093 fFuncColor->Disconnect("ColorSelected(Pixel_t)");
2094 fFuncWidth->Disconnect("Selected(Int_t)");
2095 fFuncStyle->Disconnect("Selected(Int_t)");
2096 fDrawBorder->Disconnect("Toggled(Bool_t)");
2097 fEndErrorSize->Disconnect("ValueSet(Long_t)");
2098 fErrorX->Disconnect("ValueSet(Long_t)");
2099 break;
2100 case 4: // AXIS
2101 fTimeOffsetDate->Disconnect("ValueSet(Long_t)");
2102 fTimeOffsetTime->Disconnect("ValueSet(Long_t)");
2103 fStripDecimals->Disconnect("Toggled(Bool_t)");
2104 fApplyOnXYZ->Disconnect("Clicked()");
2105 fXTitleSize->Disconnect("ValueSet(Long_t)");
2106 fXTitleColor->Disconnect("ColorSelected(Pixel_t)");
2107 fXTitleOffset->Disconnect("ValueSet(Long_t)");
2108 fXTitleFont->Disconnect("Selected(Int_t)");
2109 fXLabelSize->Disconnect("ValueSet(Long_t)");
2110 fXLabelColor->Disconnect("ColorSelected(Pixel_t)");
2111 fXLabelOffset->Disconnect("ValueSet(Long_t)");
2112 fXLabelFont->Disconnect("Selected(Int_t)");
2113 fXAxisColor->Disconnect("ColorSelected(Pixel_t)");
2114 fXTickLength->Disconnect("ValueSet(Long_t)");
2115 fOptLogx->Disconnect("Toggled(Bool_t)");
2116 fXNdivMain->Disconnect("ValueSet(Long_t)");
2117 fXNdivSub->Disconnect("ValueSet(Long_t)");
2118 fXNdivSubSub->Disconnect("ValueSet(Long_t)");
2119 fXNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2120 fYTitleSize->Disconnect("ValueSet(Long_t)");
2121 fYTitleColor->Disconnect("ColorSelected(Pixel_t)");
2122 fYTitleOffset->Disconnect("ValueSet(Long_t)");
2123 fYTitleFont->Disconnect("Selected(Int_t)");
2124 fYLabelSize->Disconnect("ValueSet(Long_t)");
2125 fYLabelColor->Disconnect("ColorSelected(Pixel_t)");
2126 fYLabelOffset->Disconnect("ValueSet(Long_t)");
2127 fYLabelFont->Disconnect("Selected(Int_t)");
2128 fYAxisColor->Disconnect("ColorSelected(Pixel_t)");
2129 fYTickLength->Disconnect("ValueSet(Long_t)");
2130 fOptLogy->Disconnect("Toggled(Bool_t)");
2131 fYNdivMain->Disconnect("ValueSet(Long_t)");
2132 fYNdivSub->Disconnect("ValueSet(Long_t)");
2133 fYNdivSubSub->Disconnect("ValueSet(Long_t)");
2134 fYNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2135 fZTitleSize->Disconnect("ValueSet(Long_t)");
2136 fZTitleColor->Disconnect("ColorSelected(Pixel_t)");
2137 fZTitleOffset->Disconnect("ValueSet(Long_t)");
2138 fZTitleFont->Disconnect("Selected(Int_t)");
2139 fZLabelSize->Disconnect("ValueSet(Long_t)");
2140 fZLabelColor->Disconnect("ColorSelected(Pixel_t)");
2141 fZLabelOffset->Disconnect("ValueSet(Long_t)");
2142 fZLabelFont->Disconnect("Selected(Int_t)");
2143 fZAxisColor->Disconnect("ColorSelected(Pixel_t)");
2144 fZTickLength->Disconnect("ValueSet(Long_t)");
2145 fOptLogz->Disconnect("Toggled(Bool_t)");
2146 fZNdivMain->Disconnect("ValueSet(Long_t)");
2147 fZNdivSub->Disconnect("ValueSet(Long_t)");
2148 fZNdivSubSub->Disconnect("ValueSet(Long_t)");
2149 fZNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2150 break;
2151 case 5: // TITLES
2152 fOptTitle->Disconnect("Toggled(Bool_t)");
2153 fTitleColor->Disconnect("ColorSelected(Pixel_t)");
2154 fTitleStyle->Disconnect("PatternSelected(Style_t)");
2155 fTitleTextColor->Disconnect("ColorSelected(Pixel_t)");
2156 fTitleFontSize->Disconnect("ValueSet(Long_t)");
2157 fTitleFont->Disconnect("Selected(Int_t)");
2158 fTitleAlign->Disconnect("Selected(Int_t)");
2159 fTitleBorderSize->Disconnect("Selected(Int_t)");
2160 fTitleX->Disconnect("ValueSet(Long_t)");
2161 fTitleY->Disconnect("ValueSet(Long_t)");
2162 fTitleW->Disconnect("ValueSet(Long_t)");
2163 fTitleH->Disconnect("ValueSet(Long_t)");
2164 fLegendBorderSize->Disconnect("Selected(Int_t)");
2165 break;
2166 case 6: // STATS
2167 fStatColor->Disconnect("ColorSelected(Pixel_t)");
2168 fStatStyle->Disconnect("PatternSelected(Style_t)");
2169 fStatTextColor->Disconnect("ColorSelected(Pixel_t)");
2170 fStatFontSize->Disconnect("ValueSet(Long_t)");
2171 fStatFont->Disconnect("Selected(Int_t)");
2172 fStatX->Disconnect("ValueSet(Long_t)");
2173 fStatY->Disconnect("ValueSet(Long_t)");
2174 fStatW->Disconnect("ValueSet(Long_t)");
2175 fStatH->Disconnect("ValueSet(Long_t)");
2176 fStatBorderSize->Disconnect("Selected(Int_t)");
2177 fOptStatName->Disconnect("Toggled(Bool_t)");
2178 fOptStatEntries->Disconnect("Toggled(Bool_t)");
2179 fOptStatOverflow->Disconnect("Toggled(Bool_t)");
2180 fOptStatMean->Disconnect("Toggled(Bool_t)");
2181 fOptStatUnderflow->Disconnect("Toggled(Bool_t)");
2182 fOptStatRMS->Disconnect("Toggled(Bool_t)");
2183 fOptStatSkewness->Disconnect("Toggled(Bool_t)");
2184 fOptStatIntegral->Disconnect("Toggled(Bool_t)");
2185 fOptStatKurtosis->Disconnect("Toggled(Bool_t)");
2186 fOptStatErrors->Disconnect("Toggled(Bool_t)");
2187 fStatFormat->Disconnect("TextChanged(const char *)");
2188 fOptFitValues->Disconnect("Toggled(Bool_t)");
2189 fOptFitErrors->Disconnect("Toggled(Bool_t)");
2190 fOptFitProbability->Disconnect("Toggled(Bool_t)");
2191 fOptFitChi->Disconnect("Toggled(Bool_t)");
2192 fFitFormat->Disconnect("TextChanged(const char *)");
2193 break;
2194 case 7: // PS / PDF
2195 fHeaderPS->Disconnect("TextChanged(const char *)");
2196 fTitlePS->Disconnect("TextChanged(const char *)");
2197 fColorModelPS->Disconnect("Clicked(Int_t)");
2198 fLineScalePS->Disconnect("ValueSet(Long_t)");
2199 fPaperSizePredef->Disconnect("Selected(Int_t)");
2200 fPaperSizeX->Disconnect("ValueSet(Long_t)");
2201 fPaperSizeY->Disconnect("ValueSet(Long_t)");
2202 break;
2203 }
2204}
2205
2206////////////////////////////////////////////////////////////////////////////////
2207/// Called each time something is changed in the style editor. Thanks to
2208/// this method, we can know if the style differs from the original style.
2209
2211{
2213
2214 // Update the status bar.
2216
2217 // Update the preview if the real time mode is selected.
2218 if (fRealTimePreview)
2220}
2221
2222////////////////////////////////////////////////////////////////////////////////
2223/// Add the editor to the frame 'p'. It contains the tabs allowing the user
2224/// to modify every data member of the current TStyle object.
2225
2227{
2228 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 8, 8, 5, 5);
2229 fTrashListLayout->Add(layout1);
2230 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10, 10);
2231 fTrashListLayout->Add(layout2);
2232
2235
2236 fEditionTab = new TGTab(fEditionFrame, 200, 150);
2237 fEditionTab->Associate(this);
2238 CreateTabGeneral(fEditionTab->AddTab("General"));
2241 CreateTabHistos(fEditionTab->AddTab("Histograms"));
2245 CreateTabPsPdf(fEditionTab->AddTab("PS / PDF"));
2247
2250 fEditionHelp->Associate(this);
2257 fEditionReset->Associate(this);
2260
2261 p->AddFrame(fEditionFrame, layout1);
2262
2263 fEditionHelp->SetToolTipText("Help about the current tab");
2264 fEditionUpdatePreview->SetToolTipText("Force the refresh of the preview window");
2265 fEditionReset->SetToolTipText("Reset the selected style");
2266}
2267
2268////////////////////////////////////////////////////////////////////////////////
2269/// Add the tab 'General' to the editor.
2270
2272{
2273 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
2274 fTrashListLayout->Add(layout);
2275
2280 tab->AddFrame(h1, fLayoutExpandX);
2281
2282 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2284 AddGeneralText(h2);
2291 "Screen factor:", 0, 6, TGNumberFormat::kNESRealOne,
2294 v->AddFrame(h3, layout);
2296 tab->AddFrame(h2, fLayoutExpandX);
2297
2298 fScreenFactor->GetNumberEntry()->SetToolTipText("Coefficient for different screen's resolutions");
2299}
2300
2301////////////////////////////////////////////////////////////////////////////////
2302/// Add the 'Fill' group frame to the 'General' tab.
2303
2305{
2306 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 5, 0, 5, 5);
2307 fTrashListLayout->Add(layout2);
2308
2309 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2316 AddTitle(gf, "Hatchings");
2324 gf->AddFrame(h2, layout2);
2325 f->AddFrame(gf, fLayoutExpandXYMargin);
2326
2327// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2328// fFillColor->SetToolTipText("General fill color");
2329// fFillStyle->SetToolTipText("General fill pattern");
2330 fHatchesSpacing->GetNumberEntry()->SetToolTipText("Spacing between the hatching's lines");
2331}
2332
2333////////////////////////////////////////////////////////////////////////////////
2334/// Add the 'Line' group frame to the 'General' tab.
2335
2337{
2338 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2346 fLineStyleEdit = AddTextButton(gf, "Lines' Style Editor...", kGeneralLineStyleEdit);
2348 f->AddFrame(gf, fLayoutExpandXYMargin);
2349
2350// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2351// fLineColor->SetToolTipText("General line color");
2352}
2353
2354////////////////////////////////////////////////////////////////////////////////
2355/// Add the 'Text' group frame to the 'General' tab.
2356
2358{
2359 TGGroupFrame *gf = new TGGroupFrame(f, "Text");
2370 fTextSize = AddNumberEntry(h2, 21, 10, 0, kGeneralTextSize, "Size:", 0, 5,
2374 gf->AddFrame(h2, fLayoutExpandX);
2375 fTextAngle = AddNumberEntry(gf, 0, 0, 0, kGeneralTextAngle, "Angle:",
2379 f->AddFrame(gf, fLayoutExpandXYMargin);
2380
2381// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2382// fTextColor->SetToolTipText("General text color");
2383 fTextSizeInPixels->SetToolTipText("Set the text size in pixels if selected, otherwise - in % of pad.");
2384 fTextSize->GetNumberEntry()->SetToolTipText("General text size (in pixels or in % of pad)");
2385 fTextAngle->GetNumberEntry()->SetToolTipText("General text angle");
2386}
2387
2388////////////////////////////////////////////////////////////////////////////////
2389/// Add the 'Marker' group frame to the 'General' tab.
2390
2392{
2393 TGGroupFrame *gf = new TGGroupFrame(f, "Marker");
2401 f->AddFrame(gf, fLayoutExpandXMargin);
2402
2403// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2404// fMarkerColor->SetToolTipText("Marker color");
2405// fMarkerStyle->SetToolTipText("Marker shape");
2406}
2407
2408////////////////////////////////////////////////////////////////////////////////
2409/// Add the tab 'Canvas' to the editor.
2410
2412{
2420 h->AddFrame(v1, fLayoutExpandXY);
2424 h->AddFrame(v2, fLayoutExpandXY);
2425 tab->AddFrame(h, fLayoutExpandX);
2426}
2427
2428////////////////////////////////////////////////////////////////////////////////
2429/// Add the 'Fill' group frame to the 'Canvas' tab.
2430
2432{
2433 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2439 f->AddFrame(gf, fLayoutExpandXMargin);
2440
2441// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2442// fCanvasColor->SetToolTipText("Color used to fill canvases");
2443}
2444
2445////////////////////////////////////////////////////////////////////////////////
2446/// Add the 'Geometry' group frame to the 'Canvas' tab.
2447
2449{
2450 TGGroupFrame *gf = new TGGroupFrame(f, "Geometry");
2454 fCanvasDefX = AddNumberEntry(h1, 0, 9, 0, kCanvasDefX, "X:",
2458 fCanvasDefY = AddNumberEntry(h1, 7, 8, 0, kCanvasDefY, "Y:",
2463
2466 fCanvasDefW = AddNumberEntry(h2, 0, 7, 0, kCanvasDefW, "W:",
2470 fCanvasDefH = AddNumberEntry(h2, 7, 8, 0, kCanvasDefH, "H:",
2474 gf->AddFrame(h2, fLayoutExpandX);
2475 f->AddFrame(gf, fLayoutExpandXMargin);
2476
2477 fCanvasDefX->GetNumberEntry()->SetToolTipText("Canvases' default abscissa");
2478 fCanvasDefY->GetNumberEntry()->SetToolTipText("Canvases' default ordinate");
2479 fCanvasDefW->GetNumberEntry()->SetToolTipText("Canvases' default width");
2480 fCanvasDefH->GetNumberEntry()->SetToolTipText("Canvases' default height");
2481}
2482
2483////////////////////////////////////////////////////////////////////////////////
2484/// Add the 'Border' group frame to the 'Canvas' tab.
2485
2487{
2490}
2491
2492////////////////////////////////////////////////////////////////////////////////
2493/// Add the 'Date' group frame to the 'Canvas' tab.
2494
2496{
2497 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10);
2498 fTrashListLayout->Add(layout2);
2499
2500 TGGroupFrame *gf = new TGGroupFrame(f, "Date");
2510 fAttDateTextSize = AddNumberEntry(h2, 22, 10, 0, kCanvasAttDateTextSize, "Size:", 0, 5,
2514 gf->AddFrame(h2, fLayoutExpandX);
2519 "Angle:", 0, 6, TGNumberFormat::kNESInteger,
2522 AddTitle(gf, "Position");
2523 TGVerticalFrame *h3 = new TGVerticalFrame(gf);
2525 fDateX = AddNumberEntry(h3, 0, 0, 0, kCanvasDateX, "X (% of Pad):",
2529 fDateY = AddNumberEntry(h3, 0, 0, 0, kCanvasDateY, "Y (% of Pad):",
2533 gf->AddFrame(h3, layout2);
2534 f->AddFrame(gf, fLayoutExpandXYMargin);
2535
2536 fOptDateBool->SetToolTipText("Show / Hide the date in canvases");
2537// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2538// fAttDateTextColor->SetToolTipText("Color of the date text");
2539 fAttDateTextSizeInPixels->SetToolTipText("Set the date text size in pixels if selected, otherwise - in % of pad");
2540 fAttDateTextSize->GetNumberEntry()->SetToolTipText("Date text size (in pixels or in % of pad)");
2541 fAttDateTextAngle->GetNumberEntry()->SetToolTipText("Date text angle");
2542 fDateX->GetNumberEntry()->SetToolTipText("Date abscissa in percent of pad");
2543 fDateY->GetNumberEntry()->SetToolTipText("Date ordinate in percent of pad");
2544}
2545
2546////////////////////////////////////////////////////////////////////////////////
2547/// Add the tab 'Pad' to the editor.
2548
2550{
2556 AddPadFill(v);
2557 AddPadTicks(v);
2558 h1->AddFrame(v, fLayoutExpandXY);
2559 tab->AddFrame(h1, fLayoutExpandX);
2560 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2562 AddPadBorder(h2);
2563 AddPadGrid(h2);
2564 tab->AddFrame(h2, fLayoutExpandX);
2565}
2566
2567////////////////////////////////////////////////////////////////////////////////
2568/// Add the 'Margin' group frame to the 'Pad' tab.
2569
2571{
2572 TGGroupFrame *gf = new TGGroupFrame(f, "Margin (% of Pad)");
2576 fPadLeftMargin = AddNumberEntry(h1, 0, 5, 0, kPadLeftMargin, "Left:",
2580 fPadRightMargin = AddNumberEntry(h1, 0, 0, 0, kPadRightMargin, "Right:",
2587 fPadTopMargin = AddNumberEntry(h2, 0, 5, 0, kPadTopMargin, "Top:",
2591 fPadBottomMargin = AddNumberEntry(h2, 0, 0, 0, kPadBottomMargin, "Bottom:",
2595 gf->AddFrame(h2, fLayoutExpandXY);
2596 f->AddFrame(gf, fLayoutExpandXYMargin);
2597
2598 fPadLeftMargin->GetNumberEntry()->SetToolTipText("Pads' left margin");
2599 fPadRightMargin->GetNumberEntry()->SetToolTipText("Pads' right margin");
2600 fPadTopMargin->GetNumberEntry()->SetToolTipText("Pads' top margin");
2601 fPadBottomMargin->GetNumberEntry()->SetToolTipText("Pads' bottom margin");
2602}
2603
2604////////////////////////////////////////////////////////////////////////////////
2605/// Add the 'Border' group frame to the 'Pad' tab.
2606
2608{
2611}
2612
2613////////////////////////////////////////////////////////////////////////////////
2614/// Add the 'Fill' group frame to the 'Pad' tab.
2615
2617{
2618 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2624 f->AddFrame(gf, fLayoutExpandXYMargin);
2625
2626// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2627// fPadColor->SetToolTipText("Color used to fill pads");
2628}
2629
2630////////////////////////////////////////////////////////////////////////////////
2631/// Add the 'Ticks' group frame to the 'Pad' tab.
2632
2634{
2635 TGGroupFrame *gf = new TGGroupFrame(f, "Ticks");
2641 fPadTickX = AddCheckButton(h1, "Along X", kPadTickX);
2642 h->AddFrame(h1, fLayoutExpandX);
2645 fPadTickY = AddCheckButton(h2, "Along Y", kPadTickY);
2646 h->AddFrame(h2, fLayoutExpandX);
2648 f->AddFrame(gf, fLayoutExpandXYMargin);
2649
2650 fPadTickX->SetToolTipText("Show / Hide the ticks along X");
2651 fPadTickY->SetToolTipText("Show / Hide the ticks along Y");
2652}
2653
2654////////////////////////////////////////////////////////////////////////////////
2655/// Add the 'Grid' group frame to the 'Pad' tab.
2656
2658{
2659 TGGroupFrame *gf = new TGGroupFrame(f, "Grid");
2665 fPadGridX = AddCheckButton(h10, "Along X", kPadGridX);
2666 h1->AddFrame(h10, fLayoutExpandX);
2669 fPadGridY = AddCheckButton(h20, "Along Y", kPadGridY);
2670 h1->AddFrame(h20, fLayoutExpandX);
2676 gf->AddFrame(h2, fLayoutExpandX);
2678 f->AddFrame(gf, fLayoutExpandXYMargin);
2679
2680// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2681// fGridColor->SetToolTipText("Line color for the grid");
2682 fPadGridX->SetToolTipText("Show / Hide the grid along X");
2683 fPadGridY->SetToolTipText("Show / Hide the grid along Y");
2684}
2685
2686////////////////////////////////////////////////////////////////////////////////
2687/// Add the tab 'Histos' to the editor.
2688
2690{
2691 fHistosTab = new TGTab(tab, 1, 1);
2692 fHistosTab->Associate(this);
2697}
2698
2699////////////////////////////////////////////////////////////////////////////////
2700/// Add the sub-tab 'Histos' to the tab 'Histos'.
2701
2703{
2708 tab->AddFrame(h1, fLayoutExpandX);
2709
2710 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2714 tab->AddFrame(h2, fLayoutExpandX);
2715
2716 TGHorizontalFrame *h3 = new TGHorizontalFrame(tab);
2720 tab->AddFrame(h3, fLayoutExpandX);
2721}
2722
2723////////////////////////////////////////////////////////////////////////////////
2724/// Add the 'Fill' group frame to the 'Histos - Histos' tab.
2725
2727{
2728 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2735 f->AddFrame(gf, fLayoutExpandXYMargin);
2736
2737// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2738// fHistFillColor->SetToolTipText("Color used to fill histograms");
2739// fHistFillStyle->SetToolTipText("Pattern used to fill histograms");
2740}
2741
2742////////////////////////////////////////////////////////////////////////////////
2743/// Add the 'Line' group frame to the 'Histos - Histos' tab.
2744
2746{
2747 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2755 f->AddFrame(gf, fLayoutExpandXYMargin);
2756
2757// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2758// fHistLineColor->SetToolTipText("Color used for histograms' lines");
2759}
2760
2761////////////////////////////////////////////////////////////////////////////////
2762/// Add the 'Bar' group frame to the 'Histos - Histos' tab.
2763
2765{
2766 TGGroupFrame *gf = new TGGroupFrame(f, "Bar");
2770 fBarWidth = AddNumberEntry(h, 0, 5, 0, kHistBarWidth, "W:",
2774 fBarOffset = AddNumberEntry(h, 8, 5, 0, kHistBarOffset, "O:",
2779 f->AddFrame(gf, fLayoutExpandXYMargin);
2780
2781 fBarWidth->GetNumberEntry()->SetToolTipText("Width of bars");
2782 fBarOffset->GetNumberEntry()->SetToolTipText("Offset of bars");
2783}
2784
2785////////////////////////////////////////////////////////////////////////////////
2786/// Add the 'Contours' group frame to the 'Histos - Histos' tab.
2787
2789{
2790 TGGroupFrame *gf = new TGGroupFrame(f, "Contours");
2792 fNumberContours = AddNumberEntry(gf, 0, 0, 0, kHistNumberContours, "Number:",
2796 f->AddFrame(gf, fLayoutExpandXYMargin);
2797
2798 fNumberContours->GetNumberEntry()->SetToolTipText("Number of level lines to draw");
2799}
2800
2801////////////////////////////////////////////////////////////////////////////////
2802/// Add the 'Axis' group frame to the 'Histos - Histos' tab.
2803
2805{
2806 TGGroupFrame *gf = new TGGroupFrame(f, "Axis");
2808 fHistMinimumZero = AddCheckButton(gf, "Minimum zero", kHistMinimumZero);
2809 fPaintTextFormat = AddTextEntry(gf, "Paint format:", kHistPaintTextFormat);
2810 f->AddFrame(gf, fLayoutExpandXYMargin);
2811
2812 fHistMinimumZero->SetToolTipText("Set to zero / Compute the minimum of axis range");
2813 fPaintTextFormat->SetToolTipText("Paint format of the axis labels in histograms");
2814}
2815
2816////////////////////////////////////////////////////////////////////////////////
2817/// Add the '3D Cylindrical' group frame to the 'Histos - Histos' tab.
2818
2820{
2821 TGGroupFrame *gf = new TGGroupFrame(f, "3D Cylindrical (%)");
2823 fLegoInnerR = AddNumberEntry(gf, 0, 0, 0, kHistLegoInnerR, "Inner radius:",
2827 f->AddFrame(gf, fLayoutExpandXYMargin);
2828
2829 fLegoInnerR->GetNumberEntry()->SetToolTipText("Percent of radius allocated to the tube");
2830}
2831
2832////////////////////////////////////////////////////////////////////////////////
2833/// Add the sub-tab 'Frames' to the tab 'Histos'.
2834
2836{
2837 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 13);
2838 fTrashListLayout->Add(layout);
2839
2842
2847 h1->AddFrame(v1, fLayoutExpandXY);
2848
2854 fPaletteEdit = AddTextButton(h2, "Palette Editor...", kFramePaletteEdit);
2856 v2->AddFrame(h2, layout);
2857 h1->AddFrame(v2, fLayoutExpandXY);
2858
2859 tab->AddFrame(h1, fLayoutExpandX);
2860}
2861
2862////////////////////////////////////////////////////////////////////////////////
2863/// Add the 'Fill' group frame to the 'Histos - Frames' tab.
2864
2866{
2867 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2874 f->AddFrame(gf, fLayoutExpandXMargin);
2875
2876// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2877// fFrameFillColor->SetToolTipText("Color used to fill frames");
2878// fFrameFillStyle->SetToolTipText("Pattern used to fill frames");
2879}
2880
2881////////////////////////////////////////////////////////////////////////////////
2882/// Add the 'Line' group frame to the 'Histos - Frames' tab.
2883
2885{
2886 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2894 f->AddFrame(gf, fLayoutExpandXYMargin);
2895
2896// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2897// fFrameLineColor->SetToolTipText("Color of lines in frames");
2898}
2899
2900////////////////////////////////////////////////////////////////////////////////
2901/// Add the 'Border' group frame to the 'Histos - Frames' tab.
2902
2904{
2907}
2908
2909////////////////////////////////////////////////////////////////////////////////
2910/// Add the sub-tab 'Graphs' to the tab 'Histos'.
2911
2913{
2918 tab->AddFrame(h, fLayoutExpandX);
2920}
2921
2922////////////////////////////////////////////////////////////////////////////////
2923/// Add the 'Line' group frame to the 'Histos - Graphs' tab.
2924
2926{
2927 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2935 f->AddFrame(gf, fLayoutExpandXMargin);
2936
2937// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2938// fFuncColor->SetToolTipText("Color of curves in graphs");
2939}
2940
2941////////////////////////////////////////////////////////////////////////////////
2942/// Add the 'Draw Border' check button to the 'Histos - Graphs' tab.
2943
2945{
2946 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
2947 fTrashListLayout->Add(layout);
2948
2951 fDrawBorder = AddCheckButton(h, "Draw Border (for Filled Function)", kGraphsDrawBorder);
2952 f->AddFrame(h, layout);
2953
2954 fDrawBorder->SetToolTipText("Show / Hide the border of filled functions");
2955}
2956
2957////////////////////////////////////////////////////////////////////////////////
2958/// Add the 'Errors' group frame to the 'Histos - Graphs' tab.
2959
2961{
2962 TGGroupFrame *gf = new TGGroupFrame(f, "Errors");
2965 "End error size:", 0, 4, TGNumberFormat::kNESRealOne,
2968 fErrorX = AddNumberEntry(gf, 0, 0, 0, kGraphsErrorX, "Error X (% of bin):",
2972 f->AddFrame(gf, fLayoutExpandXMargin);
2973
2974 fEndErrorSize->GetNumberEntry()->SetToolTipText("Size of lines drawn at the end of error bars");
2975 fErrorX->GetNumberEntry()->SetToolTipText("Percent of the bin width to use for errors along X");
2976}
2977
2978////////////////////////////////////////////////////////////////////////////////
2979/// Add the tab 'Axis' to the editor.
2980
2982{
2983 TGLayoutHints *layout =
2984 new TGLayoutHints(kLHintsNormal, 10, 13, 3);
2985 fTrashListLayout->Add(layout);
2986
2989
2992 fStripDecimals = AddCheckButton(h3, "Decimal labels' part", kAxisStripDecimals, 0, 8);
2993 TGVerticalFrame *space = new TGVerticalFrame(h3);
2994 fTrashListFrame->AddFirst(space);
2995 h3->AddFrame(space, fLayoutExpandXY);
2996 fApplyOnXYZ = AddTextButton(h3, "Apply on XYZ", kAxisApplyOnXYZ);
2997 h->AddFrame(h3, layout);
2998
2999 TGGroupFrame *gf = new TGGroupFrame(h, "Date/Time Offset");
3011 gf->AddFrame(h2, fLayoutExpandX);
3012 h->AddFrame(gf, fLayoutExpandXMargin);
3013 tab->AddFrame(h, fLayoutExpandX);
3014
3015 fAxisTab = new TGTab(tab);
3016 fAxisTab->Associate(this);
3017 CreateTabAxisX(fAxisTab->AddTab("X axis"));
3018 CreateTabAxisY(fAxisTab->AddTab("Y axis"));
3019 CreateTabAxisZ(fAxisTab->AddTab("Z axis"));
3021
3022 fStripDecimals->SetToolTipText("Draw / Hide the decimal part of labels");
3023 fApplyOnXYZ->SetToolTipText("Apply settings of the currently selected axis on XYZ");
3024 fTimeOffsetDate->GetNumberEntry()->SetToolTipText("Date offset for axis (dd/mm/yyyy)");
3025 fTimeOffsetTime->GetNumberEntry()->SetToolTipText("Time offset for axis (hh/mm/ss)");
3026}
3027
3028////////////////////////////////////////////////////////////////////////////////
3029/// Add the sub-tab 'X Axis' to the tab 'Axis'.
3030
3032{
3037 tab->AddFrame(h1, fLayoutExpandX);
3038
3039 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
3041 AddAxisXTitle(h2);
3042 AddAxisXLabels(h2);
3043 tab->AddFrame(h2, fLayoutExpandX);
3044}
3045
3046////////////////////////////////////////////////////////////////////////////////
3047/// Add the 'Line' group frame to the 'Axis - X Axis' tab.
3048
3050{
3051 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
3052 fTrashListLayout->Add(layout);
3053
3054 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
3061 fXTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisXTickLength, "Ticks:",
3065 h->AddFrame(h2, layout);
3067 fOptLogx = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogx);
3068 f->AddFrame(gf, fLayoutExpandXYMargin);
3069
3070// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3071// fXAxisColor->SetToolTipText("Color of axis' line");
3072 fXTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
3073 fOptLogx->SetToolTipText("Draw logarithmic scale");
3074}
3075
3076////////////////////////////////////////////////////////////////////////////////
3077/// Add the 'Title' group frame to the 'Axis - X Axis' tab.
3078
3080{
3081 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
3091 fXTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisXTitleSize, "Size:", 0, 5,
3095 gf->AddFrame(h2, fLayoutExpandX);
3096 fXTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisXTitleOffset, "Offset:",
3100 f->AddFrame(gf, fLayoutExpandXMargin);
3101
3102// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3103// fXTitleColor->SetToolTipText("Color of axis' title");
3104 fXTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
3105 fXTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
3106 fXTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
3107}
3108
3109////////////////////////////////////////////////////////////////////////////////
3110/// Add the 'Divisions' group frame to the 'Axis - X Axis' tab.
3111
3113{
3114 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
3116
3123 fXNdivSub = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivSub, "",
3127 fXNdivMain = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivMain, "",
3132
3136 gf->AddFrame(h2, fLayoutExpandX);
3137 f->AddFrame(gf, fLayoutExpandXMargin);
3138
3139 fXNdivMain->GetNumberEntry()->SetToolTipText("Primary axis divisions");
3140 fXNdivSub->GetNumberEntry()->SetToolTipText("Secondary axis divisions");
3141 fXNdivSubSub->GetNumberEntry()->SetToolTipText("Tertiary axis divisions");
3142 fXNdivisionsOptimize->SetToolTipText("Optimize the number of axis divisions if selected");
3143}
3144
3145////////////////////////////////////////////////////////////////////////////////
3146/// Add the 'Labels' group frame to the 'Axis - X Axis' tab.
3147
3149{
3150 TGGroupFrame *gf = new TGGroupFrame(f, "Labels");
3160 fXLabelSize = AddNumberEntry(h2, 22, 8, 0, kAxisXLabelSize, "Size:", 0, 5,
3164 gf->AddFrame(h2, fLayoutExpandX);
3165 fXLabelOffset = AddNumberEntry(gf, 69, 8, 0, kAxisXTitleOffset, "Offset:",
3169 f->AddFrame(gf, fLayoutExpandXMargin);
3170
3171// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3172// fXLabelColor->SetToolTipText("Color of axis' labels");
3173 fXLabelSizeInPixels->SetToolTipText("Set the labels size in pixels if selected, otherwise - in % of pad");
3174 fXLabelSize->GetNumberEntry()->SetToolTipText("Label size (in pixels or in % of pad)");
3175 fXLabelOffset->GetNumberEntry()->SetToolTipText("Offset between axis and labels");
3176}
3177
3178////////////////////////////////////////////////////////////////////////////////
3179/// Add the sub-tab 'Y Axis' to the tab 'Axis'.
3180
3182{
3187 tab->AddFrame(h1, fLayoutExpandX);
3188
3189 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
3191 AddAxisYTitle(h2);
3192 AddAxisYLabels(h2);
3193 tab->AddFrame(h2, fLayoutExpandX);
3194}
3195
3196////////////////////////////////////////////////////////////////////////////////
3197/// Add the 'Line' group frame to the 'Axis - Y Axis' tab.
3198
3200{
3201 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
3202 fTrashListLayout->Add(layout);
3203
3204 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
3211 fYTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisYTickLength, "Ticks:",
3215 h->AddFrame(h2, layout);
3217 fOptLogy = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogy);
3218 f->AddFrame(gf, fLayoutExpandXYMargin);
3219
3220// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3221// fYAxisColor->SetToolTipText("Color of axis' line");
3222 fYTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
3223 fOptLogy->SetToolTipText("Draw logarithmic scale");
3224}
3225
3226////////////////////////////////////////////////////////////////////////////////
3227/// Add the 'Title' group frame to the 'Axis - Y Axis' tab.
3228
3230{
3231 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
3241 fYTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisYTitleSize, "Size:", 0, 5,
3245 gf->AddFrame(h2, fLayoutExpandX);
3246 fYTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisYTitleOffset, "Offset:",
3250 f->AddFrame(gf, fLayoutExpandXMargin);
3251
3252// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3253// fYTitleColor->SetToolTipText("Color of axis' title");
3254 fYTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
3255 fYTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
3256 fYTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
3257}
3258
3259////////////////////////////////////////////////////////////////////////////////
3260/// Add the 'Divisions' group frame to the 'Axis - Y Axis' tab.
3261
3263{
3264 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
3268 fYNdivSubSub =