#ifndef ROOT_TASPaletteEditor
#define ROOT_TASPaletteEditor
#ifndef ROOT_TAttImage
#include "TAttImage.h"
#endif
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TLine
#include "TLine.h"
#endif
class TVirtualPad;
class TH1D;
class TRootEmbeddedCanvas;
class TGTextButton;
class TGCheckButton;
class TGComboBox;
class TGRadioButton;
class TASPaletteEditor : public TPaletteEditor, public TGMainFrame {
protected:
class PaintPalette : public TObject {
protected :
TImagePalette **fPalette;
TAttImage *fAttImage;
public:
PaintPalette(TImagePalette **palette, TAttImage *attImage)
{ fPalette = palette; fAttImage = attImage; }
void Paint(Option_t *option);
};
class LimitLine : public TLine {
private:
TASPaletteEditor *fGui;
protected:
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
public:
LimitLine(Coord_t x, Coord_t y1, Coord_t y2, TASPaletteEditor *gui);
void Paint(Option_t *option);
};
Double_t fMinValue;
Double_t fMaxValue;
TH1D *fHisto;
TRootEmbeddedCanvas *fPaletteCanvas;
TRootEmbeddedCanvas *fHistCanvas;
TList *fPaletteList;
TImagePalette *fPalette;
TVirtualPad *fImagePad;
PaintPalette *fPaintPalette;
LimitLine *fLimitLine[2];
TGTextButton *fUnDoButton;
TGTextButton *fReDoButton;
TGCheckButton *fAutoUpdate;
TGCheckButton *fStepButton;
TGRadioButton *fRamps[3];
Int_t fRampFactor;
TGComboBox *fComboBox;
void InsertNewPalette(TImagePalette *newPalette);
void Save();
void Open();
void LogPalette();
void ExpPalette();
void LinPalette();
void InvertPalette();
void NewPalette(Long_t id);
void SetStep();
void SetRamp(Long_t ramp);
void UpdateScreen(Bool_t histoUpdate);
public:
TASPaletteEditor(TAttImage *attImage, UInt_t w, UInt_t h);
virtual ~TASPaletteEditor();
Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2);
void UpdateRange();
void CloseWindow();
ClassDef(TASPaletteEditor,0)
};
#endif