//*CMZ : 2.23/02 03/09/99 12.25.17 by Rene Brun
//*CMZ : 2.00/11 08/08/98 22.37.39 by Rene Brun
//*CMZ : 1.03/09 23/06/98 18.03.03 by Rene Brun
//*-- Author : Rene Brun 04/07/96
//*KEEP,CopyRight,T=C.
/*************************************************************************
* Copyright(c) 1995-1999, The ROOT System, All rights reserved. *
* Authors: Rene Brun and Fons Rademakers. *
* *
* For the licensing terms see $ROOTSYS/AA_LICENSE. *
* For the list of contributors see $ROOTSYS/AA_CREDITS. *
*************************************************************************/
//*KEND.
//*KEEP,TROOT.
#include "TROOT.h"
//*KEEP,TAttMarkerCanvas,T=C++.
#include "TAttMarkerCanvas.h"
//*KEEP,TGroupButton,T=C++.
#include "TGroupButton.h"
//*KEEP,TMarker.
#include "TMarker.h"
//*KEEP,TText.
#include "TText.h"
//*KEEP,TVirtualPad.
#include "TVirtualPad.h"
//*KEND.
ClassImp(TAttMarkerCanvas)
//______________________________________________________________________________
//
// An AttMarkerCanvas is a TDialogCanvas specialized to set line attributes.
//
/*
*/
//
//
//______________________________________________________________________________
TAttMarkerCanvas::TAttMarkerCanvas() : TDialogCanvas()
{
//*-*-*-*-*-*-*-*-*-*-*-*AttMarkerCanvas default constructor*-*-*-*-*-*-*-*-*-*-*
//*-* ================================
}
//_____________________________________________________________________________
TAttMarkerCanvas::TAttMarkerCanvas(const Text_t *name, const Text_t *title, UInt_t ww, UInt_t wh)
: TDialogCanvas(name,title,ww,wh)
{
//*-*-*-*-*-*-*-*-*-*-*-*AttMarkerCanvas constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-* ========================
TVirtualPad *padsav = gPad;
BuildStandardButtons();
//*-*- Marker styles choice buttons
TGroupButton *test1 = 0;
TMarker *mark;
Float_t xlow, ylow, wpad, hpad;
Int_t i,j;
xlow = 0.05;
wpad = 0.19;
hpad = 0.062;
char command[64];
static Int_t markers[15] = { 1, 2, 3, 8, 5,
21,22,23,24,25,
26,27,28,29,30};
Int_t number = 0;
for (j=0;j<3;j++) {
ylow = 0.34 + j*hpad;
for (i=0;i<5;i++) {
number++;
xlow = 0.05 + i*wpad;
sprintf(command,"SetMarkerStyle(%d)",markers[number-1]);
test1 = new TGroupButton("Style","",command,xlow, ylow, xlow+0.9*wpad, ylow+0.9*hpad);
if (number == 1) test1->SetBorderMode(-1);
test1->SetFillColor(18);
test1->SetBorderSize(2);
test1->Draw();
test1->cd();
mark = new TMarker(0.5, 0.5,markers[number-1]);
mark->SetMarkerSize(2);
mark->Draw();
cd();
}
}
//*-*- Marker Size choice buttons
wpad = 0.19;
hpad = 0.065;
Float_t sizem = 0.1;
for (j=0;j<3;j++) {
ylow = 0.11 + j*hpad;
for (i=0;i<5;i++) {
sizem += 0.2;
xlow = 0.05 + i*wpad;
if (!i && !j) sizem = 1;
sprintf(command,"SetMarkerSize(%f)",sizem);
test1 = new TGroupButton("Size","",command,xlow, ylow, xlow+0.9*wpad, ylow+0.9*hpad);
if (!i && !j) test1->SetBorderMode(-1);
test1->SetFillColor(18);
test1->SetBorderSize(2);
test1->Draw();
test1->cd();
mark = new TMarker(0.5, 0.5, 24);
mark->SetMarkerSize(sizem);
mark->Draw();
if (!i && !j) sizem = 0.1;
cd();
}
}
//*-* draw colortable pads
test1->DisplayColorTable("SetMarkerColor",0.05, 0.60, 0.90, 0.38);
Update();
padsav->cd();
}
//______________________________________________________________________________
TAttMarkerCanvas::~TAttMarkerCanvas()
{
//*-*-*-*-*-*-*-*-*-*-*AttMarkerCanvas default destructor*-*-*-*-*-*-*-*-*-*-*-*
//*-* ===============================
}
//______________________________________________________________________________
void TAttMarkerCanvas::UpdateMarkerAttributes(Int_t col,Int_t sty,Float_t msiz)
{
//*-*-*-*-*-*-*-*-*-*-*Update marker attributes*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-* ========================
TIter next(GetListOfPrimitives());
TGroupButton *button;
char cmd[64];
fRefObject = gROOT->GetSelectedPrimitive();
fRefPad = (TPad*)gROOT->GetSelectedPad();
if (fRefObject) {
sprintf(cmd,"attmarker: %s",fRefObject->GetName());
SetTitle(cmd);
}
TObject *obj;
while ((obj = next())) {
if (!obj->InheritsFrom(TGroupButton::Class())) continue;
button = (TGroupButton*)obj;
if (button->GetBorderMode() < 0) {
button->SetBorderMode(1);
button->Modified();
}
sprintf(cmd,"SetMarkerColor(%d)",col);
if (!strcmp(button->GetTitle(),cmd)) button->SetBorderMode(-1);
sprintf(cmd,"SetMarkerStyle(%d)",sty);
if (!strcmp(button->GetTitle(),cmd)) button->SetBorderMode(-1);
sprintf(cmd,"SetMarkerSize(%f)",msiz);
if (!strcmp(button->GetTitle(),cmd)) button->SetBorderMode(-1);
if (button->GetBorderMode() < 0) {
button->Modified();
}
}
Update();
}
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.