Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4Style.ui.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 void TGo4Style::init()
00024 {
00025     gStyle->SetPalette(1);
00026     fxTGo4PreviewPanel=0;
00027     gStyle->SetOptStat(11111111);
00028 }
00029 
00030 void TGo4Style::SetCanvasColor()
00031 {
00032    QColor c = QColorDialog::getColor();
00033    if ( c.isValid() && fxTGo4PreviewPanel!=0) {
00034        short int C_new =  TColor::GetColor(c.red(), c.green(), c.blue());
00035        TCanvas *ActiveCanvas = fxTGo4PreviewPanel->GetCanvas();
00036      if (ActiveCanvas!=0) {
00037        ActiveCanvas->SetFillColor (C_new);
00038       ActiveCanvas->Modified();
00039          ActiveCanvas->Update();
00040      }
00041    }
00042 
00043 
00044 }
00045 
00046 void TGo4Style::SetHistFillColor()
00047 {
00048     QColor c = QColorDialog::getColor();
00049    if ( c.isValid() && fxTGo4PreviewPanel!=0) {
00050        short int C_new =  TColor::GetColor(c.red(), c.green(), c.blue());
00051        TPad *ActivePad = fxTGo4PreviewPanel->GetActivePad() ;
00052        if (fxTH1!=0) {
00053              ActivePad->SetFillColor(C_new);
00054          ActivePad->Modified();
00055             ActivePad->Update();
00056        }
00057 
00058    }
00059 
00060 
00061 }
00062 
00063 void TGo4Style::SetPadColor()
00064 {
00065     short int C_new;
00066     QColor c = QColorDialog::getColor();
00067    if ( c.isValid() && fxTGo4PreviewPanel!=0) {
00068           TCanvas *fxCanvas = fxTGo4PreviewPanel->GetCanvas();
00069           C_new =  TColor::GetColor(c.red(), c.green(), c.blue());
00070          if(!fxTGo4PreviewPanel->ApplyToAllPads()){
00071          TPad *ActivePad = fxTGo4PreviewPanel->GetActivePad() ;
00072          if (ActivePad !=0){
00073              ActivePad->SetFillColor(C_new);
00074              ActivePad->Modified();
00075              ActivePad->Update();
00076              fxCanvas->Update();
00077             }
00078          }else{
00079             TPad* fxPad=0;
00080             TIter iter(fxTGo4PreviewPanel->GetListOfPads());
00081             while((fxPad = dynamic_cast<TPad*>(iter())) !=0) {
00082                 fxPad->SetFillColor(C_new);
00083                 fxPad->Modified();
00084                 fxPad->Update();
00085                 fxCanvas->Update();
00086              }
00087          }
00088    }
00089 }
00090 
00091 void TGo4Style::SetPalette( int t )
00092 {
00093     gStyle->SetPalette(t);
00094      if ( fxTGo4PreviewPanel!=0) {
00095         if(!fxTGo4PreviewPanel->ApplyToAllPads()){
00096            TPad *ActivePad = fxTGo4PreviewPanel->GetActivePad() ;
00097              if (ActivePad !=0){
00098              ActivePad->Modified();
00099              ActivePad->Update();
00100              }
00101        }else{
00102 //          int NoPads= fxTGo4PreviewPanel->GetNoOfPads();
00103 //            TCanvas *fxCanvas = fxTGo4PreviewPanel->GetCanvas();
00104 //            for (int i=1; i<=NoPads; i++){
00105 //                fxCanvas->cd(i);
00106 //                if(gPad!=0){
00107 //                gPad->Modified();
00108 //                gPad->Update();
00109 //                }
00110 //            }
00111           TPad* fxPad=0;
00112           TIter iter(fxTGo4PreviewPanel->GetListOfPads());
00113           while((fxPad = dynamic_cast<TPad*>(iter())) !=0) {
00114               fxPad->Modified();
00115               fxPad->Update();
00116            }
00117 
00118 
00119         }
00120      }
00121 }
00122 
00123 void TGo4Style::SetHistLineColor()
00124 {
00125     QColor c = QColorDialog::getColor();
00126     if ( c.isValid() && fxTGo4PreviewPanel!=0) {
00127       short int C_new =  TColor::GetColor(c.red(), c.green(), c.blue());
00128       TPad *ActivePad= fxTGo4PreviewPanel->GetActivePad();
00129       fxTH1= fxTGo4PreviewPanel->GetPadHistogram(ActivePad);
00130       if (fxTH1!=0) {
00131          fxTH1->SetLineColor(C_new);
00132          ActivePad->Modified();
00133             ActivePad->Update();
00134 
00135       }
00136     }
00137 
00138 }
00139 
00140 
00141 void TGo4Style::SetViewPanel( TGo4PreviewPanel *ViewPanel )
00142 {
00143        fxTGo4PreviewPanel = ViewPanel;
00144 }
00145 
00146 
00147 
00148 
00149 
00150 
00151 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:03 2005 for Go4-v2.10-5 by doxygen1.2.15