#ifndef ROOT_TGTextEntry #define ROOT_TGTextEntry //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TGTextEntry // // // // A TGTextEntry is a one line text input widget. // // // // Changing text in the text entry widget will generate the event: // // kC_TEXTENTRY, kTE_TEXTCHANGED, widget id, 0. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TGFrame //*KEEP,TGFrame. #include "TGFrame.h" //*KEND. #endif #ifndef ROOT_TGWidget //*KEEP,TGWidget. #include "TGWidget.h" //*KEND. #endif #ifndef ROOT_TGTextBuffer //*KEEP,TGTextBuffer,T=C++. #include "TGTextBuffer.h" //*KEND. #endif class TBlinkTimer; class TGTextEntry : public TGFrame, public TGWidget { friend class TGClient; protected: TGTextBuffer *fText; // text buffer Int_t fStartX; // selection begin in pixels Int_t fEndX; // selection end in pixels Int_t fStartIX; // selection begin in characters Int_t fEndIX; // selection end in characters Bool_t fSelectionOn; // selection status (on/off) Int_t fCursorX; // cursor position in pixels Int_t fCursorIX; // cursor position in characters Bool_t fCursorOn; // cursor status (on/off) FontStruct_t fFontStruct; // text font GContext_t fNormGC; // normal drawing context GContext_t fSelGC, fSelbackGC; // selection mode drawing contexts TBlinkTimer *fCurBlink; // cursor blink timer static Cursor_t fgDefaultCursor; static GContext_t fgDefaultGC; static GContext_t fgDefaultSelectedGC, fgDefaultSelectedBackgroundGC; static FontStruct_t fgDefaultFontStruct; virtual void DoRedraw(); Int_t GetCharacterIndex(Int_t xcoord); void PastePrimary(Window_t wid, Atom_t property, Bool_t del); public: TGTextEntry(const TGWindow *p, TGTextBuffer *text, Int_t id = -1, GContext_t norm = fgDefaultGC, FontStruct_t font = fgDefaultFontStruct, UInt_t option = kSunkenFrame | kDoubleBorder, ULong_t back = fgWhitePixel); virtual ~TGTextEntry(); TGTextBuffer *GetBuffer() const { return fText; } virtual Bool_t HandleButton(Event_t *event); virtual Bool_t HandleDoubleClick(Event_t *event); virtual Bool_t HandleMotion(Event_t *event); virtual Bool_t HandleKey(Event_t *event); virtual Bool_t HandleFocusChange(Event_t *event); virtual Bool_t HandleSelection(Event_t *event); virtual Bool_t HandleTimer(TTimer *t); virtual void DrawBorder(); virtual void SetState(Bool_t state); ClassDef(TGTextEntry,0) // One line text entry widget }; #endif