Skip to content

Commit

Permalink
Added fSizeForText data member. It is set to kTRUE if the
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Ilka Antcheva authored and Ilka Antcheva committed May 21, 2007
1 parent c1e15c0 commit b8fa24e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
5 changes: 3 additions & 2 deletions ged/inc/TAttMarkerEditor.h
Original file line number Diff line number Diff line change
@@ -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

/*************************************************************************
Expand Down Expand Up @@ -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:
Expand Down
20 changes: 17 additions & 3 deletions ged/src/TAttMarkerEditor.cxx
Original file line number Diff line number Diff line change
@@ -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

/*************************************************************************
Expand Down Expand Up @@ -47,6 +47,7 @@ TAttMarkerEditor::TAttMarkerEditor(const TGWindow *p, Int_t width,
// Constructor of marker attributes GUI.

fAttMarker = 0;
fSizeForText = kFALSE;

MakeTitle("Marker");

Expand Down Expand Up @@ -95,8 +96,15 @@ void TAttMarkerEditor::SetModel(TObject* obj)

fAttMarker = dynamic_cast<TAttMarker *>(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 {
Expand Down Expand Up @@ -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
Expand All @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion ged/src/TH2Editor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

//______________________________________________________________________________
Expand Down

0 comments on commit b8fa24e

Please sign in to comment.