Skip to content
Snippets Groups Projects
Commit 3679af35 authored by Rene Brun's avatar Rene Brun
Browse files

From Ilka:

additional code in TAxisEditor as follows:
- fDecimal - new check button in the axis editor
- DoDecimals(Bool_t on) - slot connected to the decimal part setting of
axis labels.


git-svn-id: http://root.cern.ch/svn/root/trunk@9353 27541ba8-7e3a-0410-8455-c3a389f83636
parent 4e59078a
No related branches found
No related tags found
No related merge requests found
// @(#)root/ged:$Name: $:$Id: TAxisEditor.h,v 1.1 2004/06/18 15:55:00 brun Exp $
// @(#)root/ged:$Name: $:$Id: TAxisEditor.h,v 1.2 2004/06/25 17:13:23 brun Exp $
// Author: Ilka Antcheva 11/05/04
/*************************************************************************
......@@ -67,6 +67,7 @@ protected:
TGNumberEntry *fLabelSize; // label size number entry
TGNumberEntry *fLabelOffset; // label offset number entry
TGCheckButton *fNoExponent; // check box for No exponent choice
TGCheckButton *fDecimal; // decimal part check box
virtual void ConnectSignals2Slots();
......@@ -98,6 +99,7 @@ public:
virtual void DoLabelFont(Int_t font);
virtual void DoLabelOffset();
virtual void DoNoExponent();
virtual void DoDecimal(Bool_t on);
ClassDef(TAxisEditor,0) // axis editor
};
......
// @(#)root/ged:$Name: $:$Id: TAxisEditor.cxx,v 1.1 2004/06/18 15:55:00 brun Exp $
// @(#)root/ged:$Name: $:$Id: TAxisEditor.cxx,v 1.2 2004/06/25 17:13:23 brun Exp $
// Author: Ilka Antcheva 11/05/04
/*************************************************************************
......@@ -29,7 +29,7 @@
#include "TGClient.h"
#include "TColor.h"
#include "TVirtualPad.h"
#include "TStyle.h"
ClassImp(TGedFrame)
ClassImp(TAxisEditor)
......@@ -57,7 +57,8 @@ enum {
kAXIS_LBLLOG,
kAXIS_LBLEXP,
kAXIS_LBLDIR,
kAXIS_LBLSORT
kAXIS_LBLSORT,
kAXIS_LBLDEC
};
......@@ -204,7 +205,11 @@ TAxisEditor::TAxisEditor(const TGWindow *p, Int_t id, Int_t width,
fLabelFont->Resize(137, 20);
AddFrame(fLabelFont, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 0));
fLabelFont->Associate(this);
fDecimal = new TGCheckButton(this, "Decimal labels' part", kAXIS_LBLDEC);
fDecimal->SetToolTipText("Draw the decimal part of labels");
AddFrame(fDecimal, new TGLayoutHints(kLHintsLeft | kLHintsBottom, 3, 1, 3, 0));
MapSubwindows();
Layout();
MapWindow();
......@@ -255,6 +260,7 @@ void TAxisEditor::ConnectSignals2Slots()
fLabelColor->Connect("ColorSelected(Pixel_t)", "TAxisEditor", this, "DoLabelColor(Pixel_t)");
fLabelSize->Connect("ValueSet(Long_t)","TAxisEditor",this,"DoLabelSize()");
fNoExponent->Connect("Toggled(Bool_t)","TAxisEditor",this,"DoNoExponent()");
fDecimal->Connect("Toggled(Bool_t)","TAxisEditor",this,"DoDecimal(Bool_t)");
fLabelOffset->Connect("ValueSet(Long_t)", "TAxisEditor", this, "DoLabelOffset()");
fLabelFont->Connect("Selected(Int_t)", "TAxisEditor", this, "DoLabelFont(Int_t)");
fInit = kFALSE;
......@@ -357,6 +363,10 @@ void TAxisEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t)
if (noexp) fNoExponent->SetState(kButtonDown);
else fNoExponent->SetState(kButtonUp);
Bool_t on = fAxis->GetDecimals();
if (on) fDecimal->SetState(kButtonDown);
else fDecimal->SetState(kButtonUp);
if (fInit) ConnectSignals2Slots();
SetActive();
}
......@@ -564,3 +574,16 @@ void TAxisEditor::DoNoExponent()
fAxis->SetNoExponent(exp);
Update();
}
//______________________________________________________________________________
void TAxisEditor::DoDecimal(Bool_t on)
{
// Slot connected to the decimal part setting.
fAxis->SetDecimals(on);
gStyle->SetStripDecimals(!on);
Update();
gPad->Modified();
gPad->Update();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment