Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TStyleManager.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Denis Favre-Miville 08/09/05
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
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 <TGLabel.h>
134#include <TGLayout.h>
135#include <TGMenu.h>
136#include <TGNumberEntry.h>
137#include <TGResourcePool.h>
138#include <TGStatusBar.h>
139#include <TGTab.h>
140#include <TGToolBar.h>
141#include <TROOT.h>
142#include <snprintf.h>
143#include <TRootHelpDialog.h>
144#include <TStyle.h>
145#include <TSystem.h>
146#include <TVirtualPad.h>
147#include <TVirtualX.h>
148
150
152
171
178
190
194
213
233
250
262
273
280
285
303
321
339
354
382
393
394const char *kFiletypes[] = { "ROOT macros", "Style_*.C",
395 0, 0 };
396
397////////////////////////////////////////////////////////////////////////////////
398/// Constructor. Create the main window of the style manager.
399
401{
402 SetWindowName("Style Manager");
404
405 // Initialization: no selected style, no preview, no signal/slots,
406 // no selected object, no current macro file.
407 fCurSelStyle = 0;
408 fCurMacro = 0;
409 fCurPad = 0;
410 fCurObj = 0;
411 fPreviewWindow = 0;
413 fCurTabNum = 0;
414 fCurTabAxisNum = 0;
418
419 // Create the trash lists to have an effective deletion of every object.
420 fTrashListLayout = new TList();
421 fTrashListFrame = new TList();
422
423 // To avoid to create a lot a copies of the often used layouts.
434
435 // Build the graphical interface.
436 AddMenus(this);
437 AddToolbar(this);
439 AddEdition(this);
440
441 // Add status bar.
442 fStatusBar = new TGStatusBar(this, 50, 10, kVerticalFrame);
443 Int_t parts[] = { 20, 30, 50 };
444 fStatusBar->SetParts(parts, 3);
447
448 // Initialize the layout algorithm and map the main frame.
451 MapWindow();
452
453 // Ensure the editor will be visible (not out of the screen's range) when
454 // the user will press the 'More' button, if they didn't move the window.
455 Int_t x, y;
456 UInt_t w, h;
457 gVirtualX->GetWindowSize(GetId(), x, y, w, h);
458 fSMWidth = w;
459 fSMHeight = h;
460 if (fSMWidth < 467) fSMWidth = 467;
461 if (fSMHeight < 708) fSMHeight = 708;
462 Window_t win;
463 gVirtualX->TranslateCoordinates(GetId(), GetParent()->GetId(), 0, 0, x, y, win);
464 x -= 6;
465 y -= 21;
466 MoveResize(x, TMath::Max(TMath::Min(y, (Int_t) (gClient->GetDisplayHeight() - h)), 0), w, h);
467
468 // Only the top level interface is shown, at the begining.
469 DoMoreLess();
470
471 // Connect all widgets (excluding editor).
472 ConnectAll();
473
474 Init();
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Destructor.
479
481{
482 // Disconnect all widgets
485
486 if (fPreviewWindow) {
488 delete fPreviewWindow;
489 }
490
491 // Delete every graphical data member,
492 // excluding fPreviewWindow and fLayout[..].
493 gClient->FreePicture(fToolBarNewPic);
494 gClient->FreePicture(fToolBarDeletePic);
495 gClient->FreePicture(fToolBarImportCanvasPic);
496 gClient->FreePicture(fToolBarImportMacroPic);
497 gClient->FreePicture(fToolBarExportPic);
498 gClient->FreePicture(fToolBarHelpPic);
499 gClient->FreePicture(fMakeDefaultPic);
500
501 delete fImportCascade;
502 delete fMenuStyle;
503 delete fMenuHelp;
504 delete fMenuBar;
505
506 delete fToolBar;
507 delete fToolBarNew;
508 delete fToolBarDelete;
510 delete fToolBarImportMacro;
511 delete fToolBarExport;
512 delete fToolBarHelp;
513 delete fHorizontal3DLine;
514
515 delete fListLabel;
516 delete fListComboBox;
517 delete fCurMacro;
518 delete fCurStylabel;
519 delete fCurStyle;
520 delete fCurPadLabel;
521 delete fCurPadTextEntry;
522 delete fCurObjLabel;
523 delete fCurObjTextEntry;
524 delete fPreviewButton;
525 delete fPreviewRealTime;
526 delete fMakeDefault;
527
528 delete fApplyOnGroup;
529 delete fApplyOnAll;
530 delete fApplyOnSel;
531 delete fApplyOnButton;
532 delete fMoreLess;
533
534 delete fFillColor;
535 delete fFillStyle;
536 delete fHatchesLineWidth;
537 delete fHatchesSpacing;
538 delete fTextColor;
539 delete fTextSize;
540 delete fTextSizeInPixels;
541 delete fTextFont;
542 delete fTextAlign;
543 delete fTextAngle;
544 delete fLineColor;
545 delete fLineWidth;
546 delete fLineStyle;
547 delete fLineStyleEdit;
548 delete fMarkerColor;
549 delete fMarkerStyle;
550 delete fMarkerSize;
551 delete fScreenFactor;
552 delete fCanvasColor;
553 delete fCanvasDefX;
554 delete fCanvasDefY;
555 delete fCanvasDefW;
556 delete fCanvasDefH;
557 delete fCanvasBorderMode;
558 delete fCanvasBorderSize;
559 delete fOptDateBool;
560 delete fAttDateTextColor;
561 delete fAttDateTextSize;
563 delete fOptDateFormat;
564 delete fAttDateTextFont;
565 delete fAttDateTextAngle;
566 delete fAttDateTextAlign;
567 delete fDateX;
568 delete fDateY;
569 delete fPadLeftMargin;
570 delete fPadRightMargin;
571 delete fPadTopMargin;
572 delete fPadBottomMargin;
573 delete fPadBorderMode;
574 delete fPadBorderSize;
575 delete fPadColor;
576 delete fPadTickX;
577 delete fPadTickY;
578 delete fPadGridX;
579 delete fPadGridY;
580 delete fGridColor;
581 delete fGridWidth;
582 delete fGridStyle;
583 delete fHistFillColor;
584 delete fHistFillStyle;
585 delete fHistLineColor;
586 delete fHistLineWidth;
587 delete fHistLineStyle;
588 delete fBarWidth;
589 delete fBarOffset;
590 delete fHistMinimumZero;
591 delete fPaintTextFormat;
592 delete fNumberContours;
593 delete fLegoInnerR;
594 delete fFrameFillColor;
595 delete fFrameFillStyle;
596 delete fFrameLineColor;
597 delete fFrameLineWidth;
598 delete fFrameLineStyle;
599 delete fPaletteEdit;
600 delete fFrameBorderMode;
601 delete fFrameBorderSize;
602 delete fFuncColor;
603 delete fFuncWidth;
604 delete fFuncStyle;
605 delete fDrawBorder;
606 delete fEndErrorSize;
607 delete fErrorX;
608 delete fTimeOffsetDate;
609 delete fTimeOffsetTime;
610 delete fStripDecimals;
611 delete fApplyOnXYZ;
612 delete fXTitleSize;
613 delete fXTitleSizeInPixels;
614 delete fXTitleColor;
615 delete fXTitleOffset;
616 delete fXTitleFont;
617 delete fXLabelSize;
618 delete fXLabelSizeInPixels;
619 delete fXLabelColor;
620 delete fXLabelOffset;
621 delete fXLabelFont;
622 delete fXAxisColor;
623 delete fXTickLength;
624 delete fOptLogx;
625 delete fXNdivMain;
626 delete fXNdivSub;
627 delete fXNdivSubSub;
629 delete fYTitleSize;
630 delete fYTitleSizeInPixels;
631 delete fYTitleColor;
632 delete fYTitleOffset;
633 delete fYTitleFont;
634 delete fYLabelSize;
635 delete fYLabelSizeInPixels;
636 delete fYLabelColor;
637 delete fYLabelOffset;
638 delete fYLabelFont;
639 delete fYAxisColor;
640 delete fYTickLength;
641 delete fOptLogy;
642 delete fYNdivMain;
643 delete fYNdivSub;
644 delete fYNdivSubSub;
646 delete fZTitleSize;
647 delete fZTitleSizeInPixels;
648 delete fZTitleColor;
649 delete fZTitleOffset;
650 delete fZTitleFont;
651 delete fZLabelSize;
652 delete fZLabelSizeInPixels;
653 delete fZLabelColor;
654 delete fZLabelOffset;
655 delete fZLabelFont;
656 delete fZAxisColor;
657 delete fZTickLength;
658 delete fOptLogz;
659 delete fZNdivMain;
660 delete fZNdivSub;
661 delete fZNdivSubSub;
663 delete fOptTitle;
664 delete fTitleColor;
665 delete fTitleStyle;
666 delete fTitleTextColor;
667 delete fTitleFontSize;
669 delete fTitleFont;
670 delete fTitleAlign;
672 delete fTitleBorderSize;
673 delete fTitleX;
674 delete fTitleY;
675 delete fTitleW;
676 delete fTitleH;
678 delete fLegendBorderSize;
679 delete fStatColor;
680 delete fStatStyle;
681 delete fStatTextColor;
682 delete fStatFontSize;
684 delete fStatFont;
685 delete fStatX;
686 delete fStatY;
687 delete fStatW;
688 delete fStatH;
690 delete fStatBorderSize;
691 delete fOptStatName;
692 delete fOptStatEntries;
693 delete fOptStatOverflow;
694 delete fOptStatMean;
695 delete fOptStatUnderflow;
696 delete fOptStatRMS;
697 delete fOptStatSkewness;
698 delete fOptStatIntegral;
699 delete fOptStatKurtosis;
700 delete fOptStatErrors;
701 delete fStatFormatLabel;
702 delete fStatFormat;
703 delete fOptFitValues;
704 delete fOptFitErrors;
705 delete fOptFitProbability;
706 delete fOptFitChi;
707 delete fFitFormatLabel;
708 delete fFitFormat;
709 delete fHeaderPS;
710 delete fTitlePS;
711 delete fColorModelPS;
712 delete fColorModelPSRGB;
713 delete fColorModelPSCMYK;
714 delete fLineScalePS;
715 delete fPaperSizePredef;
716 delete fPaperSizeX;
717 delete fPaperSizeY;
718 delete fEditionHelp;
720 delete fEditionReset;
721 delete fEditionButtonFrame;
722 delete fHistosTab;
723 delete fAxisTab;
724 delete fEditionTab;
725 delete fEditionFrame;
726
727 delete fStatusBar;
728
729 // Delete the temporary frames and layout.
730 TObject *obj1;
731 TObject *obj2;
732
733 obj1 = fTrashListFrame->First();
734 while (obj1) {
735 obj2 = fTrashListFrame->After(obj1);
736 fTrashListFrame->Remove(obj1);
737 delete obj1;
738 obj1 = obj2;
739 }
740 delete fTrashListFrame;
741
742 obj1 = fTrashListLayout->First();
743 while (obj1) {
744 obj2 = fTrashListLayout->After(obj1);
746 delete obj1;
747 obj1 = obj2;
748 }
749 delete fTrashListLayout;
750
751 fgStyleManager = 0;
752}
753
754////////////////////////////////////////////////////////////////////////////////
755///static: return style manager
756
758{
759 return fgStyleManager;
760}
761
762////////////////////////////////////////////////////////////////////////////////
763/// Set up the interface. Called by the ctor or by the 'Show' method.
764
766{
767 // Build the list of available styles and select gStyle.
769
770 // Show the current object.
771 if ((gROOT->GetSelectedPad()) && (gROOT->GetSelectedPad()->GetCanvas())) {
772 DoSelectCanvas(gROOT->GetSelectedPad()->GetCanvas(),
773 gROOT->GetSelectedPad()->GetCanvas(), kButton2Down);
774 } else {
776 }
777}
778
779////////////////////////////////////////////////////////////////////////////////
780/// Called to hide the style manager.
781
783{
784 if (fgStyleManager) {
786 }
787}
788
789////////////////////////////////////////////////////////////////////////////////
790/// Called to show the style manager. Static method.
791
793{
794 if (fgStyleManager) {
796 if (!fgStyleManager->IsMapped()) {
798 }
799 } else {
800 TStyleManager::GetSM() = new TStyleManager(gClient->GetRoot());
801 }
802}
803
804////////////////////////////////////////////////////////////////////////////////
805/// Called to delete the style manager. Called when the ROOT session is
806/// closed via a canvas' menu.
807
809{
810 delete fgStyleManager;
811 fgStyleManager = 0;
812}
813
814////////////////////////////////////////////////////////////////////////////////
815/// Add the menu bar to the frame 'p'.
816
818{
819 fMenuBar = new TGMenuBar(p);
820
821 fMenuStyle = new TGPopupMenu(gClient->GetRoot());
822 fMenuStyle->Associate(this);
823 fMenuStyle->AddEntry("&New...", kMenuNew);
824 fMenuStyle->AddEntry("&Delete", kMenuDelete);
826 fMenuStyle->AddEntry("&Rename...", kMenuRename);
828 fImportCascade = new TGPopupMenu(gClient->GetRoot());
832 fMenuStyle->AddPopup("&Import From...", fImportCascade);
833
834 fMenuStyle->AddEntry("&Export...", kMenuExport);
836 fMenuStyle->AddEntry("&Close", kMenuExit);
838 fTrashListLayout->Add(layout1);
839 fMenuBar->AddPopup("&Style", fMenuStyle, layout1);
840
841 fMenuHelp = new TGPopupMenu(gClient->GetRoot());
842 fMenuHelp->Associate(this);
843 fMenuHelp->AddEntry("Top &level", kMenuHelp);
845 fMenuHelp->AddEntry("&General", kMenuHelpGeneral);
848 fMenuHelp->AddEntry("&Histograms", kMenuHelpHistos);
852 fMenuHelp->AddEntry("&PS / PDF", kMenuHelpPSPDF);
854 fTrashListLayout->Add(layout2);
855 fMenuBar->AddPopup("&Help", fMenuHelp, layout2);
856
858}
859
860////////////////////////////////////////////////////////////////////////////////
861/// Create a new style. Called via the menu bar or the tool bar.
862
864{
865 // Open a message box to allow the user to create a new style.
866 new TStyleDialog(this, fCurSelStyle, 1, 0);
867
868 // Create the list of available styles, and select:
869 // - the new style, if it has been created (Ok).
870 // - the previous selected style, if no style has been created (Cancel).
871 if (fLastChoice) BuildList();
873}
874
875////////////////////////////////////////////////////////////////////////////////
876/// Delete the current selected style from the ROOT session.
877/// Called via the menu or the tool bar.
878
880{
881 // Protection: the user is NOT allowed to delete gStyle.
882 // As a consequence, there is always at least one style in the ROOT session.
883 if (fCurSelStyle == gStyle) {
884 printf("Can not delete gStyle.\n");
885 return;
886 }
887
888 delete fCurSelStyle;
889 fCurSelStyle = 0;
890
892}
893
894////////////////////////////////////////////////////////////////////////////////
895/// Rename the current selected style. Called via the menu bar.
896
898{
899 new TStyleDialog(this, fCurSelStyle, 2, 0);
900
901 // Create the list of styles and select the previous selected style.
903}
904
905////////////////////////////////////////////////////////////////////////////////
906/// Save the current selected style in a C++ macro file. Called via the menu
907/// or the tool bar.
908
910{
911 // Create an associated macro and propose a pertinent name to the user.
912 CreateMacro();
913 TString newName;
914 newName.Form("Style_%s.C", fCurSelStyle->GetName());
915
916 // Protection: The user isn't allowed to export a style if the output
917 // file name isn't based on the "Style_*.C" mask, without spaces.
918 char* tmpFileName;
919 const char* tmpBaseName;
920 do {
921 fCurMacro->SetFilename(newName.Data());
922
923 // Open a dialog to ask the user to choose an output file.
924 new TGFileDialog(gClient->GetRoot(), this, kFDSave, fCurMacro);
925 tmpFileName = fCurMacro->fFilename;
926 if (tmpFileName) tmpBaseName = gSystem->BaseName(tmpFileName);
927 else tmpBaseName = 0;
928 } while (tmpBaseName && (strstr(tmpBaseName, "Style_") != tmpBaseName)
929 && (strstr(tmpBaseName, " ") != 0));
930
931 if (tmpBaseName != 0) {
932 // Export the style.
934 fCurMacro->SetFilename(tmpBaseName);
936 }
937
939}
940
941////////////////////////////////////////////////////////////////////////////////
942/// Close the style manager. Called via the menu bar.
943
945{
946// SendCloseMessage(); // Doesn't delete the StyleManager. Hides it.
947 delete this;
948}
949
950////////////////////////////////////////////////////////////////////////////////
951/// Open an help window. Called via the menu bar or the tool bar.
952
954{
955 TRootHelpDialog *hd;
956 switch (i) {
957 case 0:
958 hd = new TRootHelpDialog(this, "Help on General Tab", 600, 400);
960 break;
961 case 1:
962 hd = new TRootHelpDialog(this, "Help on Canvas Tab", 600, 400);
964 break;
965 case 2:
966 hd = new TRootHelpDialog(this, "Help on Pad Tab", 600, 400);
967 hd->SetText(gHelpSMPad);
968 break;
969 case 3:
970 hd = new TRootHelpDialog(this, "Help on Histograms Tab", 600, 400);
972 break;
973 case 4:
974 hd = new TRootHelpDialog(this, "Help on Axis Tab", 600, 400);
975 hd->SetText(gHelpSMAxis);
976 break;
977 case 5:
978 hd = new TRootHelpDialog(this, "Help on Title Tab", 600, 400);
980 break;
981 case 6:
982 hd = new TRootHelpDialog(this, "Help on Stats Tab", 600, 400);
984 break;
985 case 7:
986 hd = new TRootHelpDialog(this, "Help on PS / PDF Tab", 600, 400);
988 break;
989 default:
990 hd = new TRootHelpDialog(this, "Help on Top Level", 600, 400);
992 }
993 hd->Popup();
994}
995
996////////////////////////////////////////////////////////////////////////////////
997/// Create a new style (a copy of gStyle) and import the properties of the
998/// current canvas inside.
999
1001{
1002 if ((!fCurPad) || (!fCurObj)) return;
1003
1004 new TStyleDialog(this, gStyle, 3, fCurPad);
1005
1006 // Create the list of available style, and select:
1007 // - the new style, if it has been created
1008 // - the previous selected style, if no style has been created (Cancel)
1009 if (fLastChoice) {
1010 BuildList();
1011
1012 // Auto export of the canvas' style.
1013 CreateMacro();
1014 TString newName;
1015 newName.Form("Style_%s.C", fCurSelStyle->GetName());
1016 fCurMacro->SetFilename(newName.Data());
1018 } else {
1020 }
1021}
1022
1023////////////////////////////////////////////////////////////////////////////////
1024/// Create a TGFileInfo concerning a macro, if it doesn't exist already.
1025
1027{
1028 if (fCurMacro) delete fCurMacro;
1029 fCurMacro = new TGFileInfo();
1031 fCurMacro->SetIniDir(".");
1032 fCurMacro->SetFilename(nullptr);
1033}
1034
1035////////////////////////////////////////////////////////////////////////////////
1036/// Add the tool bar to the frame 'p'.
1037
1039{
1040 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 3);
1041 fTrashListLayout->Add(layout1);
1042 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsNormal, 6);
1043 fTrashListLayout->Add(layout2);
1044
1045 fToolBar = new TGToolBar(p);
1046 fToolBarNewPic = gClient->GetPicture("sm_new.xpm");
1048 fToolBarNew->SetStyle(gClient->GetStyle());
1049 fToolBarNew->Associate(this);
1051
1052 fToolBarImportCanvasPic = gClient->GetPicture("sm_import_canvas.xpm");
1057
1058 fToolBarImportMacroPic = gClient->GetPicture("sm_import_macro.xpm");
1060 fToolBarImportMacro->SetStyle(gClient->GetStyle());
1063
1064 fToolBarExportPic = gClient->GetPicture("sm_export.xpm");
1066 fToolBarExport->SetStyle(gClient->GetStyle());
1068 fToolBar->AddFrame(fToolBarExport, layout1);
1069
1070 fToolBarDeletePic = gClient->GetPicture("sm_delete.xpm");
1072 fToolBarDelete->SetStyle(gClient->GetStyle());
1074 fToolBar->AddFrame(fToolBarDelete, layout2);
1075
1076 fToolBarHelpPic = gClient->GetPicture("sm_help.xpm");
1078 fToolBarHelp->SetStyle(gClient->GetStyle());
1079 fToolBarHelp->Associate(this);
1080 fToolBar->AddFrame(fToolBarHelp, layout2);
1081
1085
1086 fToolBarNew->SetToolTipText("Create a new style");
1087 fToolBarDelete->SetToolTipText("Delete the selected style");
1088 fToolBarImportCanvas->SetToolTipText("Import a style from selected canvas");
1089 fToolBarImportMacro->SetToolTipText("Import a style from a macro");
1090 fToolBarExport->SetToolTipText("Export the selected style into a macro");
1091 fToolBarHelp->SetToolTipText("Help about the top level interface");
1092}
1093
1094////////////////////////////////////////////////////////////////////////////////
1095/// Add the top level interface to the frame 'cf'. This part of the
1096/// interface will provide all enable functionalities, excluding the
1097/// edition of styles.
1098
1100{
1101 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2);
1102 fTrashListLayout->Add(layout1);
1103 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 15);
1104 fTrashListLayout->Add(layout2);
1105 TGLayoutHints *layout3 = new TGLayoutHints(kLHintsNormal, 0, 0, 18);
1106 fTrashListLayout->Add(layout3);
1107 TGLayoutHints *layout4 = new TGLayoutHints(kLHintsNormal, 10, 10);
1108 fTrashListLayout->Add(layout4);
1109 TGLayoutHints *layout5 = new TGLayoutHints(kLHintsExpandX, 125);
1110 fTrashListLayout->Add(layout5);
1111 TGLayoutHints *layout6 = new TGLayoutHints(kLHintsNormal, 0, 10, 3);
1112 fTrashListLayout->Add(layout6);
1113 TGLayoutHints *layout7 = new TGLayoutHints(kLHintsNormal, 0, 16, 3);
1114 fTrashListLayout->Add(layout7);
1115 TGLayoutHints *layout8 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10);
1116 fTrashListLayout->Add(layout8);
1117 TGLayoutHints *layout9 = new TGLayoutHints(kLHintsNormal, -15, 0, -5, -10);
1118 fTrashListLayout->Add(layout9);
1119 TGLayoutHints *layout10 = new TGLayoutHints(kLHintsNormal, 15, 0, -5, -10);
1120 fTrashListLayout->Add(layout10);
1121 TGLayoutHints *layout11 = new TGLayoutHints(kLHintsExpandX, 0, 0, 15);
1122 fTrashListLayout->Add(layout11);
1123 TGLayoutHints *layout12 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 5);
1124 fTrashListLayout->Add(layout12);
1125 TGLayoutHints *layout13 = new TGLayoutHints(kLHintsExpandX, 20, 0, 7);
1126 fTrashListLayout->Add(layout13);
1127
1128 TGVerticalFrame *topLevel = new TGVerticalFrame(cf);
1129 fTrashListFrame->AddFirst(topLevel);
1130 TGHorizontalFrame *h1 = new TGHorizontalFrame(topLevel);
1134 fListLabel = new TGLabel(v11, "Available Styles:");
1135 v11->AddFrame(fListLabel);
1137 fListComboBox->Associate(this);
1138 fListComboBox->Resize(200, 22);
1139 v11->AddFrame(fListComboBox, layout1);
1140 h1->AddFrame(v11, fLayoutExpandX);
1143 fMakeDefaultPic = gClient->GetPicture("arrow_right2.xpm");
1145 fMakeDefault->SetStyle(gClient->GetStyle());
1146 fMakeDefault->Associate(this);
1147 fMakeDefault->Resize(40, 22);
1148 v12->AddFrame(fMakeDefault, layout3);
1149 h1->AddFrame(v12, layout4);
1152 fCurStylabel = new TGLabel(v13, "gStyle is set to:");
1153 v13->AddFrame(fCurStylabel);
1154 fCurStyle = new TGTextEntry(v13, "", kTopCurStyle);
1155 fCurStyle->Associate(this);
1157 v13->AddFrame(fCurStyle, layout1);
1158 h1->AddFrame(v13, fLayoutExpandX);
1159 topLevel->AddFrame(h1, fLayoutExpandX);
1160
1161 TGHorizontalFrame *h2 = new TGHorizontalFrame(topLevel);
1163 TGGroupFrame *gf = new TGGroupFrame(h2, "Apply on");
1165 TGVerticalFrame *vf = new TGVerticalFrame(gf);
1167 Pixel_t red;
1168 gClient->GetColorByName("#FF0000", red);
1169 TGHorizontalFrame *selCanvas = new TGHorizontalFrame(vf);
1170 fTrashListFrame->AddFirst(selCanvas);
1171 fCurPadLabel = new TGLabel(selCanvas, "Canvas:");
1172 selCanvas->AddFrame(fCurPadLabel, layout6);
1173 fCurPadTextEntry = new TGTextEntry(selCanvas, "", kTopCurPad);
1177 vf->AddFrame(selCanvas, fLayoutExpandX);
1178 TGHorizontalFrame *selObject = new TGHorizontalFrame(vf);
1179 fTrashListFrame->AddFirst(selObject);
1180 fCurObjLabel = new TGLabel(selObject, "Object:");
1181 selObject->AddFrame(fCurObjLabel, layout7);
1182 fCurObjTextEntry = new TGTextEntry(selObject, "", kTopCurObj);
1187 vf->AddFrame(selObject, layout8);
1190 fApplyOnGroup = new TGHButtonGroup(h4);
1191 fApplyOnAll = new TGRadioButton(fApplyOnGroup, "All canvases", kTopApplyOnAll);
1192 fApplyOnAll->Associate(this);
1193 fApplyOnSel = new TGRadioButton(fApplyOnGroup, "Selected object", kTopApplyOnSel);
1194 fApplyOnSel->Associate(this);
1201 fApplyOnButton = new TGTextButton(h4, "&Apply", kTopApplyOnBut);
1203 fApplyOnButton->Resize(100, 22);
1204 h4->AddFrame(fApplyOnButton, layout13);
1205 vf->AddFrame(h4, fLayoutExpandX);
1206 gf->AddFrame(vf, layout11);
1207 h2->AddFrame(gf, layout12);
1208 topLevel->AddFrame(h2, fLayoutExpandX);
1209
1210 TGHorizontalFrame *h3 = new TGHorizontalFrame(topLevel);
1212 fPreviewButton = new TGCheckButton(h3, "&Preview", kTopPreview);
1214 h3->AddFrame(fPreviewButton, layout6);
1215 fPreviewRealTime = new TGCheckButton(h3, "Run &Time Preview", kTopPreviewRealTime);
1218 h3->AddFrame(fPreviewRealTime, layout6);
1219 fMoreLess = new TGTextButton(h3, "&Close <<", kTopMoreLess);
1220 fMoreLess->Associate(this);
1221 h3->AddFrame(fMoreLess, layout5);
1222 topLevel->AddFrame(h3, fLayoutExpandX);
1223
1224 cf->AddFrame(topLevel, layout2);
1225
1226 fApplyOnButton->SetToolTipText("Apply the selected style on the selected object");
1227 fPreviewButton->SetToolTipText("Show / Hide the preview window");
1228 fPreviewRealTime->SetToolTipText("Continuous / Asynchronous update of the preview");
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232/// Build the list of styles which will appear in the available styles
1233/// combo box. The new style to select is mentioned. If no style has
1234/// been specified, the last entry of the list is selected.
1235
1237{
1238 // Empty the list.
1240
1241 // Build the list of all styles already created in the ROOT session.
1242 Int_t i = 1;
1243 Int_t styleID = 0;
1244 TStyle *tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->First());
1245 while (tmpStyle) {
1246 if (tmpStyle == style) styleID = i;
1247 fListComboBox->AddEntry(tmpStyle->GetName(), i++);
1248 tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->After(tmpStyle));
1249 }
1250
1251 // Select 'style' in the list of available styles.
1252 if (styleID == 0) styleID = i - 1;
1253 fListComboBox->Select(styleID);
1254 DoListSelect();
1256}
1257
1258////////////////////////////////////////////////////////////////////////////////
1259/// Update the content of the status bar: show the name of the current
1260/// selected style, its title and the macro from which it has been imported.
1261
1263{
1266
1267 if ((!strcmp(fCurSelStyle->GetName(), "Default"))
1268 || (!strcmp(fCurSelStyle->GetName(), "Plain" ))
1269 || (!strcmp(fCurSelStyle->GetName(), "Bold" ))
1270 || (!strcmp(fCurSelStyle->GetName(), "Video" ))
1271 || (!strcmp(fCurSelStyle->GetName(), "Pub" ))) {
1272 fStatusBar->SetText("ROOT style", 1);
1273 } else if (fStyleChanged) {
1274 fStatusBar->SetText("User Style _ Not Saved", 1);
1275 } else {
1276 fStatusBar->SetText("User Style", 1);
1277 }
1278}
1279
1280////////////////////////////////////////////////////////////////////////////////
1281/// Update the values of every widget entry in the editor. The new values
1282/// are loaded from the current selected style.
1283
1285{
1286 Double_t delta;
1287 Int_t year;
1288 Int_t month;
1289 Int_t day;
1290 Int_t oneYearInSecs;
1291 Int_t oneMonthInSecs;
1292 Int_t tmp;
1293 Int_t tmp2;
1294 switch (tabNum) {
1295 case 0: // GENERAL
1307 // Nothing to do with fLineStyleEdit.
1309 if (fCurSelStyle->GetTextFont()%10 > 2) {
1312 } else {
1315 }
1319 break;
1320 case 1: // CANVAS
1329 if (fCurSelStyle->GetAttDate()->GetTextFont()%10 > 2) {
1332 } else {
1335 }
1340 fDateX->SetIntNumber((Int_t) (fCurSelStyle->GetDateX()*100 + 0.5));
1341 fDateY->SetIntNumber((Int_t) (fCurSelStyle->GetDateY()*100 + 0.5));
1342
1343 if (fCurSelStyle->GetOptDate()) {
1349// TODO Just delete when ComboBox can be grayed
1350 //fOptDateFormat->SetState(kTRUE);
1351 //ModAttDateTextFont->SetState(kTRUE);
1352 //ModAttDateTextAlign->SetState(kTRUE);
1356 } else {
1361// TODO Just delete when ComboBox can be grayed
1362 //fOptDateFormat->SetState(kFALSE);
1363 //ModAttDateTextFont->SetState(kFALSE);
1364 //ModAttDateTextAlign->SetState(kFALSE);
1368 }
1369 break;
1370 case 2: // PAD
1380 else
1384 else
1388 else
1392 else
1397 break;
1398 case 3: // HISTOS
1408 else
1418 // Nothing to do with fPaletteEdit;
1426 else
1429 fErrorX->SetIntNumber((Int_t) (fCurSelStyle->GetErrorX() * 100 + 0.5));
1430 break;
1431 case 4: // AXIS
1432 delta = fCurSelStyle->GetTimeOffset() - 788918400;
1433 year = 1995;
1434 month = 1;
1435 day = 1;
1436 while (delta < 0) {
1437 year--;
1438 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
1439 else oneYearInSecs = 3600 * 24 * 366;
1440 delta += oneYearInSecs;
1441 }
1442 oneYearInSecs = 3600 * 24 * 365; // because 365 days in 1995.
1443 while (delta >= oneYearInSecs) {
1444 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
1445 else oneYearInSecs = 3600 * 24 * 366;
1446 delta -= oneYearInSecs;
1447 year++;
1448 }
1449 oneMonthInSecs = 3600 * 24 * 31; // because 31 days in January.
1450 while (delta >= oneMonthInSecs) {
1451 month++;
1452 delta -= oneMonthInSecs;
1453 switch (month) {
1454 case 2:
1455 if (year % 4) oneMonthInSecs = 3600 * 24 * 28;
1456 else oneMonthInSecs = 3600 * 24 * 29;
1457 break;
1458 case 3: case 5: case 7: case 8: case 10: case 12:
1459 oneMonthInSecs = 3600 * 24 * 31;
1460 break;
1461 default:
1462 oneMonthInSecs = 3600 * 24 * 30;
1463 }
1464 }
1465 day = (Int_t) delta / (3600 * 24) + 1;
1466 delta = ((Int_t) delta) % (3600 * 24);
1467 fTimeOffsetDate->SetNumber(year*10000 + month*100 + day);
1468 fTimeOffsetTime->SetNumber(delta);
1469
1472 else
1475 if (fCurSelStyle->GetTitleFont("X")%10 > 2) {
1478 } else {
1481 }
1486 if (fCurSelStyle->GetLabelFont("X")%10 > 2) {
1489 } else {
1492 }
1498 if (fCurSelStyle->GetOptLogx())
1500 else
1505 if (fCurSelStyle->GetNdivisions("X") > 0)
1507 else
1510 if (fCurSelStyle->GetTitleFont("Y")%10 > 2) {
1513 } else {
1516 }
1521 if (fCurSelStyle->GetLabelFont("Y")%10 > 2) {
1524 } else {
1527 }
1533 if (fCurSelStyle->GetOptLogy())
1535 else
1540 if (fCurSelStyle->GetNdivisions("Y") > 0)
1542 else
1545 if (fCurSelStyle->GetTitleFont("Z")%10 > 2) {
1548 } else {
1551 }
1556 if (fCurSelStyle->GetLabelFont("Z")%10 > 2) {
1559 } else {
1562 }
1568
1569 if (fCurSelStyle->GetOptLogz())
1571 else
1573
1577 if (fCurSelStyle->GetNdivisions("Z") > 0)
1579 else
1581 break;
1582 case 5: // TITLES
1587 if (fCurSelStyle->GetTitleFont()%10 > 2) {
1590 } else {
1593 }
1598 fTitleX->SetIntNumber((Int_t) (fCurSelStyle->GetTitleX() * 100 + 0.5));
1599 fTitleY->SetIntNumber((Int_t) (fCurSelStyle->GetTitleY() * 100 + 0.5));
1600 fTitleW->SetIntNumber((Int_t) (fCurSelStyle->GetTitleW() * 100 + 0.5));
1601 fTitleH->SetIntNumber((Int_t) (fCurSelStyle->GetTitleH() * 100 + 0.5));
1602
1603 if (fCurSelStyle->GetOptTitle()) {
1611// TODO Just delete when ComboBox can be grayed
1612 //fTitleFont->SetState(kTRUE);
1613 //fTitleAlign->SetState(kTRUE);
1614 //fTitleBorderSize->SetState(kTRUE);
1615 //fLegendBorderSize->SetState(kTRUE);
1620 } else {
1627// TODO Just delete when ComboBox can be grayed
1628 //fTitleFont->SetState(kFALSE);
1629 //fTitleAlign->SetState(kFALSE);
1630 //fTitleBorderSize->SetState(kFALSE);
1631 //fLegendBorderSize->SetState(kFALSE);
1636 }
1637 break;
1638 case 6: // STATS
1643 if (fCurSelStyle->GetStatFont()%10 > 2) {
1646 } else {
1649 }
1651
1657 tmp = fCurSelStyle->GetOptStat();
1658
1659 if (tmp % 10) fOptStatName->SetState(kButtonDown, kFALSE);
1661
1662 if ((tmp/10) % 10) fOptStatEntries->SetState(kButtonDown, kFALSE);
1664
1665 if ((tmp/100) % 10) fOptStatMean->SetState(kButtonDown, kFALSE);
1667
1668 if ((tmp/1000) % 10) fOptStatRMS->SetState(kButtonDown, kFALSE);
1670
1671 if ((tmp/10000) % 10) fOptStatUnderflow->SetState(kButtonDown, kFALSE);
1673
1674 if ((tmp/100000) % 10) fOptStatOverflow->SetState(kButtonDown, kFALSE);
1676
1677 if ((tmp/1000000) % 10) fOptStatIntegral->SetState(kButtonDown, kFALSE);
1679
1680 if ((tmp/10000000) % 10) fOptStatSkewness->SetState(kButtonDown, kFALSE);
1682
1683 if ((tmp/100000000) % 10) fOptStatKurtosis->SetState(kButtonDown, kFALSE);
1685
1686 if ((((tmp/100) % 10) == 2) || (((tmp/1000) % 10) == 2) ||
1687 (((tmp/10000000) % 10) == 2) || (((tmp/100000000) % 10) == 2))
1690
1692 tmp2 = fCurSelStyle->GetOptFit();
1693
1694 if (tmp2 % 10) fOptFitValues->SetState(kButtonDown, kFALSE);
1696
1697 if ((tmp2/10) % 10) {
1700 } else
1702
1703 if ((tmp2/100) % 10) fOptFitChi->SetState(kButtonDown, kFALSE);
1705
1706 if ((tmp2/1000) % 10) fOptFitProbability->SetState(kButtonDown, kFALSE);
1708
1710 break;
1711
1712 case 7: // PS / PDF
1717 Float_t papSizeX;
1718 Float_t papSizeY;
1719 fCurSelStyle->GetPaperSize(papSizeX, papSizeY);
1720 if ((papSizeX == 20) && (papSizeY == 26)) {
1723 fPaperSizeX->SetNumber(papSizeX);
1724 fPaperSizeY->SetNumber(papSizeY);
1725 } else if ((papSizeX == 20) && (papSizeY == 24)) {
1728 fPaperSizeX->SetNumber(papSizeX * 0.394);
1729 fPaperSizeY->SetNumber(papSizeY * 0.394);
1730 } else {
1733 fPaperSizeX->SetNumber(papSizeX);
1734 fPaperSizeY->SetNumber(papSizeY);
1735 }
1736 break;
1737 }
1738}
1739
1740////////////////////////////////////////////////////////////////////////////////
1741/// Connect every entry in the top level interface to the slot.
1742
1744{
1745 Connect("CloseWindow()", "TStyleManager", this, "CloseWindow()");
1746 fMenuStyle->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
1747 fMenuHelp->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
1748 fToolBarNew->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuNew));
1749 fToolBarDelete->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuDelete));
1750 fToolBarImportCanvas->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportCanvas));
1751 fToolBarImportMacro->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportMacro));
1752 fToolBarExport->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuExport));
1753 fToolBarHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelp));
1754 fListComboBox->Connect("Selected(Int_t)", "TStyleManager", this, "DoListSelect()");
1755 fPreviewButton->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoPreview(Bool_t)");
1756 fPreviewRealTime->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoRealTime(Bool_t)");
1757 fMakeDefault->Connect("Clicked()", "TStyleManager", this, "DoMakeDefault()");
1758 fApplyOnGroup->Connect("Clicked(Int_t)", "TStyleManager", this, "DoApplyOnSelect(Int_t)");
1759 fApplyOnButton->Connect("Clicked()", "TStyleManager", this, "DoApplyOn()");
1760 fMoreLess->Connect("Clicked()", "TStyleManager", this, "DoMoreLess()");
1761
1762 fEditionHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelpEditor));
1763 fEditionUpdatePreview->Connect("Clicked()", "TStyleManager", this, "DoEditionUpdatePreview()");
1764 fEditionReset->Connect("Clicked()", "TStyleManager", this, "DoImportMacro(Int_t=kFALSE)");
1765 fEditionTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeTab(Int_t)");
1766 fAxisTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeAxisTab(Int_t)");
1767
1768 // Connect signals emited when the current pad changed.
1769 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)", "TStyleManager",
1770 this, "DoSelectCanvas(TVirtualPad *, TObject *, Int_t)");
1771 TQObject::Connect("TCanvas", "Closed()", "TStyleManager", this, "DoSelectNoCanvas()");
1772}
1773
1774////////////////////////////////////////////////////////////////////////////////
1775/// Disconnect every entry in the top level interface of the slot.
1776
1778{
1779 Disconnect("CloseWindow()");
1780 fMenuStyle->Disconnect("Activated(Int_t)");
1781 fMenuHelp->Disconnect("Activated(Int_t)");
1782 fToolBarNew->Disconnect("Clicked()");
1783 fToolBarDelete->Disconnect("Clicked()");
1784 fToolBarImportCanvas->Disconnect("Clicked()");
1785 fToolBarImportMacro->Disconnect("Clicked()");
1786 fToolBarExport->Disconnect("Clicked()");
1787 fToolBarHelp->Disconnect("Clicked()");
1788 fListComboBox->Disconnect("Selected(Int_t)");
1789 fPreviewButton->Disconnect("Toggled(Bool_t)");
1790 fMakeDefault->Disconnect("Clicked()");
1791 fApplyOnGroup->Disconnect("Clicked(Int_t)");
1792 fApplyOnButton->Disconnect("Clicked()");
1793 fMoreLess->Disconnect("Clicked()");
1794
1795 fEditionHelp->Disconnect("Clicked()");
1796 fEditionUpdatePreview->Disconnect("Clicked()");
1797 fEditionReset->Disconnect("Clicked()");
1798 fEditionTab->Disconnect("Selected(Int_t)");
1799
1800 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
1801 TQObject::Disconnect("TCanvas", "Closed()");
1802}
1803
1804////////////////////////////////////////////////////////////////////////////////
1805/// Connect every widget entry of the editor to its specific slot.
1806
1808{
1809 if (fSigSlotConnected) return;
1811
1812 switch (tabNum) {
1813 case 0: // GENERAL
1814 fFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFillColor()");
1815 fFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFillStyle()");
1816 fHatchesLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHatchesLineWidth()");
1817 fHatchesSpacing->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModHatchesSpacing()");
1818 fMarkerColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModMarkerColor()");
1819 fMarkerStyle->Connect("MarkerSelected(Style_t)", "TStyleManager", this, "ModMarkerStyle()");
1820 fMarkerSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModMarkerSize()");
1821 fScreenFactor->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModScreenFactor()");
1822 fLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModLineColor()");
1823 fLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineWidth()");
1824 fLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineStyle()");
1825 fLineStyleEdit->Connect("Clicked()", "TStyleManager", this, "ModLineStyleEdit()");
1826 fTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTextColor()");
1827 fTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextSize()");
1828 fTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTextSizeInPixels(Bool_t)");
1829 fTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextFont()");
1830 fTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextAlign()");
1831 fTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextAngle()");
1832 break;
1833 case 1: // CANVAS
1834 fCanvasColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModCanvasColor()");
1835 fCanvasDefX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefX()");
1836 fCanvasDefY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefY()");
1837 fCanvasDefW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefW()");
1838 fCanvasDefH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefH()");
1839 fCanvasBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModCanvasBorderMode()");
1840 fCanvasBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModCanvasBorderSize()");
1841 fOptDateBool->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptDateBool()");
1842 fAttDateTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModAttDateTextColor()");
1843 fAttDateTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextSize()");
1844 fAttDateTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModAttDateTextSizeInPixels(Bool_t)");
1845 fOptDateFormat->Connect("Selected(Int_t)", "TStyleManager", this, "ModOptDateFormat()");
1846 fAttDateTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextFont()");
1847 fAttDateTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextAngle()");
1848 fAttDateTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextAlign()");
1849 fDateX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateX()");
1850 fDateY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateY()");
1851 break;
1852 case 2: // PAD
1853 fPadTopMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadTopMargin()");
1854 fPadBottomMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadBottomMargin()");
1855 fPadLeftMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadLeftMargin()");
1856 fPadRightMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadRightMargin()");
1857 fPadBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModPadBorderMode()");
1858 fPadBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModPadBorderSize()");
1859 fPadColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModPadColor()");
1860 fPadTickX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickX()");
1861 fPadTickY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickY()");
1862 fPadGridX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridX()");
1863 fPadGridY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridY()");
1864 fGridColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModGridColor()");
1865 fGridWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridWidth()");
1866 fGridStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridStyle()");
1867 break;
1868 case 3: // HISTOS
1869 fHistFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistFillColor()");
1870 fHistFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModHistFillStyle()");
1871 fHistLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistLineColor()");
1872 fHistLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineWidth()");
1873 fHistLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineStyle()");
1874 fBarWidth->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarWidth()");
1875 fBarOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarOffset()");
1876 fHistMinimumZero->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModHistMinimumZero()");
1877 fPaintTextFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModPaintTextFormat()");
1878 fNumberContours->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModNumberContours()");
1879 fLegoInnerR->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLegoInnerR()");
1880 fFrameFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameFillColor()");
1881 fFrameFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFrameFillStyle()");
1882 fFrameLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameLineColor()");
1883 fFrameLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineWidth()");
1884 fFrameLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineStyle()");
1885 fPaletteEdit->Connect("Clicked()", "TStyleManager", this, "ModPaletteEdit()");
1886 fFrameBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModFrameBorderMode()");
1887 fFrameBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameBorderSize()");
1888 fFuncColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFuncColor()");
1889 fFuncWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncWidth()");
1890 fFuncStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncStyle()");
1891 fDrawBorder->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModDrawBorder()");
1892 fEndErrorSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModEndErrorSize()");
1893 fErrorX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModErrorX()");
1894 break;
1895 case 4: // AXIS
1896 fTimeOffsetDate->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
1897 fTimeOffsetTime->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
1898 fStripDecimals->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStripDecimals()");
1899 fApplyOnXYZ->Connect("Clicked()", "TStyleManager", this, "ModApplyOnXYZ()");
1900 fXTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleSize()");
1901 fXTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXTitleSizeInPixels(Bool_t)");
1902 fXTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXTitleColor()");
1903 fXTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleOffset()");
1904 fXTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXTitleFont()");
1905 fXLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelSize()");
1906 fXLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXLabelSizeInPixels(Bool_t)");
1907 fXLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXLabelColor()");
1908 fXLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelOffset()");
1909 fXLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXLabelFont()");
1910 fXAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXAxisColor()");
1911 fXTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTickLength()");
1912 fOptLogx->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogx()");
1913 fXNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1914 fXNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1915 fXNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
1916 fXNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXNdivisions()");
1917 fYTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleSize()");
1918 fYTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYTitleSizeInPixels(Bool_t)");
1919 fYTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYTitleColor()");
1920 fYTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleOffset()");
1921 fYTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYTitleFont()");
1922 fYLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelSize()");
1923 fYLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYLabelSizeInPixels(Bool_t)");
1924 fYLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYLabelColor()");
1925 fYLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelOffset()");
1926 fYLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYLabelFont()");
1927 fYAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYAxisColor()");
1928 fYTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTickLength()");
1929 fOptLogy->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogy()");
1930 fYNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1931 fYNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1932 fYNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
1933 fYNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYNdivisions()");
1934 fZTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleSize()");
1935 fZTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZTitleSizeInPixels(Bool_t)");
1936 fZTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZTitleColor()");
1937 fZTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleOffset()");
1938 fZTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZTitleFont()");
1939 fZLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelSize()");
1940 fZLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZLabelSizeInPixels(Bool_t)");
1941 fZLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZLabelColor()");
1942 fZLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelOffset()");
1943 fZLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZLabelFont()");
1944 fZAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZAxisColor()");
1945 fZTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTickLength()");
1946 fOptLogz->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogz()");
1947 fZNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1948 fZNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1949 fZNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
1950 fZNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZNdivisions()");
1951 break;
1952 case 5: // TITLES
1953 fOptTitle->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptTitle()");
1954 fTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleFillColor()");
1955 fTitleStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModTitleStyle()");
1956 fTitleTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleTextColor()");
1957 fTitleFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleFontSize()");
1958 fTitleFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTitleFontSizeInPixels(Bool_t)");
1959 fTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleFont()");
1960 fTitleAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleAlign()");
1961 fTitleBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleBorderSize()");
1962 fTitleX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleX()");
1963 fTitleY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleY()");
1964 fTitleW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleW()");
1965 fTitleH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleH()");
1966 fLegendBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModLegendBorderSize()");
1967 break;
1968 case 6: // STATS
1969 fStatColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatColor(Pixel_t)");
1970 fStatStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModStatStyle(Style_t)");
1971 fStatTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatTextColor(Pixel_t)");
1972 fStatFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatFontSize()");
1973 fStatFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStatFontSizeInPixels(Bool_t)");
1974 fStatFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatFont()");
1975 fStatX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatX()");
1976 fStatY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatY()");
1977 fStatW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatW()");
1978 fStatH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatH()");
1979 fStatBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatBorderSize()");
1980 fOptStatName->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1981 fOptStatEntries->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1982 fOptStatOverflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1983 fOptStatMean->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1984 fOptStatUnderflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1985 fOptStatRMS->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1986 fOptStatSkewness->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1987 fOptStatIntegral->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1988 fOptStatKurtosis->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1989 fOptStatErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
1990 fStatFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModStatFormat(const char *)");
1991 fOptFitValues->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1992 fOptFitErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1993 fOptFitProbability->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1994 fOptFitChi->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
1995 fFitFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModFitFormat(const char *)");
1996 break;
1997 case 7: // PS / PDF
1998 fHeaderPS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModHeaderPS()");
1999 fTitlePS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModTitlePS()");
2000 fColorModelPS->Connect("Clicked(Int_t)", "TStyleManager", this, "ModColorModelPS()");
2001 fLineScalePS->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLineScalePS()");
2002 fPaperSizePredef->Connect("Selected(Int_t)", "TStyleManager", this, "ModPaperSizePredef()");
2003 fPaperSizeX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
2004 fPaperSizeY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
2005 break;
2006 }
2007}
2008
2009////////////////////////////////////////////////////////////////////////////////
2010/// Disconnect every widget entry of the editor from its slot. Must be
2011/// called before UpdateEditor() to avoid recursive calls.
2012
2014{
2015 if (!fSigSlotConnected) return;
2017
2018 switch (tabNum) {
2019 case 0: // GENERAL
2020 fFillColor->Disconnect("ColorSelected(Pixel_t)");
2021 fFillStyle->Disconnect("PatternSelected(Style_t)");
2022 fHatchesLineWidth->Disconnect("Selected(Int_t)");
2023 fHatchesSpacing->Disconnect("ValueSet(Long_t)");
2024 fMarkerColor->Disconnect("ColorSelected(Pixel_t)");
2025 fMarkerStyle->Disconnect("MarkerSelected(Style_t)");
2026 fMarkerSize->Disconnect("Selected(Int_t)");
2027 fScreenFactor->Disconnect("ValueSet(Long_t)");
2028 fLineColor->Disconnect("ColorSelected(Pixel_t)");
2029 fLineWidth->Disconnect("Selected(Int_t)");
2030 fLineStyle->Disconnect("Selected(Int_t)");
2031 fLineStyleEdit->Disconnect("Clicked()");
2032 fTextColor->Disconnect("ColorSelected(Pixel_t)");
2033 fTextSize->Disconnect("ValueSet(Long_t)");
2034 fTextFont->Disconnect("Selected(Int_t)");
2035 fTextAlign->Disconnect("Selected(Int_t)");
2036 fTextAngle->Disconnect("ValueSet(Long_t)");
2037 break;
2038 case 1: // CANVAS
2039 fCanvasColor->Disconnect("ColorSelected(Pixel_t)");
2040 fCanvasDefX->Disconnect("ValueSet(Long_t)");
2041 fCanvasDefY->Disconnect("ValueSet(Long_t)");
2042 fCanvasDefW->Disconnect("ValueSet(Long_t)");
2043 fCanvasDefH->Disconnect("ValueSet(Long_t)");
2044 fCanvasBorderMode->Disconnect("Clicked(Int_t)");
2045 fCanvasBorderSize->Disconnect("Selected(Int_t)");
2046 fOptDateBool->Disconnect("Toggled(Bool_t)");
2047 fAttDateTextColor->Disconnect("ColorSelected(Pixel_t)");
2048 fAttDateTextSize->Disconnect("ValueSet(Long_t)");
2049 fOptDateFormat->Disconnect("Selected(Int_t)");
2050 fAttDateTextFont->Disconnect("Selected(Int_t)");
2051 fAttDateTextAngle->Disconnect("ValueSet(Long_t)");
2052 fAttDateTextAlign->Disconnect("Selected(Int_t)");
2053 fDateX->Disconnect("ValueSet(Long_t)");
2054 fDateY->Disconnect("ValueSet(Long_t)");
2055 break;
2056 case 2: // PAD
2057 fPadTopMargin->Disconnect("ValueSet(Long_t)");
2058 fPadBottomMargin->Disconnect("ValueSet(Long_t)");
2059 fPadLeftMargin->Disconnect("ValueSet(Long_t)");
2060 fPadRightMargin->Disconnect("ValueSet(Long_t)");
2061 fPadBorderMode->Disconnect("Clicked(Int_t)");
2062 fPadBorderSize->Disconnect("Selected(Int_t)");
2063 fPadColor->Disconnect("ColorSelected(Pixel_t)");
2064 fPadTickX->Disconnect("Toggled(Bool_t)");
2065 fPadTickY->Disconnect("Toggled(Bool_t)");
2066 fPadGridX->Disconnect("Toggled(Bool_t)");
2067 fPadGridY->Disconnect("Toggled(Bool_t)");
2068 fGridColor->Disconnect("ColorSelected(Pixel_t)");
2069 fGridWidth->Disconnect("Selected(Int_t)");
2070 fGridStyle->Disconnect("Selected(Int_t)");
2071 break;
2072 case 3: // HISTOS
2073 fHistFillColor->Disconnect("ColorSelected(Pixel_t)");
2074 fHistFillStyle->Disconnect("PatternSelected(Style_t)");
2075 fHistLineColor->Disconnect("ColorSelected(Pixel_t)");
2076 fHistLineWidth->Disconnect("Selected(Int_t)");
2077 fHistLineStyle->Disconnect("Selected(Int_t)");
2078 fBarWidth->Disconnect("ValueSet(Long_t)");
2079 fBarOffset->Disconnect("ValueSet(Long_t)");
2080 fHistMinimumZero->Disconnect("Toggled(Bool_t)");
2081 fPaintTextFormat->Disconnect("TextChanged(const char *)");
2082 fNumberContours->Disconnect("ValueSet(Long_t)");
2083 fLegoInnerR->Disconnect("ValueSet(Long_t)");
2084 fFrameFillColor->Disconnect("ColorSelected(Pixel_t)");
2085 fFrameFillStyle->Disconnect("PatternSelected(Style_t)");
2086 fFrameLineColor->Disconnect("ColorSelected(Pixel_t)");
2087 fFrameLineWidth->Disconnect("Selected(Int_t)");
2088 fFrameLineStyle->Disconnect("Selected(Int_t)");
2089 fPaletteEdit->Disconnect("Clicked()");
2090 fFrameBorderMode->Disconnect("Clicked(Int_t)");
2091 fFrameBorderSize->Disconnect("Selected(Int_t)");
2092 fFuncColor->Disconnect("ColorSelected(Pixel_t)");
2093 fFuncWidth->Disconnect("Selected(Int_t)");
2094 fFuncStyle->Disconnect("Selected(Int_t)");
2095 fDrawBorder->Disconnect("Toggled(Bool_t)");
2096 fEndErrorSize->Disconnect("ValueSet(Long_t)");
2097 fErrorX->Disconnect("ValueSet(Long_t)");
2098 break;
2099 case 4: // AXIS
2100 fTimeOffsetDate->Disconnect("ValueSet(Long_t)");
2101 fTimeOffsetTime->Disconnect("ValueSet(Long_t)");
2102 fStripDecimals->Disconnect("Toggled(Bool_t)");
2103 fApplyOnXYZ->Disconnect("Clicked()");
2104 fXTitleSize->Disconnect("ValueSet(Long_t)");
2105 fXTitleColor->Disconnect("ColorSelected(Pixel_t)");
2106 fXTitleOffset->Disconnect("ValueSet(Long_t)");
2107 fXTitleFont->Disconnect("Selected(Int_t)");
2108 fXLabelSize->Disconnect("ValueSet(Long_t)");
2109 fXLabelColor->Disconnect("ColorSelected(Pixel_t)");
2110 fXLabelOffset->Disconnect("ValueSet(Long_t)");
2111 fXLabelFont->Disconnect("Selected(Int_t)");
2112 fXAxisColor->Disconnect("ColorSelected(Pixel_t)");
2113 fXTickLength->Disconnect("ValueSet(Long_t)");
2114 fOptLogx->Disconnect("Toggled(Bool_t)");
2115 fXNdivMain->Disconnect("ValueSet(Long_t)");
2116 fXNdivSub->Disconnect("ValueSet(Long_t)");
2117 fXNdivSubSub->Disconnect("ValueSet(Long_t)");
2118 fXNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2119 fYTitleSize->Disconnect("ValueSet(Long_t)");
2120 fYTitleColor->Disconnect("ColorSelected(Pixel_t)");
2121 fYTitleOffset->Disconnect("ValueSet(Long_t)");
2122 fYTitleFont->Disconnect("Selected(Int_t)");
2123 fYLabelSize->Disconnect("ValueSet(Long_t)");
2124 fYLabelColor->Disconnect("ColorSelected(Pixel_t)");
2125 fYLabelOffset->Disconnect("ValueSet(Long_t)");
2126 fYLabelFont->Disconnect("Selected(Int_t)");
2127 fYAxisColor->Disconnect("ColorSelected(Pixel_t)");
2128 fYTickLength->Disconnect("ValueSet(Long_t)");
2129 fOptLogy->Disconnect("Toggled(Bool_t)");
2130 fYNdivMain->Disconnect("ValueSet(Long_t)");
2131 fYNdivSub->Disconnect("ValueSet(Long_t)");
2132 fYNdivSubSub->Disconnect("ValueSet(Long_t)");
2133 fYNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2134 fZTitleSize->Disconnect("ValueSet(Long_t)");
2135 fZTitleColor->Disconnect("ColorSelected(Pixel_t)");
2136 fZTitleOffset->Disconnect("ValueSet(Long_t)");
2137 fZTitleFont->Disconnect("Selected(Int_t)");
2138 fZLabelSize->Disconnect("ValueSet(Long_t)");
2139 fZLabelColor->Disconnect("ColorSelected(Pixel_t)");
2140 fZLabelOffset->Disconnect("ValueSet(Long_t)");
2141 fZLabelFont->Disconnect("Selected(Int_t)");
2142 fZAxisColor->Disconnect("ColorSelected(Pixel_t)");
2143 fZTickLength->Disconnect("ValueSet(Long_t)");
2144 fOptLogz->Disconnect("Toggled(Bool_t)");
2145 fZNdivMain->Disconnect("ValueSet(Long_t)");
2146 fZNdivSub->Disconnect("ValueSet(Long_t)");
2147 fZNdivSubSub->Disconnect("ValueSet(Long_t)");
2148 fZNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
2149 break;
2150 case 5: // TITLES
2151 fOptTitle->Disconnect("Toggled(Bool_t)");
2152 fTitleColor->Disconnect("ColorSelected(Pixel_t)");
2153 fTitleStyle->Disconnect("PatternSelected(Style_t)");
2154 fTitleTextColor->Disconnect("ColorSelected(Pixel_t)");
2155 fTitleFontSize->Disconnect("ValueSet(Long_t)");
2156 fTitleFont->Disconnect("Selected(Int_t)");
2157 fTitleAlign->Disconnect("Selected(Int_t)");
2158 fTitleBorderSize->Disconnect("Selected(Int_t)");
2159 fTitleX->Disconnect("ValueSet(Long_t)");
2160 fTitleY->Disconnect("ValueSet(Long_t)");
2161 fTitleW->Disconnect("ValueSet(Long_t)");
2162 fTitleH->Disconnect("ValueSet(Long_t)");
2163 fLegendBorderSize->Disconnect("Selected(Int_t)");
2164 break;
2165 case 6: // STATS
2166 fStatColor->Disconnect("ColorSelected(Pixel_t)");
2167 fStatStyle->Disconnect("PatternSelected(Style_t)");
2168 fStatTextColor->Disconnect("ColorSelected(Pixel_t)");
2169 fStatFontSize->Disconnect("ValueSet(Long_t)");
2170 fStatFont->Disconnect("Selected(Int_t)");
2171 fStatX->Disconnect("ValueSet(Long_t)");
2172 fStatY->Disconnect("ValueSet(Long_t)");
2173 fStatW->Disconnect("ValueSet(Long_t)");
2174 fStatH->Disconnect("ValueSet(Long_t)");
2175 fStatBorderSize->Disconnect("Selected(Int_t)");
2176 fOptStatName->Disconnect("Toggled(Bool_t)");
2177 fOptStatEntries->Disconnect("Toggled(Bool_t)");
2178 fOptStatOverflow->Disconnect("Toggled(Bool_t)");
2179 fOptStatMean->Disconnect("Toggled(Bool_t)");
2180 fOptStatUnderflow->Disconnect("Toggled(Bool_t)");
2181 fOptStatRMS->Disconnect("Toggled(Bool_t)");
2182 fOptStatSkewness->Disconnect("Toggled(Bool_t)");
2183 fOptStatIntegral->Disconnect("Toggled(Bool_t)");
2184 fOptStatKurtosis->Disconnect("Toggled(Bool_t)");
2185 fOptStatErrors->Disconnect("Toggled(Bool_t)");
2186 fStatFormat->Disconnect("TextChanged(const char *)");
2187 fOptFitValues->Disconnect("Toggled(Bool_t)");
2188 fOptFitErrors->Disconnect("Toggled(Bool_t)");
2189 fOptFitProbability->Disconnect("Toggled(Bool_t)");
2190 fOptFitChi->Disconnect("Toggled(Bool_t)");
2191 fFitFormat->Disconnect("TextChanged(const char *)");
2192 break;
2193 case 7: // PS / PDF
2194 fHeaderPS->Disconnect("TextChanged(const char *)");
2195 fTitlePS->Disconnect("TextChanged(const char *)");
2196 fColorModelPS->Disconnect("Clicked(Int_t)");
2197 fLineScalePS->Disconnect("ValueSet(Long_t)");
2198 fPaperSizePredef->Disconnect("Selected(Int_t)");
2199 fPaperSizeX->Disconnect("ValueSet(Long_t)");
2200 fPaperSizeY->Disconnect("ValueSet(Long_t)");
2201 break;
2202 }
2203}
2204
2205////////////////////////////////////////////////////////////////////////////////
2206/// Called each time something is changed in the style editor. Thanks to
2207/// this method, we can know if the style differs from the original style.
2208
2210{
2212
2213 // Update the status bar.
2215
2216 // Update the preview if the real time mode is selected.
2217 if (fRealTimePreview)
2219}
2220
2221////////////////////////////////////////////////////////////////////////////////
2222/// Add the editor to the frame 'p'. It contains the tabs allowing the user
2223/// to modify every data member of the current TStyle object.
2224
2226{
2227 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 8, 8, 5, 5);
2228 fTrashListLayout->Add(layout1);
2229 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10, 10);
2230 fTrashListLayout->Add(layout2);
2231
2234
2235 fEditionTab = new TGTab(fEditionFrame, 200, 150);
2236 fEditionTab->Associate(this);
2237 CreateTabGeneral(fEditionTab->AddTab("General"));
2240 CreateTabHistos(fEditionTab->AddTab("Histograms"));
2244 CreateTabPsPdf(fEditionTab->AddTab("PS / PDF"));
2246
2249 fEditionHelp->Associate(this);
2256 fEditionReset->Associate(this);
2259
2260 p->AddFrame(fEditionFrame, layout1);
2261
2262 fEditionHelp->SetToolTipText("Help about the current tab");
2263 fEditionUpdatePreview->SetToolTipText("Force the refresh of the preview window");
2264 fEditionReset->SetToolTipText("Reset the selected style");
2265}
2266
2267////////////////////////////////////////////////////////////////////////////////
2268/// Add the tab 'General' to the editor.
2269
2271{
2272 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
2273 fTrashListLayout->Add(layout);
2274
2279 tab->AddFrame(h1, fLayoutExpandX);
2280
2281 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2283 AddGeneralText(h2);
2290 "Screen factor:", 0, 6, TGNumberFormat::kNESRealOne,
2293 v->AddFrame(h3, layout);
2295 tab->AddFrame(h2, fLayoutExpandX);
2296
2297 fScreenFactor->GetNumberEntry()->SetToolTipText("Coefficient for different screen's resolutions");
2298}
2299
2300////////////////////////////////////////////////////////////////////////////////
2301/// Add the 'Fill' group frame to the 'General' tab.
2302
2304{
2305 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 5, 0, 5, 5);
2306 fTrashListLayout->Add(layout2);
2307
2308 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2315 AddTitle(gf, "Hatchings");
2323 gf->AddFrame(h2, layout2);
2324 f->AddFrame(gf, fLayoutExpandXYMargin);
2325
2326// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2327// fFillColor->SetToolTipText("General fill color");
2328// fFillStyle->SetToolTipText("General fill pattern");
2329 fHatchesSpacing->GetNumberEntry()->SetToolTipText("Spacing between the hatching's lines");
2330}
2331
2332////////////////////////////////////////////////////////////////////////////////
2333/// Add the 'Line' group frame to the 'General' tab.
2334
2336{
2337 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2345 fLineStyleEdit = AddTextButton(gf, "Lines' Style Editor...", kGeneralLineStyleEdit);
2347 f->AddFrame(gf, fLayoutExpandXYMargin);
2348
2349// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2350// fLineColor->SetToolTipText("General line color");
2351}
2352
2353////////////////////////////////////////////////////////////////////////////////
2354/// Add the 'Text' group frame to the 'General' tab.
2355
2357{
2358 TGGroupFrame *gf = new TGGroupFrame(f, "Text");
2369 fTextSize = AddNumberEntry(h2, 21, 10, 0, kGeneralTextSize, "Size:", 0, 5,
2373 gf->AddFrame(h2, fLayoutExpandX);
2374 fTextAngle = AddNumberEntry(gf, 0, 0, 0, kGeneralTextAngle, "Angle:",
2378 f->AddFrame(gf, fLayoutExpandXYMargin);
2379
2380// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2381// fTextColor->SetToolTipText("General text color");
2382 fTextSizeInPixels->SetToolTipText("Set the text size in pixels if selected, otherwise - in % of pad.");
2383 fTextSize->GetNumberEntry()->SetToolTipText("General text size (in pixels or in % of pad)");
2384 fTextAngle->GetNumberEntry()->SetToolTipText("General text angle");
2385}
2386
2387////////////////////////////////////////////////////////////////////////////////
2388/// Add the 'Marker' group frame to the 'General' tab.
2389
2391{
2392 TGGroupFrame *gf = new TGGroupFrame(f, "Marker");
2400 f->AddFrame(gf, fLayoutExpandXMargin);
2401
2402// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2403// fMarkerColor->SetToolTipText("Marker color");
2404// fMarkerStyle->SetToolTipText("Marker shape");
2405}
2406
2407////////////////////////////////////////////////////////////////////////////////
2408/// Add the tab 'Canvas' to the editor.
2409
2411{
2419 h->AddFrame(v1, fLayoutExpandXY);
2423 h->AddFrame(v2, fLayoutExpandXY);
2424 tab->AddFrame(h, fLayoutExpandX);
2425}
2426
2427////////////////////////////////////////////////////////////////////////////////
2428/// Add the 'Fill' group frame to the 'Canvas' tab.
2429
2431{
2432 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2438 f->AddFrame(gf, fLayoutExpandXMargin);
2439
2440// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2441// fCanvasColor->SetToolTipText("Color used to fill canvases");
2442}
2443
2444////////////////////////////////////////////////////////////////////////////////
2445/// Add the 'Geometry' group frame to the 'Canvas' tab.
2446
2448{
2449 TGGroupFrame *gf = new TGGroupFrame(f, "Geometry");
2453 fCanvasDefX = AddNumberEntry(h1, 0, 9, 0, kCanvasDefX, "X:",
2457 fCanvasDefY = AddNumberEntry(h1, 7, 8, 0, kCanvasDefY, "Y:",
2462
2465 fCanvasDefW = AddNumberEntry(h2, 0, 7, 0, kCanvasDefW, "W:",
2469 fCanvasDefH = AddNumberEntry(h2, 7, 8, 0, kCanvasDefH, "H:",
2473 gf->AddFrame(h2, fLayoutExpandX);
2474 f->AddFrame(gf, fLayoutExpandXMargin);
2475
2476 fCanvasDefX->GetNumberEntry()->SetToolTipText("Canvases' default abscissa");
2477 fCanvasDefY->GetNumberEntry()->SetToolTipText("Canvases' default ordinate");
2478 fCanvasDefW->GetNumberEntry()->SetToolTipText("Canvases' default width");
2479 fCanvasDefH->GetNumberEntry()->SetToolTipText("Canvases' default height");
2480}
2481
2482////////////////////////////////////////////////////////////////////////////////
2483/// Add the 'Border' group frame to the 'Canvas' tab.
2484
2486{
2489}
2490
2491////////////////////////////////////////////////////////////////////////////////
2492/// Add the 'Date' group frame to the 'Canvas' tab.
2493
2495{
2496 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10);
2497 fTrashListLayout->Add(layout2);
2498
2499 TGGroupFrame *gf = new TGGroupFrame(f, "Date");
2509 fAttDateTextSize = AddNumberEntry(h2, 22, 10, 0, kCanvasAttDateTextSize, "Size:", 0, 5,
2513 gf->AddFrame(h2, fLayoutExpandX);
2518 "Angle:", 0, 6, TGNumberFormat::kNESInteger,
2521 AddTitle(gf, "Position");
2522 TGVerticalFrame *h3 = new TGVerticalFrame(gf);
2524 fDateX = AddNumberEntry(h3, 0, 0, 0, kCanvasDateX, "X (% of Pad):",
2528 fDateY = AddNumberEntry(h3, 0, 0, 0, kCanvasDateY, "Y (% of Pad):",
2532 gf->AddFrame(h3, layout2);
2533 f->AddFrame(gf, fLayoutExpandXYMargin);
2534
2535 fOptDateBool->SetToolTipText("Show / Hide the date in canvases");
2536// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2537// fAttDateTextColor->SetToolTipText("Color of the date text");
2538 fAttDateTextSizeInPixels->SetToolTipText("Set the date text size in pixels if selected, otherwise - in % of pad");
2539 fAttDateTextSize->GetNumberEntry()->SetToolTipText("Date text size (in pixels or in % of pad)");
2540 fAttDateTextAngle->GetNumberEntry()->SetToolTipText("Date text angle");
2541 fDateX->GetNumberEntry()->SetToolTipText("Date abscissa in percent of pad");
2542 fDateY->GetNumberEntry()->SetToolTipText("Date ordinate in percent of pad");
2543}
2544
2545////////////////////////////////////////////////////////////////////////////////
2546/// Add the tab 'Pad' to the editor.
2547
2549{
2555 AddPadFill(v);
2556 AddPadTicks(v);
2557 h1->AddFrame(v, fLayoutExpandXY);
2558 tab->AddFrame(h1, fLayoutExpandX);
2559 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2561 AddPadBorder(h2);
2562 AddPadGrid(h2);
2563 tab->AddFrame(h2, fLayoutExpandX);
2564}
2565
2566////////////////////////////////////////////////////////////////////////////////
2567/// Add the 'Margin' group frame to the 'Pad' tab.
2568
2570{
2571 TGGroupFrame *gf = new TGGroupFrame(f, "Margin (% of Pad)");
2575 fPadLeftMargin = AddNumberEntry(h1, 0, 5, 0, kPadLeftMargin, "Left:",
2579 fPadRightMargin = AddNumberEntry(h1, 0, 0, 0, kPadRightMargin, "Right:",
2586 fPadTopMargin = AddNumberEntry(h2, 0, 5, 0, kPadTopMargin, "Top:",
2590 fPadBottomMargin = AddNumberEntry(h2, 0, 0, 0, kPadBottomMargin, "Bottom:",
2594 gf->AddFrame(h2, fLayoutExpandXY);
2595 f->AddFrame(gf, fLayoutExpandXYMargin);
2596
2597 fPadLeftMargin->GetNumberEntry()->SetToolTipText("Pads' left margin");
2598 fPadRightMargin->GetNumberEntry()->SetToolTipText("Pads' right margin");
2599 fPadTopMargin->GetNumberEntry()->SetToolTipText("Pads' top margin");
2600 fPadBottomMargin->GetNumberEntry()->SetToolTipText("Pads' bottom margin");
2601}
2602
2603////////////////////////////////////////////////////////////////////////////////
2604/// Add the 'Border' group frame to the 'Pad' tab.
2605
2607{
2610}
2611
2612////////////////////////////////////////////////////////////////////////////////
2613/// Add the 'Fill' group frame to the 'Pad' tab.
2614
2616{
2617 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2623 f->AddFrame(gf, fLayoutExpandXYMargin);
2624
2625// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2626// fPadColor->SetToolTipText("Color used to fill pads");
2627}
2628
2629////////////////////////////////////////////////////////////////////////////////
2630/// Add the 'Ticks' group frame to the 'Pad' tab.
2631
2633{
2634 TGGroupFrame *gf = new TGGroupFrame(f, "Ticks");
2640 fPadTickX = AddCheckButton(h1, "Along X", kPadTickX);
2641 h->AddFrame(h1, fLayoutExpandX);
2644 fPadTickY = AddCheckButton(h2, "Along Y", kPadTickY);
2645 h->AddFrame(h2, fLayoutExpandX);
2647 f->AddFrame(gf, fLayoutExpandXYMargin);
2648
2649 fPadTickX->SetToolTipText("Show / Hide the ticks along X");
2650 fPadTickY->SetToolTipText("Show / Hide the ticks along Y");
2651}
2652
2653////////////////////////////////////////////////////////////////////////////////
2654/// Add the 'Grid' group frame to the 'Pad' tab.
2655
2657{
2658 TGGroupFrame *gf = new TGGroupFrame(f, "Grid");
2664 fPadGridX = AddCheckButton(h10, "Along X", kPadGridX);
2665 h1->AddFrame(h10, fLayoutExpandX);
2668 fPadGridY = AddCheckButton(h20, "Along Y", kPadGridY);
2669 h1->AddFrame(h20, fLayoutExpandX);
2675 gf->AddFrame(h2, fLayoutExpandX);
2677 f->AddFrame(gf, fLayoutExpandXYMargin);
2678
2679// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2680// fGridColor->SetToolTipText("Line color for the grid");
2681 fPadGridX->SetToolTipText("Show / Hide the grid along X");
2682 fPadGridY->SetToolTipText("Show / Hide the grid along Y");
2683}
2684
2685////////////////////////////////////////////////////////////////////////////////
2686/// Add the tab 'Histos' to the editor.
2687
2689{
2690 fHistosTab = new TGTab(tab, 1, 1);
2691 fHistosTab->Associate(this);
2696}
2697
2698////////////////////////////////////////////////////////////////////////////////
2699/// Add the sub-tab 'Histos' to the tab 'Histos'.
2700
2702{
2707 tab->AddFrame(h1, fLayoutExpandX);
2708
2709 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
2713 tab->AddFrame(h2, fLayoutExpandX);
2714
2715 TGHorizontalFrame *h3 = new TGHorizontalFrame(tab);
2719 tab->AddFrame(h3, fLayoutExpandX);
2720}
2721
2722////////////////////////////////////////////////////////////////////////////////
2723/// Add the 'Fill' group frame to the 'Histos - Histos' tab.
2724
2726{
2727 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2734 f->AddFrame(gf, fLayoutExpandXYMargin);
2735
2736// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2737// fHistFillColor->SetToolTipText("Color used to fill histograms");
2738// fHistFillStyle->SetToolTipText("Pattern used to fill histograms");
2739}
2740
2741////////////////////////////////////////////////////////////////////////////////
2742/// Add the 'Line' group frame to the 'Histos - Histos' tab.
2743
2745{
2746 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2754 f->AddFrame(gf, fLayoutExpandXYMargin);
2755
2756// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2757// fHistLineColor->SetToolTipText("Color used for histograms' lines");
2758}
2759
2760////////////////////////////////////////////////////////////////////////////////
2761/// Add the 'Bar' group frame to the 'Histos - Histos' tab.
2762
2764{
2765 TGGroupFrame *gf = new TGGroupFrame(f, "Bar");
2769 fBarWidth = AddNumberEntry(h, 0, 5, 0, kHistBarWidth, "W:",
2773 fBarOffset = AddNumberEntry(h, 8, 5, 0, kHistBarOffset, "O:",
2778 f->AddFrame(gf, fLayoutExpandXYMargin);
2779
2780 fBarWidth->GetNumberEntry()->SetToolTipText("Width of bars");
2781 fBarOffset->GetNumberEntry()->SetToolTipText("Offset of bars");
2782}
2783
2784////////////////////////////////////////////////////////////////////////////////
2785/// Add the 'Contours' group frame to the 'Histos - Histos' tab.
2786
2788{
2789 TGGroupFrame *gf = new TGGroupFrame(f, "Contours");
2791 fNumberContours = AddNumberEntry(gf, 0, 0, 0, kHistNumberContours, "Number:",
2795 f->AddFrame(gf, fLayoutExpandXYMargin);
2796
2797 fNumberContours->GetNumberEntry()->SetToolTipText("Number of level lines to draw");
2798}
2799
2800////////////////////////////////////////////////////////////////////////////////
2801/// Add the 'Axis' group frame to the 'Histos - Histos' tab.
2802
2804{
2805 TGGroupFrame *gf = new TGGroupFrame(f, "Axis");
2807 fHistMinimumZero = AddCheckButton(gf, "Minimum zero", kHistMinimumZero);
2808 fPaintTextFormat = AddTextEntry(gf, "Paint format:", kHistPaintTextFormat);
2809 f->AddFrame(gf, fLayoutExpandXYMargin);
2810
2811 fHistMinimumZero->SetToolTipText("Set to zero / Compute the minimum of axis range");
2812 fPaintTextFormat->SetToolTipText("Paint format of the axis labels in histograms");
2813}
2814
2815////////////////////////////////////////////////////////////////////////////////
2816/// Add the '3D Cylindrical' group frame to the 'Histos - Histos' tab.
2817
2819{
2820 TGGroupFrame *gf = new TGGroupFrame(f, "3D Cylindrical (%)");
2822 fLegoInnerR = AddNumberEntry(gf, 0, 0, 0, kHistLegoInnerR, "Inner radius:",
2826 f->AddFrame(gf, fLayoutExpandXYMargin);
2827
2828 fLegoInnerR->GetNumberEntry()->SetToolTipText("Percent of radius allocated to the tube");
2829}
2830
2831////////////////////////////////////////////////////////////////////////////////
2832/// Add the sub-tab 'Frames' to the tab 'Histos'.
2833
2835{
2836 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 13);
2837 fTrashListLayout->Add(layout);
2838
2841
2846 h1->AddFrame(v1, fLayoutExpandXY);
2847
2853 fPaletteEdit = AddTextButton(h2, "Palette Editor...", kFramePaletteEdit);
2855 v2->AddFrame(h2, layout);
2856 h1->AddFrame(v2, fLayoutExpandXY);
2857
2858 tab->AddFrame(h1, fLayoutExpandX);
2859}
2860
2861////////////////////////////////////////////////////////////////////////////////
2862/// Add the 'Fill' group frame to the 'Histos - Frames' tab.
2863
2865{
2866 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
2873 f->AddFrame(gf, fLayoutExpandXMargin);
2874
2875// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2876// fFrameFillColor->SetToolTipText("Color used to fill frames");
2877// fFrameFillStyle->SetToolTipText("Pattern used to fill frames");
2878}
2879
2880////////////////////////////////////////////////////////////////////////////////
2881/// Add the 'Line' group frame to the 'Histos - Frames' tab.
2882
2884{
2885 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2893 f->AddFrame(gf, fLayoutExpandXYMargin);
2894
2895// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2896// fFrameLineColor->SetToolTipText("Color of lines in frames");
2897}
2898
2899////////////////////////////////////////////////////////////////////////////////
2900/// Add the 'Border' group frame to the 'Histos - Frames' tab.
2901
2903{
2906}
2907
2908////////////////////////////////////////////////////////////////////////////////
2909/// Add the sub-tab 'Graphs' to the tab 'Histos'.
2910
2912{
2917 tab->AddFrame(h, fLayoutExpandX);
2919}
2920
2921////////////////////////////////////////////////////////////////////////////////
2922/// Add the 'Line' group frame to the 'Histos - Graphs' tab.
2923
2925{
2926 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
2934 f->AddFrame(gf, fLayoutExpandXMargin);
2935
2936// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
2937// fFuncColor->SetToolTipText("Color of curves in graphs");
2938}
2939
2940////////////////////////////////////////////////////////////////////////////////
2941/// Add the 'Draw Border' check button to the 'Histos - Graphs' tab.
2942
2944{
2945 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
2946 fTrashListLayout->Add(layout);
2947
2950 fDrawBorder = AddCheckButton(h, "Draw Border (for Filled Function)", kGraphsDrawBorder);
2951 f->AddFrame(h, layout);
2952
2953 fDrawBorder->SetToolTipText("Show / Hide the border of filled functions");
2954}
2955
2956////////////////////////////////////////////////////////////////////////////////
2957/// Add the 'Errors' group frame to the 'Histos - Graphs' tab.
2958
2960{
2961 TGGroupFrame *gf = new TGGroupFrame(f, "Errors");
2964 "End error size:", 0, 4, TGNumberFormat::kNESRealOne,
2967 fErrorX = AddNumberEntry(gf, 0, 0, 0, kGraphsErrorX, "Error X (% of bin):",
2971 f->AddFrame(gf, fLayoutExpandXMargin);
2972
2973 fEndErrorSize->GetNumberEntry()->SetToolTipText("Size of lines drawn at the end of error bars");
2974 fErrorX->GetNumberEntry()->SetToolTipText("Percent of the bin width to use for errors along X");
2975}
2976
2977////////////////////////////////////////////////////////////////////////////////
2978/// Add the tab 'Axis' to the editor.
2979
2981{
2982 TGLayoutHints *layout =
2983 new TGLayoutHints(kLHintsNormal, 10, 13, 3);
2984 fTrashListLayout->Add(layout);
2985
2988
2991 fStripDecimals = AddCheckButton(h3, "Decimal labels' part", kAxisStripDecimals, 0, 8);
2992 TGVerticalFrame *space = new TGVerticalFrame(h3);
2993 fTrashListFrame->AddFirst(space);
2994 h3->AddFrame(space, fLayoutExpandXY);
2995 fApplyOnXYZ = AddTextButton(h3, "Apply on XYZ", kAxisApplyOnXYZ);
2996 h->AddFrame(h3, layout);
2997
2998 TGGroupFrame *gf = new TGGroupFrame(h, "Date/Time Offset");
3010 gf->AddFrame(h2, fLayoutExpandX);
3011 h->AddFrame(gf, fLayoutExpandXMargin);
3012 tab->AddFrame(h, fLayoutExpandX);
3013
3014 fAxisTab = new TGTab(tab);
3015 fAxisTab->Associate(this);
3016 CreateTabAxisX(fAxisTab->AddTab("X axis"));
3017 CreateTabAxisY(fAxisTab->AddTab("Y axis"));
3018 CreateTabAxisZ(fAxisTab->AddTab("Z axis"));
3020
3021 fStripDecimals->SetToolTipText("Draw / Hide the decimal part of labels");
3022 fApplyOnXYZ->SetToolTipText("Apply settings of the currently selected axis on XYZ");
3023 fTimeOffsetDate->GetNumberEntry()->SetToolTipText("Date offset for axis (dd/mm/yyyy)");
3024 fTimeOffsetTime->GetNumberEntry()->SetToolTipText("Time offset for axis (hh/mm/ss)");
3025}
3026
3027////////////////////////////////////////////////////////////////////////////////
3028/// Add the sub-tab 'X Axis' to the tab 'Axis'.
3029
3031{
3036 tab->AddFrame(h1, fLayoutExpandX);
3037
3038 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
3040 AddAxisXTitle(h2);
3041 AddAxisXLabels(h2);
3042 tab->AddFrame(h2, fLayoutExpandX);
3043}
3044
3045////////////////////////////////////////////////////////////////////////////////
3046/// Add the 'Line' group frame to the 'Axis - X Axis' tab.
3047
3049{
3050 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
3051 fTrashListLayout->Add(layout);
3052
3053 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
3060 fXTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisXTickLength, "Ticks:",
3064 h->AddFrame(h2, layout);
3066 fOptLogx = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogx);
3067 f->AddFrame(gf, fLayoutExpandXYMargin);
3068
3069// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3070// fXAxisColor->SetToolTipText("Color of axis' line");
3071 fXTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
3072 fOptLogx->SetToolTipText("Draw logarithmic scale");
3073}
3074
3075////////////////////////////////////////////////////////////////////////////////
3076/// Add the 'Title' group frame to the 'Axis - X Axis' tab.
3077
3079{
3080 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
3090 fXTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisXTitleSize, "Size:", 0, 5,
3094 gf->AddFrame(h2, fLayoutExpandX);
3095 fXTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisXTitleOffset, "Offset:",
3099 f->AddFrame(gf, fLayoutExpandXMargin);
3100
3101// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3102// fXTitleColor->SetToolTipText("Color of axis' title");
3103 fXTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
3104 fXTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
3105 fXTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
3106}
3107
3108////////////////////////////////////////////////////////////////////////////////
3109/// Add the 'Divisions' group frame to the 'Axis - X Axis' tab.
3110
3112{
3113 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
3115
3122 fXNdivSub = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivSub, "",
3126 fXNdivMain = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivMain, "",
3131
3135 gf->AddFrame(h2, fLayoutExpandX);
3136 f->AddFrame(gf, fLayoutExpandXMargin);
3137
3138 fXNdivMain->GetNumberEntry()->SetToolTipText("Primary axis divisions");
3139 fXNdivSub->GetNumberEntry()->SetToolTipText("Secondary axis divisions");
3140 fXNdivSubSub->GetNumberEntry()->SetToolTipText("Tertiary axis divisions");
3141 fXNdivisionsOptimize->SetToolTipText("Optimize the number of axis divisions if selected");
3142}
3143
3144////////////////////////////////////////////////////////////////////////////////
3145/// Add the 'Labels' group frame to the 'Axis - X Axis' tab.
3146
3148{
3149 TGGroupFrame *gf = new TGGroupFrame(f, "Labels");
3159 fXLabelSize = AddNumberEntry(h2, 22, 8, 0, kAxisXLabelSize, "Size:", 0, 5,
3163 gf->AddFrame(h2, fLayoutExpandX);
3164 fXLabelOffset = AddNumberEntry(gf, 69, 8, 0, kAxisXTitleOffset, "Offset:",
3168 f->AddFrame(gf, fLayoutExpandXMargin);
3169
3170// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3171// fXLabelColor->SetToolTipText("Color of axis' labels");
3172 fXLabelSizeInPixels->SetToolTipText("Set the labels size in pixels if selected, otherwise - in % of pad");
3173 fXLabelSize->GetNumberEntry()->SetToolTipText("Label size (in pixels or in % of pad)");
3174 fXLabelOffset->GetNumberEntry()->SetToolTipText("Offset between axis and labels");
3175}
3176
3177////////////////////////////////////////////////////////////////////////////////
3178/// Add the sub-tab 'Y Axis' to the tab 'Axis'.
3179
3181{
3186 tab->AddFrame(h1, fLayoutExpandX);
3187
3188 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
3190 AddAxisYTitle(h2);
3191 AddAxisYLabels(h2);
3192 tab->AddFrame(h2, fLayoutExpandX);
3193}
3194
3195////////////////////////////////////////////////////////////////////////////////
3196/// Add the 'Line' group frame to the 'Axis - Y Axis' tab.
3197
3199{
3200 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
3201 fTrashListLayout->Add(layout);
3202
3203 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
3210 fYTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisYTickLength, "Ticks:",
3214 h->AddFrame(h2, layout);
3216 fOptLogy = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogy);
3217 f->AddFrame(gf, fLayoutExpandXYMargin);
3218
3219// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3220// fYAxisColor->SetToolTipText("Color of axis' line");
3221 fYTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
3222 fOptLogy->SetToolTipText("Draw logarithmic scale");
3223}
3224
3225////////////////////////////////////////////////////////////////////////////////
3226/// Add the 'Title' group frame to the 'Axis - Y Axis' tab.
3227
3229{
3230 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
3240 fYTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisYTitleSize, "Size:", 0, 5,
3244 gf->AddFrame(h2, fLayoutExpandX);
3245 fYTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisYTitleOffset, "Offset:",
3249 f->AddFrame(gf, fLayoutExpandXMargin);
3250
3251// TODO Delete the // when the selectColor and selectPattern tooltips are OK.
3252// fYTitleColor->SetToolTipText("Color of axis' title");
3253 fYTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
3254 fYTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
3255 fYTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
3256}
3257
3258////////////////////////////////////////////////////////////////////////////////
3259/// Add the 'Divisions' group frame to the 'Axis - Y Axis' tab.
3260
3262{
3263 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
3266