00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 #include "TStyleManager.h"
00119 #include "TStyleDialog.h"
00120 #include "TStylePreview.h"
00121 #include "HelpSMText.h"
00122
00123 #include <TCanvas.h>
00124 #include <TColor.h>
00125 #include <TG3DLine.h>
00126 #include <TGButton.h>
00127 #include <TGButtonGroup.h>
00128 #include <TGColorSelect.h>
00129 #include <TGComboBox.h>
00130 #include <TGedMarkerSelect.h>
00131 #include <TGedPatternSelect.h>
00132 #include <TGFileDialog.h>
00133 #include <TGFrame.h>
00134 #include <TGLabel.h>
00135 #include <TGLayout.h>
00136 #include <TGMenu.h>
00137 #include <TGMsgBox.h>
00138 #include <TGNumberEntry.h>
00139 #include <TGResourcePool.h>
00140 #include <TGStatusBar.h>
00141 #include <TGTab.h>
00142 #include <TGToolBar.h>
00143 #include <TROOT.h>
00144 #include <TRootHelpDialog.h>
00145 #include <TStyle.h>
00146 #include <TSystem.h>
00147 #include <TVirtualPad.h>
00148
00149 TStyleManager *TStyleManager::fgStyleManager = 0;
00150
00151 ClassImp(TStyleManager)
00152
00153 enum EStyleManagerWid {
00154 kMenuNew,
00155 kMenuDelete,
00156 kMenuRename,
00157 kMenuImportCanvas,
00158 kMenuImportMacro,
00159 kMenuExport,
00160 kMenuExit,
00161 kMenuHelp,
00162 kMenuHelpEditor,
00163 kMenuHelpGeneral,
00164 kMenuHelpCanvas,
00165 kMenuHelpPad,
00166 kMenuHelpHistos,
00167 kMenuHelpAxis,
00168 kMenuHelpTitle,
00169 kMenuHelpStats,
00170 kMenuHelpPSPDF,
00171
00172 kToolbarNew,
00173 kToolbarDelete,
00174 kToolbarImportCanvas,
00175 kToolbarImportMacro,
00176 kToolbarExport,
00177 kToolbarHelp,
00178
00179 kTopStylesList,
00180 kTopPreview,
00181 kTopPreviewRealTime,
00182 kTopMakeDefault,
00183 kTopCurStyle,
00184 kTopCurPad,
00185 kTopCurObj,
00186 kTopApplyOnAll,
00187 kTopApplyOnSel,
00188 kTopApplyOnBut,
00189 kTopMoreLess,
00190
00191 kEditButHelp,
00192 kEditButUpPrev,
00193 kEditButReset,
00194
00195 kGeneralFillColor,
00196 kGeneralFillStyle,
00197 kGeneralHatchesLineWidth,
00198 kGeneralHatchesSpacing,
00199 kGeneralTextColor,
00200 kGeneralTextSize,
00201 kGeneralTextSizeInPixels,
00202 kGeneralTextFont,
00203 kGeneralTextAlign,
00204 kGeneralTextAngle,
00205 kGeneralLineColor,
00206 kGeneralLineWidth,
00207 kGeneralLineStyle,
00208 kGeneralLineStyleEdit,
00209 kGeneralMarkerColor,
00210 kGeneralMarkerStyle,
00211 kGeneralMarkerSize,
00212 kGeneralScreenFactor,
00213
00214 kCanvasColor,
00215 kCanvasDefX,
00216 kCanvasDefY,
00217 kCanvasDefW,
00218 kCanvasDefH,
00219 kCanvasBorderModeSunken,
00220 kCanvasBorderModeNone,
00221 kCanvasBorderModeRaised,
00222 kCanvasBorderSize,
00223 kCanvasOptDateBool,
00224 kCanvasAttDateTextColor,
00225 kCanvasAttDateTextSize,
00226 kCanvasAttDateTextSizeInPixels,
00227 kCanvasOptDateFormat,
00228 kCanvasAttDateTextFont,
00229 kCanvasAttDateTextAngle,
00230 kCanvasAttDateTextAlign,
00231 kCanvasDateX,
00232 kCanvasDateY,
00233
00234 kPadLeftMargin,
00235 kPadRightMargin,
00236 kPadTopMargin,
00237 kPadBottomMargin,
00238 kPadBorderModeSunken,
00239 kPadBorderModeNone,
00240 kPadBorderModeRaised,
00241 kPadBorderSize,
00242 kPadColor,
00243 kPadTickX,
00244 kPadTickY,
00245 kPadGridX,
00246 kPadGridY,
00247 kPadGridColor,
00248 kPadGridWidth,
00249 kPadGridStyle,
00250
00251 kHistFillColor,
00252 kHistFillStyle,
00253 kHistLineColor,
00254 kHistLineWidth,
00255 kHistLineStyle,
00256 kHistBarWidth,
00257 kHistBarOffset,
00258 kHistMinimumZero,
00259 kHistPaintTextFormat,
00260 kHistNumberContours,
00261 kHistLegoInnerR,
00262
00263 kFrameFillColor,
00264 kFrameFillStyle,
00265 kFrameLineColor,
00266 kFrameLineWidth,
00267 kFrameLineStyle,
00268 kFramePaletteEdit,
00269 kFrameBorderModeSunken,
00270 kFrameBorderModeNone,
00271 kFrameBorderModeRaised,
00272 kFrameBorderSize,
00273
00274 kGraphsFuncColor,
00275 kGraphsFuncWidth,
00276 kGraphsFuncStyle,
00277 kGraphsDrawBorder,
00278 kGraphsEndErrorSize,
00279 kGraphsErrorX,
00280
00281 kAxisTimeOffsetDate,
00282 kAxisTimeOffsetTime,
00283 kAxisStripDecimals,
00284 kAxisApplyOnXYZ,
00285
00286 kAxisXTitleSize,
00287 kAxisXTitleSizeInPixels,
00288 kAxisXTitleColor,
00289 kAxisXTitleOffset,
00290 kAxisXTitleFont,
00291 kAxisXLabelSize,
00292 kAxisXLabelSizeInPixels,
00293 kAxisXLabelColor,
00294 kAxisXLabelOffset,
00295 kAxisXLabelFont,
00296 kAxisXAxisColor,
00297 kAxisXTickLength,
00298 kAxisOptLogx,
00299 kAxisXNdivMain,
00300 kAxisXNdivSub,
00301 kAxisXNdivSubSub,
00302 kAxisXNdivisionsOptimize,
00303
00304 kAxisYTitleSize,
00305 kAxisYTitleSizeInPixels,
00306 kAxisYTitleColor,
00307 kAxisYTitleOffset,
00308 kAxisYTitleFont,
00309 kAxisYLabelSize,
00310 kAxisYLabelSizeInPixels,
00311 kAxisYLabelColor,
00312 kAxisYLabelOffset,
00313 kAxisYLabelFont,
00314 kAxisYAxisColor,
00315 kAxisYTickLength,
00316 kAxisOptLogy,
00317 kAxisYNdivMain,
00318 kAxisYNdivSub,
00319 kAxisYNdivSubSub,
00320 kAxisYNdivisionsOptimize,
00321
00322 kAxisZTitleSize,
00323 kAxisZTitleSizeInPixels,
00324 kAxisZTitleColor,
00325 kAxisZTitleOffset,
00326 kAxisZTitleFont,
00327 kAxisZLabelSize,
00328 kAxisZLabelSizeInPixels,
00329 kAxisZLabelColor,
00330 kAxisZLabelOffset,
00331 kAxisZLabelFont,
00332 kAxisZAxisColor,
00333 kAxisZTickLength,
00334 kAxisOptLogz,
00335 kAxisZNdivMain,
00336 kAxisZNdivSub,
00337 kAxisZNdivSubSub,
00338 kAxisZNdivisionsOptimize,
00339
00340 kTitleOptTitle,
00341 kTitleFillColor,
00342 kTitleStyle,
00343 kTitleTextColor,
00344 kTitleFontSize,
00345 kTitleFontSizeInPixels,
00346 kTitleFont,
00347 kTitleAlign,
00348 kTitleBorderSize,
00349 kTitleX,
00350 kTitleY,
00351 kTitleW,
00352 kTitleH,
00353 kTitleLegendBorderSize,
00354
00355 kStatColor,
00356 kStatStyle,
00357 kStatTextColor,
00358 kStatFontSize,
00359 kStatFontSizeInPixels,
00360 kStatFont,
00361 kStatX,
00362 kStatY,
00363 kStatW,
00364 kStatH,
00365 kStatBorderSize,
00366 kStatOptStatName,
00367 kStatOptStatEntries,
00368 kStatOptStatOverflow,
00369 kStatOptStatMean,
00370 kStatOptStatUnderflow,
00371 kStatOptStatRMS,
00372 kStatOptStatSkewness,
00373 kStatOptStatIntegral,
00374 kStatOptStatKurtosis,
00375 kStatOptStatErrors,
00376 kStatFormat,
00377 kStatOptFitValues,
00378 kStatOptFitErrors,
00379 kStatOptFitProbability,
00380 kStatOptFitChi,
00381 kStatFitFormat,
00382
00383 kPSPDFHeaderPS,
00384 kPSPDFTitlePS,
00385 kPSPDFColorModelPS,
00386 kPSPDFColorModelPSRGB,
00387 kPSPDFColorModelPSCMYK,
00388 kPSPDFLineScalePS,
00389 kPSPDFPaperSizePredef,
00390 kPSPDFPaperSizeX,
00391 kPSPDFPaperSizeY
00392 };
00393
00394 const char *kFiletypes[] = { "ROOT macros", "Style_*.C",
00395 0, 0 };
00396
00397
00398 TStyleManager::TStyleManager(const TGWindow *p) : TGMainFrame(p)
00399 {
00400
00401
00402 SetWindowName("Style Manager");
00403 SetCleanup(kNoCleanup);
00404
00405
00406
00407 fCurSelStyle = 0;
00408 fCurMacro = 0;
00409 fCurPad = 0;
00410 fCurObj = 0;
00411 fPreviewWindow = 0;
00412 fRealTimePreview = kFALSE;
00413 fCurTabNum = 0;
00414 fCurTabAxisNum = 0;
00415 fMoreAndNotLess = kTRUE;
00416 fSigSlotConnected = kFALSE;
00417 fStyleChanged = kFALSE;
00418
00419
00420 fTrashListLayout = new TList();
00421 fTrashListFrame = new TList();
00422
00423
00424 fLayoutExpandX = new TGLayoutHints(kLHintsExpandX);
00425 fTrashListLayout->Add(fLayoutExpandX);
00426 fLayoutExpandXMargin = new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5);
00427 fTrashListLayout->Add(fLayoutExpandXMargin);
00428 fLayoutExpandXY = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
00429 fTrashListLayout->Add(fLayoutExpandXY);
00430 fLayoutExpandXYMargin = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5);
00431 fTrashListLayout->Add(fLayoutExpandXYMargin);
00432 fLayoutExpandXCenterYMargin = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 0, 3, 3);
00433 fTrashListLayout->Add(fLayoutExpandXCenterYMargin);
00434
00435
00436 AddMenus(this);
00437 AddToolbar(this);
00438 AddTopLevelInterface(this);
00439 AddEdition(this);
00440
00441
00442 fStatusBar = new TGStatusBar(this, 50, 10, kVerticalFrame);
00443 Int_t parts[] = { 20, 30, 50 };
00444 fStatusBar->SetParts(parts, 3);
00445 fStatusBar->Draw3DCorner(kFALSE);
00446 AddFrame(fStatusBar, fLayoutExpandX);
00447
00448
00449 MapSubwindows();
00450 Resize(GetDefaultSize());
00451 MapWindow();
00452
00453
00454
00455 Int_t x, y;
00456 UInt_t w, h;
00457 gVirtualX->GetWindowSize(GetId(), x, y, w, h);
00458 fSMWidth = w;
00459 fSMHeight = h;
00460 if (fSMWidth < 467) fSMWidth = 467;
00461 if (fSMHeight < 708) fSMHeight = 708;
00462 Window_t win;
00463 gVirtualX->TranslateCoordinates(GetId(), GetParent()->GetId(), 0, 0, x, y, win);
00464 x -= 6;
00465 y -= 21;
00466 MoveResize(x, TMath::Max(TMath::Min(y, (Int_t) (gClient->GetDisplayHeight() - h)), 0), w, h);
00467
00468
00469 DoMoreLess();
00470
00471
00472 ConnectAll();
00473
00474 Init();
00475 }
00476
00477
00478 TStyleManager::~TStyleManager()
00479 {
00480
00481
00482
00483 DisconnectAll();
00484 DisconnectEditor(fCurTabNum);
00485
00486 if (fPreviewWindow) {
00487 DoPreviewClosed();
00488 delete fPreviewWindow;
00489 }
00490
00491
00492
00493 gClient->FreePicture(fToolBarNewPic);
00494 gClient->FreePicture(fToolBarDeletePic);
00495 gClient->FreePicture(fToolBarImportCanvasPic);
00496 gClient->FreePicture(fToolBarImportMacroPic);
00497 gClient->FreePicture(fToolBarExportPic);
00498 gClient->FreePicture(fToolBarHelpPic);
00499 gClient->FreePicture(fMakeDefaultPic);
00500
00501 delete fImportCascade;
00502 delete fMenuStyle;
00503 delete fMenuHelp;
00504 delete fMenuBar;
00505
00506 delete fToolBar;
00507 delete fToolBarNew;
00508 delete fToolBarDelete;
00509 delete fToolBarImportCanvas;
00510 delete fToolBarImportMacro;
00511 delete fToolBarExport;
00512 delete fToolBarHelp;
00513 delete fHorizontal3DLine;
00514
00515 delete fListLabel;
00516 delete fListComboBox;
00517 delete fCurMacro;
00518 delete fCurStylabel;
00519 delete fCurStyle;
00520 delete fCurPadLabel;
00521 delete fCurPadTextEntry;
00522 delete fCurObjLabel;
00523 delete fCurObjTextEntry;
00524 delete fPreviewButton;
00525 delete fPreviewRealTime;
00526 delete fMakeDefault;
00527
00528 delete fApplyOnGroup;
00529 delete fApplyOnAll;
00530 delete fApplyOnSel;
00531 delete fApplyOnButton;
00532 delete fMoreLess;
00533
00534 delete fFillColor;
00535 delete fFillStyle;
00536 delete fHatchesLineWidth;
00537 delete fHatchesSpacing;
00538 delete fTextColor;
00539 delete fTextSize;
00540 delete fTextSizeInPixels;
00541 delete fTextFont;
00542 delete fTextAlign;
00543 delete fTextAngle;
00544 delete fLineColor;
00545 delete fLineWidth;
00546 delete fLineStyle;
00547 delete fLineStyleEdit;
00548 delete fMarkerColor;
00549 delete fMarkerStyle;
00550 delete fMarkerSize;
00551 delete fScreenFactor;
00552 delete fCanvasColor;
00553 delete fCanvasDefX;
00554 delete fCanvasDefY;
00555 delete fCanvasDefW;
00556 delete fCanvasDefH;
00557 delete fCanvasBorderMode;
00558 delete fCanvasBorderSize;
00559 delete fOptDateBool;
00560 delete fAttDateTextColor;
00561 delete fAttDateTextSize;
00562 delete fAttDateTextSizeInPixels;
00563 delete fOptDateFormat;
00564 delete fAttDateTextFont;
00565 delete fAttDateTextAngle;
00566 delete fAttDateTextAlign;
00567 delete fDateX;
00568 delete fDateY;
00569 delete fPadLeftMargin;
00570 delete fPadRightMargin;
00571 delete fPadTopMargin;
00572 delete fPadBottomMargin;
00573 delete fPadBorderMode;
00574 delete fPadBorderSize;
00575 delete fPadColor;
00576 delete fPadTickX;
00577 delete fPadTickY;
00578 delete fPadGridX;
00579 delete fPadGridY;
00580 delete fGridColor;
00581 delete fGridWidth;
00582 delete fGridStyle;
00583 delete fHistFillColor;
00584 delete fHistFillStyle;
00585 delete fHistLineColor;
00586 delete fHistLineWidth;
00587 delete fHistLineStyle;
00588 delete fBarWidth;
00589 delete fBarOffset;
00590 delete fHistMinimumZero;
00591 delete fPaintTextFormat;
00592 delete fNumberContours;
00593 delete fLegoInnerR;
00594 delete fFrameFillColor;
00595 delete fFrameFillStyle;
00596 delete fFrameLineColor;
00597 delete fFrameLineWidth;
00598 delete fFrameLineStyle;
00599 delete fPaletteEdit;
00600 delete fFrameBorderMode;
00601 delete fFrameBorderSize;
00602 delete fFuncColor;
00603 delete fFuncWidth;
00604 delete fFuncStyle;
00605 delete fDrawBorder;
00606 delete fEndErrorSize;
00607 delete fErrorX;
00608 delete fTimeOffsetDate;
00609 delete fTimeOffsetTime;
00610 delete fStripDecimals;
00611 delete fApplyOnXYZ;
00612 delete fXTitleSize;
00613 delete fXTitleSizeInPixels;
00614 delete fXTitleColor;
00615 delete fXTitleOffset;
00616 delete fXTitleFont;
00617 delete fXLabelSize;
00618 delete fXLabelSizeInPixels;
00619 delete fXLabelColor;
00620 delete fXLabelOffset;
00621 delete fXLabelFont;
00622 delete fXAxisColor;
00623 delete fXTickLength;
00624 delete fOptLogx;
00625 delete fXNdivMain;
00626 delete fXNdivSub;
00627 delete fXNdivSubSub;
00628 delete fXNdivisionsOptimize;
00629 delete fYTitleSize;
00630 delete fYTitleSizeInPixels;
00631 delete fYTitleColor;
00632 delete fYTitleOffset;
00633 delete fYTitleFont;
00634 delete fYLabelSize;
00635 delete fYLabelSizeInPixels;
00636 delete fYLabelColor;
00637 delete fYLabelOffset;
00638 delete fYLabelFont;
00639 delete fYAxisColor;
00640 delete fYTickLength;
00641 delete fOptLogy;
00642 delete fYNdivMain;
00643 delete fYNdivSub;
00644 delete fYNdivSubSub;
00645 delete fYNdivisionsOptimize;
00646 delete fZTitleSize;
00647 delete fZTitleSizeInPixels;
00648 delete fZTitleColor;
00649 delete fZTitleOffset;
00650 delete fZTitleFont;
00651 delete fZLabelSize;
00652 delete fZLabelSizeInPixels;
00653 delete fZLabelColor;
00654 delete fZLabelOffset;
00655 delete fZLabelFont;
00656 delete fZAxisColor;
00657 delete fZTickLength;
00658 delete fOptLogz;
00659 delete fZNdivMain;
00660 delete fZNdivSub;
00661 delete fZNdivSubSub;
00662 delete fZNdivisionsOptimize;
00663 delete fOptTitle;
00664 delete fTitleColor;
00665 delete fTitleStyle;
00666 delete fTitleTextColor;
00667 delete fTitleFontSize;
00668 delete fTitleFontSizeInPixels;
00669 delete fTitleFont;
00670 delete fTitleAlign;
00671 delete fTitleBorderSizeLabel;
00672 delete fTitleBorderSize;
00673 delete fTitleX;
00674 delete fTitleY;
00675 delete fTitleW;
00676 delete fTitleH;
00677 delete fLegendBorderSizeLabel;
00678 delete fLegendBorderSize;
00679 delete fStatColor;
00680 delete fStatStyle;
00681 delete fStatTextColor;
00682 delete fStatFontSize;
00683 delete fStatFontSizeInPixels;
00684 delete fStatFont;
00685 delete fStatX;
00686 delete fStatY;
00687 delete fStatW;
00688 delete fStatH;
00689 delete fStatBorderSizeLabel;
00690 delete fStatBorderSize;
00691 delete fOptStatName;
00692 delete fOptStatEntries;
00693 delete fOptStatOverflow;
00694 delete fOptStatMean;
00695 delete fOptStatUnderflow;
00696 delete fOptStatRMS;
00697 delete fOptStatSkewness;
00698 delete fOptStatIntegral;
00699 delete fOptStatKurtosis;
00700 delete fOptStatErrors;
00701 delete fStatFormatLabel;
00702 delete fStatFormat;
00703 delete fOptFitValues;
00704 delete fOptFitErrors;
00705 delete fOptFitProbability;
00706 delete fOptFitChi;
00707 delete fFitFormatLabel;
00708 delete fFitFormat;
00709 delete fHeaderPS;
00710 delete fTitlePS;
00711 delete fColorModelPS;
00712 delete fColorModelPSRGB;
00713 delete fColorModelPSCMYK;
00714 delete fLineScalePS;
00715 delete fPaperSizePredef;
00716 delete fPaperSizeX;
00717 delete fPaperSizeY;
00718 delete fEditionHelp;
00719 delete fEditionUpdatePreview;
00720 delete fEditionReset;
00721 delete fEditionButtonFrame;
00722 delete fHistosTab;
00723 delete fAxisTab;
00724 delete fEditionTab;
00725 delete fEditionFrame;
00726
00727 delete fStatusBar;
00728
00729
00730 TObject *obj1;
00731 TObject *obj2;
00732
00733 obj1 = fTrashListFrame->First();
00734 while (obj1) {
00735 obj2 = fTrashListFrame->After(obj1);
00736 fTrashListFrame->Remove(obj1);
00737 delete obj1;
00738 obj1 = obj2;
00739 }
00740 delete fTrashListFrame;
00741
00742 obj1 = fTrashListLayout->First();
00743 while (obj1) {
00744 obj2 = fTrashListLayout->After(obj1);
00745 fTrashListLayout->Remove(obj1);
00746 delete obj1;
00747 obj1 = obj2;
00748 }
00749 delete fTrashListLayout;
00750
00751 fgStyleManager = 0;
00752 }
00753
00754
00755 TStyleManager *&TStyleManager::GetSM()
00756 {
00757
00758 return fgStyleManager;
00759 }
00760
00761
00762 void TStyleManager::Init()
00763 {
00764
00765
00766
00767 BuildList(gStyle);
00768
00769
00770 if ((gROOT->GetSelectedPad()) && (gROOT->GetSelectedPad()->GetCanvas())) {
00771 DoSelectCanvas(gROOT->GetSelectedPad()->GetCanvas(),
00772 gROOT->GetSelectedPad()->GetCanvas(), kButton2Down);
00773 } else {
00774 DoSelectNoCanvas();
00775 }
00776 }
00777
00778
00779 void TStyleManager::Hide()
00780 {
00781
00782
00783 if (fgStyleManager) {
00784 fgStyleManager->UnmapWindow();
00785 }
00786 }
00787
00788
00789 void TStyleManager::Show()
00790 {
00791
00792
00793 if (fgStyleManager) {
00794 fgStyleManager->Init();
00795 if (!fgStyleManager->IsMapped()) {
00796 fgStyleManager->MapWindow();
00797 }
00798 } else {
00799 TStyleManager::GetSM() = new TStyleManager(gClient->GetRoot());
00800 }
00801 }
00802
00803
00804 void TStyleManager::Terminate()
00805 {
00806
00807
00808
00809 delete fgStyleManager;
00810 fgStyleManager = 0;
00811 }
00812
00813
00814 void TStyleManager::AddMenus(TGCompositeFrame *p)
00815 {
00816
00817
00818 fMenuBar = new TGMenuBar(p);
00819
00820 fMenuStyle = new TGPopupMenu(gClient->GetRoot());
00821 fMenuStyle->Associate(this);
00822 fMenuStyle->AddEntry("&New...", kMenuNew);
00823 fMenuStyle->AddEntry("&Delete", kMenuDelete);
00824 fMenuStyle->AddSeparator();
00825 fMenuStyle->AddEntry("&Rename...", kMenuRename);
00826 fMenuStyle->AddSeparator();
00827 fImportCascade = new TGPopupMenu(gClient->GetRoot());
00828 fImportCascade->Associate(this);
00829 fImportCascade->AddEntry("&Macro...", kMenuImportMacro);
00830 fImportCascade->AddEntry("&Canvas...", kMenuImportCanvas);
00831 fMenuStyle->AddPopup("&Import From...", fImportCascade);
00832
00833 fMenuStyle->AddEntry("&Export...", kMenuExport);
00834 fMenuStyle->AddSeparator();
00835 fMenuStyle->AddEntry("&Close", kMenuExit);
00836 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal);
00837 fTrashListLayout->Add(layout1);
00838 fMenuBar->AddPopup("&Style", fMenuStyle, layout1);
00839
00840 fMenuHelp = new TGPopupMenu(gClient->GetRoot());
00841 fMenuHelp->Associate(this);
00842 fMenuHelp->AddEntry("Top &level", kMenuHelp);
00843 fMenuHelp->AddSeparator();
00844 fMenuHelp->AddEntry("&General", kMenuHelpGeneral);
00845 fMenuHelp->AddEntry("&Canvas", kMenuHelpCanvas);
00846 fMenuHelp->AddEntry("Pa&d", kMenuHelpPad);
00847 fMenuHelp->AddEntry("&Histograms", kMenuHelpHistos);
00848 fMenuHelp->AddEntry("&Axis", kMenuHelpAxis);
00849 fMenuHelp->AddEntry("&Title", kMenuHelpTitle);
00850 fMenuHelp->AddEntry("&Stats", kMenuHelpStats);
00851 fMenuHelp->AddEntry("&PS / PDF", kMenuHelpPSPDF);
00852 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsRight);
00853 fTrashListLayout->Add(layout2);
00854 fMenuBar->AddPopup("&Help", fMenuHelp, layout2);
00855
00856 p->AddFrame(fMenuBar, fLayoutExpandX);
00857 }
00858
00859
00860 void TStyleManager::DoNew()
00861 {
00862
00863
00864
00865 new TStyleDialog(this, fCurSelStyle, 1, 0);
00866
00867
00868
00869
00870 if (fLastChoice) BuildList();
00871 else BuildList(fCurSelStyle);
00872 }
00873
00874
00875 void TStyleManager::DoDelete()
00876 {
00877
00878
00879
00880
00881
00882 if (fCurSelStyle == gStyle) {
00883 printf("Can not delete gStyle.\n");
00884 return;
00885 }
00886
00887 delete fCurSelStyle;
00888 fCurSelStyle = 0;
00889
00890 BuildList(gStyle);
00891 }
00892
00893
00894 void TStyleManager::DoRename()
00895 {
00896
00897
00898 new TStyleDialog(this, fCurSelStyle, 2, 0);
00899
00900
00901 BuildList(fCurSelStyle);
00902 }
00903
00904
00905 void TStyleManager::DoExport()
00906 {
00907
00908
00909
00910
00911 CreateMacro();
00912 TString newName;
00913 newName.Form("Style_%s.C", fCurSelStyle->GetName());
00914
00915
00916
00917 char* tmpFileName;
00918 const char* tmpBaseName;
00919 do {
00920 fCurMacro->fFilename = StrDup(newName.Data());
00921
00922
00923 new TGFileDialog(gClient->GetRoot(), this, kFDSave, fCurMacro);
00924 tmpFileName = fCurMacro->fFilename;
00925 if (tmpFileName) tmpBaseName = gSystem->BaseName(tmpFileName);
00926 else tmpBaseName = 0;
00927 } while (tmpBaseName && (strstr(tmpBaseName, "Style_") != tmpBaseName)
00928 && (strstr(tmpBaseName, " ") != 0));
00929
00930 delete [] newName;
00931
00932 if (tmpBaseName != 0) {
00933
00934 fCurSelStyle->SaveSource(gSystem->UnixPathName(tmpFileName));
00935 fCurMacro->fFilename = StrDup(tmpBaseName);
00936 fStyleChanged = kFALSE;
00937 }
00938
00939 UpdateStatusBar();
00940 }
00941
00942
00943 void TStyleManager::DoExit()
00944 {
00945
00946
00947
00948 delete this;
00949 }
00950
00951
00952 void TStyleManager::DoHelp(Int_t i)
00953 {
00954
00955
00956 TRootHelpDialog *hd;
00957 switch (i) {
00958 case 0:
00959 hd = new TRootHelpDialog(this, "Help on General Tab", 600, 400);
00960 hd->SetText(gHelpSMGeneral);
00961 break;
00962 case 1:
00963 hd = new TRootHelpDialog(this, "Help on Canvas Tab", 600, 400);
00964 hd->SetText(gHelpSMCanvas);
00965 break;
00966 case 2:
00967 hd = new TRootHelpDialog(this, "Help on Pad Tab", 600, 400);
00968 hd->SetText(gHelpSMPad);
00969 break;
00970 case 3:
00971 hd = new TRootHelpDialog(this, "Help on Histograms Tab", 600, 400);
00972 hd->SetText(gHelpSMHistos);
00973 break;
00974 case 4:
00975 hd = new TRootHelpDialog(this, "Help on Axis Tab", 600, 400);
00976 hd->SetText(gHelpSMAxis);
00977 break;
00978 case 5:
00979 hd = new TRootHelpDialog(this, "Help on Title Tab", 600, 400);
00980 hd->SetText(gHelpSMTitle);
00981 break;
00982 case 6:
00983 hd = new TRootHelpDialog(this, "Help on Stats Tab", 600, 400);
00984 hd->SetText(gHelpSMStats);
00985 break;
00986 case 7:
00987 hd = new TRootHelpDialog(this, "Help on PS / PDF Tab", 600, 400);
00988 hd->SetText(gHelpSMPSPDF);
00989 break;
00990 default:
00991 hd = new TRootHelpDialog(this, "Help on Top Level", 600, 400);
00992 hd->SetText(gHelpSMTopLevel);
00993 }
00994 hd->Popup();
00995 }
00996
00997
00998 void TStyleManager::DoImportCanvas()
00999 {
01000
01001
01002
01003 if ((!fCurPad) || (!fCurObj)) return;
01004
01005 new TStyleDialog(this, gStyle, 3, fCurPad);
01006
01007
01008
01009
01010 if (fLastChoice) {
01011 BuildList();
01012
01013
01014 CreateMacro();
01015 TString newName;
01016 newName.Form("Style_%s.C", fCurSelStyle->GetName());
01017 fCurMacro->fFilename = StrDup(newName.Data());
01018 fCurSelStyle->SaveSource(gSystem->UnixPathName(fCurMacro->fFilename));
01019 } else {
01020 BuildList(fCurSelStyle);
01021 }
01022 }
01023
01024
01025 void TStyleManager::CreateMacro()
01026 {
01027
01028
01029 if (fCurMacro) delete fCurMacro;
01030 fCurMacro = new TGFileInfo();
01031 TString dir(".");
01032 fCurMacro->fFileTypes = kFiletypes;
01033 fCurMacro->fIniDir = StrDup(dir);
01034 fCurMacro->fFilename = 0;
01035 }
01036
01037
01038 void TStyleManager::AddToolbar(TGCompositeFrame *p)
01039 {
01040
01041
01042 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 3);
01043 fTrashListLayout->Add(layout1);
01044 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsNormal, 6);
01045 fTrashListLayout->Add(layout2);
01046
01047 fToolBar = new TGToolBar(p);
01048 fToolBarNewPic = gClient->GetPicture("sm_new.xpm");
01049 fToolBarNew = new TGPictureButton(fToolBar, fToolBarNewPic, kToolbarNew);
01050 fToolBarNew->Associate(this);
01051 fToolBar->AddFrame(fToolBarNew);
01052
01053 fToolBarImportCanvasPic = gClient->GetPicture("sm_import_canvas.xpm");
01054 fToolBarImportCanvas = new TGPictureButton(fToolBar, fToolBarImportCanvasPic, kToolbarImportCanvas);
01055 fToolBarImportCanvas->Associate(this);
01056 fToolBar->AddFrame(fToolBarImportCanvas, layout2);
01057
01058 fToolBarImportMacroPic = gClient->GetPicture("sm_import_macro.xpm");
01059 fToolBarImportMacro = new TGPictureButton(fToolBar, fToolBarImportMacroPic, kToolbarImportMacro);
01060 fToolBarImportMacro->Associate(this);
01061 fToolBar->AddFrame(fToolBarImportMacro);
01062
01063 fToolBarExportPic = gClient->GetPicture("sm_export.xpm");
01064 fToolBarExport = new TGPictureButton(fToolBar, fToolBarExportPic, kToolbarExport);
01065 fToolBarExport->Associate(this);
01066 fToolBar->AddFrame(fToolBarExport, layout1);
01067
01068 fToolBarDeletePic = gClient->GetPicture("sm_delete.xpm");
01069 fToolBarDelete = new TGPictureButton(fToolBar, fToolBarDeletePic, kToolbarDelete);
01070 fToolBarDelete->Associate(this);
01071 fToolBar->AddFrame(fToolBarDelete, layout2);
01072
01073 fToolBarHelpPic = gClient->GetPicture("sm_help.xpm");
01074 fToolBarHelp = new TGPictureButton(fToolBar, fToolBarHelpPic, kToolbarHelp);
01075 fToolBarHelp->Associate(this);
01076 fToolBar->AddFrame(fToolBarHelp, layout2);
01077
01078 p->AddFrame(fToolBar, fLayoutExpandX);
01079 fHorizontal3DLine = new TGHorizontal3DLine(p);
01080 p->AddFrame(fHorizontal3DLine, fLayoutExpandX);
01081
01082 fToolBarNew->SetToolTipText("Create a new style");
01083 fToolBarDelete->SetToolTipText("Delete the selected style");
01084 fToolBarImportCanvas->SetToolTipText("Import a style from selected canvas");
01085 fToolBarImportMacro->SetToolTipText("Import a style from a macro");
01086 fToolBarExport->SetToolTipText("Export the selected style into a macro");
01087 fToolBarHelp->SetToolTipText("Help about the top level interface");
01088 }
01089
01090
01091 void TStyleManager::AddTopLevelInterface(TGCompositeFrame *cf)
01092 {
01093
01094
01095
01096
01097 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2);
01098 fTrashListLayout->Add(layout1);
01099 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 10, 10, 15);
01100 fTrashListLayout->Add(layout2);
01101 TGLayoutHints *layout3 = new TGLayoutHints(kLHintsNormal, 0, 0, 18);
01102 fTrashListLayout->Add(layout3);
01103 TGLayoutHints *layout4 = new TGLayoutHints(kLHintsNormal, 10, 10);
01104 fTrashListLayout->Add(layout4);
01105 TGLayoutHints *layout5 = new TGLayoutHints(kLHintsExpandX, 125);
01106 fTrashListLayout->Add(layout5);
01107 TGLayoutHints *layout6 = new TGLayoutHints(kLHintsNormal, 0, 10, 3);
01108 fTrashListLayout->Add(layout6);
01109 TGLayoutHints *layout7 = new TGLayoutHints(kLHintsNormal, 0, 16, 3);
01110 fTrashListLayout->Add(layout7);
01111 TGLayoutHints *layout8 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10);
01112 fTrashListLayout->Add(layout8);
01113 TGLayoutHints *layout9 = new TGLayoutHints(kLHintsNormal, -15, 0, -5, -10);
01114 fTrashListLayout->Add(layout9);
01115 TGLayoutHints *layout10 = new TGLayoutHints(kLHintsNormal, 15, 0, -5, -10);
01116 fTrashListLayout->Add(layout10);
01117 TGLayoutHints *layout11 = new TGLayoutHints(kLHintsExpandX, 0, 0, 15);
01118 fTrashListLayout->Add(layout11);
01119 TGLayoutHints *layout12 = new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 5);
01120 fTrashListLayout->Add(layout12);
01121 TGLayoutHints *layout13 = new TGLayoutHints(kLHintsExpandX, 20, 0, 7);
01122 fTrashListLayout->Add(layout13);
01123
01124 TGVerticalFrame *topLevel = new TGVerticalFrame(cf);
01125 fTrashListFrame->AddFirst(topLevel);
01126 TGHorizontalFrame *h1 = new TGHorizontalFrame(topLevel);
01127 fTrashListFrame->AddFirst(h1);
01128 TGVerticalFrame *v11 = new TGVerticalFrame(h1);
01129 fTrashListFrame->AddFirst(v11);
01130 fListLabel = new TGLabel(v11, "Available Styles:");
01131 v11->AddFrame(fListLabel);
01132 fListComboBox = new TGComboBox(v11, kTopStylesList);
01133 fListComboBox->Associate(this);
01134 fListComboBox->Resize(200, 22);
01135 v11->AddFrame(fListComboBox, layout1);
01136 h1->AddFrame(v11, fLayoutExpandX);
01137 TGVerticalFrame *v12 = new TGVerticalFrame(h1);
01138 fTrashListFrame->AddFirst(v12);
01139 fMakeDefaultPic = gClient->GetPicture("arrow_right2.xpm");
01140 fMakeDefault = new TGPictureButton(v12, fMakeDefaultPic, kTopMakeDefault);
01141 fMakeDefault->Associate(this);
01142 fMakeDefault->Resize(40, 22);
01143 v12->AddFrame(fMakeDefault, layout3);
01144 h1->AddFrame(v12, layout4);
01145 TGVerticalFrame *v13 = new TGVerticalFrame(h1);
01146 fTrashListFrame->AddFirst(v13);
01147 fCurStylabel = new TGLabel(v13, "gStyle is set to:");
01148 v13->AddFrame(fCurStylabel);
01149 fCurStyle = new TGTextEntry(v13, "", kTopCurStyle);
01150 fCurStyle->Associate(this);
01151 fCurStyle->SetEnabled(kFALSE);
01152 v13->AddFrame(fCurStyle, layout1);
01153 h1->AddFrame(v13, fLayoutExpandX);
01154 topLevel->AddFrame(h1, fLayoutExpandX);
01155
01156 TGHorizontalFrame *h2 = new TGHorizontalFrame(topLevel);
01157 fTrashListFrame->AddFirst(h2);
01158 TGGroupFrame *gf = new TGGroupFrame(h2, "Apply on");
01159 fTrashListFrame->AddFirst(gf);
01160 TGVerticalFrame *vf = new TGVerticalFrame(gf);
01161 fTrashListFrame->AddFirst(vf);
01162 Pixel_t red;
01163 gClient->GetColorByName("#FF0000", red);
01164 TGHorizontalFrame *selCanvas = new TGHorizontalFrame(vf);
01165 fTrashListFrame->AddFirst(selCanvas);
01166 fCurPadLabel = new TGLabel(selCanvas, "Canvas:");
01167 selCanvas->AddFrame(fCurPadLabel, layout6);
01168 fCurPadTextEntry = new TGTextEntry(selCanvas, "", kTopCurPad);
01169 fCurPadTextEntry->SetEnabled(kFALSE);
01170 fCurPadTextEntry->SetTextColor(red, kFALSE);
01171 selCanvas->AddFrame(fCurPadTextEntry, fLayoutExpandX);
01172 vf->AddFrame(selCanvas, fLayoutExpandX);
01173 TGHorizontalFrame *selObject = new TGHorizontalFrame(vf);
01174 fTrashListFrame->AddFirst(selObject);
01175 fCurObjLabel = new TGLabel(selObject, "Object:");
01176 selObject->AddFrame(fCurObjLabel, layout7);
01177 fCurObjTextEntry = new TGTextEntry(selObject, "", kTopCurObj);
01178 fCurObjTextEntry->Associate(this);
01179 fCurObjTextEntry->SetEnabled(kFALSE);
01180 fCurObjTextEntry->SetTextColor(red, kFALSE);
01181 selObject->AddFrame(fCurObjTextEntry, fLayoutExpandX);
01182 vf->AddFrame(selObject, layout8);
01183 TGHorizontalFrame *h4 = new TGHorizontalFrame(vf);
01184 fTrashListFrame->AddFirst(h4);
01185 fApplyOnGroup = new TGHButtonGroup(h4);
01186 fApplyOnAll = new TGRadioButton(fApplyOnGroup, "All canvases", kTopApplyOnAll);
01187 fApplyOnAll->Associate(this);
01188 fApplyOnSel = new TGRadioButton(fApplyOnGroup, "Selected object", kTopApplyOnSel);
01189 fApplyOnSel->Associate(this);
01190 fAllAndNotCurrent = kFALSE;
01191 fApplyOnGroup->SetButton(kTopApplyOnSel);
01192 fApplyOnGroup->Show();
01193 fApplyOnGroup->SetLayoutHints(layout9, fApplyOnAll);
01194 fApplyOnGroup->SetLayoutHints(layout10, fApplyOnSel);
01195 h4->AddFrame(fApplyOnGroup);
01196 fApplyOnButton = new TGTextButton(h4, "&Apply", kTopApplyOnBut);
01197 fApplyOnButton->Associate(this);
01198 fApplyOnButton->Resize(100, 22);
01199 h4->AddFrame(fApplyOnButton, layout13);
01200 vf->AddFrame(h4, fLayoutExpandX);
01201 gf->AddFrame(vf, layout11);
01202 h2->AddFrame(gf, layout12);
01203 topLevel->AddFrame(h2, fLayoutExpandX);
01204
01205 TGHorizontalFrame *h3 = new TGHorizontalFrame(topLevel);
01206 fTrashListFrame->AddFirst(h3);
01207 fPreviewButton = new TGCheckButton(h3, "&Preview", kTopPreview);
01208 fPreviewButton->Associate(this);
01209 h3->AddFrame(fPreviewButton, layout6);
01210 fPreviewRealTime = new TGCheckButton(h3, "Run &Time Preview", kTopPreviewRealTime);
01211 fPreviewRealTime->Associate(this);
01212 fPreviewRealTime->SetEnabled(kFALSE);
01213 h3->AddFrame(fPreviewRealTime, layout6);
01214 fMoreLess = new TGTextButton(h3, "&Close <<", kTopMoreLess);
01215 fMoreLess->Associate(this);
01216 h3->AddFrame(fMoreLess, layout5);
01217 topLevel->AddFrame(h3, fLayoutExpandX);
01218
01219 cf->AddFrame(topLevel, layout2);
01220
01221 fApplyOnButton->SetToolTipText("Apply the selected style on the selected object");
01222 fPreviewButton->SetToolTipText("Show / Hide the preview window");
01223 fPreviewRealTime->SetToolTipText("Continuous / Asynchronous update of the preview");
01224 }
01225
01226
01227 void TStyleManager::BuildList(TStyle *style)
01228 {
01229
01230
01231
01232
01233
01234 fListComboBox->RemoveEntries(1, fListComboBox->GetNumberOfEntries());
01235
01236
01237 Int_t i = 1;
01238 Int_t styleID = 0;
01239 TStyle *tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->First());
01240 while (tmpStyle) {
01241 if (tmpStyle == style) styleID = i;
01242 fListComboBox->AddEntry(tmpStyle->GetName(), i++);
01243 tmpStyle = (TStyle *) (gROOT->GetListOfStyles()->After(tmpStyle));
01244 }
01245
01246
01247 if (styleID == 0) styleID = i - 1;
01248 fListComboBox->Select(styleID);
01249 DoListSelect();
01250 fCurStyle->SetText(gStyle->GetName());
01251 }
01252
01253
01254 void TStyleManager::UpdateStatusBar()
01255 {
01256
01257
01258
01259 fStatusBar->SetText(fCurSelStyle->GetName(), 0);
01260 fStatusBar->SetText(fCurSelStyle->GetTitle(), 2);
01261
01262 if ((!strcmp(fCurSelStyle->GetName(), "Default"))
01263 || (!strcmp(fCurSelStyle->GetName(), "Plain" ))
01264 || (!strcmp(fCurSelStyle->GetName(), "Bold" ))
01265 || (!strcmp(fCurSelStyle->GetName(), "Video" ))
01266 || (!strcmp(fCurSelStyle->GetName(), "Pub" ))) {
01267 fStatusBar->SetText("ROOT style", 1);
01268 } else if (fStyleChanged) {
01269 fStatusBar->SetText("User Style _ Not Saved", 1);
01270 } else {
01271 fStatusBar->SetText("User Style", 1);
01272 }
01273 }
01274
01275
01276 void TStyleManager::UpdateEditor(Int_t tabNum)
01277 {
01278
01279
01280
01281 Double_t delta;
01282 Int_t year;
01283 Int_t month;
01284 Int_t day;
01285 Int_t oneYearInSecs;
01286 Int_t oneMonthInSecs;
01287 Int_t tmp;
01288 Int_t tmp2;
01289 switch (tabNum) {
01290 case 0:
01291 fFillColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetFillColor()));
01292 fFillStyle->SetPattern(fCurSelStyle->GetFillStyle());
01293 fHatchesLineWidth->Select(fCurSelStyle->GetHatchesLineWidth());
01294 fHatchesSpacing->SetNumber(fCurSelStyle->GetHatchesSpacing());
01295 fMarkerColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetMarkerColor()));
01296 fMarkerStyle->SetMarkerStyle(fCurSelStyle->GetMarkerStyle());
01297 fMarkerSize->Select((Int_t) fCurSelStyle->GetMarkerSize() * 5);
01298 fScreenFactor->SetNumber(fCurSelStyle->GetScreenFactor());
01299 fLineColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetLineColor()));
01300 fLineWidth->Select(fCurSelStyle->GetLineWidth());
01301 fLineStyle->Select(fCurSelStyle->GetLineStyle());
01302
01303 fTextColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTextColor()));
01304 if (fCurSelStyle->GetTextFont()%10 > 2) {
01305 fTextSizeInPixels->SetState(kButtonDown, kFALSE);
01306 ModTextSizeInPixels(kTRUE);
01307 } else {
01308 fTextSizeInPixels->SetState(kButtonUp, kFALSE);
01309 ModTextSizeInPixels(kFALSE);
01310 }
01311 fTextFont->Select(fCurSelStyle->GetTextFont()/10);
01312 fTextAlign->Select(fCurSelStyle->GetTextAlign());
01313 fTextAngle->SetNumber(fCurSelStyle->GetTextAngle());
01314 break;
01315 case 1:
01316 fCanvasColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetCanvasColor()));
01317 fCanvasDefX->SetIntNumber(fCurSelStyle->GetCanvasDefX());
01318 fCanvasDefY->SetIntNumber(fCurSelStyle->GetCanvasDefY());
01319 fCanvasDefW->SetIntNumber(fCurSelStyle->GetCanvasDefW());
01320 fCanvasDefH->SetIntNumber(fCurSelStyle->GetCanvasDefH());
01321 fCanvasBorderMode->SetButton(fCurSelStyle->GetCanvasBorderMode() + 1 + kCanvasBorderModeSunken);
01322 fCanvasBorderSize->Select(fCurSelStyle->GetCanvasBorderSize());
01323 fAttDateTextColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetAttDate()->GetTextColor()));
01324 if (fCurSelStyle->GetAttDate()->GetTextFont()%10 > 2) {
01325 fAttDateTextSizeInPixels->SetState(kButtonDown, kFALSE);
01326 ModAttDateTextSizeInPixels(kTRUE);
01327 } else {
01328 fAttDateTextSizeInPixels->SetState(kButtonUp, kFALSE);
01329 ModAttDateTextSizeInPixels(kFALSE);
01330 }
01331 fOptDateFormat->Select(fCurSelStyle->GetOptDate()/10 + 1);
01332 fAttDateTextFont->Select(fCurSelStyle->GetAttDate()->GetTextFont()/10);
01333 fAttDateTextAlign->Select(fCurSelStyle->GetAttDate()->GetTextAlign());
01334 fAttDateTextAngle->SetNumber(fCurSelStyle->GetAttDate()->GetTextAngle());
01335 fDateX->SetIntNumber((Int_t) (fCurSelStyle->GetDateX()*100 + 0.5));
01336 fDateY->SetIntNumber((Int_t) (fCurSelStyle->GetDateY()*100 + 0.5));
01337
01338 if (fCurSelStyle->GetOptDate()) {
01339 fOptDateBool->SetState(kButtonDown, kFALSE);
01340 fAttDateTextColor->Enable();
01341 fAttDateTextSize->SetState(kTRUE);
01342 if (!fAttDateTextSizeInPixels->IsDown())
01343 fAttDateTextSizeInPixels->SetEnabled(kTRUE);
01344
01345
01346
01347
01348 fAttDateTextAngle->SetState(kTRUE);
01349 fDateX->SetState(kTRUE);
01350 fDateY->SetState(kTRUE);
01351 } else {
01352 fOptDateBool->SetState(kButtonUp, kFALSE);
01353 fAttDateTextColor->Disable();
01354 fAttDateTextSize->SetState(kFALSE);
01355 fAttDateTextSizeInPixels->SetEnabled(kFALSE);
01356
01357
01358
01359
01360 fAttDateTextAngle->SetState(kFALSE);
01361 fDateX->SetState(kFALSE);
01362 fDateY->SetState(kFALSE);
01363 }
01364 break;
01365 case 2:
01366 fPadTopMargin->SetIntNumber((Int_t) (fCurSelStyle->GetPadTopMargin() * 100 + 0.5));
01367 fPadBottomMargin->SetIntNumber((Int_t) (fCurSelStyle->GetPadBottomMargin() * 100 + 0.5));
01368 fPadLeftMargin->SetIntNumber((Int_t) (fCurSelStyle->GetPadLeftMargin() * 100 + 0.5));
01369 fPadRightMargin->SetIntNumber((Int_t) (fCurSelStyle->GetPadRightMargin() * 100 + 0.5));
01370 fPadBorderMode->SetButton(fCurSelStyle->GetPadBorderMode() + 1 + kPadBorderModeSunken);
01371 fPadBorderSize->Select(fCurSelStyle->GetPadBorderSize());
01372 fPadColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetPadColor()));
01373 if (fCurSelStyle->GetPadTickX())
01374 fPadTickX->SetState(kButtonDown, kFALSE);
01375 else
01376 fPadTickX->SetState(kButtonUp, kFALSE);
01377 if (fCurSelStyle->GetPadTickY())
01378 fPadTickY->SetState(kButtonDown, kFALSE);
01379 else
01380 fPadTickY->SetState(kButtonUp, kFALSE);
01381 if (fCurSelStyle->GetPadGridX())
01382 fPadGridX->SetState(kButtonDown, kFALSE);
01383 else
01384 fPadGridX->SetState(kButtonUp, kFALSE);
01385 if (fCurSelStyle->GetPadGridY())
01386 fPadGridY->SetState(kButtonDown, kFALSE);
01387 else
01388 fPadGridY->SetState(kButtonUp, kFALSE);
01389 fGridColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetGridColor()));
01390 fGridWidth->Select(fCurSelStyle->GetGridWidth());
01391 fGridStyle->Select(fCurSelStyle->GetGridStyle());
01392 break;
01393 case 3:
01394 fHistFillColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetHistFillColor()));
01395 fHistFillStyle->SetPattern(fCurSelStyle->GetHistFillStyle());
01396 fHistLineColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetHistLineColor()));
01397 fHistLineWidth->Select(fCurSelStyle->GetHistLineWidth());
01398 fHistLineStyle->Select(fCurSelStyle->GetHistLineStyle());
01399 fBarWidth->SetNumber(fCurSelStyle->GetBarWidth());
01400 fBarOffset->SetNumber(fCurSelStyle->GetBarOffset());
01401 if (fCurSelStyle->GetHistMinimumZero())
01402 fHistMinimumZero->SetState(kButtonDown, kFALSE);
01403 else
01404 fHistMinimumZero->SetState(kButtonUp, kFALSE);
01405 fPaintTextFormat->SetText(fCurSelStyle->GetPaintTextFormat());
01406 fNumberContours->SetIntNumber(fCurSelStyle->GetNumberContours());
01407 fLegoInnerR->SetIntNumber((Int_t) (fCurSelStyle->GetLegoInnerR() * 100 + 0.5));
01408 fFrameFillColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetFrameFillColor()));
01409 fFrameFillStyle->SetPattern(fCurSelStyle->GetFrameFillStyle());
01410 fFrameLineColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetFrameLineColor()));
01411 fFrameLineWidth->Select(fCurSelStyle->GetFrameLineWidth());
01412 fFrameLineStyle->Select(fCurSelStyle->GetFrameLineStyle());
01413
01414 fFrameBorderMode->SetButton(fCurSelStyle->GetFrameBorderMode() + 1 + kFrameBorderModeSunken);
01415 fFrameBorderSize->Select(fCurSelStyle->GetFrameBorderSize());
01416 fFuncColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetFuncColor()));
01417 fFuncWidth->Select(fCurSelStyle->GetFuncWidth());
01418 fFuncStyle->Select(fCurSelStyle->GetFuncStyle());
01419 if (fCurSelStyle->GetDrawBorder())
01420 fDrawBorder->SetState(kButtonDown, kFALSE);
01421 else
01422 fDrawBorder->SetState(kButtonUp, kFALSE);
01423 fEndErrorSize->SetNumber(fCurSelStyle->GetEndErrorSize());
01424 fErrorX->SetIntNumber((Int_t) (fCurSelStyle->GetErrorX() * 100 + 0.5));
01425 break;
01426 case 4:
01427 delta = fCurSelStyle->GetTimeOffset() - 788918400;
01428 year = 1995;
01429 month = 1;
01430 day = 1;
01431 while (delta < 0) {
01432 year--;
01433 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
01434 else oneYearInSecs = 3600 * 24 * 366;
01435 delta += oneYearInSecs;
01436 }
01437 oneYearInSecs = 3600 * 24 * 365;
01438 while (delta >= oneYearInSecs) {
01439 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
01440 else oneYearInSecs = 3600 * 24 * 366;
01441 delta -= oneYearInSecs;
01442 year++;
01443 }
01444 oneMonthInSecs = 3600 * 24 * 31;
01445 while (delta >= oneMonthInSecs) {
01446 month++;
01447 delta -= oneMonthInSecs;
01448 switch (month) {
01449 case 2:
01450 if (year % 4) oneMonthInSecs = 3600 * 24 * 28;
01451 else oneMonthInSecs = 3600 * 24 * 29;
01452 break;
01453 case 3: case 5: case 7: case 8: case 10: case 12:
01454 oneMonthInSecs = 3600 * 24 * 31;
01455 break;
01456 default:
01457 oneMonthInSecs = 3600 * 24 * 30;
01458 }
01459 }
01460 day = (Int_t) delta / (3600 * 24) + 1;
01461 delta = ((Int_t) delta) % (3600 * 24);
01462 fTimeOffsetDate->SetNumber(year*10000 + month*100 + day);
01463 fTimeOffsetTime->SetNumber(delta);
01464
01465 if (fCurSelStyle->GetStripDecimals())
01466 fStripDecimals->SetState(kButtonUp, kFALSE);
01467 else
01468 fStripDecimals->SetState(kButtonDown, kFALSE);
01469 fXTitleSize->SetNumber(fCurSelStyle->GetTitleSize("X"));
01470 if (fCurSelStyle->GetTitleFont("X")%10 > 2) {
01471 fXTitleSizeInPixels->SetState(kButtonDown, kFALSE);
01472 ModXTitleSizeInPixels(kTRUE);
01473 } else {
01474 fXTitleSizeInPixels->SetState(kButtonUp, kFALSE);
01475 ModXTitleSizeInPixels(kFALSE);
01476 }
01477 fXTitleColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTitleColor("X")));
01478 fXTitleOffset->SetNumber(fCurSelStyle->GetTitleOffset("X"));
01479 fXTitleFont->Select(fCurSelStyle->GetTitleFont("X")/10);
01480 fXLabelSize->SetNumber(fCurSelStyle->GetLabelSize("X"));
01481 if (fCurSelStyle->GetLabelFont("X")%10 > 2) {
01482 fXLabelSizeInPixels->SetState(kButtonDown, kFALSE);
01483 ModXLabelSizeInPixels(kTRUE);
01484 } else {
01485 fXLabelSizeInPixels->SetState(kButtonUp, kFALSE);
01486 ModXLabelSizeInPixels(kFALSE);
01487 }
01488 fXLabelColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetLabelColor("X")));
01489 fXLabelOffset->SetNumber(fCurSelStyle->GetLabelOffset("X"));
01490 fXLabelFont->Select(fCurSelStyle->GetLabelFont("X")/10);
01491 fXAxisColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetAxisColor("X")));
01492 fXTickLength->SetNumber(fCurSelStyle->GetTickLength("X"));
01493 if (fCurSelStyle->GetOptLogx())
01494 fOptLogx->SetState(kButtonDown, kFALSE);
01495 else
01496 fOptLogx->SetState(kButtonUp, kFALSE);
01497 fXNdivMain->SetIntNumber(TMath::Abs(fCurSelStyle->GetNdivisions("X")) % 100);
01498 fXNdivSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("X")) % 10000)/100);
01499 fXNdivSubSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("X")) % 1000000)/10000);
01500 if (fCurSelStyle->GetNdivisions("X") > 0)
01501 fXNdivisionsOptimize->SetState(kButtonDown, kFALSE);
01502 else
01503 fXNdivisionsOptimize->SetState(kButtonUp, kFALSE);
01504 fYTitleSize->SetNumber(fCurSelStyle->GetTitleSize("Y"));
01505 if (fCurSelStyle->GetTitleFont("Y")%10 > 2) {
01506 fYTitleSizeInPixels->SetState(kButtonDown, kFALSE);
01507 ModYTitleSizeInPixels(kTRUE);
01508 } else {
01509 fYTitleSizeInPixels->SetState(kButtonUp, kFALSE);
01510 ModYTitleSizeInPixels(kFALSE);
01511 }
01512 fYTitleColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTitleColor("Y")));
01513 fYTitleOffset->SetNumber(fCurSelStyle->GetTitleOffset("Y"));
01514 fYTitleFont->Select(fCurSelStyle->GetTitleFont("Y")/10);
01515 fYLabelSize->SetNumber(fCurSelStyle->GetLabelSize("Y"));
01516 if (fCurSelStyle->GetLabelFont("Y")%10 > 2) {
01517 fYLabelSizeInPixels->SetState(kButtonDown, kFALSE);
01518 ModYLabelSizeInPixels(kTRUE);
01519 } else {
01520 fYLabelSizeInPixels->SetState(kButtonUp, kFALSE);
01521 ModYLabelSizeInPixels(kFALSE);
01522 }
01523 fYLabelColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetLabelColor("Y")));
01524 fYLabelOffset->SetNumber(fCurSelStyle->GetLabelOffset("Y"));
01525 fYLabelFont->Select(fCurSelStyle->GetLabelFont("Y")/10);
01526 fYAxisColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetAxisColor("Y")));
01527 fYTickLength->SetNumber(fCurSelStyle->GetTickLength("Y"));
01528 if (fCurSelStyle->GetOptLogy())
01529 fOptLogy->SetState(kButtonDown, kFALSE);
01530 else
01531 fOptLogy->SetState(kButtonUp, kFALSE);
01532 fYNdivMain->SetIntNumber(TMath::Abs(fCurSelStyle->GetNdivisions("Y")) % 100);
01533 fYNdivSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("Y")) % 10000)/100);
01534 fYNdivSubSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("Y")) % 1000000)/10000);
01535 if (fCurSelStyle->GetNdivisions("Y") > 0)
01536 fYNdivisionsOptimize->SetState(kButtonDown, kFALSE);
01537 else
01538 fYNdivisionsOptimize->SetState(kButtonUp, kFALSE);
01539 fZTitleSize->SetNumber(fCurSelStyle->GetTitleSize("Z"));
01540 if (fCurSelStyle->GetTitleFont("Z")%10 > 2) {
01541 fZTitleSizeInPixels->SetState(kButtonDown, kFALSE);
01542 ModZTitleSizeInPixels(kTRUE);
01543 } else {
01544 fZTitleSizeInPixels->SetState(kButtonUp, kFALSE);
01545 ModZTitleSizeInPixels(kFALSE);
01546 }
01547 fZTitleColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTitleColor("Z")));
01548 fZTitleOffset->SetNumber(fCurSelStyle->GetTitleOffset("Z"));
01549 fZTitleFont->Select(fCurSelStyle->GetTitleFont("Z")/10);
01550 fZLabelSize->SetNumber(fCurSelStyle->GetLabelSize("Z"));
01551 if (fCurSelStyle->GetLabelFont("Z")%10 > 2) {
01552 fZLabelSizeInPixels->SetState(kButtonDown, kFALSE);
01553 ModZLabelSizeInPixels(kTRUE);
01554 } else {
01555 fZLabelSizeInPixels->SetState(kButtonUp, kFALSE);
01556 ModZLabelSizeInPixels(kFALSE);
01557 }
01558 fZLabelColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetLabelColor("Z")));
01559 fZLabelOffset->SetNumber(fCurSelStyle->GetLabelOffset("Z"));
01560 fZLabelFont->Select(fCurSelStyle->GetLabelFont("Z")/10);
01561 fZAxisColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetAxisColor("Z")));
01562 fZTickLength->SetNumber(fCurSelStyle->GetTickLength("Z"));
01563
01564 if (fCurSelStyle->GetOptLogz())
01565 fOptLogz->SetState(kButtonDown, kFALSE);
01566 else
01567 fOptLogz->SetState(kButtonUp, kFALSE);
01568
01569 fZNdivMain->SetIntNumber(TMath::Abs(fCurSelStyle->GetNdivisions("Z")) % 100);
01570 fZNdivSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("Z")) % 10000)/100);
01571 fZNdivSubSub->SetIntNumber((TMath::Abs(fCurSelStyle->GetNdivisions("Z")) % 1000000)/10000);
01572 if (fCurSelStyle->GetNdivisions("Z") > 0)
01573 fZNdivisionsOptimize->SetState(kButtonDown, kFALSE);
01574 else
01575 fZNdivisionsOptimize->SetState(kButtonUp, kFALSE);
01576 break;
01577 case 5:
01578 fTitleColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTitleFillColor()));
01579 fTitleStyle->SetPattern(fCurSelStyle->GetTitleStyle());
01580 fTitleTextColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetTitleTextColor()));
01581 fTitleFontSize->SetNumber(fCurSelStyle->GetTitleFontSize());
01582 if (fCurSelStyle->GetTitleFont()%10 > 2) {
01583 fTitleFontSizeInPixels->SetState(kButtonDown, kFALSE);
01584 ModTitleFontSizeInPixels(kTRUE);
01585 } else {
01586 fTitleFontSizeInPixels->SetState(kButtonUp, kFALSE);
01587 ModTitleFontSizeInPixels(kFALSE);
01588 }
01589 fTitleFont->Select(fCurSelStyle->GetTitleFont()/10);
01590 fTitleAlign->Select(fCurSelStyle->GetTitleAlign());
01591 fTitleBorderSize->Select(fCurSelStyle->GetTitleBorderSize());
01592 fLegendBorderSize->Select(fCurSelStyle->GetLegendBorderSize());
01593 fTitleX->SetIntNumber((Int_t) (fCurSelStyle->GetTitleX() * 100 + 0.5));
01594 fTitleY->SetIntNumber((Int_t) (fCurSelStyle->GetTitleY() * 100 + 0.5));
01595 fTitleW->SetIntNumber((Int_t) (fCurSelStyle->GetTitleW() * 100 + 0.5));
01596 fTitleH->SetIntNumber((Int_t) (fCurSelStyle->GetTitleH() * 100 + 0.5));
01597
01598 if (fCurSelStyle->GetOptTitle()) {
01599 fOptTitle->SetState(kButtonDown, kFALSE);
01600 fTitleColor->Enable();
01601 fTitleStyle->Enable();
01602 fTitleTextColor->Enable();
01603 fTitleFontSize->SetState(kTRUE);
01604 if (!fTitleFontSizeInPixels->IsDown())
01605 fTitleFontSizeInPixels->SetEnabled(kTRUE);
01606
01607
01608
01609
01610
01611 fTitleX->SetState(kTRUE);
01612 fTitleY->SetState(kTRUE);
01613 fTitleW->SetState(kTRUE);
01614 fTitleH->SetState(kTRUE);
01615 } else {
01616 fOptTitle->SetState(kButtonUp, kFALSE);
01617 fTitleColor->Disable();
01618 fTitleStyle->Disable();
01619 fTitleTextColor->Disable();
01620 fTitleFontSize->SetState(kFALSE);
01621 fTitleFontSizeInPixels->SetEnabled(kFALSE);
01622
01623
01624
01625
01626
01627 fTitleX->SetState(kFALSE);
01628 fTitleY->SetState(kFALSE);
01629 fTitleW->SetState(kFALSE);
01630 fTitleH->SetState(kFALSE);
01631 }
01632 break;
01633 case 6:
01634 fStatColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetStatColor()));
01635 fStatStyle->SetPattern(fCurSelStyle->GetStatStyle());
01636 fStatTextColor->SetColor(TColor::Number2Pixel(fCurSelStyle->GetStatTextColor()));
01637 fStatFont->Select(fCurSelStyle->GetStatFont()/10);
01638 if (fCurSelStyle->GetStatFont()%10 > 2) {
01639 fStatFontSizeInPixels->SetState(kButtonDown, kFALSE);
01640 ModStatFontSizeInPixels(kTRUE);
01641 } else {
01642 fStatFontSizeInPixels->SetState(kButtonUp, kFALSE);
01643 ModStatFontSizeInPixels(kFALSE);
01644 }
01645 fStatFontSize->SetNumber(fCurSelStyle->GetStatFontSize());
01646
01647 fStatX->SetNumber(fCurSelStyle->GetStatX());
01648 fStatY->SetNumber(fCurSelStyle->GetStatY());
01649 fStatW->SetNumber(fCurSelStyle->GetStatW());
01650 fStatH->SetNumber(fCurSelStyle->GetStatH());
01651 fStatBorderSize->Select(fCurSelStyle->GetStatBorderSize());
01652 tmp = fCurSelStyle->GetOptStat();
01653
01654 if (tmp % 10) fOptStatName->SetState(kButtonDown, kFALSE);
01655 else fOptStatName->SetState(kButtonUp, kFALSE);
01656
01657 if ((tmp/10) % 10) fOptStatEntries->SetState(kButtonDown, kFALSE);
01658 else fOptStatEntries->SetState(kButtonUp, kFALSE);
01659
01660 if ((tmp/100) % 10) fOptStatMean->SetState(kButtonDown, kFALSE);
01661 else fOptStatMean->SetState(kButtonUp, kFALSE);
01662
01663 if ((tmp/1000) % 10) fOptStatRMS->SetState(kButtonDown, kFALSE);
01664 else fOptStatRMS->SetState(kButtonUp, kFALSE);
01665
01666 if ((tmp/10000) % 10) fOptStatUnderflow->SetState(kButtonDown, kFALSE);
01667 else fOptStatUnderflow->SetState(kButtonUp, kFALSE);
01668
01669 if ((tmp/100000) % 10) fOptStatOverflow->SetState(kButtonDown, kFALSE);
01670 else fOptStatOverflow->SetState(kButtonUp, kFALSE);
01671
01672 if ((tmp/1000000) % 10) fOptStatIntegral->SetState(kButtonDown, kFALSE);
01673 else fOptStatIntegral->SetState(kButtonUp, kFALSE);
01674
01675 if ((tmp/10000000) % 10) fOptStatSkewness->SetState(kButtonDown, kFALSE);
01676 else fOptStatSkewness->SetState(kButtonUp, kFALSE);
01677
01678 if ((tmp/100000000) % 10) fOptStatKurtosis->SetState(kButtonDown, kFALSE);
01679 else fOptStatKurtosis->SetState(kButtonUp, kFALSE);
01680
01681 if ((((tmp/100) % 10) == 2) || (((tmp/1000) % 10) == 2) ||
01682 (((tmp/10000000) % 10) == 2) || (((tmp/100000000) % 10) == 2))
01683 fOptStatErrors->SetState(kButtonDown, kFALSE);
01684 else fOptStatErrors->SetState(kButtonUp, kFALSE);
01685
01686 fStatFormat->SetText(fCurSelStyle->GetStatFormat());
01687 tmp2 = fCurSelStyle->GetOptFit();
01688
01689 if (tmp2 % 10) fOptFitValues->SetState(kButtonDown, kFALSE);
01690 else fOptFitValues->SetState(kButtonUp, kFALSE);
01691
01692 if ((tmp2/10) % 10) {
01693 fOptFitErrors->SetState(kButtonDown, kFALSE);
01694 fOptFitValues->SetState(kButtonDown, kFALSE);
01695 } else
01696 fOptFitErrors->SetState(kButtonUp, kFALSE);
01697
01698 if ((tmp2/100) % 10) fOptFitChi->SetState(kButtonDown, kFALSE);
01699 else fOptFitChi->SetState(kButtonUp, kFALSE);
01700
01701 if ((tmp2/1000) % 10) fOptFitProbability->SetState(kButtonDown, kFALSE);
01702 else fOptFitProbability->SetState(kButtonUp, kFALSE);
01703
01704 fFitFormat->SetText(fCurSelStyle->GetFitFormat());
01705 break;
01706
01707 case 7:
01708 fHeaderPS->SetText(fCurSelStyle->GetHeaderPS());
01709 fTitlePS->SetText(fCurSelStyle->GetTitlePS());
01710 fColorModelPS->SetButton(fCurSelStyle->GetColorModelPS() + kPSPDFColorModelPSRGB);
01711 fLineScalePS->SetNumber(fCurSelStyle->GetLineScalePS());
01712 Float_t papSizeX;
01713 Float_t papSizeY;
01714 fCurSelStyle->GetPaperSize(papSizeX, papSizeY);
01715 if ((papSizeX == 20) && (papSizeY == 26)) {
01716 fPaperSizePredef->Select(3);
01717 fPaperSizeEnCm = kTRUE;
01718 fPaperSizeX->SetNumber(papSizeX);
01719 fPaperSizeY->SetNumber(papSizeY);
01720 } else if ((papSizeX == 20) && (papSizeY == 24)) {
01721 fPaperSizePredef->Select(4);
01722 fPaperSizeEnCm = kFALSE;
01723 fPaperSizeX->SetNumber(papSizeX * 0.394);
01724 fPaperSizeY->SetNumber(papSizeY * 0.394);
01725 } else {
01726 fPaperSizePredef->Select(1);
01727 fPaperSizeEnCm = kTRUE;
01728 fPaperSizeX->SetNumber(papSizeX);
01729 fPaperSizeY->SetNumber(papSizeY);
01730 }
01731 break;
01732 }
01733 }
01734
01735
01736 void TStyleManager::ConnectAll()
01737 {
01738
01739
01740 Connect("CloseWindow()", "TStyleManager", this, "CloseWindow()");
01741 fMenuStyle->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
01742 fMenuHelp->Connect("Activated(Int_t)", "TStyleManager", this, "DoMenu(Int_t)");
01743 fToolBarNew->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuNew));
01744 fToolBarDelete->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuDelete));
01745 fToolBarImportCanvas->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportCanvas));
01746 fToolBarImportMacro->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuImportMacro));
01747 fToolBarExport->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuExport));
01748 fToolBarHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelp));
01749 fListComboBox->Connect("Selected(Int_t)", "TStyleManager", this, "DoListSelect()");
01750 fPreviewButton->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoPreview(Bool_t)");
01751 fPreviewRealTime->Connect("Toggled(Bool_t)", "TStyleManager", this, "DoRealTime(Bool_t)");
01752 fMakeDefault->Connect("Clicked()", "TStyleManager", this, "DoMakeDefault()");
01753 fApplyOnGroup->Connect("Clicked(Int_t)", "TStyleManager", this, "DoApplyOnSelect(Int_t)");
01754 fApplyOnButton->Connect("Clicked()", "TStyleManager", this, "DoApplyOn()");
01755 fMoreLess->Connect("Clicked()", "TStyleManager", this, "DoMoreLess()");
01756
01757 fEditionHelp->Connect("Clicked()", "TStyleManager", this, TString::Format("DoMenu(Int_t=%d)", kMenuHelpEditor));
01758 fEditionUpdatePreview->Connect("Clicked()", "TStyleManager", this, "DoEditionUpdatePreview()");
01759 fEditionReset->Connect("Clicked()", "TStyleManager", this, "DoImportMacro(Int_t=kFALSE)");
01760 fEditionTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeTab(Int_t)");
01761 fAxisTab->Connect("Selected(Int_t)", "TStyleManager", this, "DoChangeAxisTab(Int_t)");
01762
01763
01764 TQObject::Connect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)", "TStyleManager",
01765 this, "DoSelectCanvas(TVirtualPad *, TObject *, Int_t)");
01766 TQObject::Connect("TCanvas", "Closed()", "TStyleManager", this, "DoSelectNoCanvas()");
01767 }
01768
01769
01770 void TStyleManager::DisconnectAll()
01771 {
01772
01773
01774 Disconnect("CloseWindow()");
01775 fMenuStyle->Disconnect("Activated(Int_t)");
01776 fMenuHelp->Disconnect("Activated(Int_t)");
01777 fToolBarNew->Disconnect("Clicked()");
01778 fToolBarDelete->Disconnect("Clicked()");
01779 fToolBarImportCanvas->Disconnect("Clicked()");
01780 fToolBarImportMacro->Disconnect("Clicked()");
01781 fToolBarExport->Disconnect("Clicked()");
01782 fToolBarHelp->Disconnect("Clicked()");
01783 fListComboBox->Disconnect("Selected(Int_t)");
01784 fPreviewButton->Disconnect("Toggled(Bool_t)");
01785 fMakeDefault->Disconnect("Clicked()");
01786 fApplyOnGroup->Disconnect("Clicked(Int_t)");
01787 fApplyOnButton->Disconnect("Clicked()");
01788 fMoreLess->Disconnect("Clicked()");
01789
01790 fEditionHelp->Disconnect("Clicked()");
01791 fEditionUpdatePreview->Disconnect("Clicked()");
01792 fEditionReset->Disconnect("Clicked()");
01793 fEditionTab->Disconnect("Selected(Int_t)");
01794
01795 TQObject::Disconnect("TCanvas", "Selected(TVirtualPad *, TObject *, Int_t)");
01796 TQObject::Disconnect("TCanvas", "Closed()");
01797 }
01798
01799
01800 void TStyleManager::ConnectEditor(Int_t tabNum)
01801 {
01802
01803
01804 if (fSigSlotConnected) return;
01805 fSigSlotConnected = kTRUE;
01806
01807 switch (tabNum) {
01808 case 0:
01809 fFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFillColor()");
01810 fFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFillStyle()");
01811 fHatchesLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHatchesLineWidth()");
01812 fHatchesSpacing->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModHatchesSpacing()");
01813 fMarkerColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModMarkerColor()");
01814 fMarkerStyle->Connect("MarkerSelected(Style_t)", "TStyleManager", this, "ModMarkerStyle()");
01815 fMarkerSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModMarkerSize()");
01816 fScreenFactor->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModScreenFactor()");
01817 fLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModLineColor()");
01818 fLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineWidth()");
01819 fLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModLineStyle()");
01820 fLineStyleEdit->Connect("Clicked()", "TStyleManager", this, "ModLineStyleEdit()");
01821 fTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTextColor()");
01822 fTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextSize()");
01823 fTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTextSizeInPixels(Bool_t)");
01824 fTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextFont()");
01825 fTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTextAlign()");
01826 fTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTextAngle()");
01827 break;
01828 case 1:
01829 fCanvasColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModCanvasColor()");
01830 fCanvasDefX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefX()");
01831 fCanvasDefY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefY()");
01832 fCanvasDefW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefW()");
01833 fCanvasDefH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModCanvasDefH()");
01834 fCanvasBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModCanvasBorderMode()");
01835 fCanvasBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModCanvasBorderSize()");
01836 fOptDateBool->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptDateBool()");
01837 fAttDateTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModAttDateTextColor()");
01838 fAttDateTextSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextSize()");
01839 fAttDateTextSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModAttDateTextSizeInPixels(Bool_t)");
01840 fOptDateFormat->Connect("Selected(Int_t)", "TStyleManager", this, "ModOptDateFormat()");
01841 fAttDateTextFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextFont()");
01842 fAttDateTextAngle->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModAttDateTextAngle()");
01843 fAttDateTextAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModAttDateTextAlign()");
01844 fDateX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateX()");
01845 fDateY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModDateY()");
01846 break;
01847 case 2:
01848 fPadTopMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadTopMargin()");
01849 fPadBottomMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadBottomMargin()");
01850 fPadLeftMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadLeftMargin()");
01851 fPadRightMargin->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPadRightMargin()");
01852 fPadBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModPadBorderMode()");
01853 fPadBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModPadBorderSize()");
01854 fPadColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModPadColor()");
01855 fPadTickX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickX()");
01856 fPadTickY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadTickY()");
01857 fPadGridX->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridX()");
01858 fPadGridY->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModPadGridY()");
01859 fGridColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModGridColor()");
01860 fGridWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridWidth()");
01861 fGridStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModGridStyle()");
01862 break;
01863 case 3:
01864 fHistFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistFillColor()");
01865 fHistFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModHistFillStyle()");
01866 fHistLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModHistLineColor()");
01867 fHistLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineWidth()");
01868 fHistLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModHistLineStyle()");
01869 fBarWidth->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarWidth()");
01870 fBarOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModBarOffset()");
01871 fHistMinimumZero->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModHistMinimumZero()");
01872 fPaintTextFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModPaintTextFormat()");
01873 fNumberContours->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModNumberContours()");
01874 fLegoInnerR->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLegoInnerR()");
01875 fFrameFillColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameFillColor()");
01876 fFrameFillStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModFrameFillStyle()");
01877 fFrameLineColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFrameLineColor()");
01878 fFrameLineWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineWidth()");
01879 fFrameLineStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameLineStyle()");
01880 fPaletteEdit->Connect("Clicked()", "TStyleManager", this, "ModPaletteEdit()");
01881 fFrameBorderMode->Connect("Clicked(Int_t)", "TStyleManager", this, "ModFrameBorderMode()");
01882 fFrameBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModFrameBorderSize()");
01883 fFuncColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModFuncColor()");
01884 fFuncWidth->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncWidth()");
01885 fFuncStyle->Connect("Selected(Int_t)", "TStyleManager", this, "ModFuncStyle()");
01886 fDrawBorder->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModDrawBorder()");
01887 fEndErrorSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModEndErrorSize()");
01888 fErrorX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModErrorX()");
01889 break;
01890 case 4:
01891 fTimeOffsetDate->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
01892 fTimeOffsetTime->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTimeOffset()");
01893 fStripDecimals->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStripDecimals()");
01894 fApplyOnXYZ->Connect("Clicked()", "TStyleManager", this, "ModApplyOnXYZ()");
01895 fXTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleSize()");
01896 fXTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXTitleSizeInPixels(Bool_t)");
01897 fXTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXTitleColor()");
01898 fXTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTitleOffset()");
01899 fXTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXTitleFont()");
01900 fXLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelSize()");
01901 fXLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXLabelSizeInPixels(Bool_t)");
01902 fXLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXLabelColor()");
01903 fXLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXLabelOffset()");
01904 fXLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModXLabelFont()");
01905 fXAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModXAxisColor()");
01906 fXTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXTickLength()");
01907 fOptLogx->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogx()");
01908 fXNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
01909 fXNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
01910 fXNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModXNdivisions()");
01911 fXNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModXNdivisions()");
01912 fYTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleSize()");
01913 fYTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYTitleSizeInPixels(Bool_t)");
01914 fYTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYTitleColor()");
01915 fYTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTitleOffset()");
01916 fYTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYTitleFont()");
01917 fYLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelSize()");
01918 fYLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYLabelSizeInPixels(Bool_t)");
01919 fYLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYLabelColor()");
01920 fYLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYLabelOffset()");
01921 fYLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModYLabelFont()");
01922 fYAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModYAxisColor()");
01923 fYTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYTickLength()");
01924 fOptLogy->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogy()");
01925 fYNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
01926 fYNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
01927 fYNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModYNdivisions()");
01928 fYNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModYNdivisions()");
01929 fZTitleSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleSize()");
01930 fZTitleSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZTitleSizeInPixels(Bool_t)");
01931 fZTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZTitleColor()");
01932 fZTitleOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTitleOffset()");
01933 fZTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZTitleFont()");
01934 fZLabelSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelSize()");
01935 fZLabelSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZLabelSizeInPixels(Bool_t)");
01936 fZLabelColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZLabelColor()");
01937 fZLabelOffset->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZLabelOffset()");
01938 fZLabelFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModZLabelFont()");
01939 fZAxisColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModZAxisColor()");
01940 fZTickLength->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZTickLength()");
01941 fOptLogz->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptLogz()");
01942 fZNdivMain->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
01943 fZNdivSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
01944 fZNdivSubSub->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModZNdivisions()");
01945 fZNdivisionsOptimize->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModZNdivisions()");
01946 break;
01947 case 5:
01948 fOptTitle->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptTitle()");
01949 fTitleColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleFillColor()");
01950 fTitleStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModTitleStyle()");
01951 fTitleTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModTitleTextColor()");
01952 fTitleFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleFontSize()");
01953 fTitleFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModTitleFontSizeInPixels(Bool_t)");
01954 fTitleFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleFont()");
01955 fTitleAlign->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleAlign()");
01956 fTitleBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModTitleBorderSize()");
01957 fTitleX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleX()");
01958 fTitleY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleY()");
01959 fTitleW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleW()");
01960 fTitleH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModTitleH()");
01961 fLegendBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModLegendBorderSize()");
01962 break;
01963 case 6:
01964 fStatColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatColor(Pixel_t)");
01965 fStatStyle->Connect("PatternSelected(Style_t)", "TStyleManager", this, "ModStatStyle(Style_t)");
01966 fStatTextColor->Connect("ColorSelected(Pixel_t)", "TStyleManager", this, "ModStatTextColor(Pixel_t)");
01967 fStatFontSize->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatFontSize()");
01968 fStatFontSizeInPixels->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModStatFontSizeInPixels(Bool_t)");
01969 fStatFont->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatFont()");
01970 fStatX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatX()");
01971 fStatY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatY()");
01972 fStatW->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatW()");
01973 fStatH->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModStatH()");
01974 fStatBorderSize->Connect("Selected(Int_t)", "TStyleManager", this, "ModStatBorderSize()");
01975 fOptStatName->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01976 fOptStatEntries->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01977 fOptStatOverflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01978 fOptStatMean->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01979 fOptStatUnderflow->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01980 fOptStatRMS->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01981 fOptStatSkewness->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01982 fOptStatIntegral->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01983 fOptStatKurtosis->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01984 fOptStatErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptStat()");
01985 fStatFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModStatFormat(const char *)");
01986 fOptFitValues->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
01987 fOptFitErrors->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
01988 fOptFitProbability->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
01989 fOptFitChi->Connect("Toggled(Bool_t)", "TStyleManager", this, "ModOptFit()");
01990 fFitFormat->Connect("TextChanged(const char *)", "TStyleManager", this, "ModFitFormat(const char *)");
01991 break;
01992 case 7:
01993 fHeaderPS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModHeaderPS()");
01994 fTitlePS->Connect("TextChanged(const char *)", "TStyleManager", this, "ModTitlePS()");
01995 fColorModelPS->Connect("Clicked(Int_t)", "TStyleManager", this, "ModColorModelPS()");
01996 fLineScalePS->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModLineScalePS()");
01997 fPaperSizePredef->Connect("Selected(Int_t)", "TStyleManager", this, "ModPaperSizePredef()");
01998 fPaperSizeX->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
01999 fPaperSizeY->Connect("ValueSet(Long_t)", "TStyleManager", this, "ModPaperSizeXY()");
02000 break;
02001 }
02002 }
02003
02004
02005 void TStyleManager::DisconnectEditor(Int_t tabNum)
02006 {
02007
02008
02009
02010 if (!fSigSlotConnected) return;
02011 fSigSlotConnected = kFALSE;
02012
02013 switch (tabNum) {
02014 case 0:
02015 fFillColor->Disconnect("ColorSelected(Pixel_t)");
02016 fFillStyle->Disconnect("PatternSelected(Style_t)");
02017 fHatchesLineWidth->Disconnect("Selected(Int_t)");
02018 fHatchesSpacing->Disconnect("ValueSet(Long_t)");
02019 fMarkerColor->Disconnect("ColorSelected(Pixel_t)");
02020 fMarkerStyle->Disconnect("MarkerSelected(Style_t)");
02021 fMarkerSize->Disconnect("Selected(Int_t)");
02022 fScreenFactor->Disconnect("ValueSet(Long_t)");
02023 fLineColor->Disconnect("ColorSelected(Pixel_t)");
02024 fLineWidth->Disconnect("Selected(Int_t)");
02025 fLineStyle->Disconnect("Selected(Int_t)");
02026 fLineStyleEdit->Disconnect("Clicked()");
02027 fTextColor->Disconnect("ColorSelected(Pixel_t)");
02028 fTextSize->Disconnect("ValueSet(Long_t)");
02029 fTextFont->Disconnect("Selected(Int_t)");
02030 fTextAlign->Disconnect("Selected(Int_t)");
02031 fTextAngle->Disconnect("ValueSet(Long_t)");
02032 break;
02033 case 1:
02034 fCanvasColor->Disconnect("ColorSelected(Pixel_t)");
02035 fCanvasDefX->Disconnect("ValueSet(Long_t)");
02036 fCanvasDefY->Disconnect("ValueSet(Long_t)");
02037 fCanvasDefW->Disconnect("ValueSet(Long_t)");
02038 fCanvasDefH->Disconnect("ValueSet(Long_t)");
02039 fCanvasBorderMode->Disconnect("Clicked(Int_t)");
02040 fCanvasBorderSize->Disconnect("Selected(Int_t)");
02041 fOptDateBool->Disconnect("Toggled(Bool_t)");
02042 fAttDateTextColor->Disconnect("ColorSelected(Pixel_t)");
02043 fAttDateTextSize->Disconnect("ValueSet(Long_t)");
02044 fOptDateFormat->Disconnect("Selected(Int_t)");
02045 fAttDateTextFont->Disconnect("Selected(Int_t)");
02046 fAttDateTextAngle->Disconnect("ValueSet(Long_t)");
02047 fAttDateTextAlign->Disconnect("Selected(Int_t)");
02048 fDateX->Disconnect("ValueSet(Long_t)");
02049 fDateY->Disconnect("ValueSet(Long_t)");
02050 break;
02051 case 2:
02052 fPadTopMargin->Disconnect("ValueSet(Long_t)");
02053 fPadBottomMargin->Disconnect("ValueSet(Long_t)");
02054 fPadLeftMargin->Disconnect("ValueSet(Long_t)");
02055 fPadRightMargin->Disconnect("ValueSet(Long_t)");
02056 fPadBorderMode->Disconnect("Clicked(Int_t)");
02057 fPadBorderSize->Disconnect("Selected(Int_t)");
02058 fPadColor->Disconnect("ColorSelected(Pixel_t)");
02059 fPadTickX->Disconnect("Toggled(Bool_t)");
02060 fPadTickY->Disconnect("Toggled(Bool_t)");
02061 fPadGridX->Disconnect("Toggled(Bool_t)");
02062 fPadGridY->Disconnect("Toggled(Bool_t)");
02063 fGridColor->Disconnect("ColorSelected(Pixel_t)");
02064 fGridWidth->Disconnect("Selected(Int_t)");
02065 fGridStyle->Disconnect("Selected(Int_t)");
02066 break;
02067 case 3:
02068 fHistFillColor->Disconnect("ColorSelected(Pixel_t)");
02069 fHistFillStyle->Disconnect("PatternSelected(Style_t)");
02070 fHistLineColor->Disconnect("ColorSelected(Pixel_t)");
02071 fHistLineWidth->Disconnect("Selected(Int_t)");
02072 fHistLineStyle->Disconnect("Selected(Int_t)");
02073 fBarWidth->Disconnect("ValueSet(Long_t)");
02074 fBarOffset->Disconnect("ValueSet(Long_t)");
02075 fHistMinimumZero->Disconnect("Toggled(Bool_t)");
02076 fPaintTextFormat->Disconnect("TextChanged(const char *)");
02077 fNumberContours->Disconnect("ValueSet(Long_t)");
02078 fLegoInnerR->Disconnect("ValueSet(Long_t)");
02079 fFrameFillColor->Disconnect("ColorSelected(Pixel_t)");
02080 fFrameFillStyle->Disconnect("PatternSelected(Style_t)");
02081 fFrameLineColor->Disconnect("ColorSelected(Pixel_t)");
02082 fFrameLineWidth->Disconnect("Selected(Int_t)");
02083 fFrameLineStyle->Disconnect("Selected(Int_t)");
02084 fPaletteEdit->Disconnect("Clicked()");
02085 fFrameBorderMode->Disconnect("Clicked(Int_t)");
02086 fFrameBorderSize->Disconnect("Selected(Int_t)");
02087 fFuncColor->Disconnect("ColorSelected(Pixel_t)");
02088 fFuncWidth->Disconnect("Selected(Int_t)");
02089 fFuncStyle->Disconnect("Selected(Int_t)");
02090 fDrawBorder->Disconnect("Toggled(Bool_t)");
02091 fEndErrorSize->Disconnect("ValueSet(Long_t)");
02092 fErrorX->Disconnect("ValueSet(Long_t)");
02093 break;
02094 case 4:
02095 fTimeOffsetDate->Disconnect("ValueSet(Long_t)");
02096 fTimeOffsetTime->Disconnect("ValueSet(Long_t)");
02097 fStripDecimals->Disconnect("Toggled(Bool_t)");
02098 fApplyOnXYZ->Disconnect("Clicked()");
02099 fXTitleSize->Disconnect("ValueSet(Long_t)");
02100 fXTitleColor->Disconnect("ColorSelected(Pixel_t)");
02101 fXTitleOffset->Disconnect("ValueSet(Long_t)");
02102 fXTitleFont->Disconnect("Selected(Int_t)");
02103 fXLabelSize->Disconnect("ValueSet(Long_t)");
02104 fXLabelColor->Disconnect("ColorSelected(Pixel_t)");
02105 fXLabelOffset->Disconnect("ValueSet(Long_t)");
02106 fXLabelFont->Disconnect("Selected(Int_t)");
02107 fXAxisColor->Disconnect("ColorSelected(Pixel_t)");
02108 fXTickLength->Disconnect("ValueSet(Long_t)");
02109 fOptLogx->Disconnect("Toggled(Bool_t)");
02110 fXNdivMain->Disconnect("ValueSet(Long_t)");
02111 fXNdivSub->Disconnect("ValueSet(Long_t)");
02112 fXNdivSubSub->Disconnect("ValueSet(Long_t)");
02113 fXNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
02114 fYTitleSize->Disconnect("ValueSet(Long_t)");
02115 fYTitleColor->Disconnect("ColorSelected(Pixel_t)");
02116 fYTitleOffset->Disconnect("ValueSet(Long_t)");
02117 fYTitleFont->Disconnect("Selected(Int_t)");
02118 fYLabelSize->Disconnect("ValueSet(Long_t)");
02119 fYLabelColor->Disconnect("ColorSelected(Pixel_t)");
02120 fYLabelOffset->Disconnect("ValueSet(Long_t)");
02121 fYLabelFont->Disconnect("Selected(Int_t)");
02122 fYAxisColor->Disconnect("ColorSelected(Pixel_t)");
02123 fYTickLength->Disconnect("ValueSet(Long_t)");
02124 fOptLogy->Disconnect("Toggled(Bool_t)");
02125 fYNdivMain->Disconnect("ValueSet(Long_t)");
02126 fYNdivSub->Disconnect("ValueSet(Long_t)");
02127 fYNdivSubSub->Disconnect("ValueSet(Long_t)");
02128 fYNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
02129 fZTitleSize->Disconnect("ValueSet(Long_t)");
02130 fZTitleColor->Disconnect("ColorSelected(Pixel_t)");
02131 fZTitleOffset->Disconnect("ValueSet(Long_t)");
02132 fZTitleFont->Disconnect("Selected(Int_t)");
02133 fZLabelSize->Disconnect("ValueSet(Long_t)");
02134 fZLabelColor->Disconnect("ColorSelected(Pixel_t)");
02135 fZLabelOffset->Disconnect("ValueSet(Long_t)");
02136 fZLabelFont->Disconnect("Selected(Int_t)");
02137 fZAxisColor->Disconnect("ColorSelected(Pixel_t)");
02138 fZTickLength->Disconnect("ValueSet(Long_t)");
02139 fOptLogz->Disconnect("Toggled(Bool_t)");
02140 fZNdivMain->Disconnect("ValueSet(Long_t)");
02141 fZNdivSub->Disconnect("ValueSet(Long_t)");
02142 fZNdivSubSub->Disconnect("ValueSet(Long_t)");
02143 fZNdivisionsOptimize->Disconnect("Toggled(Bool_t)");
02144 break;
02145 case 5:
02146 fOptTitle->Disconnect("Toggled(Bool_t)");
02147 fTitleColor->Disconnect("ColorSelected(Pixel_t)");
02148 fTitleStyle->Disconnect("PatternSelected(Style_t)");
02149 fTitleTextColor->Disconnect("ColorSelected(Pixel_t)");
02150 fTitleFontSize->Disconnect("ValueSet(Long_t)");
02151 fTitleFont->Disconnect("Selected(Int_t)");
02152 fTitleAlign->Disconnect("Selected(Int_t)");
02153 fTitleBorderSize->Disconnect("Selected(Int_t)");
02154 fTitleX->Disconnect("ValueSet(Long_t)");
02155 fTitleY->Disconnect("ValueSet(Long_t)");
02156 fTitleW->Disconnect("ValueSet(Long_t)");
02157 fTitleH->Disconnect("ValueSet(Long_t)");
02158 fLegendBorderSize->Disconnect("Selected(Int_t)");
02159 break;
02160 case 6:
02161 fStatColor->Disconnect("ColorSelected(Pixel_t)");
02162 fStatStyle->Disconnect("PatternSelected(Style_t)");
02163 fStatTextColor->Disconnect("ColorSelected(Pixel_t)");
02164 fStatFontSize->Disconnect("ValueSet(Long_t)");
02165 fStatFont->Disconnect("Selected(Int_t)");
02166 fStatX->Disconnect("ValueSet(Long_t)");
02167 fStatY->Disconnect("ValueSet(Long_t)");
02168 fStatW->Disconnect("ValueSet(Long_t)");
02169 fStatH->Disconnect("ValueSet(Long_t)");
02170 fStatBorderSize->Disconnect("Selected(Int_t)");
02171 fOptStatName->Disconnect("Toggled(Bool_t)");
02172 fOptStatEntries->Disconnect("Toggled(Bool_t)");
02173 fOptStatOverflow->Disconnect("Toggled(Bool_t)");
02174 fOptStatMean->Disconnect("Toggled(Bool_t)");
02175 fOptStatUnderflow->Disconnect("Toggled(Bool_t)");
02176 fOptStatRMS->Disconnect("Toggled(Bool_t)");
02177 fOptStatSkewness->Disconnect("Toggled(Bool_t)");
02178 fOptStatIntegral->Disconnect("Toggled(Bool_t)");
02179 fOptStatKurtosis->Disconnect("Toggled(Bool_t)");
02180 fOptStatErrors->Disconnect("Toggled(Bool_t)");
02181 fStatFormat->Disconnect("TextChanged(const char *)");
02182 fOptFitValues->Disconnect("Toggled(Bool_t)");
02183 fOptFitErrors->Disconnect("Toggled(Bool_t)");
02184 fOptFitProbability->Disconnect("Toggled(Bool_t)");
02185 fOptFitChi->Disconnect("Toggled(Bool_t)");
02186 fFitFormat->Disconnect("TextChanged(const char *)");
02187 break;
02188 case 7:
02189 fHeaderPS->Disconnect("TextChanged(const char *)");
02190 fTitlePS->Disconnect("TextChanged(const char *)");
02191 fColorModelPS->Disconnect("Clicked(Int_t)");
02192 fLineScalePS->Disconnect("ValueSet(Long_t)");
02193 fPaperSizePredef->Disconnect("Selected(Int_t)");
02194 fPaperSizeX->Disconnect("ValueSet(Long_t)");
02195 fPaperSizeY->Disconnect("ValueSet(Long_t)");
02196 break;
02197 }
02198 }
02199
02200
02201 void TStyleManager::DoEditor()
02202 {
02203
02204
02205
02206 fStyleChanged = kTRUE;
02207
02208
02209 UpdateStatusBar();
02210
02211
02212 if (fRealTimePreview)
02213 DoEditionUpdatePreview();
02214 }
02215
02216
02217 void TStyleManager::AddEdition(TGCompositeFrame *p)
02218 {
02219
02220
02221
02222 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 8, 8, 5, 5);
02223 fTrashListLayout->Add(layout1);
02224 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10, 10);
02225 fTrashListLayout->Add(layout2);
02226
02227 fEditionFrame = new TGVerticalFrame(p);
02228 fEditionFrame->ChangeOptions(kRaisedFrame);
02229
02230 fEditionTab = new TGTab(fEditionFrame, 200, 150);
02231 fEditionTab->Associate(this);
02232 CreateTabGeneral(fEditionTab->AddTab("General"));
02233 CreateTabCanvas(fEditionTab->AddTab("Canvas"));
02234 CreateTabPad(fEditionTab->AddTab("Pad"));
02235 CreateTabHistos(fEditionTab->AddTab("Histograms"));
02236 CreateTabAxis(fEditionTab->AddTab("Axis"));
02237 CreateTabTitle(fEditionTab->AddTab("Title"));
02238 CreateTabStats(fEditionTab->AddTab("Stats"));
02239 CreateTabPsPdf(fEditionTab->AddTab("PS / PDF"));
02240 fEditionFrame->AddFrame(fEditionTab, layout1);
02241
02242 fEditionButtonFrame = new TGHorizontalFrame(fEditionFrame);
02243 fEditionHelp = new TGTextButton(fEditionButtonFrame, "He&lp", kEditButHelp);
02244 fEditionHelp->Associate(this);
02245 fEditionButtonFrame->AddFrame(fEditionHelp, layout1);
02246 fEditionUpdatePreview = new TGTextButton(fEditionButtonFrame, "&Update Preview", kEditButUpPrev);
02247 fEditionUpdatePreview->Associate(this);
02248 fEditionUpdatePreview->SetEnabled(kFALSE);
02249 fEditionButtonFrame->AddFrame(fEditionUpdatePreview, layout1);
02250 fEditionReset = new TGTextButton(fEditionButtonFrame, "&Reset", kEditButReset);
02251 fEditionReset->Associate(this);
02252 fEditionButtonFrame->AddFrame(fEditionReset, layout1);
02253 fEditionFrame->AddFrame(fEditionButtonFrame, layout1);
02254
02255 p->AddFrame(fEditionFrame, layout1);
02256
02257 fEditionHelp->SetToolTipText("Help about the current tab");
02258 fEditionUpdatePreview->SetToolTipText("Force the refresh of the preview window");
02259 fEditionReset->SetToolTipText("Reset the selected style");
02260 }
02261
02262
02263 void TStyleManager::CreateTabGeneral(TGCompositeFrame *tab)
02264 {
02265
02266
02267 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
02268 fTrashListLayout->Add(layout);
02269
02270 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
02271 fTrashListFrame->AddFirst(h1);
02272 AddGeneralFill(h1);
02273 AddGeneralLine(h1);
02274 tab->AddFrame(h1, fLayoutExpandX);
02275
02276 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
02277 fTrashListFrame->AddFirst(h2);
02278 AddGeneralText(h2);
02279 TGVerticalFrame *v = new TGVerticalFrame(h2);
02280 fTrashListFrame->AddFirst(v);
02281 AddGeneralMarker(v);
02282 TGHorizontalFrame *h3 = new TGHorizontalFrame(v);
02283 fTrashListFrame->AddFirst(h3);
02284 fScreenFactor = AddNumberEntry(h3, 0, 0, 0, kGeneralScreenFactor,
02285 "Screen factor:", 0, 6, TGNumberFormat::kNESRealOne,
02286 TGNumberFormat::kNEAPositive,
02287 TGNumberFormat::kNELLimitMinMax, 0.2, 5);
02288 v->AddFrame(h3, layout);
02289 h2->AddFrame(v, fLayoutExpandXY);
02290 tab->AddFrame(h2, fLayoutExpandX);
02291
02292 fScreenFactor->GetNumberEntry()->SetToolTipText("Coefficient for different screen's resolutions");
02293 }
02294
02295
02296 void TStyleManager::AddGeneralFill(TGCompositeFrame *f)
02297 {
02298
02299
02300 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 5, 0, 5, 5);
02301 fTrashListLayout->Add(layout2);
02302
02303 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
02304 fTrashListFrame->AddFirst(gf);
02305 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02306 fTrashListFrame->AddFirst(h1);
02307 fFillColor = AddColorEntry(h1, kGeneralFillColor);
02308 fFillStyle = AddFillStyleEntry(h1, kGeneralFillStyle);
02309 gf->AddFrame(h1, fLayoutExpandX);
02310 AddTitle(gf, "Hatchings");
02311 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02312 fTrashListFrame->AddFirst(h2);
02313 fHatchesLineWidth = AddLineWidthEntry(h2, kGeneralHatchesLineWidth);
02314 fHatchesSpacing = AddNumberEntry(h2, 0, 5, 0, kGeneralHatchesSpacing,
02315 "", 0, 5, TGNumberFormat::kNESRealOne,
02316 TGNumberFormat::kNEAAnyNumber,
02317 TGNumberFormat::kNELLimitMinMax, 0.1, 5);
02318 gf->AddFrame(h2, layout2);
02319 f->AddFrame(gf, fLayoutExpandXYMargin);
02320
02321
02322
02323
02324 fHatchesSpacing->GetNumberEntry()->SetToolTipText("Spacing between the hatching's lines");
02325 }
02326
02327
02328 void TStyleManager::AddGeneralLine(TGCompositeFrame *f)
02329 {
02330
02331
02332 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
02333 fTrashListFrame->AddFirst(gf);
02334 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02335 fTrashListFrame->AddFirst(h);
02336 fLineColor = AddColorEntry(h, kGeneralLineColor);
02337 fLineWidth = AddLineWidthEntry(h, kGeneralLineWidth);
02338 gf->AddFrame(h, fLayoutExpandX);
02339 fLineStyle = AddLineStyleEntry(gf, kGeneralLineStyle);
02340 fLineStyleEdit = AddTextButton(gf, "Lines' Style Editor...", kGeneralLineStyleEdit);
02341 fLineStyleEdit->SetEnabled(kFALSE);
02342 f->AddFrame(gf, fLayoutExpandXYMargin);
02343
02344
02345
02346 }
02347
02348
02349 void TStyleManager::AddGeneralText(TGCompositeFrame *f)
02350 {
02351
02352
02353 TGGroupFrame *gf = new TGGroupFrame(f, "Text");
02354 fTrashListFrame->AddFirst(gf);
02355 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02356 fTrashListFrame->AddFirst(h1);
02357 fTextColor = AddColorEntry(h1, kGeneralTextColor);
02358 fTextFont = AddFontTypeEntry(h1, kGeneralTextFont);
02359 gf->AddFrame(h1, fLayoutExpandX);
02360 fTextAlign = AddTextAlignEntry(gf, kGeneralTextAlign);
02361 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02362 fTrashListFrame->AddFirst(h2);
02363 fTextSizeInPixels = AddCheckButton(h2, "Pixels", kGeneralTextSizeInPixels);
02364 fTextSize = AddNumberEntry(h2, 21, 10, 0, kGeneralTextSize, "Size:", 0, 5,
02365 TGNumberFormat::kNESRealThree,
02366 TGNumberFormat::kNEAAnyNumber,
02367 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
02368 gf->AddFrame(h2, fLayoutExpandX);
02369 fTextAngle = AddNumberEntry(gf, 0, 0, 0, kGeneralTextAngle, "Angle:",
02370 0, 5, TGNumberFormat::kNESInteger,
02371 TGNumberFormat::kNEAAnyNumber,
02372 TGNumberFormat::kNELLimitMinMax, -180, 180);
02373 f->AddFrame(gf, fLayoutExpandXYMargin);
02374
02375
02376
02377 fTextSizeInPixels->SetToolTipText("Set the text size in pixels if selected, otherwise - in % of pad.");
02378 fTextSize->GetNumberEntry()->SetToolTipText("General text size (in pixels or in % of pad)");
02379 fTextAngle->GetNumberEntry()->SetToolTipText("General text angle");
02380 }
02381
02382
02383 void TStyleManager::AddGeneralMarker(TGCompositeFrame *f)
02384 {
02385
02386
02387 TGGroupFrame *gf = new TGGroupFrame(f, "Marker");
02388 fTrashListFrame->AddFirst(gf);
02389 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02390 fTrashListFrame->AddFirst(h);
02391 fMarkerColor = AddColorEntry(h, kGeneralMarkerColor);
02392 fMarkerStyle = AddMarkerStyleEntry(h, kGeneralMarkerStyle);
02393 fMarkerSize = AddMarkerSizeEntry(h, kGeneralMarkerSize);
02394 gf->AddFrame(h, fLayoutExpandX);
02395 f->AddFrame(gf, fLayoutExpandXMargin);
02396
02397
02398
02399
02400 }
02401
02402
02403 void TStyleManager::CreateTabCanvas(TGCompositeFrame *tab)
02404 {
02405
02406
02407 TGHorizontalFrame *h = new TGHorizontalFrame(tab);
02408 fTrashListFrame->AddFirst(h);
02409 TGVerticalFrame *v1 = new TGVerticalFrame(h);
02410 fTrashListFrame->AddFirst(v1);
02411 AddCanvasFill(v1);
02412 AddCanvasGeometry(v1);
02413 AddCanvasBorder(v1);
02414 h->AddFrame(v1, fLayoutExpandXY);
02415 TGVerticalFrame *v2 = new TGVerticalFrame(h);
02416 fTrashListFrame->AddFirst(v2);
02417 AddCanvasDate(v2);
02418 h->AddFrame(v2, fLayoutExpandXY);
02419 tab->AddFrame(h, fLayoutExpandX);
02420 }
02421
02422
02423 void TStyleManager::AddCanvasFill(TGCompositeFrame *f)
02424 {
02425
02426
02427 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
02428 fTrashListFrame->AddFirst(gf);
02429 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02430 fTrashListFrame->AddFirst(h);
02431 fCanvasColor = AddColorEntry(h, kCanvasColor);
02432 gf->AddFrame(h, fLayoutExpandX);
02433 f->AddFrame(gf, fLayoutExpandXMargin);
02434
02435
02436
02437 }
02438
02439
02440 void TStyleManager::AddCanvasGeometry(TGCompositeFrame *f)
02441 {
02442
02443
02444 TGGroupFrame *gf = new TGGroupFrame(f, "Geometry");
02445 fTrashListFrame->AddFirst(gf);
02446 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02447 fTrashListFrame->AddFirst(h1);
02448 fCanvasDefX = AddNumberEntry(h1, 0, 9, 0, kCanvasDefX, "X:",
02449 0, 5, TGNumberFormat::kNESInteger,
02450 TGNumberFormat::kNEAPositive,
02451 TGNumberFormat::kNELLimitMinMax, 0, 5000);
02452 fCanvasDefY = AddNumberEntry(h1, 7, 8, 0, kCanvasDefY, "Y:",
02453 0, 5, TGNumberFormat::kNESInteger,
02454 TGNumberFormat::kNEAPositive,
02455 TGNumberFormat::kNELLimitMinMax, 0, 5000);
02456 gf->AddFrame(h1, fLayoutExpandX);
02457
02458 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02459 fTrashListFrame->AddFirst(h2);
02460 fCanvasDefW = AddNumberEntry(h2, 0, 7, 0, kCanvasDefW, "W:",
02461 0, 5, TGNumberFormat::kNESInteger,
02462 TGNumberFormat::kNEAPositive,
02463 TGNumberFormat::kNELLimitMinMax, 0, 5000);
02464 fCanvasDefH = AddNumberEntry(h2, 7, 8, 0, kCanvasDefH, "H:",
02465 0, 5, TGNumberFormat::kNESInteger,
02466 TGNumberFormat::kNEAPositive,
02467 TGNumberFormat::kNELLimitMinMax, 0, 5000);
02468 gf->AddFrame(h2, fLayoutExpandX);
02469 f->AddFrame(gf, fLayoutExpandXMargin);
02470
02471 fCanvasDefX->GetNumberEntry()->SetToolTipText("Canvases' default abscissa");
02472 fCanvasDefY->GetNumberEntry()->SetToolTipText("Canvases' default ordinate");
02473 fCanvasDefW->GetNumberEntry()->SetToolTipText("Canvases' default width");
02474 fCanvasDefH->GetNumberEntry()->SetToolTipText("Canvases' default height");
02475 }
02476
02477
02478 void TStyleManager::AddCanvasBorder(TGCompositeFrame *f)
02479 {
02480
02481
02482 fCanvasBorderMode = AddBorderModeEntry(f, kCanvasBorderModeSunken, kCanvasBorderModeNone, kCanvasBorderModeRaised);
02483 fCanvasBorderSize = AddLineWidthEntry(fCanvasBorderMode, kCanvasBorderSize);
02484 }
02485
02486
02487 void TStyleManager::AddCanvasDate(TGCompositeFrame *f)
02488 {
02489
02490
02491 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10);
02492 fTrashListLayout->Add(layout2);
02493
02494 TGGroupFrame *gf = new TGGroupFrame(f, "Date");
02495 fTrashListFrame->AddFirst(gf);
02496 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02497 fTrashListFrame->AddFirst(h1);
02498 fOptDateBool = AddCheckButton(h1, "Show", kCanvasOptDateBool, 23);
02499 fAttDateTextColor = AddColorEntry(h1, kCanvasAttDateTextColor);
02500 gf->AddFrame(h1, fLayoutExpandX);
02501 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02502 fTrashListFrame->AddFirst(h2);
02503 fAttDateTextSizeInPixels = AddCheckButton(h2, "Pixels", kCanvasAttDateTextSizeInPixels);
02504 fAttDateTextSize = AddNumberEntry(h2, 22, 10, 0, kCanvasAttDateTextSize, "Size:", 0, 5,
02505 TGNumberFormat::kNESRealThree,
02506 TGNumberFormat::kNEAAnyNumber,
02507 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
02508 gf->AddFrame(h2, fLayoutExpandX);
02509 fOptDateFormat = AddDateFormatEntry(gf, kCanvasOptDateFormat);
02510 fAttDateTextFont = AddFontTypeEntry(gf, kCanvasAttDateTextFont);
02511 fAttDateTextAlign = AddTextAlignEntry(gf, kCanvasAttDateTextAlign);
02512 fAttDateTextAngle = AddNumberEntry(gf, 0, 0, 0, kCanvasAttDateTextAngle,
02513 "Angle:", 0, 6, TGNumberFormat::kNESInteger,
02514 TGNumberFormat::kNEAAnyNumber,
02515 TGNumberFormat::kNELLimitMinMax, -180, 180);
02516 AddTitle(gf, "Position");
02517 TGVerticalFrame *h3 = new TGVerticalFrame(gf);
02518 fTrashListFrame->AddFirst(h3);
02519 fDateX = AddNumberEntry(h3, 0, 0, 0, kCanvasDateX, "X (% of Pad):",
02520 0, 6, TGNumberFormat::kNESInteger,
02521 TGNumberFormat::kNEAAnyNumber,
02522 TGNumberFormat::kNELLimitMinMax, 0, 100);
02523 fDateY = AddNumberEntry(h3, 0, 0, 0, kCanvasDateY, "Y (% of Pad):",
02524 0, 6, TGNumberFormat::kNESInteger,
02525 TGNumberFormat::kNEAAnyNumber,
02526 TGNumberFormat::kNELLimitMinMax, 0, 100);
02527 gf->AddFrame(h3, layout2);
02528 f->AddFrame(gf, fLayoutExpandXYMargin);
02529
02530 fOptDateBool->SetToolTipText("Show / Hide the date in canvases");
02531
02532
02533 fAttDateTextSizeInPixels->SetToolTipText("Set the date text size in pixels if selected, otherwise - in % of pad");
02534 fAttDateTextSize->GetNumberEntry()->SetToolTipText("Date text size (in pixels or in % of pad)");
02535 fAttDateTextAngle->GetNumberEntry()->SetToolTipText("Date text angle");
02536 fDateX->GetNumberEntry()->SetToolTipText("Date abscissa in percent of pad");
02537 fDateY->GetNumberEntry()->SetToolTipText("Date ordinate in percent of pad");
02538 }
02539
02540
02541 void TStyleManager::CreateTabPad(TGCompositeFrame *tab)
02542 {
02543
02544
02545 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
02546 fTrashListFrame->AddFirst(h1);
02547 AddPadMargin(h1);
02548 TGVerticalFrame *v = new TGVerticalFrame(h1);
02549 fTrashListFrame->AddFirst(v);
02550 AddPadFill(v);
02551 AddPadTicks(v);
02552 h1->AddFrame(v, fLayoutExpandXY);
02553 tab->AddFrame(h1, fLayoutExpandX);
02554 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
02555 fTrashListFrame->AddFirst(h2);
02556 AddPadBorder(h2);
02557 AddPadGrid(h2);
02558 tab->AddFrame(h2, fLayoutExpandX);
02559 }
02560
02561
02562 void TStyleManager::AddPadMargin(TGCompositeFrame *f)
02563 {
02564
02565
02566 TGGroupFrame *gf = new TGGroupFrame(f, "Margin (% of Pad)");
02567 fTrashListFrame->AddFirst(gf);
02568 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02569 fTrashListFrame->AddFirst(h1);
02570 fPadLeftMargin = AddNumberEntry(h1, 0, 5, 0, kPadLeftMargin, "Left:",
02571 0, 3, TGNumberFormat::kNESInteger,
02572 TGNumberFormat::kNEAAnyNumber,
02573 TGNumberFormat::kNELLimitMinMax, 0, 99);
02574 fPadRightMargin = AddNumberEntry(h1, 0, 0, 0, kPadRightMargin, "Right:",
02575 0, 3, TGNumberFormat::kNESInteger,
02576 TGNumberFormat::kNEAAnyNumber,
02577 TGNumberFormat::kNELLimitMinMax, 0, 99);
02578 gf->AddFrame(h1, fLayoutExpandXY);
02579 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02580 fTrashListFrame->AddFirst(h2);
02581 fPadTopMargin = AddNumberEntry(h2, 0, 5, 0, kPadTopMargin, "Top:",
02582 0, 3, TGNumberFormat::kNESInteger,
02583 TGNumberFormat::kNEAAnyNumber,
02584 TGNumberFormat::kNELLimitMinMax, 0, 99);
02585 fPadBottomMargin = AddNumberEntry(h2, 0, 0, 0, kPadBottomMargin, "Bottom:",
02586 0, 3, TGNumberFormat::kNESInteger,
02587 TGNumberFormat::kNEAAnyNumber,
02588 TGNumberFormat::kNELLimitMinMax, 0, 99);
02589 gf->AddFrame(h2, fLayoutExpandXY);
02590 f->AddFrame(gf, fLayoutExpandXYMargin);
02591
02592 fPadLeftMargin->GetNumberEntry()->SetToolTipText("Pads' left margin");
02593 fPadRightMargin->GetNumberEntry()->SetToolTipText("Pads' right margin");
02594 fPadTopMargin->GetNumberEntry()->SetToolTipText("Pads' top margin");
02595 fPadBottomMargin->GetNumberEntry()->SetToolTipText("Pads' bottom margin");
02596 }
02597
02598
02599 void TStyleManager::AddPadBorder(TGCompositeFrame *f)
02600 {
02601
02602
02603 fPadBorderMode = AddBorderModeEntry(f, kPadBorderModeSunken, kPadBorderModeNone, kPadBorderModeRaised);
02604 fPadBorderSize = AddLineWidthEntry(fPadBorderMode, kPadBorderSize);
02605 }
02606
02607
02608 void TStyleManager::AddPadFill(TGCompositeFrame *f)
02609 {
02610
02611
02612 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
02613 fTrashListFrame->AddFirst(gf);
02614 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02615 fTrashListFrame->AddFirst(h);
02616 fPadColor = AddColorEntry(h, kPadColor);
02617 gf->AddFrame(h, fLayoutExpandX);
02618 f->AddFrame(gf, fLayoutExpandXYMargin);
02619
02620
02621
02622 }
02623
02624
02625 void TStyleManager::AddPadTicks(TGCompositeFrame *f)
02626 {
02627
02628
02629 TGGroupFrame *gf = new TGGroupFrame(f, "Ticks");
02630 fTrashListFrame->AddFirst(gf);
02631 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02632 fTrashListFrame->AddFirst(h);
02633 TGHorizontalFrame *h1 = new TGHorizontalFrame(h);
02634 fTrashListFrame->AddFirst(h1);
02635 fPadTickX = AddCheckButton(h1, "Along X", kPadTickX);
02636 h->AddFrame(h1, fLayoutExpandX);
02637 TGHorizontalFrame *h2 = new TGHorizontalFrame(h);
02638 fTrashListFrame->AddFirst(h2);
02639 fPadTickY = AddCheckButton(h2, "Along Y", kPadTickY);
02640 h->AddFrame(h2, fLayoutExpandX);
02641 gf->AddFrame(h, fLayoutExpandX);
02642 f->AddFrame(gf, fLayoutExpandXYMargin);
02643
02644 fPadTickX->SetToolTipText("Show / Hide the ticks along X");
02645 fPadTickY->SetToolTipText("Show / Hide the ticks along Y");
02646 }
02647
02648
02649 void TStyleManager::AddPadGrid(TGCompositeFrame *f)
02650 {
02651
02652
02653 TGGroupFrame *gf = new TGGroupFrame(f, "Grid");
02654 fTrashListFrame->AddFirst(gf);
02655 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02656 fTrashListFrame->AddFirst(h1);
02657 TGHorizontalFrame *h10 = new TGHorizontalFrame(h1);
02658 fTrashListFrame->AddFirst(h10);
02659 fPadGridX = AddCheckButton(h10, "Along X", kPadGridX);
02660 h1->AddFrame(h10, fLayoutExpandX);
02661 TGHorizontalFrame *h20 = new TGHorizontalFrame(h1);
02662 fTrashListFrame->AddFirst(h20);
02663 fPadGridY = AddCheckButton(h20, "Along Y", kPadGridY);
02664 h1->AddFrame(h20, fLayoutExpandX);
02665 gf->AddFrame(h1, fLayoutExpandX);
02666 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02667 fTrashListFrame->AddFirst(h2);
02668 fGridColor = AddColorEntry(h2, kPadGridColor);
02669 fGridWidth = AddLineWidthEntry(h2, kPadGridWidth);
02670 gf->AddFrame(h2, fLayoutExpandX);
02671 fGridStyle = AddLineStyleEntry(gf, kPadGridStyle);
02672 f->AddFrame(gf, fLayoutExpandXYMargin);
02673
02674
02675
02676 fPadGridX->SetToolTipText("Show / Hide the grid along X");
02677 fPadGridY->SetToolTipText("Show / Hide the grid along Y");
02678 }
02679
02680
02681 void TStyleManager::CreateTabHistos(TGCompositeFrame *tab)
02682 {
02683
02684
02685 fHistosTab = new TGTab(tab, 1, 1);
02686 fHistosTab->Associate(this);
02687 CreateTabHistosHistos(fHistosTab->AddTab("Histos"));
02688 CreateTabHistosFrames(fHistosTab->AddTab("Frames"));
02689 CreateTabHistosGraphs(fHistosTab->AddTab("Graphs"));
02690 tab->AddFrame(fHistosTab, fLayoutExpandXY);
02691 }
02692
02693
02694 void TStyleManager::CreateTabHistosHistos(TGCompositeFrame *tab)
02695 {
02696
02697
02698 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
02699 fTrashListFrame->AddFirst(h1);
02700 AddHistosHistosFill(h1);
02701 AddHistosHistosContours(h1);
02702 tab->AddFrame(h1, fLayoutExpandX);
02703
02704 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
02705 fTrashListFrame->AddFirst(h2);
02706 AddHistosHistosLine(h2);
02707 AddHistosHistosAxis(h2);
02708 tab->AddFrame(h2, fLayoutExpandX);
02709
02710 TGHorizontalFrame *h3 = new TGHorizontalFrame(tab);
02711 fTrashListFrame->AddFirst(h3);
02712 AddHistosHistosBar(h3);
02713 AddHistosHistosLegoInnerR(h3);
02714 tab->AddFrame(h3, fLayoutExpandX);
02715 }
02716
02717
02718 void TStyleManager::AddHistosHistosFill(TGCompositeFrame *f)
02719 {
02720
02721
02722 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
02723 fTrashListFrame->AddFirst(gf);
02724 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02725 fTrashListFrame->AddFirst(h1);
02726 fHistFillColor = AddColorEntry(h1, kHistFillColor);
02727 fHistFillStyle = AddFillStyleEntry(h1, kHistFillStyle);
02728 gf->AddFrame(h1, fLayoutExpandX);
02729 f->AddFrame(gf, fLayoutExpandXYMargin);
02730
02731
02732
02733
02734 }
02735
02736
02737 void TStyleManager::AddHistosHistosLine(TGCompositeFrame *f)
02738 {
02739
02740
02741 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
02742 fTrashListFrame->AddFirst(gf);
02743 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02744 fTrashListFrame->AddFirst(h);
02745 fHistLineColor = AddColorEntry(h, kHistLineColor);
02746 fHistLineWidth = AddLineWidthEntry(h, kHistLineWidth);
02747 gf->AddFrame(h, fLayoutExpandX);
02748 fHistLineStyle = AddLineStyleEntry(gf, kHistLineStyle);
02749 f->AddFrame(gf, fLayoutExpandXYMargin);
02750
02751
02752
02753 }
02754
02755
02756 void TStyleManager::AddHistosHistosBar(TGCompositeFrame *f)
02757 {
02758
02759
02760 TGGroupFrame *gf = new TGGroupFrame(f, "Bar");
02761 fTrashListFrame->AddFirst(gf);
02762 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02763 fTrashListFrame->AddFirst(h);
02764 fBarWidth = AddNumberEntry(h, 0, 5, 0, kHistBarWidth, "W:",
02765 0, 5, TGNumberFormat::kNESRealTwo,
02766 TGNumberFormat::kNEAAnyNumber,
02767 TGNumberFormat::kNELLimitMinMax, 0, 5);
02768 fBarOffset = AddNumberEntry(h, 8, 5, 0, kHistBarOffset, "O:",
02769 0, 5, TGNumberFormat::kNESRealTwo,
02770 TGNumberFormat::kNEAAnyNumber,
02771 TGNumberFormat::kNELLimitMinMax, 0, 5);
02772 gf->AddFrame(h, fLayoutExpandX);
02773 f->AddFrame(gf, fLayoutExpandXYMargin);
02774
02775 fBarWidth->GetNumberEntry()->SetToolTipText("Width of bars");
02776 fBarOffset->GetNumberEntry()->SetToolTipText("Offset of bars");
02777 }
02778
02779
02780 void TStyleManager::AddHistosHistosContours(TGCompositeFrame *f)
02781 {
02782
02783
02784 TGGroupFrame *gf = new TGGroupFrame(f, "Contours");
02785 fTrashListFrame->AddFirst(gf);
02786 fNumberContours = AddNumberEntry(gf, 0, 0, 0, kHistNumberContours, "Number:",
02787 0, 5, TGNumberFormat::kNESInteger,
02788 TGNumberFormat::kNEAAnyNumber,
02789 TGNumberFormat::kNELLimitMinMax, 0, 99);
02790 f->AddFrame(gf, fLayoutExpandXYMargin);
02791
02792 fNumberContours->GetNumberEntry()->SetToolTipText("Number of level lines to draw");
02793 }
02794
02795
02796 void TStyleManager::AddHistosHistosAxis(TGCompositeFrame *f)
02797 {
02798
02799
02800 TGGroupFrame *gf = new TGGroupFrame(f, "Axis");
02801 fTrashListFrame->AddFirst(gf);
02802 fHistMinimumZero = AddCheckButton(gf, "Minimum zero", kHistMinimumZero);
02803 fPaintTextFormat = AddTextEntry(gf, "Paint format:", kHistPaintTextFormat);
02804 f->AddFrame(gf, fLayoutExpandXYMargin);
02805
02806 fHistMinimumZero->SetToolTipText("Set to zero / Compute the minimum of axis range");
02807 fPaintTextFormat->SetToolTipText("Paint format of the axis labels in histograms");
02808 }
02809
02810
02811 void TStyleManager::AddHistosHistosLegoInnerR(TGCompositeFrame *f)
02812 {
02813
02814
02815 TGGroupFrame *gf = new TGGroupFrame(f, "3D Cylindrical (%)");
02816 fTrashListFrame->AddFirst(gf);
02817 fLegoInnerR = AddNumberEntry(gf, 0, 0, 0, kHistLegoInnerR, "Inner radius:",
02818 0, 5, TGNumberFormat::kNESInteger,
02819 TGNumberFormat::kNEAAnyNumber,
02820 TGNumberFormat::kNELLimitMinMax, 0, 100);
02821 f->AddFrame(gf, fLayoutExpandXYMargin);
02822
02823 fLegoInnerR->GetNumberEntry()->SetToolTipText("Percent of radius allocated to the tube");
02824 }
02825
02826
02827 void TStyleManager::CreateTabHistosFrames(TGCompositeFrame *tab)
02828 {
02829
02830
02831 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 13);
02832 fTrashListLayout->Add(layout);
02833
02834 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
02835 fTrashListFrame->AddFirst(h1);
02836
02837 TGVerticalFrame *v1 = new TGVerticalFrame(h1);
02838 fTrashListFrame->AddFirst(v1);
02839 AddHistosFramesFill(v1);
02840 AddHistosFramesLine(v1);
02841 h1->AddFrame(v1, fLayoutExpandXY);
02842
02843 TGVerticalFrame *v2 = new TGVerticalFrame(h1);
02844 fTrashListFrame->AddFirst(v2);
02845 AddHistosFramesBorder(v2);
02846 TGHorizontalFrame *h2 = new TGHorizontalFrame(v2);
02847 fTrashListFrame->AddFirst(h2);
02848 fPaletteEdit = AddTextButton(h2, "Palette Editor...", kFramePaletteEdit);
02849 fPaletteEdit->SetEnabled(kFALSE);
02850 v2->AddFrame(h2, layout);
02851 h1->AddFrame(v2, fLayoutExpandXY);
02852
02853 tab->AddFrame(h1, fLayoutExpandX);
02854 }
02855
02856
02857 void TStyleManager::AddHistosFramesFill(TGCompositeFrame *f)
02858 {
02859
02860
02861 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
02862 fTrashListFrame->AddFirst(gf);
02863 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
02864 fTrashListFrame->AddFirst(h1);
02865 fFrameFillColor = AddColorEntry(h1, kFrameFillColor);
02866 fFrameFillStyle = AddFillStyleEntry(h1, kFrameFillStyle);
02867 gf->AddFrame(h1, fLayoutExpandX);
02868 f->AddFrame(gf, fLayoutExpandXMargin);
02869
02870
02871
02872
02873 }
02874
02875
02876 void TStyleManager::AddHistosFramesLine(TGCompositeFrame *f)
02877 {
02878
02879
02880 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
02881 fTrashListFrame->AddFirst(gf);
02882 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02883 fTrashListFrame->AddFirst(h);
02884 fFrameLineColor = AddColorEntry(h, kFrameLineColor);
02885 fFrameLineWidth = AddLineWidthEntry(h, kFrameLineWidth);
02886 gf->AddFrame(h, fLayoutExpandX);
02887 fFrameLineStyle = AddLineStyleEntry(gf, kFrameLineStyle);
02888 f->AddFrame(gf, fLayoutExpandXYMargin);
02889
02890
02891
02892 }
02893
02894
02895 void TStyleManager::AddHistosFramesBorder(TGCompositeFrame *f)
02896 {
02897
02898
02899 fFrameBorderMode = AddBorderModeEntry(f, kFrameBorderModeSunken, kFrameBorderModeNone, kFrameBorderModeRaised);
02900 fFrameBorderSize = AddLineWidthEntry(fFrameBorderMode, kFrameBorderSize);
02901 }
02902
02903
02904 void TStyleManager::CreateTabHistosGraphs(TGCompositeFrame *tab)
02905 {
02906
02907
02908 TGHorizontalFrame *h = new TGHorizontalFrame(tab);
02909 fTrashListFrame->AddFirst(h);
02910 AddHistosGraphsLine(h);
02911 AddHistosGraphsErrors(h);
02912 tab->AddFrame(h, fLayoutExpandX);
02913 AddHistosGraphsBorder(tab);
02914 }
02915
02916
02917 void TStyleManager::AddHistosGraphsLine(TGCompositeFrame *f)
02918 {
02919
02920
02921 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
02922 fTrashListFrame->AddFirst(gf);
02923 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
02924 fTrashListFrame->AddFirst(h);
02925 fFuncColor = AddColorEntry(h, kGraphsFuncColor);
02926 fFuncWidth = AddLineWidthEntry(h, kGraphsFuncWidth);
02927 gf->AddFrame(h, fLayoutExpandX);
02928 fFuncStyle = AddLineStyleEntry(gf, kGraphsFuncStyle);
02929 f->AddFrame(gf, fLayoutExpandXMargin);
02930
02931
02932
02933 }
02934
02935
02936 void TStyleManager::AddHistosGraphsBorder(TGCompositeFrame *f)
02937 {
02938
02939
02940 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
02941 fTrashListLayout->Add(layout);
02942
02943 TGHorizontalFrame *h = new TGHorizontalFrame(f);
02944 fTrashListFrame->AddFirst(h);
02945 fDrawBorder = AddCheckButton(h, "Draw Border (for Filled Function)", kGraphsDrawBorder);
02946 f->AddFrame(h, layout);
02947
02948 fDrawBorder->SetToolTipText("Show / Hide the border of filled functions");
02949 }
02950
02951
02952 void TStyleManager::AddHistosGraphsErrors(TGCompositeFrame *f)
02953 {
02954
02955
02956 TGGroupFrame *gf = new TGGroupFrame(f, "Errors");
02957 fTrashListFrame->AddFirst(gf);
02958 fEndErrorSize = AddNumberEntry(gf, 0, 0, 0, kGraphsEndErrorSize,
02959 "End error size:", 0, 4, TGNumberFormat::kNESRealOne,
02960 TGNumberFormat::kNEAAnyNumber,
02961 TGNumberFormat::kNELLimitMinMax, 0, 5);
02962 fErrorX = AddNumberEntry(gf, 0, 0, 0, kGraphsErrorX, "Error X (% of bin):",
02963 0, 4, TGNumberFormat::kNESInteger,
02964 TGNumberFormat::kNEAAnyNumber,
02965 TGNumberFormat::kNELLimitMinMax, 0, 100);
02966 f->AddFrame(gf, fLayoutExpandXMargin);
02967
02968 fEndErrorSize->GetNumberEntry()->SetToolTipText("Size of lines drawn at the end of error bars");
02969 fErrorX->GetNumberEntry()->SetToolTipText("Percent of the bin width to use for errors along X");
02970 }
02971
02972
02973 void TStyleManager::CreateTabAxis(TGCompositeFrame *tab)
02974 {
02975
02976
02977 TGLayoutHints *layout =
02978 new TGLayoutHints(kLHintsNormal, 10, 13, 3);
02979 fTrashListLayout->Add(layout);
02980
02981 TGHorizontalFrame *h = new TGHorizontalFrame(tab);
02982 fTrashListFrame->AddFirst(h);
02983
02984 TGVerticalFrame *h3 = new TGVerticalFrame(h);
02985 fTrashListFrame->AddFirst(h3);
02986 fStripDecimals = AddCheckButton(h3, "Decimal labels' part", kAxisStripDecimals, 0, 8);
02987 TGVerticalFrame *space = new TGVerticalFrame(h3);
02988 fTrashListFrame->AddFirst(space);
02989 h3->AddFrame(space, fLayoutExpandXY);
02990 fApplyOnXYZ = AddTextButton(h3, "Apply on XYZ", kAxisApplyOnXYZ);
02991 h->AddFrame(h3, layout);
02992
02993 TGGroupFrame *gf = new TGGroupFrame(h, "Date/Time Offset");
02994 fTrashListFrame->AddFirst(gf);
02995 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
02996 fTrashListFrame->AddFirst(h2);
02997 fTimeOffsetDate = AddNumberEntry(h2, 0, 13, 10, kAxisTimeOffsetDate, "",
02998 0, 10, TGNumberFormat::kNESDayMYear,
02999 TGNumberFormat::kNEAAnyNumber,
03000 TGNumberFormat::kNELNoLimits, 0, 0);
03001 fTimeOffsetTime = AddNumberEntry(h2, 0, 15, 0, kAxisTimeOffsetTime, "",
03002 0, 8, TGNumberFormat::kNESHourMinSec,
03003 TGNumberFormat::kNEAAnyNumber,
03004 TGNumberFormat::kNELNoLimits, 0, 0);
03005 gf->AddFrame(h2, fLayoutExpandX);
03006 h->AddFrame(gf, fLayoutExpandXMargin);
03007 tab->AddFrame(h, fLayoutExpandX);
03008
03009 fAxisTab = new TGTab(tab);
03010 fAxisTab->Associate(this);
03011 CreateTabAxisX(fAxisTab->AddTab("X axis"));
03012 CreateTabAxisY(fAxisTab->AddTab("Y axis"));
03013 CreateTabAxisZ(fAxisTab->AddTab("Z axis"));
03014 tab->AddFrame(fAxisTab, fLayoutExpandXY);
03015
03016 fStripDecimals->SetToolTipText("Draw / Hide the decimal part of labels");
03017 fApplyOnXYZ->SetToolTipText("Apply settings of the currently selected axis on XYZ");
03018 fTimeOffsetDate->GetNumberEntry()->SetToolTipText("Date offset for axis (dd/mm/yyyy)");
03019 fTimeOffsetTime->GetNumberEntry()->SetToolTipText("Time offset for axis (hh/mm/ss)");
03020 }
03021
03022
03023 void TStyleManager::CreateTabAxisX(TGCompositeFrame *tab)
03024 {
03025
03026
03027 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
03028 fTrashListFrame->AddFirst(h1);
03029 AddAxisXLine(h1);
03030 AddAxisXDivisions(h1);
03031 tab->AddFrame(h1, fLayoutExpandX);
03032
03033 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
03034 fTrashListFrame->AddFirst(h2);
03035 AddAxisXTitle(h2);
03036 AddAxisXLabels(h2);
03037 tab->AddFrame(h2, fLayoutExpandX);
03038 }
03039
03040
03041 void TStyleManager::AddAxisXLine(TGCompositeFrame *f)
03042 {
03043
03044
03045 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
03046 fTrashListLayout->Add(layout);
03047
03048 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
03049 fTrashListFrame->AddFirst(gf);
03050 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03051 fTrashListFrame->AddFirst(h);
03052 fXAxisColor = AddColorEntry(h, kAxisXAxisColor);
03053 TGHorizontalFrame *h2 = new TGHorizontalFrame(h);
03054 fTrashListFrame->AddFirst(h2);
03055 fXTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisXTickLength, "Ticks:",
03056 0, 5, TGNumberFormat::kNESRealThree,
03057 TGNumberFormat::kNEAAnyNumber,
03058 TGNumberFormat::kNELLimitMinMax, 0, 5);
03059 h->AddFrame(h2, layout);
03060 gf->AddFrame(h, fLayoutExpandX);
03061 fOptLogx = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogx);
03062 f->AddFrame(gf, fLayoutExpandXYMargin);
03063
03064
03065
03066 fXTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
03067 fOptLogx->SetToolTipText("Draw logarithmic scale");
03068 }
03069
03070
03071 void TStyleManager::AddAxisXTitle(TGCompositeFrame *f)
03072 {
03073
03074
03075 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
03076 fTrashListFrame->AddFirst(gf);
03077 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03078 fTrashListFrame->AddFirst(h1);
03079 fXTitleColor = AddColorEntry(h1, kAxisXTitleColor);
03080 fXTitleFont = AddFontTypeEntry(h1, kAxisXTitleFont);
03081 gf->AddFrame(h1, fLayoutExpandX);
03082 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03083 fTrashListFrame->AddFirst(h2);
03084 fXTitleSizeInPixels = AddCheckButton(h2, "Pixels", kAxisXTitleSizeInPixels);
03085 fXTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisXTitleSize, "Size:", 0, 5,
03086 TGNumberFormat::kNESRealThree,
03087 TGNumberFormat::kNEAAnyNumber,
03088 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03089 gf->AddFrame(h2, fLayoutExpandX);
03090 fXTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisXTitleOffset, "Offset:",
03091 0, 5, TGNumberFormat::kNESRealTwo,
03092 TGNumberFormat::kNEAAnyNumber,
03093 TGNumberFormat::kNELLimitMinMax, 0, 1);
03094 f->AddFrame(gf, fLayoutExpandXMargin);
03095
03096
03097
03098 fXTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
03099 fXTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
03100 fXTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
03101 }
03102
03103
03104 void TStyleManager::AddAxisXDivisions(TGCompositeFrame *f)
03105 {
03106
03107
03108 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
03109 fTrashListFrame->AddFirst(gf);
03110
03111 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03112 fTrashListFrame->AddFirst(h1);
03113 fXNdivSubSub = AddNumberEntry(h1, 0, 0, 0, kAxisXNdivSubSub, "",
03114 0, 3, TGNumberFormat::kNESInteger,
03115 TGNumberFormat::kNEAAnyNumber,
03116 TGNumberFormat::kNELLimitMinMax, 0, 99);
03117 fXNdivSub = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivSub, "",
03118 0, 3, TGNumberFormat::kNESInteger,
03119 TGNumberFormat::kNEAAnyNumber,
03120 TGNumberFormat::kNELLimitMinMax, 0, 99);
03121 fXNdivMain = AddNumberEntry(h1, 0, 18, 0, kAxisXNdivMain, "",
03122 0, 3, TGNumberFormat::kNESInteger,
03123 TGNumberFormat::kNEAAnyNumber,
03124 TGNumberFormat::kNELLimitMinMax, 0, 99);
03125 gf->AddFrame(h1, fLayoutExpandX);
03126
03127 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03128 fTrashListFrame->AddFirst(h2);
03129 fXNdivisionsOptimize = AddCheckButton(h2, "Optimize", kAxisXNdivisionsOptimize);
03130 gf->AddFrame(h2, fLayoutExpandX);
03131 f->AddFrame(gf, fLayoutExpandXMargin);
03132
03133 fXNdivMain->GetNumberEntry()->SetToolTipText("Primary axis divisions");
03134 fXNdivSub->GetNumberEntry()->SetToolTipText("Secondary axis divisions");
03135 fXNdivSubSub->GetNumberEntry()->SetToolTipText("Tertiary axis divisions");
03136 fXNdivisionsOptimize->SetToolTipText("Optimize the number of axis divisions if selected");
03137 }
03138
03139
03140 void TStyleManager::AddAxisXLabels(TGCompositeFrame *f)
03141 {
03142
03143
03144 TGGroupFrame *gf = new TGGroupFrame(f, "Labels");
03145 fTrashListFrame->AddFirst(gf);
03146 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03147 fTrashListFrame->AddFirst(h1);
03148 fXLabelColor = AddColorEntry(h1, kAxisXLabelColor);
03149 fXLabelFont = AddFontTypeEntry(h1, kAxisXLabelFont);
03150 gf->AddFrame(h1, fLayoutExpandX);
03151 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03152 fTrashListFrame->AddFirst(h2);
03153 fXLabelSizeInPixels = AddCheckButton(h2, "Pixels", kAxisXLabelSizeInPixels);
03154 fXLabelSize = AddNumberEntry(h2, 22, 8, 0, kAxisXLabelSize, "Size:", 0, 5,
03155 TGNumberFormat::kNESRealThree,
03156 TGNumberFormat::kNEAAnyNumber,
03157 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03158 gf->AddFrame(h2, fLayoutExpandX);
03159 fXLabelOffset = AddNumberEntry(gf, 69, 8, 0, kAxisXTitleOffset, "Offset:",
03160 0, 5, TGNumberFormat::kNESRealTwo,
03161 TGNumberFormat::kNEAAnyNumber,
03162 TGNumberFormat::kNELLimitMinMax, 0, 1);
03163 f->AddFrame(gf, fLayoutExpandXMargin);
03164
03165
03166
03167 fXLabelSizeInPixels->SetToolTipText("Set the labels size in pixels if selected, otherwise - in % of pad");
03168 fXLabelSize->GetNumberEntry()->SetToolTipText("Label size (in pixels or in % of pad)");
03169 fXLabelOffset->GetNumberEntry()->SetToolTipText("Offset between axis and labels");
03170 }
03171
03172
03173 void TStyleManager::CreateTabAxisY(TGCompositeFrame *tab)
03174 {
03175
03176
03177 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
03178 fTrashListFrame->AddFirst(h1);
03179 AddAxisYLine(h1);
03180 AddAxisYDivisions(h1);
03181 tab->AddFrame(h1, fLayoutExpandX);
03182
03183 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
03184 fTrashListFrame->AddFirst(h2);
03185 AddAxisYTitle(h2);
03186 AddAxisYLabels(h2);
03187 tab->AddFrame(h2, fLayoutExpandX);
03188 }
03189
03190
03191 void TStyleManager::AddAxisYLine(TGCompositeFrame *f)
03192 {
03193
03194
03195 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
03196 fTrashListLayout->Add(layout);
03197
03198 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
03199 fTrashListFrame->AddFirst(gf);
03200 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03201 fTrashListFrame->AddFirst(h);
03202 fYAxisColor = AddColorEntry(h, kAxisYAxisColor);
03203 TGHorizontalFrame *h2 = new TGHorizontalFrame(h);
03204 fTrashListFrame->AddFirst(h2);
03205 fYTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisYTickLength, "Ticks:",
03206 0, 5, TGNumberFormat::kNESRealThree,
03207 TGNumberFormat::kNEAAnyNumber,
03208 TGNumberFormat::kNELLimitMinMax, 0, 5);
03209 h->AddFrame(h2, layout);
03210 gf->AddFrame(h, fLayoutExpandX);
03211 fOptLogy = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogy);
03212 f->AddFrame(gf, fLayoutExpandXYMargin);
03213
03214
03215
03216 fYTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
03217 fOptLogy->SetToolTipText("Draw logarithmic scale");
03218 }
03219
03220
03221 void TStyleManager::AddAxisYTitle(TGCompositeFrame *f)
03222 {
03223
03224
03225 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
03226 fTrashListFrame->AddFirst(gf);
03227 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03228 fTrashListFrame->AddFirst(h1);
03229 fYTitleColor = AddColorEntry(h1, kAxisYTitleColor);
03230 fYTitleFont = AddFontTypeEntry(h1, kAxisYTitleFont);
03231 gf->AddFrame(h1, fLayoutExpandX);
03232 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03233 fTrashListFrame->AddFirst(h2);
03234 fYTitleSizeInPixels = AddCheckButton(h2, "Pixels", kAxisYTitleSizeInPixels);
03235 fYTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisYTitleSize, "Size:", 0, 5,
03236 TGNumberFormat::kNESRealThree,
03237 TGNumberFormat::kNEAAnyNumber,
03238 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03239 gf->AddFrame(h2, fLayoutExpandX);
03240 fYTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisYTitleOffset, "Offset:",
03241 0, 5, TGNumberFormat::kNESRealTwo,
03242 TGNumberFormat::kNEAAnyNumber,
03243 TGNumberFormat::kNELLimitMinMax, 0, 1);
03244 f->AddFrame(gf, fLayoutExpandXMargin);
03245
03246
03247
03248 fYTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
03249 fYTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
03250 fYTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
03251 }
03252
03253
03254 void TStyleManager::AddAxisYDivisions(TGCompositeFrame *f)
03255 {
03256
03257
03258 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
03259 fTrashListFrame->AddFirst(gf);
03260 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03261 fTrashListFrame->AddFirst(h1);
03262 fYNdivSubSub = AddNumberEntry(h1, 0, 0, 0, kAxisYNdivSubSub, "",
03263 0, 3, TGNumberFormat::kNESInteger,
03264 TGNumberFormat::kNEAAnyNumber,
03265 TGNumberFormat::kNELLimitMinMax, 0, 99);
03266 fYNdivSub = AddNumberEntry(h1, 0, 18, 0, kAxisYNdivSub, "",
03267 0, 3, TGNumberFormat::kNESInteger,
03268 TGNumberFormat::kNEAAnyNumber,
03269 TGNumberFormat::kNELLimitMinMax, 0, 99);
03270 fYNdivMain = AddNumberEntry(h1, 0, 18, 0, kAxisYNdivMain, "",
03271 0, 3, TGNumberFormat::kNESInteger,
03272 TGNumberFormat::kNEAAnyNumber,
03273 TGNumberFormat::kNELLimitMinMax, 0, 99);
03274 gf->AddFrame(h1, fLayoutExpandX);
03275
03276 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03277 fTrashListFrame->AddFirst(h2);
03278 fYNdivisionsOptimize = AddCheckButton(h2, "Optimize", kAxisYNdivisionsOptimize);
03279 gf->AddFrame(h2, fLayoutExpandX);
03280 f->AddFrame(gf, fLayoutExpandXMargin);
03281
03282 fYNdivMain->GetNumberEntry()->SetToolTipText("Primary axis divisions");
03283 fYNdivSub->GetNumberEntry()->SetToolTipText("Secondary axis divisions");
03284 fYNdivSubSub->GetNumberEntry()->SetToolTipText("Tertiary axis divisions");
03285 fYNdivisionsOptimize->SetToolTipText("Optimize the number of axis divisions");
03286 }
03287
03288
03289 void TStyleManager::AddAxisYLabels(TGCompositeFrame *f)
03290 {
03291
03292
03293 TGGroupFrame *gf = new TGGroupFrame(f, "Labels");
03294 fTrashListFrame->AddFirst(gf);
03295 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03296 fTrashListFrame->AddFirst(h1);
03297 fYLabelColor = AddColorEntry(h1, kAxisYLabelColor);
03298 fYLabelFont = AddFontTypeEntry(h1, kAxisYLabelFont);
03299 gf->AddFrame(h1, fLayoutExpandX);
03300
03301 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03302 fTrashListFrame->AddFirst(h2);
03303 fYLabelSizeInPixels = AddCheckButton(h2, "Pixels", kAxisYLabelSizeInPixels);
03304 fYLabelSize = AddNumberEntry(h2, 22, 8, 0, kAxisYLabelSize, "Size:", 0, 5,
03305 TGNumberFormat::kNESRealThree,
03306 TGNumberFormat::kNEAAnyNumber,
03307 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03308 gf->AddFrame(h2, fLayoutExpandX);
03309 fYLabelOffset = AddNumberEntry(gf, 69, 8, 0, kAxisYTitleOffset, "Offset:",
03310 0, 5, TGNumberFormat::kNESRealTwo,
03311 TGNumberFormat::kNEAAnyNumber,
03312 TGNumberFormat::kNELLimitMinMax, 0, 1);
03313 f->AddFrame(gf, fLayoutExpandXMargin);
03314
03315
03316
03317 fYLabelSizeInPixels->SetToolTipText("Set the labels size in pixels if selected, otherwise - in % of pad");
03318 fYLabelSize->GetNumberEntry()->SetToolTipText("Label size (in pixels or in % of pad)");
03319 fYLabelOffset->GetNumberEntry()->SetToolTipText("Offset between axis and labels");
03320 }
03321
03322
03323 void TStyleManager::CreateTabAxisZ(TGCompositeFrame *tab)
03324 {
03325
03326
03327 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
03328 fTrashListFrame->AddFirst(h1);
03329 AddAxisZLine(h1);
03330 AddAxisZDivisions(h1);
03331 tab->AddFrame(h1, fLayoutExpandX);
03332
03333 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
03334 fTrashListFrame->AddFirst(h2);
03335 AddAxisZTitle(h2);
03336 AddAxisZLabels(h2);
03337 tab->AddFrame(h2, fLayoutExpandX);
03338 }
03339
03340
03341 void TStyleManager::AddAxisZLine(TGCompositeFrame *f)
03342 {
03343
03344
03345 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 20);
03346 fTrashListLayout->Add(layout);
03347
03348 TGGroupFrame *gf = new TGGroupFrame(f, "Line");
03349 fTrashListFrame->AddFirst(gf);
03350 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03351 fTrashListFrame->AddFirst(h);
03352 fZAxisColor = AddColorEntry(h, kAxisZAxisColor);
03353 TGHorizontalFrame *h2 = new TGHorizontalFrame(h);
03354 fTrashListFrame->AddFirst(h2);
03355 fZTickLength = AddNumberEntry(h2, 3, 8, 0, kAxisZTickLength, "Ticks:",
03356 0, 5, TGNumberFormat::kNESRealThree,
03357 TGNumberFormat::kNEAAnyNumber,
03358 TGNumberFormat::kNELLimitMinMax, 0, 5);
03359 h->AddFrame(h2, layout);
03360 gf->AddFrame(h, fLayoutExpandX);
03361 fOptLogz = AddCheckButton(gf, "Logarithmic scale", kAxisOptLogz);
03362 f->AddFrame(gf, fLayoutExpandXYMargin);
03363
03364
03365
03366 fZTickLength->GetNumberEntry()->SetToolTipText("Set the ticks' length");
03367 fOptLogz->SetToolTipText("Draw logarithmic scale");
03368 }
03369
03370
03371 void TStyleManager::AddAxisZTitle(TGCompositeFrame *f)
03372 {
03373
03374
03375 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
03376 fTrashListFrame->AddFirst(gf);
03377 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03378 fTrashListFrame->AddFirst(h1);
03379 fZTitleColor = AddColorEntry(h1, kAxisZTitleColor);
03380 fZTitleFont = AddFontTypeEntry(h1, kAxisZTitleFont);
03381 gf->AddFrame(h1, fLayoutExpandX);
03382
03383 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03384 fTrashListFrame->AddFirst(h2);
03385 fZTitleSizeInPixels = AddCheckButton(h2, "Pixels", kAxisZTitleSizeInPixels);
03386 fZTitleSize = AddNumberEntry(h2, 21, 8, 0, kAxisZTitleSize, "Size:", 0, 5,
03387 TGNumberFormat::kNESRealThree,
03388 TGNumberFormat::kNEAAnyNumber,
03389 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03390 gf->AddFrame(h2, fLayoutExpandX);
03391 fZTitleOffset = AddNumberEntry(gf, 68, 8, 0, kAxisZTitleOffset, "Offset:",
03392 0, 5, TGNumberFormat::kNESRealTwo,
03393 TGNumberFormat::kNEAAnyNumber,
03394 TGNumberFormat::kNELLimitMinMax, 0, 1);
03395 f->AddFrame(gf, fLayoutExpandXMargin);
03396
03397
03398
03399 fZTitleSizeInPixels->SetToolTipText("Set the title size in pixels if selected, otherwise - in % of pad");
03400 fZTitleSize->GetNumberEntry()->SetToolTipText("Title size (in pixels or in % of pad)");
03401 fZTitleOffset->GetNumberEntry()->SetToolTipText("Offset between axis and title");
03402 }
03403
03404
03405 void TStyleManager::AddAxisZDivisions(TGCompositeFrame *f)
03406 {
03407
03408
03409 TGGroupFrame *gf = new TGGroupFrame(f, "Divisions");
03410 fTrashListFrame->AddFirst(gf);
03411 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03412 fTrashListFrame->AddFirst(h1);
03413 fZNdivSubSub = AddNumberEntry(h1, 0, 0, 0, kAxisZNdivSubSub, "",
03414 0, 3, TGNumberFormat::kNESInteger,
03415 TGNumberFormat::kNEAAnyNumber,
03416 TGNumberFormat::kNELLimitMinMax, 0, 99);
03417 fZNdivSub = AddNumberEntry(h1, 0, 18, 0, kAxisZNdivSub, "",
03418 0, 3, TGNumberFormat::kNESInteger,
03419 TGNumberFormat::kNEAAnyNumber,
03420 TGNumberFormat::kNELLimitMinMax, 0, 99);
03421 fZNdivMain = AddNumberEntry(h1, 0, 18, 0, kAxisZNdivMain, "",
03422 0, 3, TGNumberFormat::kNESInteger,
03423 TGNumberFormat::kNEAAnyNumber,
03424 TGNumberFormat::kNELLimitMinMax, 0, 99);
03425 gf->AddFrame(h1, fLayoutExpandX);
03426
03427 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03428 fTrashListFrame->AddFirst(h2);
03429 fZNdivisionsOptimize = AddCheckButton(h2, "Optimize", kAxisZNdivisionsOptimize);
03430 gf->AddFrame(h2, fLayoutExpandX);
03431 f->AddFrame(gf, fLayoutExpandXMargin);
03432
03433 fZNdivMain->GetNumberEntry()->SetToolTipText("Primary axis divisions");
03434 fZNdivSub->GetNumberEntry()->SetToolTipText("Secondary axis divisions");
03435 fZNdivSubSub->GetNumberEntry()->SetToolTipText("Tertiary axis divisions");
03436 fZNdivisionsOptimize->SetToolTipText("Optimize the number of axis divisions");
03437 }
03438
03439
03440 void TStyleManager::AddAxisZLabels(TGCompositeFrame *f)
03441 {
03442
03443
03444 TGGroupFrame *gf = new TGGroupFrame(f, "Labels");
03445 fTrashListFrame->AddFirst(gf);
03446 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03447 fTrashListFrame->AddFirst(h1);
03448 fZLabelColor = AddColorEntry(h1, kAxisZLabelColor);
03449 fZLabelFont = AddFontTypeEntry(h1, kAxisZLabelFont);
03450 gf->AddFrame(h1, fLayoutExpandX);
03451
03452 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03453 fTrashListFrame->AddFirst(h2);
03454 fZLabelSizeInPixels = AddCheckButton(h2, "Pixels", kAxisZLabelSizeInPixels);
03455 fZLabelSize = AddNumberEntry(h2, 22, 8, 0, kAxisZLabelSize, "Size:", 0, 5,
03456 TGNumberFormat::kNESRealThree,
03457 TGNumberFormat::kNEAAnyNumber,
03458 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03459 gf->AddFrame(h2, fLayoutExpandX);
03460 fZLabelOffset = AddNumberEntry(gf, 69, 8, 0, kAxisZTitleOffset, "Offset:",
03461 0, 5, TGNumberFormat::kNESRealTwo,
03462 TGNumberFormat::kNEAAnyNumber,
03463 TGNumberFormat::kNELLimitMinMax, 0, 1);
03464 f->AddFrame(gf, fLayoutExpandXMargin);
03465
03466
03467
03468 fZLabelSizeInPixels->SetToolTipText("Set the labels size in pixels if selected, otherwise - in % of pad");
03469 fZLabelSize->GetNumberEntry()->SetToolTipText("Label size (in pixels or in % of pad)");
03470 fZLabelOffset->GetNumberEntry()->SetToolTipText("Offset between axis and labels");
03471 }
03472
03473
03474 void TStyleManager::CreateTabTitle(TGCompositeFrame *tab)
03475 {
03476
03477
03478 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 20, 5, 5);
03479 fTrashListLayout->Add(layout);
03480
03481 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
03482 fTrashListFrame->AddFirst(h1);
03483 fOptTitle = AddCheckButton(h1, "Show title", kTitleOptTitle);
03484 tab->AddFrame(h1, layout);
03485
03486 TGHorizontalFrame *h2 = new TGHorizontalFrame(tab);
03487 fTrashListFrame->AddFirst(h2);
03488 TGVerticalFrame *v1 = new TGVerticalFrame(h2);
03489 fTrashListFrame->AddFirst(v1);
03490 AddTitleFill(v1);
03491 AddTitleText(v1);
03492 h2->AddFrame(v1, fLayoutExpandXY);
03493 TGVerticalFrame *v2 = new TGVerticalFrame(h2);
03494 fTrashListFrame->AddFirst(v2);
03495 AddTitleBorderSize(v2);
03496 AddTitleGeometry(v2);
03497 h2->AddFrame(v2, fLayoutExpandXY);
03498 tab->AddFrame(h2, fLayoutExpandX);
03499
03500 fOptTitle->SetToolTipText("Show / Hide the title pave");
03501 }
03502
03503
03504 void TStyleManager::AddTitleFill(TGCompositeFrame *f)
03505 {
03506
03507
03508 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
03509 fTrashListFrame->AddFirst(gf);
03510 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03511 fTrashListFrame->AddFirst(h1);
03512 fTitleColor = AddColorEntry(h1, kTitleFillColor);
03513 fTitleStyle = AddFillStyleEntry(h1, kTitleStyle);
03514 gf->AddFrame(h1, fLayoutExpandX);
03515 f->AddFrame(gf, fLayoutExpandXMargin);
03516
03517
03518
03519
03520 }
03521
03522
03523 void TStyleManager::AddTitleBorderSize(TGCompositeFrame *f)
03524 {
03525
03526
03527 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 0, 24, 6);
03528 fTrashListLayout->Add(layout1);
03529 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsNormal, 0, 5, 6);
03530 fTrashListLayout->Add(layout2);
03531 TGLayoutHints *layout3 = new TGLayoutHints(kLHintsExpandX, 0, 0, 3, 3);
03532 fTrashListLayout->Add(layout3);
03533
03534 TGGroupFrame *gf = new TGGroupFrame(f, "Shadow");
03535 fTrashListFrame->AddFirst(gf);
03536 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03537 fTrashListFrame->AddFirst(h1);
03538 fTitleBorderSizeLabel = new TGLabel(h1, "Title's:");
03539 h1->AddFrame(fTitleBorderSizeLabel, layout1);
03540 fTitleBorderSize = AddLineWidthEntry(h1, kTitleBorderSize);
03541 gf->AddFrame(h1, layout3);
03542
03543 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03544 fTrashListFrame->AddFirst(h2);
03545 fLegendBorderSizeLabel = new TGLabel(h2, "Legend's:");
03546 h2->AddFrame(fLegendBorderSizeLabel, layout2);
03547 fLegendBorderSize = AddLineWidthEntry(h2, kTitleLegendBorderSize);
03548 gf->AddFrame(h2, layout3);
03549 f->AddFrame(gf, fLayoutExpandXMargin);
03550 }
03551
03552
03553 void TStyleManager::AddTitleText(TGCompositeFrame *f)
03554 {
03555
03556
03557 TGGroupFrame *gf = new TGGroupFrame(f, "Text");
03558 fTrashListFrame->AddFirst(gf);
03559 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03560 fTrashListFrame->AddFirst(h1);
03561 fTitleTextColor = AddColorEntry(h1, kTitleTextColor);
03562 fTitleFont = AddFontTypeEntry(h1, kTitleFont);
03563 gf->AddFrame(h1, fLayoutExpandX);
03564 fTitleAlign = AddTextAlignEntry(gf, kTitleAlign);
03565 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03566 fTrashListFrame->AddFirst(h2);
03567 fTitleFontSizeInPixels = AddCheckButton(h2, "Pixels", kTitleFontSizeInPixels);
03568 fTitleFontSize = AddNumberEntry(h2, 21, 10, 0, kTitleFontSize, "Size:", 0, 5,
03569 TGNumberFormat::kNESRealThree,
03570 TGNumberFormat::kNEAAnyNumber,
03571 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03572 gf->AddFrame(h2, fLayoutExpandX);
03573 f->AddFrame(gf, fLayoutExpandXYMargin);
03574
03575
03576
03577 fTitleFontSizeInPixels->SetToolTipText("Set the title's text size in pixels if selected, otherwise - in % of pad");
03578 fTitleFontSize->GetNumberEntry()->SetToolTipText("Title's text size (in pixels or in % of pad)");
03579 }
03580
03581
03582 void TStyleManager::AddTitleGeometry(TGCompositeFrame *f)
03583 {
03584
03585
03586 TGGroupFrame *gf = new TGGroupFrame(f, "Geometry (% of Pad)");
03587 fTrashListFrame->AddFirst(gf);
03588 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03589 fTrashListFrame->AddFirst(h1);
03590 fTitleX = AddNumberEntry(h1, 0, 8, 0, kTitleX, "X:",
03591 0, 4, TGNumberFormat::kNESInteger,
03592 TGNumberFormat::kNEAAnyNumber,
03593 TGNumberFormat::kNELLimitMinMax, 0, 100);
03594 fTitleY = AddNumberEntry(h1, 8, 8, 0, kTitleY, "Y:",
03595 0, 4, TGNumberFormat::kNESInteger,
03596 TGNumberFormat::kNEAAnyNumber,
03597 TGNumberFormat::kNELLimitMinMax, 0, 100);
03598 gf->AddFrame(h1, fLayoutExpandXY);
03599 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03600 fTrashListFrame->AddFirst(h2);
03601 fTitleW = AddNumberEntry(h2, 0, 6, 0, kTitleW, "W:",
03602 0, 4, TGNumberFormat::kNESInteger,
03603 TGNumberFormat::kNEAAnyNumber,
03604 TGNumberFormat::kNELLimitMinMax, 0, 100);
03605 fTitleH = AddNumberEntry(h2, 8, 8, 0, kTitleH, "H:",
03606 0, 4, TGNumberFormat::kNESInteger,
03607 TGNumberFormat::kNEAAnyNumber,
03608 TGNumberFormat::kNELLimitMinMax, 0, 100);
03609 gf->AddFrame(h2, fLayoutExpandXY);
03610 f->AddFrame(gf, fLayoutExpandXYMargin);
03611
03612 fTitleX->GetNumberEntry()->SetToolTipText("Title' default abscissa");
03613 fTitleY->GetNumberEntry()->SetToolTipText("Title' default ordinate");
03614 fTitleW->GetNumberEntry()->SetToolTipText("Title' default width");
03615 fTitleH->GetNumberEntry()->SetToolTipText("Title' default height");
03616 }
03617
03618
03619 void TStyleManager::CreateTabStats(TGCompositeFrame *tab)
03620 {
03621
03622
03623 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 0, 5, 6);
03624 fTrashListLayout->Add(layout1);
03625 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 10, 21, 5, 5);
03626 fTrashListLayout->Add(layout2);
03627
03628 TGHorizontalFrame *h1 = new TGHorizontalFrame(tab);
03629 fTrashListFrame->AddFirst(h1);
03630
03631 TGVerticalFrame *v1 = new TGVerticalFrame(h1);
03632 fTrashListFrame->AddFirst(v1);
03633 AddStatsFill(v1);
03634 TGHorizontalFrame *h2 = new TGHorizontalFrame(v1);
03635 fTrashListFrame->AddFirst(h2);
03636 fStatBorderSizeLabel = new TGLabel(h2, "Stats' shadow:");
03637 h2->AddFrame(fStatBorderSizeLabel, layout1);
03638 fStatBorderSize = AddLineWidthEntry(h2, kStatBorderSize);
03639 v1->AddFrame(h2, layout2);
03640 AddStatsText(v1);
03641 AddStatsGeometry(v1);
03642 h1->AddFrame(v1, fLayoutExpandXY);
03643
03644 TGVerticalFrame *v2 = new TGVerticalFrame(h1);
03645 fTrashListFrame->AddFirst(v2);
03646 AddStatsStats(v2);
03647 AddStatsFit(v2);
03648 h1->AddFrame(v2, fLayoutExpandXY);
03649
03650 tab->AddFrame(h1, fLayoutExpandX);
03651 }
03652
03653
03654 void TStyleManager::AddStatsFill(TGCompositeFrame *f)
03655 {
03656
03657
03658 TGGroupFrame *gf = new TGGroupFrame(f, "Fill");
03659 fTrashListFrame->AddFirst(gf);
03660 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03661 fTrashListFrame->AddFirst(h);
03662 fStatColor = AddColorEntry(h, kStatColor);
03663 fStatStyle = AddFillStyleEntry(h, kStatStyle);
03664 gf->AddFrame(h, fLayoutExpandX);
03665 f->AddFrame(gf, fLayoutExpandXMargin);
03666
03667
03668
03669
03670 }
03671
03672
03673 void TStyleManager::AddStatsText(TGCompositeFrame *f)
03674 {
03675
03676
03677 TGGroupFrame *gf = new TGGroupFrame(f, "Text");
03678 fTrashListFrame->AddFirst(gf);
03679 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03680 fTrashListFrame->AddFirst(h1);
03681 fStatTextColor = AddColorEntry(h1, kStatTextColor);
03682 fStatFont = AddFontTypeEntry(h1, kStatFont);
03683 gf->AddFrame(h1, fLayoutExpandX);
03684 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03685 fTrashListFrame->AddFirst(h2);
03686 fStatFontSizeInPixels = AddCheckButton(h2, "Pixels", kStatFontSizeInPixels);
03687 fStatFontSize = AddNumberEntry(h2, 21, 10, 0, kStatFontSize, "Size:", 0, 5,
03688 TGNumberFormat::kNESRealThree,
03689 TGNumberFormat::kNEAAnyNumber,
03690 TGNumberFormat::kNELLimitMinMax, 0, 0.3);
03691 gf->AddFrame(h2, fLayoutExpandX);
03692 f->AddFrame(gf, fLayoutExpandXYMargin);
03693
03694
03695
03696 fStatFontSizeInPixels->SetToolTipText("Set the stats's text size in pixels if selected, otherwise - in % of pad");
03697 fStatFontSize->GetNumberEntry()->SetToolTipText("Stats's text size (in pixels or in % of pad)");
03698 }
03699
03700
03701 void TStyleManager::AddStatsGeometry(TGCompositeFrame *f)
03702 {
03703
03704
03705 TGGroupFrame *gf = new TGGroupFrame(f, "Geometry");
03706 fTrashListFrame->AddFirst(gf);
03707
03708 TGHorizontalFrame *h1 = new TGHorizontalFrame(gf);
03709 fTrashListFrame->AddFirst(h1);
03710 fStatX = AddNumberEntry(h1, 0, 7, 0, kStatX, "X:",
03711 0., 4, TGNumberFormat::kNESRealTwo,
03712 TGNumberFormat::kNEANonNegative,
03713 TGNumberFormat::kNELLimitMinMax, 0., 1.);
03714 fStatY = AddNumberEntry(h1, 8, 7, 0, kStatY, "Y:",
03715 0., 4, TGNumberFormat::kNESRealTwo,
03716 TGNumberFormat::kNEANonNegative,
03717 TGNumberFormat::kNELLimitMinMax, 0., 1.);
03718 gf->AddFrame(h1, fLayoutExpandXY);
03719
03720 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03721 fTrashListFrame->AddFirst(h2);
03722 fStatW = AddNumberEntry(h2, 0, 5, 0, kStatW, "W:",
03723 0., 4, TGNumberFormat::kNESRealTwo,
03724 TGNumberFormat::kNEANonNegative,
03725 TGNumberFormat::kNELLimitMinMax, 0., 1.);
03726 fStatH = AddNumberEntry(h2, 8, 7, 0, kStatH, "H:",
03727 0., 4, TGNumberFormat::kNESRealTwo,
03728 TGNumberFormat::kNEANonNegative,
03729 TGNumberFormat::kNELLimitMinMax, 0., 1.);
03730 gf->AddFrame(h2, fLayoutExpandXY);
03731 f->AddFrame(gf, fLayoutExpandXYMargin);
03732
03733 fStatX->GetNumberEntry()->SetToolTipText("X position of top right corner of stat box.");
03734 fStatY->GetNumberEntry()->SetToolTipText("Y position of top right corner of stat box.");
03735 fStatW->GetNumberEntry()->SetToolTipText("Width of stat box.");
03736 fStatH->GetNumberEntry()->SetToolTipText("Height of stat box.");
03737 }
03738
03739
03740 void TStyleManager::AddStatsStats(TGCompositeFrame *f)
03741 {
03742
03743
03744 TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 0, 0, 5);
03745 fTrashListLayout->Add(layout);
03746
03747 TGGroupFrame *gf = new TGGroupFrame(f, "Stat Options");
03748 fTrashListFrame->AddFirst(gf);
03749 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03750 fTrashListFrame->AddFirst(h);
03751 TGVerticalFrame *v1 = new TGVerticalFrame(h);
03752 fTrashListFrame->AddFirst(v1);
03753 fOptStatName = AddCheckButton(v1, "Name", kStatOptStatName);
03754 fOptStatOverflow = AddCheckButton(v1, "Overflow", kStatOptStatOverflow);
03755 fOptStatUnderflow = AddCheckButton(v1, "Underflow", kStatOptStatUnderflow);
03756 fOptStatSkewness = AddCheckButton(v1, "Skewness", kStatOptStatSkewness);
03757 fOptStatKurtosis = AddCheckButton(v1, "Kurtosis", kStatOptStatKurtosis);
03758 h->AddFrame(v1, fLayoutExpandXY);
03759 TGVerticalFrame *v2 = new TGVerticalFrame(h);
03760 fTrashListFrame->AddFirst(v2);
03761 fOptStatEntries = AddCheckButton(v2, "Entries", kStatOptStatEntries);
03762 fOptStatMean = AddCheckButton(v2, "Mean", kStatOptStatMean);
03763 fOptStatRMS = AddCheckButton(v2, "RMS", kStatOptStatRMS);
03764 fOptStatIntegral = AddCheckButton(v2, "Integral", kStatOptStatIntegral);
03765 fOptStatErrors = AddCheckButton(v2, "Errors", kStatOptStatErrors);
03766 h->AddFrame(v2, fLayoutExpandXY);
03767 gf->AddFrame(h, fLayoutExpandX);
03768
03769 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03770 fTrashListFrame->AddFirst(h2);
03771 TGHorizontalFrame *h3 = new TGHorizontalFrame(h2);
03772 fTrashListFrame->AddFirst(h3);
03773 fStatFormatLabel = new TGLabel(h3, "Paint format:");
03774 h3->AddFrame(fStatFormatLabel, layout);
03775 h2->AddFrame(h3, fLayoutExpandX);
03776 fStatFormat = AddTextEntry(h2, "", kStatFormat);
03777 gf->AddFrame(h2, fLayoutExpandX);
03778 f->AddFrame(gf, fLayoutExpandXYMargin);
03779
03780 fOptStatName->SetToolTipText("Show / Hide the histogram name");
03781 fOptStatOverflow->SetToolTipText("Show / Hide the number of overflows");
03782 fOptStatUnderflow->SetToolTipText("Show / Hide the number of underflows");
03783 fOptStatSkewness->SetToolTipText("Show / Hide the skewness");
03784 fOptStatKurtosis->SetToolTipText("Show / Hide the kurtosis");
03785 fOptStatEntries->SetToolTipText("Show / Hide the number of entries");
03786 fOptStatMean->SetToolTipText("Show / Hide the mean value");
03787 fOptStatRMS->SetToolTipText("Show / Hide root-mean-square (RMS)");
03788 fOptStatIntegral->SetToolTipText("Show / Hide the integral of bins");
03789 fOptStatErrors->SetToolTipText("Show / Hide the errors");
03790 fStatFormat->SetToolTipText("Paint format of stat options");
03791 }
03792
03793
03794 void TStyleManager::AddStatsFit(TGCompositeFrame *f)
03795 {
03796
03797
03798 TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 0, 0, 5);
03799 fTrashListLayout->Add(layout);
03800
03801 TGGroupFrame *gf = new TGGroupFrame(f, "Fit Options");
03802 fTrashListFrame->AddFirst(gf);
03803 TGHorizontalFrame *h = new TGHorizontalFrame(gf);
03804 fTrashListFrame->AddFirst(h);
03805 TGVerticalFrame *v1 = new TGVerticalFrame(h);
03806 fTrashListFrame->AddFirst(v1);
03807 fOptFitValues = AddCheckButton(v1, "Values", kStatOptFitValues);
03808 fOptFitProbability = AddCheckButton(v1, "Probability",
03809 kStatOptFitProbability);
03810 h->AddFrame(v1, fLayoutExpandXY);
03811 TGVerticalFrame *v2 = new TGVerticalFrame(h);
03812 fTrashListFrame->AddFirst(v2);
03813 fOptFitErrors = AddCheckButton(v2, "Errors", kStatOptFitErrors);
03814 fOptFitChi = AddCheckButton(v2, "Chi", kStatOptFitChi);
03815 h->AddFrame(v2, fLayoutExpandXY);
03816 gf->AddFrame(h, fLayoutExpandX);
03817 TGHorizontalFrame *h2 = new TGHorizontalFrame(gf);
03818 fTrashListFrame->AddFirst(h2);
03819 TGHorizontalFrame *h3 = new TGHorizontalFrame(h2);
03820 fTrashListFrame->AddFirst(h3);
03821 fFitFormatLabel = new TGLabel(h3, "Paint format:");
03822 h3->AddFrame(fFitFormatLabel, layout);
03823 h2->AddFrame(h3, fLayoutExpandX);
03824 fFitFormat = AddTextEntry(h2, "", kStatFitFormat);
03825 gf->AddFrame(h2, fLayoutExpandX);
03826 f->AddFrame(gf, fLayoutExpandXMargin);
03827
03828 fOptFitValues->SetToolTipText("Show / Hide the parameter name and value");
03829 fOptFitProbability->SetToolTipText("Show / Hide probability)");
03830 fOptFitErrors->SetToolTipText("Show / Hide the errors");
03831 fOptFitChi->SetToolTipText("Show / Hide Chisquare");
03832 fFitFormat->SetToolTipText("Paint format of fit options");
03833 }
03834
03835
03836 void TStyleManager::CreateTabPsPdf(TGCompositeFrame *tab)
03837 {
03838
03839
03840 AddPsPdfHeader(tab);
03841 AddPsPdfTitle(tab);
03842 TGHorizontalFrame *h = new TGHorizontalFrame(tab);
03843 fTrashListFrame->AddFirst(h);
03844 AddPsPdfPaperSize(h);
03845 TGVerticalFrame *v = new TGVerticalFrame(h);
03846 fTrashListFrame->AddFirst(v);
03847 AddPsPdfLineScale(v);
03848 AddPsPdfColorModel(v);
03849 h->AddFrame(v, fLayoutExpandXY);
03850 tab->AddFrame(h, fLayoutExpandX);
03851 }
03852
03853
03854 void TStyleManager::AddPsPdfHeader(TGCompositeFrame *f)
03855 {
03856
03857
03858 TGGroupFrame *gf = new TGGroupFrame(f, "Header");
03859 fTrashListFrame->AddFirst(gf);
03860 fHeaderPS = AddTextEntry(gf, "", kPSPDFHeaderPS);
03861 f->AddFrame(gf, fLayoutExpandXMargin);
03862
03863 fHeaderPS->SetToolTipText("PostScript header");
03864 }
03865
03866
03867 void TStyleManager::AddPsPdfTitle(TGCompositeFrame *f)
03868 {
03869
03870
03871 TGGroupFrame *gf = new TGGroupFrame(f, "Title");
03872 fTrashListFrame->AddFirst(gf);
03873 fTitlePS = AddTextEntry(gf, "", kPSPDFTitlePS);
03874 f->AddFrame(gf, fLayoutExpandXMargin);
03875
03876 fTitlePS->SetToolTipText("PostScript title");
03877 }
03878
03879
03880 void TStyleManager::AddPsPdfColorModel(TGCompositeFrame *f)
03881 {
03882
03883
03884 fColorModelPS = new TGButtonGroup(f, "Color Model",
03885 kChildFrame | kHorizontalFrame | kFitWidth);
03886
03887 fColorModelPS->SetLayoutManager(new TGMatrixLayout(fColorModelPS, 1, 2, 15));
03888 fColorModelPSRGB = new TGRadioButton(fColorModelPS, "RGB",
03889 kPSPDFColorModelPSRGB);
03890 fColorModelPSRGB->Associate(this);
03891 fColorModelPSCMYK = new TGRadioButton(fColorModelPS, "CMYK",
03892 kPSPDFColorModelPSCMYK);
03893 fColorModelPSCMYK->Associate(this);
03894 fColorModelPS->Show();
03895 TGLayoutHints *layout2 =
03896 new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 12);
03897 fTrashListLayout->Add(layout2);
03898 f->AddFrame(fColorModelPS, layout2);
03899 }
03900
03901
03902 void TStyleManager::AddPsPdfPaperSize(TGCompositeFrame *f)
03903 {
03904
03905
03906 TGGroupFrame *gf = new TGGroupFrame(f, "Paper Size");
03907 fTrashListFrame->AddFirst(gf);
03908 fPaperSizePredef = AddPaperSizeEntry(gf, kPSPDFPaperSizePredef);
03909 fPaperSizeX = AddNumberEntry(gf, 0, 0, 0, kPSPDFPaperSizeX, "Width:",
03910 0, 6, TGNumberFormat::kNESRealOne,
03911 TGNumberFormat::kNEAPositive,
03912 TGNumberFormat::kNELLimitMinMax, 1, 40);
03913 fPaperSizeY = AddNumberEntry(gf, 0, 0, 0, kPSPDFPaperSizeY, "Height:",
03914 0, 6, TGNumberFormat::kNESRealOne,
03915 TGNumberFormat::kNEAPositive,
03916 TGNumberFormat::kNELLimitMinMax, 1, 40);
03917 f->AddFrame(gf, fLayoutExpandXMargin);
03918
03919 fPaperSizeX->GetNumberEntry()->SetToolTipText("Width of the printing area");
03920 fPaperSizeY->GetNumberEntry()->SetToolTipText("Height of the printing area");
03921 }
03922
03923
03924 void TStyleManager::AddPsPdfLineScale(TGCompositeFrame *f)
03925 {
03926
03927
03928 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 10, 20, 5, 5);
03929 fTrashListLayout->Add(layout);
03930
03931 TGHorizontalFrame *gf = new TGHorizontalFrame(f);
03932 fTrashListFrame->AddFirst(gf);
03933 fLineScalePS = AddNumberEntry(gf, 0, 0, 0, kPSPDFLineScalePS, "Line scale:",
03934 0, 6, TGNumberFormat::kNESRealOne,
03935 TGNumberFormat::kNEAPositive,
03936 TGNumberFormat::kNELLimitMinMax, 0.1, 10);
03937 f->AddFrame(gf, layout);
03938
03939 fLineScalePS->GetNumberEntry()->SetToolTipText("Line scale factor when drawing lines on PostScript");
03940 }
03941
03942
03943 void TStyleManager::AddTitle(TGCompositeFrame *f, const char *s)
03944 {
03945
03946
03947 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsExpandX, 5, 0, 7);
03948 fTrashListLayout->Add(layout1);
03949 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsExpandX, 0, 0, 6, 6);
03950 fTrashListLayout->Add(layout2);
03951
03952 TGHorizontalFrame *h = new TGHorizontalFrame(f);
03953 fTrashListFrame->AddFirst(h);
03954
03955 TGLabel *lab = new TGLabel(h, s);
03956 fTrashListFrame->AddFirst(lab);
03957 h->AddFrame(lab);
03958
03959 TGHorizontal3DLine *line = new TGHorizontal3DLine(h, 4, 2, kFALSE);
03960 fTrashListFrame->AddFirst(line);
03961 h->AddFrame(line, layout1);
03962
03963 f->AddFrame(h, layout2);
03964 }
03965
03966
03967 TGColorSelect *TStyleManager::AddColorEntry(TGCompositeFrame *f, Int_t id)
03968 {
03969
03970
03971 TGLayoutHints *layout = new TGLayoutHints(kLHintsBottom, 0, 5, 3, 3);
03972 fTrashListLayout->Add(layout);
03973
03974 TGColorSelect *cs = new TGColorSelect(f, 0, id);
03975 cs->Associate(this);
03976 f->AddFrame(cs, layout);
03977 return cs;
03978 }
03979
03980
03981 TGedPatternSelect *TStyleManager::AddFillStyleEntry(TGCompositeFrame *f,
03982 Int_t id)
03983 {
03984
03985
03986 TGLayoutHints *layout = new TGLayoutHints(kLHintsBottom, 0, 0, 3, 3);
03987 fTrashListLayout->Add(layout);
03988
03989 TGedPatternSelect *gps = new TGedPatternSelect(f, 0, id);
03990 gps->Associate(this);
03991 f->AddFrame(gps, layout);
03992 return gps;
03993 }
03994
03995
03996 TGedMarkerSelect *TStyleManager::AddMarkerStyleEntry(TGCompositeFrame *f,
03997 Int_t id)
03998 {
03999
04000
04001 TGLayoutHints *layout = new TGLayoutHints(kLHintsCenterY, 0, 5, 3, 3);
04002 fTrashListLayout->Add(layout);
04003
04004 TGedMarkerSelect *gms = new TGedMarkerSelect(f, 0, id);
04005 gms->Associate(this);
04006 f->AddFrame(gms, layout);
04007 return gms;
04008 }
04009
04010
04011 TGComboBox *TStyleManager::AddMarkerSizeEntry(TGCompositeFrame *f, Int_t id)
04012 {
04013
04014
04015 char a[10];
04016 TGComboBox *cb = new TGComboBox(f, id);
04017 cb->Associate(this);
04018 for (Int_t i = 1; i <= 15; i++) {
04019 snprintf(a, 10, "%.1f", 0.2 * i);
04020 cb->AddEntry(a, i);
04021 }
04022 cb->Resize(1, 22);
04023 f->AddFrame(cb, fLayoutExpandXCenterYMargin);
04024 return cb;
04025 }
04026
04027
04028 TGNumberEntry *TStyleManager::AddNumberEntry(TGCompositeFrame *f, Int_t e1,
04029 Int_t e2, Int_t e3, Int_t id, const char *s, Double_t init, Int_t digits,
04030 TGNumberFormat::EStyle nfS, TGNumberFormat::EAttribute nfA,
04031 TGNumberFormat::ELimit nfL, Double_t min, Double_t max)
04032 {
04033
04034
04035 TGHorizontalFrame *h = new TGHorizontalFrame(f);
04036 fTrashListFrame->AddFirst(h);
04037 if (strlen(s)) {
04038 TGLabel *lab = new TGLabel(h, s);
04039 fTrashListFrame->AddFirst(lab);
04040 TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, e1, 0, 3);
04041 fTrashListLayout->Add(layout);
04042 h->AddFrame(lab, layout);
04043 }
04044 TGNumberEntry *ne = new TGNumberEntry(h, init, digits, id,
04045 nfS, nfA, nfL, min, max);
04046 ne->Associate(this);
04047 if ((e1 == 0) && (e2 == 0) && (e3 == 0)) {
04048 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsRight);
04049 fTrashListLayout->Add(layout1);
04050 h->AddFrame(ne, layout1);
04051 } else {
04052 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsNormal, e2, e3);
04053 fTrashListLayout->Add(layout2);
04054 h->AddFrame(ne, layout2);
04055 }
04056 if (strlen(s)) {
04057 TGLayoutHints *layout3 =
04058 new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 2, 3, 3);
04059 fTrashListLayout->Add(layout3);
04060 f->AddFrame(h, layout3);
04061 } else {
04062 TGLayoutHints *layout4 =
04063 new TGLayoutHints(kLHintsNormal | kLHintsCenterY, 0, 2, 3, 3);
04064 fTrashListLayout->Add(layout4);
04065 f->AddFrame(h, layout4);
04066 }
04067 return ne;
04068 }
04069
04070
04071 TGLineWidthComboBox *TStyleManager::AddLineWidthEntry(TGCompositeFrame *f,
04072 Int_t id)
04073 {
04074
04075
04076 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 0, 0, 3, 3);
04077 fTrashListLayout->Add(layout);
04078
04079 TGHorizontalFrame *h = new TGHorizontalFrame(f);
04080 fTrashListFrame->AddFirst(h);
04081 TGLineWidthComboBox *lwcb = new TGLineWidthComboBox(h, id);
04082 lwcb->Associate(this);
04083 lwcb->Resize(1, 22);
04084 h->AddFrame(lwcb, fLayoutExpandX);
04085 f->AddFrame(h, layout);
04086 return lwcb;
04087 }
04088
04089
04090 TGLineStyleComboBox *TStyleManager::AddLineStyleEntry(TGCompositeFrame *f,
04091 Int_t id)
04092 {
04093
04094
04095 TGLineStyleComboBox *lscb = new TGLineStyleComboBox(f, id);
04096 lscb->Associate(this);
04097 lscb->Resize(1, 22);
04098 f->AddFrame(lscb, fLayoutExpandXCenterYMargin);
04099 return lscb;
04100 }
04101
04102
04103 TGTextButton *TStyleManager::AddTextButton(TGCompositeFrame *f,
04104 const char *s, Int_t id)
04105 {
04106
04107
04108 TGLayoutHints *layout = new TGLayoutHints(kLHintsExpandX, 0, 0, 3, 3);
04109 fTrashListLayout->Add(layout);
04110
04111 TGTextButton *tb = new TGTextButton(f, s, id);
04112 tb->Associate(this);
04113 f->AddFrame(tb, layout);
04114 return tb;
04115 }
04116
04117
04118 TGFontTypeComboBox *TStyleManager::AddFontTypeEntry(TGCompositeFrame *f,
04119 Int_t id)
04120 {
04121
04122
04123 TGFontTypeComboBox *ftcb = new TGFontTypeComboBox(f, id);
04124 ftcb->Associate(this);
04125 ftcb->Resize(1, 22);
04126 f->AddFrame(ftcb, fLayoutExpandXCenterYMargin);
04127 return ftcb;
04128 }
04129
04130
04131 TGComboBox *TStyleManager::AddTextAlignEntry(TGCompositeFrame *f, Int_t id)
04132 {
04133
04134
04135 TGComboBox *cb = new TGComboBox(f, id);
04136 cb->Associate(this);
04137 cb->AddEntry("11 Bottom, Left", 11);
04138 cb->AddEntry("21 Bottom, Middle", 21);
04139 cb->AddEntry("31 Bottom, Right", 31);
04140 cb->AddEntry("12 Middle, Left", 12);
04141 cb->AddEntry("22 Middle, Middle", 22);
04142 cb->AddEntry("32 Middle, Right", 32);
04143 cb->AddEntry("13 Top, Left", 13);
04144 cb->AddEntry("23 Top, Middle", 23);
04145 cb->AddEntry("33 Top, Right", 33);
04146 cb->Resize(1, 22);
04147 f->AddFrame(cb, fLayoutExpandXCenterYMargin);
04148 return cb;
04149 }
04150
04151
04152 TGButtonGroup *TStyleManager::AddBorderModeEntry(TGCompositeFrame *f,
04153 Int_t id1, Int_t id2, Int_t id3)
04154 {
04155
04156
04157 TGButtonGroup *bg = new TGButtonGroup(f, "Border");
04158 TGRadioButton *sunk = new TGRadioButton(bg, "Sunken", id1);
04159 sunk->Associate(this);
04160 fTrashListFrame->AddFirst(sunk);
04161 TGRadioButton *none = new TGRadioButton(bg, "None" , id2);
04162 none->Associate(this);
04163 fTrashListFrame->AddFirst(none);
04164 TGRadioButton *rais = new TGRadioButton(bg, "Raised", id3);
04165 rais->Associate(this);
04166 fTrashListFrame->AddFirst(rais);
04167 bg->Show();
04168 f->AddFrame(bg, fLayoutExpandXYMargin);
04169 return bg;
04170 }
04171
04172
04173 TGComboBox *TStyleManager::AddDateFormatEntry(TGCompositeFrame *f, Int_t id)
04174 {
04175
04176
04177 TGComboBox *cb = new TGComboBox(f, id);
04178 cb->Associate(this);
04179 cb->AddEntry("Wed Sep 25 17:10:35 2002", 1);
04180 cb->AddEntry("2002-09-25", 2);
04181 cb->AddEntry("2002-09-25 17:10:35", 3);
04182 cb->Resize(1, 22);
04183 cb->GetListBox()->Resize(cb->GetListBox()->GetDefaultSize().fWidth, 55);
04184 f->AddFrame(cb, fLayoutExpandXCenterYMargin);
04185 return cb;
04186 }
04187
04188
04189 TGCheckButton *TStyleManager::AddCheckButton(TGCompositeFrame *f, const char *s,
04190 Int_t id, Int_t e1, Int_t e2)
04191 {
04192
04193
04194 TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 0, e1, 4, e2);
04195 fTrashListLayout->Add(layout);
04196
04197 TGHorizontalFrame *h = new TGHorizontalFrame(f);
04198 fTrashListFrame->AddFirst(h);
04199 TGCheckButton *cb = new TGCheckButton(h, s, id);
04200 cb->Associate(this);
04201 h->AddFrame(cb, layout);
04202 f->AddFrame(h);
04203 return cb;
04204 }
04205
04206
04207 TGTextEntry *TStyleManager::AddTextEntry(TGCompositeFrame *f,
04208 const char *s, Int_t id)
04209 {
04210
04211
04212 TGHorizontalFrame *h = new TGHorizontalFrame(f);
04213 fTrashListFrame->AddFirst(h);
04214 if (strlen(s)) {
04215 TGLabel *lab = new TGLabel(h, s);
04216 fTrashListFrame->AddFirst(lab);
04217 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsNormal, 0, 0, 3);
04218 fTrashListLayout->Add(layout1);
04219 h->AddFrame(lab, layout1);
04220 }
04221 TGTextEntry *te = new TGTextEntry(h, "", id);
04222 te->Associate(this);
04223 te->Resize(57, 22);
04224 if (strlen(s)) {
04225 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsRight, 20);
04226 fTrashListLayout->Add(layout2);
04227 h->AddFrame(te, layout2);
04228 } else
04229 h->AddFrame(te, fLayoutExpandX);
04230 TGLayoutHints *layout3 =
04231 new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 2, 3, 3);
04232 fTrashListLayout->Add(layout3);
04233 f->AddFrame(h, layout3);
04234 return te;
04235 }
04236
04237
04238 TGComboBox *TStyleManager::AddPaperSizeEntry(TGCompositeFrame *f, Int_t id)
04239 {
04240
04241
04242 TGComboBox *cb = new TGComboBox(f, id);
04243 cb->Associate(this);
04244 cb->AddEntry("Custom size (cm)", 1);
04245 cb->AddEntry("Custom size (inch)", 2);
04246 cb->AddEntry("A4 (cm)", 3);
04247 cb->AddEntry("US Letter (inch)", 4);
04248 cb->AddEntry("US Letter (cm)", 4);
04249 cb->Resize(1, 22);
04250 cb->GetListBox()->Resize(cb->GetListBox()->GetDefaultSize().fWidth, 70);
04251 f->AddFrame(cb, fLayoutExpandXCenterYMargin);
04252 return cb;
04253 }
04254
04255
04256 void TStyleManager::DoMenu(Int_t menuID)
04257 {
04258
04259
04260 switch (menuID) {
04261 case kMenuNew: DoNew(); break;
04262 case kMenuDelete: DoDelete(); break;
04263 case kMenuRename: DoRename(); break;
04264 case kMenuImportCanvas: DoImportCanvas(); break;
04265 case kMenuImportMacro: DoImportMacro(kTRUE); break;
04266 case kMenuExport: DoExport(); break;
04267 case kMenuExit: DoExit(); break;
04268 case kMenuHelp: DoHelp(42); break;
04269 case kMenuHelpEditor: DoHelp(fCurTabNum); break;
04270 case kMenuHelpGeneral: DoHelp(0); break;
04271 case kMenuHelpCanvas: DoHelp(1); break;
04272 case kMenuHelpPad: DoHelp(2); break;
04273 case kMenuHelpHistos: DoHelp(3); break;
04274 case kMenuHelpAxis: DoHelp(4); break;
04275 case kMenuHelpTitle: DoHelp(5); break;
04276 case kMenuHelpStats: DoHelp(6); break;
04277 case kMenuHelpPSPDF: DoHelp(7); break;
04278 }
04279 }
04280
04281
04282 void TStyleManager::DoImportMacro(Bool_t create)
04283 {
04284
04285
04286
04287
04288
04289
04290
04291
04292
04293 if ((!create) && (!strcmp(fCurSelStyle->GetName(), "Default"))) {
04294 if ((!strcmp(fCurSelStyle->GetName(),gStyle->GetName())))
04295 gStyle->Reset("Default");
04296 else {
04297 delete gROOT->GetStyle("Default");
04298 new TStyle("Default", "Default Style");
04299 }
04300 } else if ((!create) && (!strcmp(fCurSelStyle->GetName(), "Plain"))) {
04301 if ((!strcmp(fCurSelStyle->GetName(),gStyle->GetName())))
04302 gStyle->Reset("Plain");
04303 else {
04304 delete gROOT->GetStyle("Plain");
04305 new TStyle("Plain", "Plain Style (no colors/fill areas)");
04306 }
04307 } else if ((!create) && (!strcmp(fCurSelStyle->GetName(), "Bold"))) {
04308 if ((!strcmp(fCurSelStyle->GetName(),gStyle->GetName())))
04309 gStyle->Reset("Bold");
04310 else {
04311 delete gROOT->GetStyle("Bold");
04312 new TStyle("Bold", "Bold Style");
04313 }
04314 } else if ((!create) && (!strcmp(fCurSelStyle->GetName(), "Video"))) {
04315 if ((!strcmp(fCurSelStyle->GetName(),gStyle->GetName())))
04316 gStyle->Reset("Video");
04317 else {
04318 delete gROOT->GetStyle("Video");
04319 new TStyle("Video", "Style for video presentation histograms");
04320 }
04321 } else if ((!create) && (!strcmp(fCurSelStyle->GetName(), "Pub"))) {
04322 if ((!strcmp(fCurSelStyle->GetName(),gStyle->GetName())))
04323 gStyle->Reset("Pub");
04324 else {
04325 delete gROOT->GetStyle("Pub");
04326 new TStyle("Pub", "Style for Publications");
04327 }
04328 } else {
04329 CreateMacro();
04330 if (!create) {
04331 TString newName;
04332 newName.Form("Style_%s.C", fCurSelStyle->GetName());
04333 fCurMacro->fFilename = StrDup(newName.Data());
04334 }
04335 new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fCurMacro);
04336 if (fCurMacro->fFilename != 0) {
04337 gROOT->ProcessLine(Form(".x %s", fCurMacro->fFilename));
04338 fCurMacro->fFilename = StrDup(gSystem->BaseName(fCurMacro->fFilename));
04339 }
04340 }
04341
04342 BuildList();
04343 }
04344
04345
04346 void TStyleManager::DoListSelect()
04347 {
04348
04349
04350
04351
04352
04353 fCurSelStyle = gROOT->GetStyle(((TGTextLBEntry*) fListComboBox->
04354 GetSelectedEntry())->GetText()->GetString());
04355
04356 fStyleChanged = kFALSE;
04357
04358
04359 UpdateStatusBar();
04360
04361
04362 if (fMoreAndNotLess) {
04363 DisconnectEditor(fCurTabNum);
04364 UpdateEditor(fCurTabNum);
04365 ConnectEditor(fCurTabNum);
04366 }
04367
04368
04369 if (fPreviewWindow && fPreviewWindow->IsMapped())
04370 DoEditionUpdatePreview();
04371
04372
04373 TString newTip;
04374 newTip.Form("'%s'", fCurSelStyle->GetName());
04375 newTip += " become current style";
04376 fMakeDefault->SetToolTipText(newTip.Data());
04377
04378
04379 fListComboBox->MapSubwindows();
04380 fListComboBox->Layout();
04381 }
04382
04383
04384 void TStyleManager::DoRealTime(Bool_t b)
04385 {
04386
04387
04388
04389 if (b) {
04390 fEditionUpdatePreview->SetEnabled(kFALSE);
04391 fRealTimePreview = kTRUE;
04392 DoEditionUpdatePreview();
04393 } else {
04394 fEditionUpdatePreview->SetEnabled(kTRUE);
04395 fRealTimePreview = kFALSE;
04396 }
04397 }
04398
04399
04400 void TStyleManager::DoPreview(Bool_t b)
04401 {
04402
04403
04404
04405 if (b) {
04406 fPreviewButton->SetState(kButtonDown, kFALSE);
04407 if (fPreviewWindow) {
04408 DoEditionUpdatePreview();
04409 fPreviewWindow->MapTheWindow();
04410 } else {
04411 if (fCurPad && fCurObj) {
04412 TQObject::Disconnect("TCanvas", "Closed()");
04413 fPreviewWindow = new TStylePreview(GetMainFrame(), fCurSelStyle, fCurPad);
04414 TQObject::Connect("TCanvas", "Closed()", "TStyleManager", this, "DoSelectNoCanvas()");
04415 }
04416 }
04417 fPreviewWindow->Connect("CloseWindow()", "TStyleManager", this, "DoPreviewClosed()");
04418 fPreviewRealTime->SetEnabled(kTRUE);
04419 if (fRealTimePreview) {
04420 fPreviewRealTime->SetState(kButtonDown, kFALSE);
04421 fEditionUpdatePreview->SetEnabled(kFALSE);
04422 } else {
04423 fPreviewRealTime->SetState(kButtonUp, kFALSE);
04424 fEditionUpdatePreview->SetEnabled(kTRUE);
04425 }
04426 } else DoPreviewClosed();
04427 }
04428
04429
04430 void TStyleManager::DoPreviewClosed()
04431 {
04432
04433
04434
04435 fPreviewWindow->Disconnect("CloseWindow()");
04436 fPreviewButton->SetState(kButtonUp, kFALSE);
04437 fPreviewRealTime->SetEnabled(kFALSE);
04438 fEditionUpdatePreview->SetEnabled(kFALSE);
04439 fPreviewWindow->UnmapWindow();
04440 }
04441
04442
04443 void TStyleManager::DoMakeDefault()
04444 {
04445
04446
04447
04448 gROOT->SetStyle(fCurSelStyle->GetName());
04449 fCurStyle->SetText(gStyle->GetName());
04450 }
04451
04452
04453 void TStyleManager::DoApplyOnSelect(Int_t i)
04454 {
04455
04456
04457
04458 fAllAndNotCurrent = (i == kTopApplyOnAll);
04459 }
04460
04461
04462 void TStyleManager::DoApplyOn()
04463 {
04464
04465
04466
04467 TStyle *tmp = gStyle;
04468 gStyle = fCurSelStyle;
04469
04470 if (fAllAndNotCurrent) {
04471
04472 TCanvas *tmpCanvas = (TCanvas *) (gROOT->GetListOfCanvases()->First());
04473 while (tmpCanvas) {
04474 if ((!fPreviewWindow) || (tmpCanvas != fPreviewWindow->GetMainCanvas())) {
04475 tmpCanvas->UseCurrentStyle();
04476 tmpCanvas->Modified();
04477 tmpCanvas->Update();
04478 }
04479 tmpCanvas = (TCanvas *) (gROOT->GetListOfCanvases()->After(tmpCanvas));
04480 }
04481 } else
04482 if (fCurPad && fCurObj) {
04483
04484 fCurObj->UseCurrentStyle();
04485 TCanvas *tmpCanvas = (TCanvas *) (gROOT->GetListOfCanvases()->First());
04486 while (tmpCanvas) {
04487 if (((!fPreviewWindow) || (tmpCanvas != fPreviewWindow->GetMainCanvas()))
04488 && ((tmpCanvas == fCurObj) || tmpCanvas->FindObject(fCurObj))) {
04489 tmpCanvas->Modified();
04490 tmpCanvas->Update();
04491 }
04492 tmpCanvas = (TCanvas *) (gROOT->GetListOfCanvases()->After(tmpCanvas));
04493 }
04494 }
04495
04496 gStyle = tmp;
04497 }
04498
04499
04500 void TStyleManager::DoMoreLess()
04501 {
04502
04503
04504
04505 fMoreAndNotLess = !fMoreAndNotLess;
04506 if (fMoreAndNotLess) {
04507
04508 SetWMSizeHints(fSMWidth, fSMHeight, fSMWidth, fSMHeight, 0, 0);
04509 fEditionFrame->ShowFrame(fEditionTab);
04510 fEditionFrame->ShowFrame(fEditionButtonFrame);
04511 fMoreLess->SetText("&Close <<");
04512 Resize(fSMWidth, fSMHeight);
04513
04514
04515 DisconnectEditor(fCurTabNum);
04516 UpdateEditor(fCurTabNum);
04517 ConnectEditor(fCurTabNum);
04518 fMoreLess->SetToolTipText("Close the editor");
04519 } else {
04520
04521 SetWMSizeHints(fSMWidth, 319, fSMWidth, 319, 0, 0);
04522 fEditionFrame->HideFrame(fEditionTab);
04523 fEditionFrame->HideFrame(fEditionButtonFrame);
04524 fMoreLess->SetText("&Edit >>");
04525 Resize(fSMWidth, 317);
04526 fMoreLess->SetToolTipText("Open the editor");
04527 }
04528 }
04529
04530
04531 void TStyleManager::DoEditionUpdatePreview()
04532 {
04533
04534
04535 if ((!fCurPad) || (!fCurObj)) return;
04536
04537 if (fPreviewWindow) {
04538 TQObject::Disconnect("TCanvas", "Closed()");
04539 fPreviewWindow->Update(fCurSelStyle, fCurPad);
04540 TQObject::Connect("TCanvas", "Closed()", "TStyleManager", this, "DoSelectNoCanvas()");
04541 }
04542 }
04543
04544
04545 void TStyleManager::DoChangeTab(Int_t i)
04546 {
04547
04548
04549
04550
04551 DisconnectEditor(fCurTabNum);
04552 fCurTabNum = i;
04553 UpdateEditor(fCurTabNum);
04554 ConnectEditor(fCurTabNum);
04555 }
04556
04557
04558 void TStyleManager::DoChangeAxisTab(Int_t i)
04559 {
04560
04561
04562 fCurTabAxisNum = i;
04563 }
04564
04565
04566 void TStyleManager::DoSelectNoCanvas()
04567 {
04568
04569
04570
04571 fCurPad = 0;
04572 fCurObj = 0;
04573
04574 if (fPreviewWindow && fPreviewWindow->IsMapped())
04575 DoPreview(kFALSE);
04576
04577 fCurPadTextEntry->SetText("No pad selected");
04578 fCurObjTextEntry->SetText("No object selected");
04579 fImportCascade->DisableEntry(kMenuImportCanvas);
04580 fApplyOnButton->SetEnabled(kFALSE);
04581 fToolBarImportCanvas->SetEnabled(kFALSE);
04582 fPreviewButton->SetEnabled(kFALSE);
04583 fPreviewRealTime->SetEnabled(kFALSE);
04584 fEditionUpdatePreview->SetEnabled(kFALSE);
04585 }
04586
04587
04588 void TStyleManager::DoSelectCanvas(TVirtualPad *pad, TObject *obj, Int_t mouseButton)
04589 {
04590
04591
04592
04593 if (mouseButton != kButton2Down) return;
04594
04595 if (!pad || !obj) {
04596 DoSelectNoCanvas();
04597 return;
04598 }
04599
04600
04601 if (fPreviewWindow && (pad->GetCanvas() == fPreviewWindow->GetMainCanvas()))
04602 return;
04603
04604
04605 Bool_t samePad = (fCurPad && (pad->GetCanvas() == fCurPad->GetCanvas()));
04606
04607 fCurPad = pad;
04608 fCurObj = obj;
04609 Bool_t preview = (fPreviewWindow && fPreviewWindow->IsMapped());
04610
04611 if ((!samePad) && preview) DoPreview(kFALSE);
04612
04613
04614 TString sPad;
04615 if (strlen(fCurPad->GetName())) sPad.Append(fCurPad->GetName());
04616 else sPad.Append("[no name]");
04617 sPad.Append(" - '");
04618 if (strlen(fCurPad->GetTitle()))
04619 sPad.Append(fCurPad->GetTitle());
04620 else
04621 sPad.Append("[no title]");
04622 sPad.Append("'::");
04623 sPad.Append(fCurPad->ClassName());
04624 fCurPadTextEntry->SetText(sPad);
04625 TString sObj;
04626 if (strlen(fCurObj->GetName()))
04627 sObj.Append(fCurObj->GetName());
04628 else
04629 sObj.Append("[no name]");
04630 sObj.Append("::");
04631 sObj.Append(fCurObj->ClassName());
04632 fCurObjTextEntry->SetText(sObj);
04633
04634 if (!samePad) {
04635 fImportCascade->EnableEntry(kMenuImportCanvas);
04636 fApplyOnButton->SetEnabled(kTRUE);
04637 fToolBarImportCanvas->SetEnabled(kTRUE);
04638 if (preview) {
04639 DoPreview(kTRUE);
04640 } else {
04641 fPreviewButton->SetEnabled(kTRUE);
04642 fPreviewRealTime->SetEnabled(kFALSE);
04643 fEditionUpdatePreview->SetEnabled(kFALSE);
04644 }
04645 }
04646 }
04647
04648
04649 void TStyleManager::CloseWindow()
04650 {
04651
04652
04653 Hide();
04654 }
04655
04656
04657 void TStyleManager::ModFillColor()
04658 {
04659
04660
04661 fCurSelStyle->SetFillColor(TColor::GetColor(fFillColor->GetColor()));
04662 DoEditor();
04663 }
04664
04665
04666 void TStyleManager::ModFillStyle()
04667 {
04668
04669
04670 fCurSelStyle->SetFillStyle(fFillStyle->GetPattern());
04671 DoEditor();
04672 }
04673
04674
04675 void TStyleManager::ModHatchesLineWidth()
04676 {
04677
04678
04679 fCurSelStyle->SetHatchesLineWidth(fHatchesLineWidth->GetSelected());
04680 DoEditor();
04681 }
04682
04683
04684 void TStyleManager::ModHatchesSpacing()
04685 {
04686
04687
04688 fCurSelStyle->SetHatchesSpacing(fHatchesSpacing->GetNumber());
04689 DoEditor();
04690 }
04691
04692
04693 void TStyleManager::ModMarkerColor()
04694 {
04695
04696
04697 fCurSelStyle->SetMarkerColor(TColor::GetColor(fMarkerColor->GetColor()));
04698 DoEditor();
04699 }
04700
04701
04702 void TStyleManager::ModMarkerStyle()
04703 {
04704
04705
04706 fCurSelStyle->SetMarkerStyle(fMarkerStyle->GetMarkerStyle());
04707 DoEditor();
04708 }
04709
04710
04711 void TStyleManager::ModMarkerSize()
04712 {
04713
04714
04715 fCurSelStyle->SetMarkerSize(fMarkerSize->GetSelected() * 0.2);
04716 DoEditor();
04717 }
04718
04719
04720 void TStyleManager::ModScreenFactor()
04721 {
04722
04723
04724 fCurSelStyle->SetScreenFactor(fScreenFactor->GetNumber());
04725 DoEditor();
04726 }
04727
04728
04729 void TStyleManager::ModLineColor()
04730 {
04731
04732
04733 fCurSelStyle->SetLineColor(TColor::GetColor(fLineColor->GetColor()));
04734 DoEditor();
04735 }
04736
04737
04738 void TStyleManager::ModLineWidth()
04739 {
04740
04741
04742 fCurSelStyle->SetLineWidth(fLineWidth->GetSelected());
04743 DoEditor();
04744 }
04745
04746
04747 void TStyleManager::ModLineStyle()
04748 {
04749
04750
04751 fCurSelStyle->SetLineStyle(fLineStyle->GetSelected());
04752 DoEditor();
04753 }
04754
04755
04756 void TStyleManager::ModLineStyleEdit()
04757 {
04758
04759
04760
04761 }
04762
04763
04764 void TStyleManager::ModTextColor()
04765 {
04766
04767
04768 fCurSelStyle->SetTextColor(TColor::GetColor(fTextColor->GetColor()));
04769 DoEditor();
04770 }
04771
04772
04773 void TStyleManager::ModTextSize()
04774 {
04775
04776
04777 fCurSelStyle->SetTextSize(fTextSize->GetNumber());
04778 DoEditor();
04779 }
04780
04781
04782 void TStyleManager::ModTextSizeInPixels(Bool_t b)
04783 {
04784
04785
04786 Int_t tmp = fCurSelStyle->GetTextFont() / 10;
04787 Int_t mod = fCurSelStyle->GetTextFont() % 10;
04788 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
04789 if (b) {
04790 fCurSelStyle->SetTextFont(tmp * 10 + 3);
04791 fTextSize->SetFormat(TGNumberFormat::kNESInteger,
04792 TGNumberFormat::kNEAPositive);
04793 fTextSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
04794 if (mod == 2)
04795 fCurSelStyle->SetTextSize(fCurSelStyle->GetTextSize() * h);
04796 } else {
04797 fCurSelStyle->SetTextFont(tmp * 10 + 2);
04798 fTextSize->SetFormat(TGNumberFormat::kNESRealThree,
04799 TGNumberFormat::kNEAPositive);
04800 fTextSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
04801 if (mod == 3)
04802 fCurSelStyle->SetTextSize(fCurSelStyle->GetTextSize() / h);
04803 }
04804 fTextSize->SetNumber(fCurSelStyle->GetTextSize());
04805 DoEditor();
04806 }
04807
04808
04809 void TStyleManager::ModTextFont()
04810 {
04811
04812
04813 Int_t tmp = fCurSelStyle->GetTextFont() % 10;
04814 fCurSelStyle->SetTextFont(fTextFont->GetSelected() * 10 + tmp);
04815 DoEditor();
04816 }
04817
04818
04819 void TStyleManager::ModTextAlign()
04820 {
04821
04822
04823 fCurSelStyle->SetTextAlign(fTextAlign->GetSelected());
04824 DoEditor();
04825 }
04826
04827
04828 void TStyleManager::ModTextAngle()
04829 {
04830
04831
04832 fCurSelStyle->SetTextAngle(fTextAngle->GetNumber());
04833 DoEditor();
04834 }
04835
04836
04837 void TStyleManager::ModCanvasColor()
04838 {
04839
04840
04841 fCurSelStyle->SetCanvasColor(TColor::GetColor(fCanvasColor->GetColor()));
04842 DoEditor();
04843 }
04844
04845
04846 void TStyleManager::ModCanvasDefX()
04847 {
04848
04849
04850 fCurSelStyle->SetCanvasDefX(fCanvasDefX->GetIntNumber());
04851 DoEditor();
04852 }
04853
04854
04855 void TStyleManager::ModCanvasDefY()
04856 {
04857
04858
04859 fCurSelStyle->SetCanvasDefY(fCanvasDefY->GetIntNumber());
04860 DoEditor();
04861 }
04862
04863
04864 void TStyleManager::ModCanvasDefW()
04865 {
04866
04867
04868 fCurSelStyle->SetCanvasDefW(fCanvasDefW->GetIntNumber());
04869 DoEditor();
04870 }
04871
04872
04873 void TStyleManager::ModCanvasDefH()
04874 {
04875
04876
04877 fCurSelStyle->SetCanvasDefH(fCanvasDefH->GetIntNumber());
04878 DoEditor();
04879 }
04880
04881
04882 void TStyleManager::ModCanvasBorderMode()
04883 {
04884
04885
04886 Int_t i = kCanvasBorderModeSunken;
04887 while (!fCanvasBorderMode->Find(i)->IsDown())
04888 i++;
04889 fCurSelStyle->SetCanvasBorderMode(i - 1 - kCanvasBorderModeSunken);
04890 DoEditor();
04891 }
04892
04893
04894 void TStyleManager::ModCanvasBorderSize()
04895 {
04896
04897
04898 fCurSelStyle->SetCanvasBorderSize(fCanvasBorderSize->GetSelected());
04899 DoEditor();
04900 }
04901
04902
04903 void TStyleManager::ModOptDateBool()
04904 {
04905
04906
04907 if (fOptDateBool->IsDown())
04908 fCurSelStyle->SetOptDate(4);
04909 else
04910 fCurSelStyle->SetOptDate(0);
04911 DisconnectEditor(fCurTabNum);
04912 UpdateEditor(fCurTabNum);
04913 ConnectEditor(fCurTabNum);
04914 DoEditor();
04915 }
04916
04917
04918 void TStyleManager::ModAttDateTextColor()
04919 {
04920
04921
04922
04923 fCurSelStyle->GetAttDate()->SetTextColor(TColor::GetColor(fAttDateTextColor->GetColor()));
04924 DoEditor();
04925 }
04926
04927
04928 void TStyleManager::ModAttDateTextSize()
04929 {
04930
04931
04932 fCurSelStyle->GetAttDate()->SetTextSize(fAttDateTextSize->GetNumber());
04933 DoEditor();
04934 }
04935
04936
04937 void TStyleManager::ModAttDateTextSizeInPixels(Bool_t b)
04938 {
04939
04940
04941 Int_t tmp = fCurSelStyle->GetAttDate()->GetTextFont() / 10;
04942 Int_t mod = fCurSelStyle->GetAttDate()->GetTextFont() % 10;
04943 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
04944
04945 if (b) {
04946 fCurSelStyle->GetAttDate()->SetTextFont(tmp * 10 + 3);
04947 fAttDateTextSize->SetFormat(TGNumberFormat::kNESInteger,
04948 TGNumberFormat::kNEAPositive);
04949 fAttDateTextSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
04950 if (mod == 2)
04951 fCurSelStyle->GetAttDate()->SetTextSize(fCurSelStyle->GetAttDate()->GetTextSize() * h);
04952 } else {
04953 fCurSelStyle->GetAttDate()->SetTextFont(tmp * 10 + 2);
04954 fAttDateTextSize->SetFormat(TGNumberFormat::kNESRealThree,
04955 TGNumberFormat::kNEAPositive);
04956 fAttDateTextSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
04957 if (mod == 3)
04958 fCurSelStyle->GetAttDate()->SetTextSize(fCurSelStyle->GetAttDate()->GetTextSize() / h);
04959 }
04960 fAttDateTextSize->SetNumber(fCurSelStyle->GetAttDate()->GetTextSize());
04961 DoEditor();
04962 }
04963
04964
04965 void TStyleManager::ModOptDateFormat()
04966 {
04967
04968
04969 Int_t formatPrec = fCurSelStyle->GetOptDate() % 10;
04970 fCurSelStyle->SetOptDate((fOptDateFormat->GetSelected() - 1) * 10
04971 + formatPrec);
04972 DoEditor();
04973 }
04974
04975
04976 void TStyleManager::ModAttDateTextFont()
04977 {
04978
04979
04980 Int_t fontPrec = fCurSelStyle->GetAttDate()->GetTextFont() % 10;
04981 fCurSelStyle->GetAttDate()->SetTextFont(fAttDateTextFont->GetSelected() * 10
04982 + fontPrec);
04983 DoEditor();
04984 }
04985
04986
04987 void TStyleManager::ModAttDateTextAlign()
04988 {
04989
04990
04991 fCurSelStyle->GetAttDate()->SetTextAlign(fAttDateTextAlign->GetSelected());
04992 DoEditor();
04993 }
04994
04995
04996 void TStyleManager::ModAttDateTextAngle()
04997 {
04998
04999
05000 fCurSelStyle->GetAttDate()->SetTextAngle(fAttDateTextAngle->GetNumber());
05001 DoEditor();
05002 }
05003
05004
05005 void TStyleManager::ModDateX()
05006 {
05007
05008
05009 fCurSelStyle->SetDateX(fDateX->GetIntNumber() * 0.01);
05010 DoEditor();
05011 }
05012
05013
05014 void TStyleManager::ModDateY()
05015 {
05016
05017
05018 fCurSelStyle->SetDateY(fDateY->GetIntNumber() * 0.01);
05019 DoEditor();
05020 }
05021
05022
05023 void TStyleManager::ModPadLeftMargin()
05024 {
05025
05026
05027 fCurSelStyle->SetPadLeftMargin(fPadLeftMargin->GetIntNumber() * 0.01);
05028 DoEditor();
05029 }
05030
05031
05032 void TStyleManager::ModPadRightMargin()
05033 {
05034
05035
05036 fCurSelStyle->SetPadRightMargin(fPadRightMargin->GetIntNumber() * 0.01);
05037 DoEditor();
05038 }
05039
05040
05041 void TStyleManager::ModPadTopMargin()
05042 {
05043
05044
05045 fCurSelStyle->SetPadTopMargin(fPadTopMargin->GetIntNumber() * 0.01);
05046 DoEditor();
05047 }
05048
05049
05050 void TStyleManager::ModPadBottomMargin()
05051 {
05052
05053
05054 fCurSelStyle->SetPadBottomMargin(fPadBottomMargin->GetIntNumber() * 0.01);
05055 DoEditor();
05056 }
05057
05058
05059 void TStyleManager::ModPadBorderMode()
05060 {
05061
05062
05063 Int_t i = kPadBorderModeSunken;
05064 while (!fPadBorderMode->Find(i)->IsDown())
05065 i++;
05066 fCurSelStyle->SetPadBorderMode(i - 1 - kPadBorderModeSunken);
05067 DoEditor();
05068 }
05069
05070
05071 void TStyleManager::ModPadBorderSize()
05072 {
05073
05074
05075 fCurSelStyle->SetPadBorderSize(fPadBorderSize->GetSelected());
05076 DoEditor();
05077 }
05078
05079
05080 void TStyleManager::ModPadColor()
05081 {
05082
05083
05084 fCurSelStyle->SetPadColor(TColor::GetColor(fPadColor->GetColor()));
05085 DoEditor();
05086 }
05087
05088
05089 void TStyleManager::ModPadTickX()
05090 {
05091
05092
05093 fCurSelStyle->SetPadTickX(fPadTickX->IsDown());
05094 DoEditor();
05095 }
05096
05097
05098 void TStyleManager::ModPadTickY()
05099 {
05100
05101
05102 fCurSelStyle->SetPadTickY(fPadTickY->IsDown());
05103 DoEditor();
05104 }
05105
05106
05107 void TStyleManager::ModPadGridX()
05108 {
05109
05110
05111 fCurSelStyle->SetPadGridX(fPadGridX->IsDown());
05112 DoEditor();
05113 }
05114
05115
05116 void TStyleManager::ModPadGridY()
05117 {
05118
05119
05120 fCurSelStyle->SetPadGridY(fPadGridY->IsDown());
05121 DoEditor();
05122 }
05123
05124
05125 void TStyleManager::ModGridColor()
05126 {
05127
05128
05129 fCurSelStyle->SetGridColor(TColor::GetColor(fGridColor->GetColor()));
05130 DoEditor();
05131 }
05132
05133
05134 void TStyleManager::ModGridWidth()
05135 {
05136
05137
05138 fCurSelStyle->SetGridWidth(fGridWidth->GetSelected());
05139 DoEditor();
05140 }
05141
05142
05143 void TStyleManager::ModGridStyle()
05144 {
05145
05146
05147 fCurSelStyle->SetGridStyle(fGridStyle->GetSelected());
05148 DoEditor();
05149 }
05150
05151
05152 void TStyleManager::ModHistFillColor()
05153 {
05154
05155
05156 fCurSelStyle->SetHistFillColor(TColor::GetColor(fHistFillColor->GetColor()));
05157 DoEditor();
05158 }
05159
05160
05161 void TStyleManager::ModHistFillStyle()
05162 {
05163
05164
05165 fCurSelStyle->SetHistFillStyle(fHistFillStyle->GetPattern());
05166 DoEditor();
05167 }
05168
05169
05170 void TStyleManager::ModHistLineColor()
05171 {
05172
05173
05174 fCurSelStyle->SetHistLineColor(TColor::GetColor(fHistLineColor->GetColor()));
05175 DoEditor();
05176 }
05177
05178
05179 void TStyleManager::ModHistLineWidth()
05180 {
05181
05182
05183 fCurSelStyle->SetHistLineWidth(fHistLineWidth->GetSelected());
05184 DoEditor();
05185 }
05186
05187
05188 void TStyleManager::ModHistLineStyle()
05189 {
05190
05191
05192 fCurSelStyle->SetHistLineStyle(fHistLineStyle->GetSelected());
05193 DoEditor();
05194 }
05195
05196
05197 void TStyleManager::ModBarWidth()
05198 {
05199
05200
05201 fCurSelStyle->SetBarWidth(fBarWidth->GetNumber());
05202 DoEditor();
05203 }
05204
05205
05206 void TStyleManager::ModBarOffset()
05207 {
05208
05209
05210 fCurSelStyle->SetBarOffset(fBarOffset->GetNumber());
05211 DoEditor();
05212 }
05213
05214
05215 void TStyleManager::ModHistMinimumZero()
05216 {
05217
05218
05219
05220 fCurSelStyle->SetHistMinimumZero(fHistMinimumZero->IsDown());
05221 DoEditor();
05222 }
05223
05224
05225 void TStyleManager::ModPaintTextFormat()
05226 {
05227
05228
05229 fCurSelStyle->SetPaintTextFormat(fPaintTextFormat->GetText());
05230 DoEditor();
05231 }
05232
05233
05234 void TStyleManager::ModNumberContours()
05235 {
05236
05237
05238 fCurSelStyle->SetNumberContours(fNumberContours->GetIntNumber());
05239 DoEditor();
05240 }
05241
05242
05243 void TStyleManager::ModLegoInnerR()
05244 {
05245
05246
05247 fCurSelStyle->SetLegoInnerR(fLegoInnerR->GetIntNumber() *0.01);
05248 DoEditor();
05249 }
05250
05251
05252 void TStyleManager::ModFrameFillColor()
05253 {
05254
05255
05256 fCurSelStyle->SetFrameFillColor(TColor::GetColor(fFrameFillColor->GetColor()));
05257 DoEditor();
05258 }
05259
05260
05261 void TStyleManager::ModFrameFillStyle()
05262 {
05263
05264
05265 fCurSelStyle->SetFrameFillStyle(fFrameFillStyle->GetPattern());
05266 DoEditor();
05267 }
05268
05269
05270 void TStyleManager::ModFrameLineColor()
05271 {
05272
05273
05274 fCurSelStyle->SetFrameLineColor(TColor::GetColor(fFrameLineColor->GetColor()));
05275 DoEditor();
05276 }
05277
05278
05279 void TStyleManager::ModFrameLineWidth()
05280 {
05281
05282
05283 fCurSelStyle->SetFrameLineWidth(fFrameLineWidth->GetSelected());
05284 DoEditor();
05285 }
05286
05287
05288 void TStyleManager::ModFrameLineStyle()
05289 {
05290
05291
05292 fCurSelStyle->SetFrameLineStyle(fFrameLineStyle->GetSelected());
05293 DoEditor();
05294 }
05295
05296
05297 void TStyleManager::ModPaletteEdit()
05298 {
05299
05300
05301
05302 }
05303
05304
05305 void TStyleManager::ModFrameBorderMode()
05306 {
05307
05308
05309 Int_t i = kFrameBorderModeSunken;
05310 while (!fFrameBorderMode->Find(i)->IsDown())
05311 i++;
05312 fCurSelStyle->SetFrameBorderMode(i - 1 - kFrameBorderModeSunken);
05313 DoEditor();
05314 }
05315
05316
05317 void TStyleManager::ModFrameBorderSize()
05318 {
05319
05320
05321 fCurSelStyle->SetFrameBorderSize(fFrameBorderSize->GetSelected());
05322 DoEditor();
05323 }
05324
05325
05326 void TStyleManager::ModFuncColor()
05327 {
05328
05329
05330 fCurSelStyle->SetFuncColor(TColor::GetColor(fFuncColor->GetColor()));
05331 DoEditor();
05332 }
05333
05334
05335 void TStyleManager::ModFuncWidth()
05336 {
05337
05338
05339 fCurSelStyle->SetFuncWidth(fFuncWidth->GetSelected());
05340 DoEditor();
05341 }
05342
05343
05344 void TStyleManager::ModFuncStyle()
05345 {
05346
05347
05348 fCurSelStyle->SetFuncStyle(fFuncStyle->GetSelected());
05349 DoEditor();
05350 }
05351
05352
05353 void TStyleManager::ModDrawBorder()
05354 {
05355
05356
05357 fCurSelStyle->SetDrawBorder(fDrawBorder->IsDown());
05358 DoEditor();
05359 }
05360
05361
05362 void TStyleManager::ModEndErrorSize()
05363 {
05364
05365
05366 fCurSelStyle->SetEndErrorSize(fEndErrorSize->GetNumber());
05367 DoEditor();
05368 }
05369
05370
05371 void TStyleManager::ModErrorX()
05372 {
05373
05374
05375 fCurSelStyle->SetErrorX(fErrorX->GetIntNumber() * 0.001);
05376 DoEditor();
05377 }
05378
05379
05380 void TStyleManager::ModTimeOffset()
05381 {
05382
05383
05384 Double_t offset = 0;
05385 Int_t year = ((Int_t) fTimeOffsetDate->GetNumber())/10000;
05386 Int_t month = (((Int_t) fTimeOffsetDate->GetNumber())/100) % 100;
05387 Int_t day = ((Int_t) fTimeOffsetDate->GetNumber()) % 100;
05388
05389 while (day > 1) {
05390 day--;
05391 offset += 3600 * 24;
05392 }
05393
05394 Int_t oneMonthInSecs;
05395 while (month > 1) {
05396 month--;
05397 switch (month) {
05398 case 2:
05399 if (year % 4) oneMonthInSecs = 3600 * 24 * 28;
05400 else oneMonthInSecs = 3600 * 24 * 29;
05401 break;
05402 case 1: case 3: case 5: case 7: case 8: case 10: case 12:
05403 oneMonthInSecs = 3600 * 24 * 31;
05404 break;
05405 default:
05406 oneMonthInSecs = 3600 * 24 * 30;
05407 }
05408 offset += oneMonthInSecs;
05409 }
05410
05411 Int_t oneYearInSecs;
05412 while (year < 1995) {
05413 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
05414 else oneYearInSecs = 3600 * 24 * 366;
05415 offset -= oneYearInSecs;
05416 year++;
05417 }
05418 while (year > 1995) {
05419 year--;
05420 if (year % 4) oneYearInSecs = 3600 * 24 * 365;
05421 else oneYearInSecs = 3600 * 24 * 366;
05422 offset += oneYearInSecs;
05423 }
05424
05425 offset += 788918400 + fTimeOffsetTime->GetNumber();
05426
05427 fCurSelStyle->SetTimeOffset(offset);
05428 DoEditor();
05429 }
05430
05431
05432 void TStyleManager::ModStripDecimals()
05433 {
05434
05435
05436 fCurSelStyle->SetStripDecimals(!fStripDecimals->IsDown());
05437 DoEditor();
05438 }
05439
05440
05441 void TStyleManager::ModApplyOnXYZ()
05442 {
05443
05444
05445
05446
05447 switch (fCurTabAxisNum) {
05448 case 0:
05449 fCurSelStyle->SetAxisColor(fCurSelStyle->GetAxisColor("x"), "yz");
05450 fCurSelStyle->SetTickLength(fCurSelStyle->GetTickLength("x"), "yz");
05451 fCurSelStyle->SetTitleColor(fCurSelStyle->GetTitleColor("x"), "yz");
05452 fCurSelStyle->SetTitleFont(fCurSelStyle->GetTitleFont("x"), "yz");
05453 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("x"), "yz");
05454 fCurSelStyle->SetTitleOffset(fCurSelStyle->GetTitleOffset("x"), "yz");
05455 fCurSelStyle->SetNdivisions(fCurSelStyle->GetNdivisions("x"), "yz");
05456 fCurSelStyle->SetLabelColor(fCurSelStyle->GetLabelColor("x"), "yz");
05457 fCurSelStyle->SetLabelFont(fCurSelStyle->GetLabelFont("x"), "yz");
05458 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("x"), "yz");
05459 fCurSelStyle->SetLabelOffset(fCurSelStyle->GetLabelOffset("x"), "yz");
05460 break;
05461 case 1:
05462 fCurSelStyle->SetAxisColor(fCurSelStyle->GetAxisColor("y"), "xz");
05463 fCurSelStyle->SetTickLength(fCurSelStyle->GetTickLength("y"), "xz");
05464 fCurSelStyle->SetTitleColor(fCurSelStyle->GetTitleColor("y"), "xz");
05465 fCurSelStyle->SetTitleFont(fCurSelStyle->GetTitleFont("y"), "xz");
05466 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("y"), "xz");
05467 fCurSelStyle->SetTitleOffset(fCurSelStyle->GetTitleOffset("y"), "xz");
05468 fCurSelStyle->SetNdivisions(fCurSelStyle->GetNdivisions("y"), "xz");
05469 fCurSelStyle->SetLabelColor(fCurSelStyle->GetLabelColor("y"), "xz");
05470 fCurSelStyle->SetLabelFont(fCurSelStyle->GetLabelFont("y"), "xz");
05471 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("y"), "xz");
05472 fCurSelStyle->SetLabelOffset(fCurSelStyle->GetLabelOffset("y"), "xz");
05473 break;
05474
05475 case 2:
05476 fCurSelStyle->SetAxisColor(fCurSelStyle->GetAxisColor("z"), "xy");
05477 fCurSelStyle->SetTickLength(fCurSelStyle->GetTickLength("z"), "xy");
05478 fCurSelStyle->SetTitleColor(fCurSelStyle->GetTitleColor("z"), "xy");
05479 fCurSelStyle->SetTitleFont(fCurSelStyle->GetTitleFont("z"), "xy");
05480 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("z"), "xy");
05481 fCurSelStyle->SetTitleOffset(fCurSelStyle->GetTitleOffset("z"), "xy");
05482 fCurSelStyle->SetNdivisions(fCurSelStyle->GetNdivisions("z"), "xy");
05483 fCurSelStyle->SetLabelColor(fCurSelStyle->GetLabelColor("z"), "xy");
05484 fCurSelStyle->SetLabelFont(fCurSelStyle->GetLabelFont("z"), "xy");
05485 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("z"), "xy");
05486 fCurSelStyle->SetLabelOffset(fCurSelStyle->GetLabelOffset("z"), "xy");
05487 break;
05488 }
05489
05490 DisconnectEditor(fCurTabNum);
05491 UpdateEditor(fCurTabNum);
05492 ConnectEditor(fCurTabNum);
05493 DoEditor();
05494 }
05495
05496
05497 void TStyleManager::ModXTitleSize()
05498 {
05499
05500
05501 fCurSelStyle->SetTitleSize(fXTitleSize->GetNumber(), "X");
05502 DoEditor();
05503 }
05504
05505
05506 void TStyleManager::ModXTitleSizeInPixels(Bool_t b)
05507 {
05508
05509
05510 Int_t tmp = fCurSelStyle->GetTitleFont("X") / 10;
05511 Int_t mod = fCurSelStyle->GetTitleFont("X") % 10;
05512 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05513 if (b) {
05514 fCurSelStyle->SetTitleFont(tmp * 10 + 3, "X");
05515 fXTitleSize->SetFormat(TGNumberFormat::kNESInteger,
05516 TGNumberFormat::kNEAPositive);
05517 fXTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05518 if (mod == 2)
05519 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("X") * h, "X");
05520 } else {
05521 fCurSelStyle->SetTitleFont(tmp * 10 + 2, "X");
05522 fXTitleSize->SetFormat(TGNumberFormat::kNESRealThree,
05523 TGNumberFormat::kNEAPositive);
05524 fXTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05525 if (mod == 3)
05526 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("X") / h, "X");
05527 }
05528 fXTitleSize->SetNumber(fCurSelStyle->GetTitleSize("X"));
05529 DoEditor();
05530 }
05531
05532
05533 void TStyleManager::ModXTitleColor()
05534 {
05535
05536
05537 fCurSelStyle->SetTitleColor(TColor::GetColor(fXTitleColor->GetColor()), "X");
05538 DoEditor();
05539 }
05540
05541
05542 void TStyleManager::ModXTitleOffset()
05543 {
05544
05545
05546 fCurSelStyle->SetTitleOffset(fXTitleOffset->GetNumber(), "X");
05547 DoEditor();
05548 }
05549
05550
05551 void TStyleManager::ModXTitleFont()
05552 {
05553
05554
05555 Int_t fontPrec = fCurSelStyle->GetTitleFont("X") % 10;
05556 fCurSelStyle->SetTitleFont(fXTitleFont->GetSelected() * 10 + fontPrec, "X");
05557 DoEditor();
05558 }
05559
05560
05561 void TStyleManager::ModXLabelSize()
05562 {
05563
05564
05565 fCurSelStyle->SetLabelSize(fXLabelSize->GetNumber(), "X");
05566 DoEditor();
05567 }
05568
05569
05570 void TStyleManager::ModXLabelSizeInPixels(Bool_t b)
05571 {
05572
05573
05574 Int_t tmp = fCurSelStyle->GetLabelFont("X") / 10;
05575 Int_t mod = fCurSelStyle->GetLabelFont("X") % 10;
05576 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05577 if (b) {
05578 fCurSelStyle->SetLabelFont(tmp * 10 + 3, "X");
05579 fXLabelSize->SetFormat(TGNumberFormat::kNESInteger,
05580 TGNumberFormat::kNEAPositive);
05581 fXLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05582 if (mod == 2)
05583 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("X") * h, "X");
05584 } else {
05585 fCurSelStyle->SetLabelFont(tmp * 10 + 2, "X");
05586 fXLabelSize->SetFormat(TGNumberFormat::kNESRealThree,
05587 TGNumberFormat::kNEAPositive);
05588 fXLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05589 if (mod == 3)
05590 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("X") / h, "X");
05591 }
05592 fXLabelSize->SetNumber(fCurSelStyle->GetLabelSize("X"));
05593 DoEditor();
05594 }
05595
05596
05597 void TStyleManager::ModXLabelColor()
05598 {
05599
05600
05601 fCurSelStyle->SetLabelColor(TColor::GetColor(fXLabelColor->GetColor()), "X");
05602 DoEditor();
05603 }
05604
05605
05606 void TStyleManager::ModXLabelOffset()
05607 {
05608
05609
05610 fCurSelStyle->SetLabelOffset(fXLabelOffset->GetNumber(), "X");
05611 DoEditor();
05612 }
05613
05614
05615 void TStyleManager::ModXLabelFont()
05616 {
05617
05618
05619 Int_t fontPrec = fCurSelStyle->GetLabelFont("X") % 10;
05620 fCurSelStyle->SetLabelFont(fXLabelFont->GetSelected() * 10 + fontPrec, "X");
05621 DoEditor();
05622 }
05623
05624
05625 void TStyleManager::ModXAxisColor()
05626 {
05627
05628
05629 fCurSelStyle->SetAxisColor(TColor::GetColor(fXAxisColor->GetColor()), "X");
05630 DoEditor();
05631 }
05632
05633
05634 void TStyleManager::ModXTickLength()
05635 {
05636
05637
05638 fCurSelStyle->SetTickLength(fXTickLength->GetNumber(), "X");
05639 DoEditor();
05640 }
05641
05642
05643 void TStyleManager::ModOptLogx()
05644 {
05645
05646
05647
05648 fCurSelStyle->SetOptLogx(fOptLogx->IsDown());
05649 DoEditor();
05650 }
05651
05652
05653 void TStyleManager::ModXNdivisions()
05654 {
05655
05656
05657
05658 Int_t sgn = -1;
05659 if (fXNdivisionsOptimize->IsDown()) sgn = 1;
05660 fCurSelStyle->SetNdivisions(sgn * (fXNdivMain->GetIntNumber()
05661 + 100 * fXNdivSub->GetIntNumber()
05662 + 10000 * fXNdivSubSub->GetIntNumber()), "X");
05663 DoEditor();
05664 }
05665
05666
05667 void TStyleManager::ModYTitleSize()
05668 {
05669
05670
05671 fCurSelStyle->SetTitleSize(fYTitleSize->GetNumber(), "Y");
05672 DoEditor();
05673 }
05674
05675
05676 void TStyleManager::ModYTitleSizeInPixels(Bool_t b)
05677 {
05678
05679
05680 Int_t tmp = fCurSelStyle->GetTitleFont("Y") / 10;
05681 Int_t mod = fCurSelStyle->GetTitleFont("Y") % 10;
05682 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05683 if (b) {
05684 fCurSelStyle->SetTitleFont(tmp * 10 + 3, "Y");
05685 fYTitleSize->SetFormat(TGNumberFormat::kNESInteger,
05686 TGNumberFormat::kNEAPositive);
05687 fYTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05688 if (mod == 2)
05689 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("Y") * h, "Y");
05690 } else {
05691 fCurSelStyle->SetTitleFont(tmp * 10 + 2, "Y");
05692 fYTitleSize->SetFormat(TGNumberFormat::kNESRealThree,
05693 TGNumberFormat::kNEAPositive);
05694 fYTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05695 if (mod == 3)
05696 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("Y") / h, "Y");
05697 }
05698 fYTitleSize->SetNumber(fCurSelStyle->GetTitleSize("Y"));
05699 DoEditor();
05700 }
05701
05702
05703 void TStyleManager::ModYTitleColor()
05704 {
05705
05706
05707 fCurSelStyle->SetTitleColor(TColor::GetColor(fYTitleColor->GetColor()), "Y");
05708 DoEditor();
05709 }
05710
05711
05712 void TStyleManager::ModYTitleOffset()
05713 {
05714
05715
05716 fCurSelStyle->SetTitleOffset(fYTitleOffset->GetNumber(), "Y");
05717 DoEditor();
05718 }
05719
05720
05721 void TStyleManager::ModYTitleFont()
05722 {
05723
05724
05725 Int_t fontPrec = fCurSelStyle->GetTitleFont("Y") % 10;
05726 fCurSelStyle->SetTitleFont(fYTitleFont->GetSelected() * 10 + fontPrec, "Y");
05727 DoEditor();
05728 }
05729
05730
05731 void TStyleManager::ModYLabelSize()
05732 {
05733
05734
05735 fCurSelStyle->SetLabelSize(fYLabelSize->GetNumber(), "Y");
05736 DoEditor();
05737 }
05738
05739
05740 void TStyleManager::ModYLabelSizeInPixels(Bool_t b)
05741 {
05742
05743
05744 Int_t tmp = fCurSelStyle->GetLabelFont("Y") / 10;
05745 Int_t mod = fCurSelStyle->GetLabelFont("Y") % 10;
05746 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05747 if (b) {
05748 fCurSelStyle->SetLabelFont(tmp * 10 + 3, "Y");
05749 fYLabelSize->SetFormat(TGNumberFormat::kNESInteger,
05750 TGNumberFormat::kNEAPositive);
05751 fYLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05752 if (mod == 2)
05753 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("Y") * h, "Y");
05754 } else {
05755 fCurSelStyle->SetLabelFont(tmp * 10 + 2, "Y");
05756 fYLabelSize->SetFormat(TGNumberFormat::kNESRealThree,
05757 TGNumberFormat::kNEAPositive);
05758 fYLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05759 if (mod == 3)
05760 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("Y") / h, "Y");
05761 }
05762 fYLabelSize->SetNumber(fCurSelStyle->GetLabelSize("Y"));
05763 DoEditor();
05764 }
05765
05766
05767 void TStyleManager::ModYLabelColor()
05768 {
05769
05770
05771 fCurSelStyle->SetLabelColor(TColor::GetColor(fYLabelColor->GetColor()), "Y");
05772 DoEditor();
05773 }
05774
05775
05776 void TStyleManager::ModYLabelOffset()
05777 {
05778
05779
05780 fCurSelStyle->SetLabelOffset(fYLabelOffset->GetNumber(), "Y");
05781 DoEditor();
05782 }
05783
05784
05785 void TStyleManager::ModYLabelFont()
05786 {
05787
05788
05789 Int_t fontPrec = fCurSelStyle->GetLabelFont("Y") % 10;
05790 fCurSelStyle->SetLabelFont(fYLabelFont->GetSelected() * 10 + fontPrec, "Y");
05791 DoEditor();
05792 }
05793
05794
05795 void TStyleManager::ModYAxisColor()
05796 {
05797
05798
05799 fCurSelStyle->SetAxisColor(TColor::GetColor(fYAxisColor->GetColor()), "Y");
05800 DoEditor();
05801 }
05802
05803
05804 void TStyleManager::ModYTickLength()
05805 {
05806
05807
05808 fCurSelStyle->SetTickLength(fYTickLength->GetNumber(), "Y");
05809 DoEditor();
05810 }
05811
05812
05813 void TStyleManager::ModOptLogy()
05814 {
05815
05816
05817 fCurSelStyle->SetOptLogy(fOptLogy->IsDown());
05818 DoEditor();
05819 }
05820
05821
05822 void TStyleManager::ModYNdivisions()
05823 {
05824
05825
05826
05827 Int_t sgn = -1;
05828 if (fYNdivisionsOptimize->IsDown()) sgn = 1;
05829 fCurSelStyle->SetNdivisions(sgn * (fYNdivMain->GetIntNumber()
05830 + 100 * fYNdivSub->GetIntNumber()
05831 + 10000 * fYNdivSubSub->GetIntNumber()), "Y");
05832 DoEditor();
05833 }
05834
05835
05836 void TStyleManager::ModZTitleSize()
05837 {
05838
05839
05840 fCurSelStyle->SetTitleSize(fZTitleSize->GetNumber(), "Z");
05841 DoEditor();
05842 }
05843
05844
05845 void TStyleManager::ModZTitleSizeInPixels(Bool_t b)
05846 {
05847
05848
05849 Int_t tmp = fCurSelStyle->GetTitleFont("Z") / 10;
05850 Int_t mod = fCurSelStyle->GetTitleFont("Z") % 10;
05851 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05852 if (b) {
05853 fCurSelStyle->SetTitleFont(tmp * 10 + 3, "Z");
05854 fZTitleSize->SetFormat(TGNumberFormat::kNESInteger,
05855 TGNumberFormat::kNEAPositive);
05856 fZTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05857 if (mod == 2)
05858 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("Z") * h, "Z");
05859 } else {
05860 fCurSelStyle->SetTitleFont(tmp * 10 + 2, "Z");
05861 fZTitleSize->SetFormat(TGNumberFormat::kNESRealThree,
05862 TGNumberFormat::kNEAPositive);
05863 fZTitleSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05864 if (mod == 3)
05865 fCurSelStyle->SetTitleSize(fCurSelStyle->GetTitleSize("Z") / h, "Z");
05866 }
05867 fZTitleSize->SetNumber(fCurSelStyle->GetTitleSize("Z"));
05868 DoEditor();
05869 }
05870
05871
05872 void TStyleManager::ModZTitleColor()
05873 {
05874
05875
05876 fCurSelStyle->SetTitleColor(TColor::GetColor(fZTitleColor->GetColor()), "Z");
05877 DoEditor();
05878 }
05879
05880
05881 void TStyleManager::ModZTitleOffset()
05882 {
05883
05884
05885 fCurSelStyle->SetTitleOffset(fZTitleOffset->GetNumber(), "Z");
05886 DoEditor();
05887 }
05888
05889
05890 void TStyleManager::ModZTitleFont()
05891 {
05892
05893
05894 Int_t fontPrec = fCurSelStyle->GetTitleFont("Z") % 10;
05895 fCurSelStyle->SetTitleFont(fZTitleFont->GetSelected() * 10 + fontPrec, "Z");
05896 DoEditor();
05897 }
05898
05899
05900 void TStyleManager::ModZLabelSize()
05901 {
05902
05903
05904 fCurSelStyle->SetLabelSize(fZLabelSize->GetNumber(), "Z");
05905 DoEditor();
05906 }
05907
05908
05909 void TStyleManager::ModZLabelSizeInPixels(Bool_t b)
05910 {
05911
05912
05913 Int_t tmp = fCurSelStyle->GetLabelFont("Z") / 10;
05914 Int_t mod = fCurSelStyle->GetLabelFont("Z") % 10;
05915 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
05916 if (b) {
05917 fCurSelStyle->SetLabelFont(tmp * 10 + 3, "Z");
05918 fZLabelSize->SetFormat(TGNumberFormat::kNESInteger,
05919 TGNumberFormat::kNEAPositive);
05920 fZLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
05921 if (mod == 2)
05922 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("Z") * h, "Z");
05923 } else {
05924 fCurSelStyle->SetLabelFont(tmp * 10 + 2, "Z");
05925 fZLabelSize->SetFormat(TGNumberFormat::kNESRealThree,
05926 TGNumberFormat::kNEAPositive);
05927 fZLabelSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
05928 if (mod == 3)
05929 fCurSelStyle->SetLabelSize(fCurSelStyle->GetLabelSize("Z") / h, "Z");
05930 }
05931 fZLabelSize->SetNumber(fCurSelStyle->GetLabelSize("Z"));
05932 DoEditor();
05933 }
05934
05935
05936 void TStyleManager::ModZLabelColor()
05937 {
05938
05939
05940 fCurSelStyle->SetLabelColor(TColor::GetColor(fZLabelColor->GetColor()), "Z");
05941 DoEditor();
05942 }
05943
05944
05945 void TStyleManager::ModZLabelOffset()
05946 {
05947
05948
05949 fCurSelStyle->SetLabelOffset(fZLabelOffset->GetNumber(), "Z");
05950 DoEditor();
05951 }
05952
05953
05954 void TStyleManager::ModZLabelFont()
05955 {
05956
05957
05958 Int_t fontPrec = fCurSelStyle->GetLabelFont("Z") % 10;
05959 fCurSelStyle->SetLabelFont(fZLabelFont->GetSelected() * 10 + fontPrec, "Z");
05960 DoEditor();
05961 }
05962
05963
05964 void TStyleManager::ModZAxisColor()
05965 {
05966
05967
05968 fCurSelStyle->SetAxisColor(TColor::GetColor(fZAxisColor->GetColor()), "Z");
05969 DoEditor();
05970 }
05971
05972
05973 void TStyleManager::ModZTickLength()
05974 {
05975
05976
05977 fCurSelStyle->SetTickLength(fZTickLength->GetNumber(), "Z");
05978 DoEditor();
05979 }
05980
05981
05982 void TStyleManager::ModOptLogz()
05983 {
05984
05985
05986 fCurSelStyle->SetOptLogz(fOptLogz->IsDown());
05987 DoEditor();
05988 }
05989
05990
05991 void TStyleManager::ModZNdivisions()
05992 {
05993
05994
05995
05996 Int_t sgn = -1;
05997 if (fZNdivisionsOptimize->IsDown()) sgn = 1;
05998 fCurSelStyle->SetNdivisions(sgn * (fZNdivMain->GetIntNumber()
05999 + 100 * fZNdivSub->GetIntNumber()
06000 + 10000 * fZNdivSubSub->GetIntNumber()), "Z");
06001 DoEditor();
06002 }
06003
06004
06005 void TStyleManager::ModOptTitle()
06006 {
06007
06008
06009 fCurSelStyle->SetOptTitle(fOptTitle->IsDown());
06010 DisconnectEditor(fCurTabNum);
06011 UpdateEditor(fCurTabNum);
06012 ConnectEditor(fCurTabNum);
06013 DoEditor();
06014 }
06015
06016
06017 void TStyleManager::ModTitleFillColor()
06018 {
06019
06020
06021 fCurSelStyle->SetTitleFillColor(TColor::GetColor(fTitleColor->GetColor()));
06022 DoEditor();
06023 }
06024
06025
06026 void TStyleManager::ModTitleStyle()
06027 {
06028
06029
06030 fCurSelStyle->SetTitleStyle(fTitleStyle->GetPattern());
06031 DoEditor();
06032 }
06033
06034
06035 void TStyleManager::ModTitleTextColor()
06036 {
06037
06038
06039 fCurSelStyle->SetTitleTextColor(TColor::GetColor(fTitleTextColor->GetColor()));
06040 DoEditor();
06041 }
06042
06043
06044 void TStyleManager::ModTitleFontSize()
06045 {
06046
06047
06048 fCurSelStyle->SetTitleFontSize(fTitleFontSize->GetNumber());
06049 DoEditor();
06050 }
06051
06052
06053 void TStyleManager::ModTitleFontSizeInPixels(Bool_t b)
06054 {
06055
06056
06057 Int_t tmp = fCurSelStyle->GetTitleFont() / 10;
06058 Int_t mod = fCurSelStyle->GetTitleFont() % 10;
06059 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
06060 if (b) {
06061 fCurSelStyle->SetTitleFont(tmp * 10 + 3);
06062 fTitleFontSize->SetFormat(TGNumberFormat::kNESInteger,
06063 TGNumberFormat::kNEAPositive);
06064 fTitleFontSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
06065 if (mod == 2)
06066 fCurSelStyle->SetTitleFontSize(fCurSelStyle->GetTitleFontSize() * h);
06067 } else {
06068 fCurSelStyle->SetTitleFont(tmp * 10 + 2);
06069 fTitleFontSize->SetFormat(TGNumberFormat::kNESRealThree,
06070 TGNumberFormat::kNEAPositive);
06071 fTitleFontSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 1);
06072 if (mod == 3)
06073 fCurSelStyle->SetTitleFontSize(fCurSelStyle->GetTitleFontSize() / h);
06074 }
06075 fTitleFontSize->SetNumber(fCurSelStyle->GetTitleFontSize());
06076 DoEditor();
06077 }
06078
06079
06080 void TStyleManager::ModTitleFont()
06081 {
06082
06083
06084 Int_t tmp = fCurSelStyle->GetTitleFont() % 10;
06085 fCurSelStyle->SetTitleFont(fTitleFont->GetSelected() * 10 + tmp);
06086 DoEditor();
06087 }
06088
06089
06090 void TStyleManager::ModTitleAlign()
06091 {
06092
06093
06094 fCurSelStyle->SetTitleAlign(fTitleAlign->GetSelected());
06095 DoEditor();
06096 }
06097
06098
06099 void TStyleManager::ModTitleBorderSize()
06100 {
06101
06102
06103 fCurSelStyle->SetTitleBorderSize(fTitleBorderSize->GetSelected());
06104 DoEditor();
06105 }
06106
06107
06108 void TStyleManager::ModLegendBorderSize()
06109 {
06110
06111
06112 fCurSelStyle->SetLegendBorderSize(fLegendBorderSize->GetSelected());
06113 DoEditor();
06114 }
06115
06116
06117 void TStyleManager::ModTitleX()
06118 {
06119
06120
06121 fCurSelStyle->SetTitleX(fTitleX->GetIntNumber() * 0.01);
06122 DoEditor();
06123 }
06124
06125
06126 void TStyleManager::ModTitleY()
06127 {
06128
06129
06130 fCurSelStyle->SetTitleY(fTitleY->GetIntNumber() * 0.01);
06131 DoEditor();
06132 }
06133
06134
06135 void TStyleManager::ModTitleW()
06136 {
06137
06138
06139 fCurSelStyle->SetTitleW(fTitleW->GetIntNumber() * 0.01);
06140 DoEditor();
06141 }
06142
06143
06144 void TStyleManager::ModTitleH()
06145 {
06146
06147
06148 fCurSelStyle->SetTitleH(fTitleH->GetIntNumber() * 0.01);
06149 DoEditor();
06150 }
06151
06152
06153 void TStyleManager::ModStatColor(Pixel_t color)
06154 {
06155
06156
06157 fCurSelStyle->SetStatColor(TColor::GetColor(color));
06158 DoEditor();
06159 }
06160
06161
06162 void TStyleManager::ModStatStyle(Style_t pattern)
06163 {
06164
06165
06166 fCurSelStyle->SetStatStyle(pattern);
06167 DoEditor();
06168 }
06169
06170
06171 void TStyleManager::ModStatTextColor(Pixel_t color)
06172 {
06173
06174
06175 fCurSelStyle->SetStatTextColor(TColor::GetColor(color));
06176 DoEditor();
06177 }
06178
06179
06180 void TStyleManager::ModStatFontSize()
06181 {
06182
06183 fCurSelStyle->SetStatFontSize(fStatFontSize->GetNumber());
06184 DoEditor();
06185 }
06186
06187
06188 void TStyleManager::ModStatFontSizeInPixels(Bool_t b)
06189 {
06190
06191
06192 Int_t tmp = fCurSelStyle->GetStatFont() / 10;
06193 Int_t mod = fCurSelStyle->GetStatFont() % 10;
06194 Double_t h = TMath::Max(fCurSelStyle->GetCanvasDefH(), 100);
06195 if (b) {
06196 fCurSelStyle->SetStatFont(tmp * 10 + 3);
06197 fStatFontSize->SetFormat(TGNumberFormat::kNESInteger,
06198 TGNumberFormat::kNEANonNegative);
06199 fStatFontSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, h);
06200 if (mod == 2)
06201 fCurSelStyle->SetStatFontSize(fCurSelStyle->GetStatFontSize() * h);
06202 fStatFontSize->SetNumber(fCurSelStyle->GetStatFontSize());
06203 } else {
06204 fCurSelStyle->SetStatFont(tmp * 10 + 2);
06205 fStatFontSize->SetFormat(TGNumberFormat::kNESRealThree,
06206 TGNumberFormat::kNEANonNegative);
06207 fStatFontSize->SetLimits(TGNumberFormat::kNELLimitMinMax, 0., 1.);
06208 if (mod == 3)
06209 fCurSelStyle->SetStatFontSize(fCurSelStyle->GetStatFontSize() / h);
06210 fStatFontSize->SetNumber(fCurSelStyle->GetStatFontSize());
06211 }
06212 fStatFontSize->SetNumber(fCurSelStyle->GetStatFontSize());
06213 DoEditor();
06214 }
06215
06216
06217 void TStyleManager::ModStatFont()
06218 {
06219
06220
06221 Int_t tmp = fCurSelStyle->GetStatFont() % 10;
06222 fCurSelStyle->SetStatFont(fStatFont->GetSelected() * 10 + tmp);
06223 DoEditor();
06224 }
06225
06226
06227 void TStyleManager::ModStatX()
06228 {
06229
06230
06231 fCurSelStyle->SetStatX((Float_t)fStatX->GetNumber());
06232 DoEditor();
06233 }
06234
06235
06236 void TStyleManager::ModStatY()
06237 {
06238
06239
06240 fCurSelStyle->SetStatY((Float_t)fStatY->GetNumber());
06241 DoEditor();
06242 }
06243
06244
06245 void TStyleManager::ModStatW()
06246 {
06247
06248
06249 fCurSelStyle->SetStatW((Float_t)fStatW->GetNumber());
06250 DoEditor();
06251 }
06252
06253
06254 void TStyleManager::ModStatH()
06255 {
06256
06257
06258 fCurSelStyle->SetStatH((Float_t)fStatH->GetNumber());
06259 DoEditor();
06260 }
06261
06262
06263 void TStyleManager::ModStatBorderSize()
06264 {
06265
06266
06267 fCurSelStyle->SetStatBorderSize(fStatBorderSize->GetSelected());
06268 DoEditor();
06269 }
06270
06271
06272 void TStyleManager::ModOptStat()
06273 {
06274
06275
06276 Int_t stat = 0;
06277 if (fOptStatName->IsDown()) stat +=1;
06278 if (fOptStatEntries->IsDown()) stat +=10;
06279 if (fOptStatMean->IsDown()) stat +=100;
06280 if (fOptStatRMS->IsDown()) stat +=1000;
06281 if (fOptStatUnderflow->IsDown()) stat +=10000;
06282 if (fOptStatOverflow->IsDown()) stat +=100000;
06283 if (fOptStatIntegral->IsDown()) stat +=1000000;
06284 if (fOptStatSkewness->IsDown()) stat +=10000000;
06285 if (fOptStatKurtosis->IsDown()) stat +=100000000;
06286 if (fOptStatErrors->IsDown()) {
06287 if (fOptStatMean->IsDown()) stat +=100;
06288 if (fOptStatRMS->IsDown()) stat +=1000;
06289 if (fOptStatSkewness->IsDown()) stat +=10000000;
06290 if (fOptStatKurtosis->IsDown()) stat +=100000000;
06291 }
06292 if (stat == 1) stat = 1000000001;
06293 fCurSelStyle->SetOptStat(stat);
06294 DoEditor();
06295 }
06296
06297
06298 void TStyleManager::ModStatFormat(const char *sformat)
06299 {
06300
06301
06302 fCurSelStyle->SetStatFormat(sformat);
06303 DoEditor();
06304 }
06305
06306
06307 void TStyleManager::ModOptFit()
06308 {
06309
06310
06311 Int_t fit = 0;
06312 if (fOptFitValues->IsDown()) fit +=1;
06313 if (fOptFitErrors->IsDown()) fit +=10;
06314 if (fOptFitChi->IsDown()) fit +=100;
06315 if (fOptFitProbability->IsDown()) fit +=1000;
06316 if (fit == 1) fit = 10001;
06317 fCurSelStyle->SetOptFit(fit);
06318 DoEditor();
06319 }
06320
06321
06322 void TStyleManager::ModFitFormat(const char *fitformat)
06323 {
06324
06325
06326 fCurSelStyle->SetFitFormat(fitformat);
06327 DoEditor();
06328 }
06329
06330
06331 void TStyleManager::ModHeaderPS()
06332 {
06333
06334
06335 fCurSelStyle->SetHeaderPS(fHeaderPS->GetText());
06336 DoEditor();
06337 }
06338
06339
06340 void TStyleManager::ModTitlePS()
06341 {
06342
06343
06344 fCurSelStyle->SetTitlePS(fTitlePS->GetText());
06345 DoEditor();
06346 }
06347
06348
06349 void TStyleManager::ModColorModelPS()
06350 {
06351
06352
06353 Int_t i = kPSPDFColorModelPSRGB;
06354 while (!fColorModelPS->Find(i)->IsDown()) i++;
06355 fCurSelStyle->SetColorModelPS(i - kPSPDFColorModelPSRGB);
06356 DoEditor();
06357 }
06358
06359
06360 void TStyleManager::ModLineScalePS()
06361 {
06362
06363
06364 fCurSelStyle->SetLineScalePS(fLineScalePS->GetNumber());
06365 DoEditor();
06366 }
06367
06368
06369 void TStyleManager::ModPaperSizePredef()
06370 {
06371
06372
06373 Float_t papSizeX;
06374 Float_t papSizeY;
06375 fCurSelStyle->GetPaperSize(papSizeX, papSizeY);
06376
06377 if (fPaperSizePredef->GetSelected() == 1) {
06378 if (!fPaperSizeEnCm) {
06379 fPaperSizeEnCm = kTRUE;
06380 fPaperSizeX->SetNumber(papSizeX);
06381 fPaperSizeY->SetNumber(papSizeY);
06382 }
06383 } else if (fPaperSizePredef->GetSelected() == 2) {
06384 if (fPaperSizeEnCm) {
06385 fPaperSizeEnCm = kFALSE;
06386 fPaperSizeX->SetNumber(papSizeX * 0.394);
06387 fPaperSizeY->SetNumber(papSizeY * 0.394);
06388 }
06389 } else if (fPaperSizePredef->GetSelected() == 3) {
06390 fPaperSizeEnCm = kTRUE;
06391 fPaperSizeX->SetNumber(20);
06392 fPaperSizeY->SetNumber(26);
06393 fCurSelStyle->SetPaperSize(20, 26);
06394 } else if (fPaperSizePredef->GetSelected() == 4) {
06395 fPaperSizeEnCm = kFALSE;
06396 fPaperSizeX->SetNumber(20 * 0.394);
06397 fPaperSizeY->SetNumber(24 * 0.394);
06398 fCurSelStyle->SetPaperSize(20, 24);
06399 }
06400 DoEditor();
06401 }
06402
06403
06404 void TStyleManager::ModPaperSizeXY()
06405 {
06406
06407
06408 if (fPaperSizeEnCm) {
06409 fCurSelStyle->SetPaperSize(fPaperSizeX->GetNumber(),
06410 fPaperSizeY->GetNumber());
06411 fPaperSizePredef->Select(1);
06412 } else {
06413 fCurSelStyle->SetPaperSize(fPaperSizeX->GetNumber() * 2.54,
06414 fPaperSizeY->GetNumber() * 2.54);
06415 fPaperSizePredef->Select(2);
06416 }
06417 DoEditor();
06418 }