12#ifndef ROOT_TGTextView
13#define ROOT_TGTextView
105 virtual void AddLine(
const char *
string);
138 virtual void Clicked(
const char *word) {
Emit(
"Clicked(char *)", word); }
ULong_t Pixel_t
Pixel value.
Handle_t FontStruct_t
Pointer to font structure.
#define ClassDefOverride(name, id)
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t Atom_t typelist
Option_t Option_t TPoint TPoint const char text
Drag and drop data container.
Encapsulate fonts used in the GUI system.
static Pixel_t GetWhitePixel()
Get white pixel value.
Encapsulate a graphics context used in the low level graphics.
A TGTextView is a text viewer widget.
Bool_t HandleDNDLeave() override
Handle Drag Leave event.
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.
Int_t fMaxDescent
maximum descent in font
virtual void Update()
update the whole window of text view
TGGC fNormGC
graphics context for drawing text
Int_t fMaxAscent
maximum ascent in font
Bool_t fReadOnly
text cannot be edited
TGText * fText
text buffer
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.
void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Draw lines in exposed region.
virtual Long_t ReturnLongestLine()
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.
Bool_t HandleCrossing(Event_t *event) override
Handle mouse crossing event.
Int_t fMaxWidth
maximum width of character in font
TGText * fClipText
clipboard text buffer
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
void Layout() override
Layout the components of view.
FontStruct_t fFont
text font
virtual void DataDropped(const char *fname)
void Init(Pixel_t bg)
Initialize a text view widget.
Bool_t fIsSaved
true is content is saved
static const TGGC & GetDefaultSelectedGC()
Return selection graphics context in use.
virtual void SetReadOnly(Bool_t on=kTRUE)
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Bool_t fIsMarking
true if in marking mode
Bool_t HandleTimer(TTimer *t) override
Handle scroll timer.
Bool_t HandleSelectionClear(Event_t *event) override
Handle selection clear event.
Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action, Int_t xroot, Int_t yroot) override
Handle Drag position event.
virtual void AddLine(const char *string)
Add a line of text to the view widget.
Bool_t fIsMarked
true if text is marked/selected
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in the text editor widget.
virtual void Clicked(const char *word)
TGGC fSelbackGC
graphics context for drawing marked background
virtual void HLayout()
Horizontal layout of widgets (canvas, scrollbar).
TGGC fSelGC
graphics context for drawing marked text
Atom_t HandleDNDEnter(Atom_t *typelist) override
Handle Drag Enter event.
TViewTimer * fScrollTimer
scrollbar timer
Bool_t HandleDoubleClick(Event_t *event) override
handle double click
static const TGGC & GetDefaultSelectedBackgroundGC()
Return graphics context for highlighted frame background.
virtual Bool_t SelectAll()
Select all text in the viewer.
void SetForegroundColor(Pixel_t) override
Set text color.
Atom_t * fDNDTypeList
handles DND types
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
end position of marked text
virtual Long_t ToScrXCoord(Long_t xCoord, Long_t line)
Convert column number in specified line to screen coordinate.
virtual void VLayout()
Vertical layout of widgets (canvas, scrollbar).
TGTextView & operator=(const TGTextView &)=delete
virtual void Marked(Bool_t mark)
static const TGFont * fgDefaultFont
void Copy(TObject &) const override
Copy this to obj.
virtual void DataChanged()
Bool_t IsReadOnly() const
Bool_t fMarkedFromY
true if text is marker from y
void SavePrimitive(std::ostream &out, Option_t *="") override
Save a text edit widget as a C++ statement(s) on output stream out.
virtual Long_t ReturnLineCount()
virtual Bool_t Copy()
Copy selected text to clipboard.
virtual void DoubleClicked(const char *word)
TGTextView(const TGTextView &)=delete
Bool_t HandleSelectionRequest(Event_t *event) override
Handle request to send current clipboard contents to requestor window.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in text editor.
virtual Long_t ReturnHeighestColHeight()
virtual void AddLineFast(const char *string)
Add a line of text to the view widget.
virtual ~TGTextView()
Cleanup text view widget.
Bool_t HandleDNDDrop(TDNDData *data) override
Handle Drop event.
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.
TGLongPosition fMarkedStart
start position of marked text
virtual void SetText(TGText *text)
Adopt a new text buffer. The text will be deleted by this object.
Bool_t fMarkedFromX
true if text is marked from x
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.
void Clear(Option_t *="") override
Clear text view widget.
static const TGGC * fgDefaultSelectedBackgroundGC
A TGText is a multi line text buffer.
Long_t GetLongestLine() const
Long_t GetLineLength(Long_t row)
Get length of specified line. Returns -1 if row does not exist.
A TGView provides the infrastructure for text viewer and editor widgets.
TGLongPosition fScrollVal
scroll value
ROOT GUI Window base class.
Mother of all ROOT objects.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Handles synchronous and a-synchronous timer events.
TViewTimer & operator=(const TViewTimer &)=delete
TViewTimer(TGView *t, Long_t ms)
TViewTimer(const TViewTimer &)=delete
Bool_t Notify() override
Notify when timer times out and reset the timer.