ROOT
6.06/09
Reference Guide
|
Public Member Functions | |
TGText () | |
Create default (empty) text buffer. More... | |
TGText (TGText *text) | |
Create text buffer and initialize with other text buffer. More... | |
TGText (const char *string) | |
Create text buffer and initialize with single line string. More... | |
virtual | ~TGText () |
Destroy text buffer. More... | |
void | Clear () |
Clear text buffer. More... | |
Bool_t | Load (const char *fn, Long_t startpos=0, Long_t length=-1) |
Load text from file fn. More... | |
Bool_t | LoadBuffer (const char *txtbuf) |
Load a 0 terminated buffer. Lines will be split at ' '. More... | |
Bool_t | Save (const char *fn) |
Save text buffer to file fn. More... | |
Bool_t | Append (const char *fn) |
Append buffer to file fn. More... | |
Bool_t | IsSaved () const |
const char * | GetFileName () const |
Bool_t | DelChar (TGLongPosition pos) |
Delete character at specified position pos. More... | |
Bool_t | InsChar (TGLongPosition pos, char c) |
Insert character c at the specified position pos. More... | |
char | GetChar (TGLongPosition pos) |
Get character a position pos. If charcater not valid return -1. More... | |
Bool_t | DelText (TGLongPosition start, TGLongPosition end) |
Delete text between start and end positions. More... | |
Bool_t | InsText (TGLongPosition pos, const char *buf) |
Insert single line at specified position. More... | |
Bool_t | InsText (TGLongPosition ins_pos, TGText *src, TGLongPosition start_src, TGLongPosition end_src) |
Insert src text from start_src to end_src into text at position ins_pos. More... | |
Bool_t | AddText (TGText *text) |
Add another text buffer to this buffer. More... | |
Bool_t | DelLine (ULong_t pos) |
Delete specified row. Returns false if row does not exist. More... | |
char * | GetLine (TGLongPosition pos, ULong_t length) |
Return string at position pos. More... | |
TString | AsString () |
Returns content as ROOT string. More... | |
TGTextLine * | GetCurrentLine () const |
Bool_t | BreakLine (TGLongPosition pos) |
Break line at position pos. Returns false if pos is not valid. More... | |
Bool_t | InsLine (ULong_t row, const char *string) |
Insert string before specified position. More... | |
Long_t | RowCount () const |
Long_t | ColCount () const |
Long_t | GetLineLength (Long_t row) |
Get length of specified line. Returns -1 if row does not exist. More... | |
Long_t | GetLongestLine () const |
void | ReTab (Long_t row) |
Redo all tabs in a line. Needed after a new tab is inserted. More... | |
Bool_t | Search (TGLongPosition *foundPos, TGLongPosition start, const char *searchString, Bool_t direction, Bool_t caseSensitive) |
Search for string searchString starting at the specified position going in forward (direction = true) or backward direction. More... | |
Bool_t | Replace (TGLongPosition start, const char *oldText, const char *newText, Bool_t direction, Bool_t caseSensitive) |
Replace oldText by newText. Returns false if nothing replaced. More... | |
Protected Member Functions | |
TGText (const TGText &) | |
TGText & | operator= (const TGText &) |
assignment operator More... | |
void | Init () |
Common initialization method. More... | |
Bool_t | SetCurrentRow (Long_t row) |
Make specified row the current row. More... | |
void | LongestLine () |
Set fLongestLine. More... | |
Protected Attributes | |
TString | fFilename |
Bool_t | fIsSaved |
TGTextLine * | fFirst |
TGTextLine * | fCurrent |
Long_t | fCurrentRow |
Long_t | fRowCount |
Long_t | fColCount |
Long_t | fLongestLine |
#include <TGText.h>
|
protected |
TGText::TGText | ( | ) |
Create default (empty) text buffer.
Definition at line 362 of file TGText.cxx.
TGText::TGText | ( | TGText * | text | ) |
Create text buffer and initialize with other text buffer.
Definition at line 370 of file TGText.cxx.
TGText::TGText | ( | const char * | string | ) |
Create text buffer and initialize with single line string.
Definition at line 384 of file TGText.cxx.
|
virtual |
Destroy text buffer.
Definition at line 396 of file TGText.cxx.
Add another text buffer to this buffer.
Definition at line 910 of file TGText.cxx.
Referenced by TGTextView::AddText().
Bool_t TGText::Append | ( | const char * | fn | ) |
Append buffer to file fn.
Definition at line 650 of file TGText.cxx.
TString TGText::AsString | ( | ) |
Returns content as ROOT string.
Definition at line 1237 of file TGText.cxx.
Referenced by TGTextEdit::Copy(), TGTextEdit::Paste(), and TGLAnnotation::UpdateText().
Bool_t TGText::BreakLine | ( | TGLongPosition | pos | ) |
Break line at position pos. Returns false if pos is not valid.
Definition at line 1007 of file TGText.cxx.
Referenced by TGTextEdit::BreakLine(), and InsText().
void TGText::Clear | ( | ) |
Clear text buffer.
Definition at line 405 of file TGText.cxx.
Referenced by TGTextView::Clear(), TGTextEdit::Delete(), TGTextEdit::Paste(), and ~TGText().
Bool_t TGText::DelChar | ( | TGLongPosition | pos | ) |
Delete character at specified position pos.
Definition at line 690 of file TGText.cxx.
Referenced by TGTextEdit::DelChar().
Delete specified row. Returns false if row does not exist.
Definition at line 963 of file TGText.cxx.
Referenced by TGTextEdit::DelChar(), and DelText().
Bool_t TGText::DelText | ( | TGLongPosition | start, |
TGLongPosition | end | ||
) |
Delete text between start and end positions.
Returns false in case of failure (start and end not being within bounds).
Definition at line 735 of file TGText.cxx.
Referenced by TGTextEdit::Delete(), and Replace().
char TGText::GetChar | ( | TGLongPosition | pos | ) |
Get character a position pos. If charcater not valid return -1.
Definition at line 722 of file TGText.cxx.
Referenced by TGTextEdit::DelChar(), TGTextEdit::DrawCursor(), TGTextEdit::HandleButton(), TGTextEdit::HandleDoubleClick(), TGTextEdit::HandleMotion(), TGTextEdit::HandleSelection(), TGTextEdit::LineDown(), TGTextEdit::LineUp(), TGTextEdit::NextChar(), TGTextEdit::PrevChar(), TGTextEdit::ScreenDown(), and TGTextEdit::ScreenUp().
|
inline |
Definition at line 116 of file TGText.h.
Referenced by TGTextEdit::HandleButton(), TGTextEdit::HandleDoubleClick(), and TGTextEdit::InsChar().
|
inline |
Definition at line 102 of file TGText.h.
Referenced by TGTextEdit::Print(), TGTextEdit::ProcessMessage(), TGTextEdit::SaveFile(), TGTextView::SavePrimitive(), TGTextEdit::SavePrimitive(), and Editor::SetTitle().
char * TGText::GetLine | ( | TGLongPosition | pos, |
ULong_t | length | ||
) |
Return string at position pos.
Returns 0 in case pos is not valid. The returned string must be deleted by the user.
Definition at line 996 of file TGText.cxx.
Referenced by TGTextEdit::DelChar(), TGTextView::DrawRegion(), TGTextView::HandleSelectionRequest(), InsText(), TGTextEdit::Print(), TGTextView::ToObjXCoord(), and TGTextView::ToScrXCoord().
Get length of specified line. Returns -1 if row does not exist.
Definition at line 1042 of file TGText.cxx.
Referenced by AddText(), TGTextView::AdjustWidth(), TGTextView::Copy(), TGTextEdit::DelChar(), TGTextEdit::Delete(), DelText(), TGTextEdit::DrawCursor(), TGTextView::DrawRegion(), TGTextEdit::End(), TGTextEdit::Goto(), TGTextEdit::HandleButton(), TGTextEdit::HandleDoubleClick(), TGTextEdit::HandleKey(), TGTextEdit::HandleMotion(), TGTextEdit::HandleSelection(), TGTextView::HandleSelectionRequest(), TGTextEdit::InsChar(), InsText(), TGTextEdit::LineDown(), TGTextEdit::LineUp(), TGTextView::Mark(), TGTextEdit::NextChar(), TGTextEdit::PrevChar(), TGTextEdit::Print(), TGTextView::ReturnLineLength(), TGTextView::ReturnLongestLineWidth(), TGTextView::SelectAll(), TGTextEdit::SetMenuState(), TGText(), TGTextView::TGTextView(), TGTextView::ToObjXCoord(), and TGTextView::ToScrXCoord().
|
inline |
Definition at line 124 of file TGText.h.
Referenced by TGTextView::AdjustWidth(), and TGTextView::ReturnLongestLine().
|
protected |
Bool_t TGText::InsChar | ( | TGLongPosition | pos, |
char | c | ||
) |
Insert character c at the specified position pos.
Definition at line 706 of file TGText.cxx.
Referenced by TGTextEdit::InsChar().
Insert string before specified position.
Returns false if insertion failed.
Definition at line 927 of file TGText.cxx.
Bool_t TGText::InsText | ( | TGLongPosition | pos, |
const char * | buffer | ||
) |
Insert single line at specified position.
Return false in case position is out of bounds.
Definition at line 887 of file TGText.cxx.
Referenced by TGTextView::AddLineFast(), AddText(), TGTextEdit::Copy(), TGTextView::Copy(), TGTextEdit::DelChar(), TGTextEdit::HandleSelection(), Replace(), TGText(), and TGTextView::TGTextView().
Bool_t TGText::InsText | ( | TGLongPosition | ins_pos, |
TGText * | src, | ||
TGLongPosition | start_src, | ||
TGLongPosition | end_src | ||
) |
Insert src text from start_src to end_src into text at position ins_pos.
Returns false in case of failure (start_src, end_src out of range for src, and ins_pos out of range for this).
Definition at line 784 of file TGText.cxx.
|
inline |
Definition at line 101 of file TGText.h.
Referenced by TGTextView::IsSaved().
Load text from file fn.
Startpos is the begin from where to load the file and length is the number of characters to read from the file.
Definition at line 430 of file TGText.cxx.
Referenced by TGTextView::LoadFile().
Bool_t TGText::LoadBuffer | ( | const char * | txtbuf | ) |
Load a 0 terminated buffer. Lines will be split at '
'.
Definition at line 512 of file TGText.cxx.
Referenced by TSessionLogView::AddBuffer(), TProofProgressLog::AddBuffer(), TRootHelpDialog::AddText(), TGTextEdit::HandleSelection(), TGTextView::LoadBuffer(), TGLAnnotation::MakeEditor(), and TGTextEdit::Paste().
|
protected |
Set fLongestLine.
Definition at line 1219 of file TGText.cxx.
Referenced by BreakLine(), DelChar(), DelLine(), DelText(), InsChar(), InsLine(), InsText(), Load(), and LoadBuffer().
assignment operator
Definition at line 330 of file TGText.cxx.
Bool_t TGText::Replace | ( | TGLongPosition | start, |
const char * | oldText, | ||
const char * | newText, | ||
Bool_t | direction, | ||
Bool_t | caseSensitive | ||
) |
Replace oldText by newText. Returns false if nothing replaced.
Definition at line 1196 of file TGText.cxx.
Referenced by TGTextEdit::Replace().
Redo all tabs in a line. Needed after a new tab is inserted.
Definition at line 1086 of file TGText.cxx.
Referenced by TGTextEdit::DelChar(), and TGTextEdit::InsChar().
|
inline |
Definition at line 120 of file TGText.h.
Referenced by TGTextView::AddLine(), TGTextView::AddLineFast(), AddText(), TGTextView::AddText(), TGTextEdit::Copy(), TGTextEdit::Delete(), TGTextEdit::DrawCursor(), TGTextView::DrawRegion(), TGTextEdit::Goto(), TGTextEdit::HandleButton(), TGTextView::HandleDNDDrop(), TGTextEdit::HandleDoubleClick(), TGTextEdit::HandleKey(), TGTextEdit::HandleMotion(), TGTextEdit::HandleSelection(), TGTextView::HandleSelectionRequest(), TGTextEdit::LineDown(), TGLAnnotation::MakeEditor(), TGTextView::Mark(), TGTextEdit::NextChar(), TGTextEdit::Print(), TGTextView::ReturnHeighestColHeight(), TGTextView::ReturnLineCount(), TGTextView::ReturnLongestLineWidth(), TGTextEdit::ScreenDown(), TGTextView::SelectAll(), TGTextEdit::SetMenuState(), TGText(), TGTextView::TGTextView(), TGTextView::ToObjXCoord(), and TGTextView::ToScrYCoord().
Bool_t TGText::Save | ( | const char * | fn | ) |
Save text buffer to file fn.
Definition at line 609 of file TGText.cxx.
Referenced by TGHtmlBrowser::ProcessMessage(), TGTextEdit::SaveFile(), TGTextView::SavePrimitive(), TGTextEdit::SavePrimitive(), and TGHtml::SavePrimitive().
Bool_t TGText::Search | ( | TGLongPosition * | foundPos, |
TGLongPosition | start, | ||
const char * | searchString, | ||
Bool_t | direction, | ||
Bool_t | caseSensitive | ||
) |
Search for string searchString starting at the specified position going in forward (direction = true) or backward direction.
Returns true if found and foundPos is set accordingly.
Definition at line 1142 of file TGText.cxx.
Referenced by Replace(), TGTextView::Search(), and TGTextEdit::Search().
Make specified row the current row.
Returns false if row does not exist. In which case fCurrent is not changed or set to the last valid line.
Definition at line 1054 of file TGText.cxx.
Referenced by BreakLine(), DelChar(), DelLine(), DelText(), GetChar(), GetLine(), GetLineLength(), InsChar(), InsLine(), InsText(), Replace(), ReTab(), and Search().
|
protected |
Definition at line 80 of file TGText.h.
Referenced by AsString(), Clear(), ColCount(), Init(), LongestLine(), and operator=().
|
protected |
Definition at line 77 of file TGText.h.
Referenced by BreakLine(), Clear(), DelChar(), DelLine(), DelText(), GetChar(), GetCurrentLine(), GetLine(), GetLineLength(), Init(), InsChar(), InsLine(), InsText(), Load(), LoadBuffer(), operator=(), ReTab(), Search(), and SetCurrentRow().
|
protected |
Definition at line 78 of file TGText.h.
Referenced by BreakLine(), Clear(), DelLine(), DelText(), Init(), InsLine(), InsText(), operator=(), Search(), and SetCurrentRow().
|
protected |
Definition at line 74 of file TGText.h.
Referenced by Clear(), Load(), LoadBuffer(), operator=(), and Save().
|
protected |
Definition at line 76 of file TGText.h.
Referenced by Append(), AsString(), Clear(), DelLine(), Init(), InsLine(), Load(), LoadBuffer(), LongestLine(), operator=(), Save(), and ~TGText().
|
protected |
|
protected |
Definition at line 81 of file TGText.h.
Referenced by AsString(), Clear(), GetLongestLine(), Init(), LongestLine(), and operator=().
|
protected |
Definition at line 79 of file TGText.h.
Referenced by AddText(), BreakLine(), Clear(), DelChar(), DelLine(), DelText(), GetChar(), Init(), InsChar(), InsLine(), InsText(), Load(), LoadBuffer(), operator=(), RowCount(), and SetCurrentRow().