ROOT logo
#ifndef TEXTBOX
#define TEXTBOX
#include "TPave.h"
#include "TList.h"
#include "TTimer.h"
#include "HprEditBits.h"
#include <iostream>

namespace std {} using namespace std;
//______________________________________________________________________

class TextBox;

class TbTimer : public TTimer
{
private:
   TextBox *fTextBox;
public:
   TbTimer(Long_t ms, Bool_t synch,  TextBox *textbox);
   virtual ~TbTimer(){};
   Bool_t Notify();

ClassDef(TbTimer, 0)
};
//______________________________________________________________________

class TextBoxMember : public TObject {

private:
   TObject * fObject;
   Short_t   fAlign;
   Bool_t    fFirst;
   Int_t fAlignType;    // 0 no align, 1 on edges only, 2 center
public:
   TextBoxMember(){};
   TextBoxMember(TObject *obj, Short_t align, Int_t align_type)
   : fObject(obj), fAlign(align),  fAlignType(align_type)
{
}
   ~TextBoxMember(){};
   TObject *GetObject(){return fObject;};
   Short_t GetAlign(){return fAlign;};
   Int_t   GetAlignType(){return fAlignType;};
   void    SetAlign(Short_t al){fAlign = al;};
   void SetFirst(Bool_t first) {fFirst = first;};
   Bool_t GetFirst() {return fFirst;};
ClassDef(TextBoxMember, 1)

};
//______________________________________________________________________

class TextBox : public TPave {

private:
   TbTimer  *fTimer;  //!
   Int_t    fPrimitives; //!
   Double_t fX1Save;
   Double_t fY1Save;
   Double_t fX2Save;
   Double_t fY2Save;
   TList    fMembers;
   Bool_t   fOwnMembers;
   Double_t fTextMargin;
   Double_t fSmall;
   Int_t    fAlignType;    // 0 no align, 1 on edges only, 2 center
public:
   TextBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2,const char *name = NULL);
   TextBox();
   ~TextBox();
   void RecursiveRemove(TObject * obj);
   void ExecuteEvent(Int_t event, Int_t px, Int_t py);
   void AlignEntries(Double_t dX1, Double_t dY1, Double_t dX2, Double_t dY2);
   void Paint(Option_t * option = " ");

//   void PaintPaveArc(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
//                      Int_t, Option_t *option);
   void AdoptAll() ;                       // *MENU*
   void AdoptMember(TObject* obj) ;                    //
   void AddMember(TObject* obj, Double_t x, Double_t y);
   TextBoxMember *FindMember(TObject *obj);
   void      PrintMembers();                 // *MENU*
   Int_t   IsInside(Double_t x, Double_t y) const {
      return (x > GetX1()-fSmall && x < GetX2() + fSmall
           && y > GetY1()-fSmall && y < GetY2() + fSmall);
   }
   Double_t PhiOfLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t align);

   Double_t GetXbyAlign(Short_t align, Double_t ts = 0);
   Double_t GetYbyAlign(Short_t align, Double_t ts = 0);
   Short_t  GetAlignbyXY(Double_t x, Double_t y, Bool_t its_line = kFALSE);
   Int_t GetAlignType() { return fAlignType;};
   void  SetAlignType(Int_t at) {fAlignType = at;};  // *MENU*
   TList *GetListOfMembers() {return &fMembers;};
   void TransformPave(TPave *p, Short_t align);
   void SetPaveNDC(TPave *p);
   void Wakeup();
   void ObjCreated(Int_t px, Int_t py, TObject*);
   void ObjMoved(Int_t px, Int_t py, TObject*);
ClassDef(TextBox, 1)
};
#endif

 TextBox.h:1
 TextBox.h:2
 TextBox.h:3
 TextBox.h:4
 TextBox.h:5
 TextBox.h:6
 TextBox.h:7
 TextBox.h:8
 TextBox.h:9
 TextBox.h:10
 TextBox.h:11
 TextBox.h:12
 TextBox.h:13
 TextBox.h:14
 TextBox.h:15
 TextBox.h:16
 TextBox.h:17
 TextBox.h:18
 TextBox.h:19
 TextBox.h:20
 TextBox.h:21
 TextBox.h:22
 TextBox.h:23
 TextBox.h:24
 TextBox.h:25
 TextBox.h:26
 TextBox.h:27
 TextBox.h:28
 TextBox.h:29
 TextBox.h:30
 TextBox.h:31
 TextBox.h:32
 TextBox.h:33
 TextBox.h:34
 TextBox.h:35
 TextBox.h:36
 TextBox.h:37
 TextBox.h:38
 TextBox.h:39
 TextBox.h:40
 TextBox.h:41
 TextBox.h:42
 TextBox.h:43
 TextBox.h:44
 TextBox.h:45
 TextBox.h:46
 TextBox.h:47
 TextBox.h:48
 TextBox.h:49
 TextBox.h:50
 TextBox.h:51
 TextBox.h:52
 TextBox.h:53
 TextBox.h:54
 TextBox.h:55
 TextBox.h:56
 TextBox.h:57
 TextBox.h:58
 TextBox.h:59
 TextBox.h:60
 TextBox.h:61
 TextBox.h:62
 TextBox.h:63
 TextBox.h:64
 TextBox.h:65
 TextBox.h:66
 TextBox.h:67
 TextBox.h:68
 TextBox.h:69
 TextBox.h:70
 TextBox.h:71
 TextBox.h:72
 TextBox.h:73
 TextBox.h:74
 TextBox.h:75
 TextBox.h:76
 TextBox.h:77
 TextBox.h:78
 TextBox.h:79
 TextBox.h:80
 TextBox.h:81
 TextBox.h:82
 TextBox.h:83
 TextBox.h:84
 TextBox.h:85
 TextBox.h:86
 TextBox.h:87
 TextBox.h:88
 TextBox.h:89
 TextBox.h:90
 TextBox.h:91
 TextBox.h:92
 TextBox.h:93
 TextBox.h:94
 TextBox.h:95
 TextBox.h:96
 TextBox.h:97
 TextBox.h:98
 TextBox.h:99
 TextBox.h:100
 TextBox.h:101
 TextBox.h:102