1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
| enum TTrameDir {tdUnknown, tdIn, tdOut};
// Options pour Paint
#define topts_sel 1 // élément sélectionné
#define topts_desc 2 // afficher description
//---------------------------------------------------------------------------
class TTrame
{
private:
TTrame *Pnext;
TTrame *Pprev;
TTrameDir Pdirection;
AnsiString Pdata;
AnsiString *Pdesc;
int Ptypetrame;
// TTimeStamp Temps;
protected:
public:
int Pnumtrame;
__fastcall TTrame::TTrame(AnsiString Trame,AnsiString *Desc,TTrameDir Direction);
bool __fastcall IsFiltered(unsigned char *filterlist);
void __fastcall Paint(TRect *rect,TCanvas *canvas, unsigned char opts);
TTrame * __fastcall Next(void);
TTrame * __fastcall Prev(void);
TTrame * __fastcall NextF(unsigned char *filterlist);
TTrame * __fastcall PrevF(unsigned char *filterlist);
TTrameDir __fastcall Direction(void);
void __fastcall Link(TTrame *prev,TTrame *next);
AnsiString __fastcall TrameRead(void);
};
//---------------------------------------------------------------------------
class PACKAGE TTrameList : public TCustomControl
{
private:
TTrame *Phead;
TTrame *Ptop;
TTrame *Ptail;
TTrame *Psel;
TScrollBar *Psb;
TFont *FFont;
TColor Pcolorin;
TColor Pcolorout;
TColor Pcolorunk;
int Pnblines;
int Plineheight;
bool Pfocus;
bool Pdescription;
bool Pfalseclick;
unsigned char Pfilter[125];
protected:
DYNAMIC void __fastcall DoEnter(void);
DYNAMIC void __fastcall DoExit(void);
DYNAMIC void __fastcall Click(void);
DYNAMIC void __fastcall MouseDown(TMouseButton Button,Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseUp(TMouseButton Button,Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
bool __fastcall CanResize(int &NewWidth, int &NewHeight);
void __fastcall Paint(void);
void __fastcall SBChange( TObject *Sender );
void __fastcall UpdateSB(void);
void __fastcall AjustTop(void);
virtual void __fastcall SetDescription( bool value );
virtual void __fastcall SetLineHeight( int value );
virtual void __fastcall SetColorIn( TColor value );
virtual void __fastcall SetColorOut( TColor value );
virtual void __fastcall SetColorUnk( TColor value );
TTrame * __fastcall FindTrame(int Num);
// void __fastcall SetSB(TScrollBar *Value);
void __fastcall SetNumSel( int Num );
int __fastcall RNumSel(void);
public:
__fastcall TTrameList(TComponent* Owner);
__fastcall ~TTrameList();
void __fastcall Append(AnsiString Trame,AnsiString *Desc,TTrameDir Direction);
void __fastcall Up(void);
void __fastcall Down(void);
void __fastcall PageUp(void);
void __fastcall PageDown(void);
void __fastcall SetPos(int pos);
void __fastcall Filter(AnsiString Trame);
void __fastcall UnFilter(AnsiString Trame);
void __fastcall Clear(void);
AnsiString __fastcall TrameRead(int numtrame);
TTrameDir __fastcall TrameDir(int numtrame);
void __fastcall Change(void);
__published:
__property Align;
__property Anchors;
__property Constraints;
__property TabOrder;
__property TabStop;
__property Color;
__property bool Description = { read=Pdescription, write=SetDescription, default = false };
__property TColor ColorIn = { read=Pcolorin, write=SetColorIn, default = 0x00FFF0F0 };
__property TColor ColorOut= { read=Pcolorout, write=SetColorOut,default = 0x00F0F0FF };
__property TColor ColorUnk= { read=Pcolorunk, write=SetColorUnk,default = 0x00FFFFF0 };
__property Font;
__property int LineHeight = { read=Plineheight, write=SetLineHeight, default=8 };
__property int NumSel = {read = RNumSel, write=SetNumSel};
// __property TScrollBar *ScrollBar = {read=Psb, write=SetSB};
__property OnClick;
__property OnKeyUp;
__property OnKeyPress;
__property OnKeyDown;
__property OnEnter;
__property OnExit;
}; |
Partager