From b8fa24e536c639f385560ef811e4eb7c228d611d Mon Sep 17 00:00:00 2001 From: Ilka Antcheva Date: Mon, 21 May 2007 13:42:26 +0000 Subject: [PATCH] Added fSizeForText data member. It is set to kTRUE if the "TEXT" draw option uses marker size as a text size setting. Follow up changes in TH2Editor. git-svn-id: http://root.cern.ch/svn/root/trunk@18842 27541ba8-7e3a-0410-8455-c3a389f83636 --- ged/inc/TAttMarkerEditor.h | 5 +++-- ged/src/TAttMarkerEditor.cxx | 20 +++++++++++++++++--- ged/src/TH2Editor.cxx | 4 +++- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ged/inc/TAttMarkerEditor.h b/ged/inc/TAttMarkerEditor.h index 0185e5f4f74d3..cddba75902acd 100644 --- a/ged/inc/TAttMarkerEditor.h +++ b/ged/inc/TAttMarkerEditor.h @@ -1,4 +1,4 @@ -// @(#)root/ged:$Name: $:$Id: TAttMarkerEditor.h,v 1.4 2006/09/25 13:35:58 rdm Exp $ +// @(#)root/ged:$Name: $:$Id: TAttMarkerEditor.h,v 1.5 2007/02/06 15:39:54 antcheva Exp $ // Author: Ilka Antcheva 11/05/04 /************************************************************************* @@ -36,7 +36,8 @@ class TAttMarkerEditor : public TGedFrame { TGNumberEntry *fMarkerSize; // marker size combo box TGColorSelect *fColorSelect; // marker color TGedMarkerSelect *fMarkerType; // marker type - + Bool_t fSizeForText; // true if "text" draw option uses marker size + virtual void ConnectSignals2Slots(); public: diff --git a/ged/src/TAttMarkerEditor.cxx b/ged/src/TAttMarkerEditor.cxx index dd26919317a4b..7b457b134dd6e 100644 --- a/ged/src/TAttMarkerEditor.cxx +++ b/ged/src/TAttMarkerEditor.cxx @@ -1,4 +1,4 @@ -// @(#)root/ged:$Name: $:$Id: TAttMarkerEditor.cxx,v 1.11 2006/09/25 13:35:58 rdm Exp $ +// @(#)root/ged:$Name: $:$Id: TAttMarkerEditor.cxx,v 1.12 2007/02/06 15:39:54 antcheva Exp $ // Author: Ilka Antcheva 11/05/04 /************************************************************************* @@ -47,6 +47,7 @@ TAttMarkerEditor::TAttMarkerEditor(const TGWindow *p, Int_t width, // Constructor of marker attributes GUI. fAttMarker = 0; + fSizeForText = kFALSE; MakeTitle("Marker"); @@ -95,8 +96,15 @@ void TAttMarkerEditor::SetModel(TObject* obj) fAttMarker = dynamic_cast(obj); + TString str = GetDrawOption(); + str.ToUpper(); + if (obj->InheritsFrom("TH2") && str.Contains("TEXT")) { + fSizeForText = kTRUE; + } else { + fSizeForText = kFALSE; + } Style_t marker = fAttMarker->GetMarkerStyle(); - if (marker==1 || marker==6 || marker==7) { + if ((marker==1 || marker==6 || marker==7) && !fSizeForText) { fMarkerSize->SetNumber(1.); fMarkerSize->SetState(kFALSE); } else { @@ -131,7 +139,7 @@ void TAttMarkerEditor::DoMarkerStyle(Style_t marker) // Slot connected to the marker type. if (fAvoidSignal) return; - if (marker==1 || marker==6 || marker==7) { + if ((marker==1 || marker==6 || marker==7) && !fSizeForText) { fMarkerSize->SetNumber(1.); fMarkerSize->SetState(kFALSE); } else @@ -147,6 +155,12 @@ void TAttMarkerEditor::DoMarkerSize() // Slot connected to the marker size. if (fAvoidSignal) return; + Style_t marker = fAttMarker->GetMarkerStyle(); + if ((marker==1 || marker==6 || marker==7) && !fSizeForText) { + fMarkerSize->SetNumber(1.); + fMarkerSize->SetState(kFALSE); + } else + fMarkerSize->SetState(kTRUE); Float_t size = fMarkerSize->GetNumber(); fAttMarker->SetMarkerSize(size); Update(); diff --git a/ged/src/TH2Editor.cxx b/ged/src/TH2Editor.cxx index b184432908705..3bf237310c86b 100644 --- a/ged/src/TH2Editor.cxx +++ b/ged/src/TH2Editor.cxx @@ -1369,7 +1369,9 @@ void TH2Editor::DoAddText(Bool_t on) } if (make) { DoHistChanges(); - } + // next line is needed for marker editor refresh + fGedEditor->GetCanvas()->Selected(fGedEditor->GetPad(), fHist, 1); + } } //______________________________________________________________________________