12#ifndef ROOT_TGTextView
13#define ROOT_TGTextView
94 virtual Bool_t LoadFile(
const char *fname,
long startpos = 0,
long length = -1);
116 virtual void AddLine(
const char *
string);
149 virtual void Clicked(
const char *word) {
Emit(
"Clicked(char *)", word); }
#define ClassDef(name, id)
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual Long_t ReturnLineLength(Long_t line)
virtual void AdjustWidth()
Adjust widget width to longest line.
virtual Bool_t Search(const char *string, Bool_t direction, Bool_t caseSensitive)
Search for string in text.
virtual void Update()
update the whole window of text view
virtual void UnMark()
Clear marked region.
virtual Long_t ToObjXCoord(Long_t xCoord, Long_t line)
Convert x screen coordinate to column in specified line.
virtual void SetHsbPosition(Long_t newPos)
Set position of horizontal scrollbar.
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
virtual void Mark(Long_t xPos, Long_t yPos)
Mark a text region from xPos to yPos.
virtual Long_t ReturnLongestLine()
virtual void Copy(TObject &) const
Copy this to obj.
static TGGC * fgDefaultSelectedGC
virtual Long_t ToScrYCoord(Long_t yCoord)
Convert line number to screen coordinate.
virtual Long_t ReturnLongestLineWidth()
Return width of longest line.
virtual Bool_t HandleDoubleClick(Event_t *event)
handle double click
TGTextView & operator=(const TGTextView &)
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
virtual void DataDropped(const char *fname)
void Init(Pixel_t bg)
Initialize a text view widget.
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle request to send current clipboard contents to requestor window.
static const TGGC & GetDefaultSelectedGC()
Return selection graphics context in use.
virtual void SetReadOnly(Bool_t on=kTRUE)
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in the text editor widget.
static const TGGC & GetDefaultGC()
Return default graphics context in use.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a text edit widget as a C++ statement(s) on output stream out.
virtual void AddLine(const char *string)
Add a line of text to the view widget.
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
virtual Bool_t HandleSelectionClear(Event_t *event)
Handle selection clear event.
virtual void Clicked(const char *word)
virtual void HLayout()
Horizontal layout of widgets (canvas, scrollbar).
virtual Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action, Int_t xroot, Int_t yroot)
Handle Drag position event.
TViewTimer * fScrollTimer
static const TGGC & GetDefaultSelectedBackgroundGC()
Return graphics context for highlighted frame background.
virtual Bool_t SelectAll()
Select all text in the viewer.
virtual void Layout()
Layout the components of view.
virtual void SetForegroundColor(Pixel_t)
Set text color.
virtual void SetSelectBack(Pixel_t p)
set selected text background color
static TGGC * fgDefaultGC
virtual void SetVsbPosition(Long_t newPos)
Set position of vertical scrollbar.
TGLongPosition fMarkedEnd
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw lines in exposed region.
virtual Long_t ToScrXCoord(Long_t xCoord, Long_t line)
Convert column number in specified line to screen coordinate.
virtual void Clear(Option_t *="")
Clear text view widget.
virtual void VLayout()
Vertical layout of widgets (canvas, scrollbar).
virtual Bool_t HandleDNDLeave()
Handle Drag Leave event.
virtual void Marked(Bool_t mark)
static const TGFont * fgDefaultFont
virtual void DataChanged()
Bool_t IsReadOnly() const
virtual Long_t ReturnLineCount()
virtual Bool_t Copy()
Copy selected text to clipboard.
virtual void DoubleClicked(const char *word)
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle Drag Enter event.
TGTextView(const TGTextView &)
virtual Bool_t HandleTimer(TTimer *t)
Handle scroll timer.
virtual Long_t ReturnHeighestColHeight()
virtual void AddLineFast(const char *string)
Add a line of text to the view widget.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in text editor.
virtual ~TGTextView()
Cleanup text view widget.
virtual void SetFont(FontStruct_t font)
Changes text entry font.
virtual void SetBackground(Pixel_t p)
set background color
virtual void ShowBottom()
Show bottom of the page.
virtual void SetSBRange(Int_t direction)
Set the range for the kVertical or kHorizontal scrollbar.
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle Drop event.
TGLongPosition fMarkedStart
virtual void SetText(TGText *text)
Adopt a new text buffer. The text will be deleted by this object.
virtual void ShowTop()
Show top of the page.
virtual void AddText(TGText *text)
Add text to the view widget.
virtual void SetSelectFore(Pixel_t p)
set selected text color
virtual Long_t ToObjYCoord(Long_t yCoord)
Convert y screen coordinate to line number.
static const TGGC * fgDefaultSelectedBackgroundGC
Long_t GetLongestLine() const
Long_t GetLineLength(Long_t row)
Get length of specified line. Returns -1 if row does not exist.
TGLongPosition fScrollVal
Mother of all ROOT objects.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Handles synchronous and a-synchronous timer events.
TViewTimer & operator=(const TViewTimer &)
TViewTimer(const TViewTimer &)
TViewTimer(TGView *t, Long_t ms)
Bool_t Notify()
Notify when timer times out and reset the timer.
static constexpr double ms