Provides a gtk+ gtktextview wrapper. This widget works under a buffer-view model, text buffer take care of changes and text view of displaying. Any change to text buffer will reflect automagically into text view. This widget substitutes old VDKText used on vdkbuilder version <= 1.2.5 and now deprecated even if will remain in use on earlier versions of VDK 2.0 series.
More...
#include <vdktextview.h>
List of all members.
Public Member Functions
- VDKTextView (VDKForm *owner, VDKTextBuffer *buffer=NULL, int left_border=0)
- virtual ~VDKTextView ()
- virtual void SetForeground (VDKRgb rgb, GtkStateType state=GTK_STATE_NORMAL)
- virtual void SetBackground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
- virtual void SetFont (VDKFont *font)
- VDKTextBuffer * Buffer (VDKTextBuffer *buff=NULL)
- void TextBorder (int size, int which=TVB_ALL)
- void ScrollToPos (int pointer=-1, int margin=0)
- void ScrollToLine (int line, int col, int margin=0)
- bool LoadFromFile (char *filename)
- void Clear ()
- gchar * GetChars (int start=0, int end=-1)
- bool SaveToFile (char *filename)
- void Thaw ()
- void Freeze ()
- void Undo ()
- void Eol ()
- void TextInsert (const char *txt, int nchar=-1)
- void ForwardDelete (int nchars)
- void BackwardDelete (int nchars)
- bool IsLineVisible (int line)
- int GetLineAtOffset (int offset)
Public Attributes
Detailed Description
Provides a gtk+ gtktextview wrapper. This widget works under a buffer-view model, text buffer take care of changes and text view of displaying. Any change to text buffer will reflect automagically into text view. This widget substitutes old VDKText used on vdkbuilder version <= 1.2.5 and now deprecated even if will remain in use on earlier versions of VDK 2.0 series.
Constructor & Destructor Documentation
Constructor
- Parameters:
-
owner | |
buffer | NULL widget will make his own buffer, otherwise will share <buffer> |
left_border | if greater than 0 a left window will be made with <left_border> size |
- tip
- left_border should be greater than zero if user wants activate ShowLineNumbers property.
VDKTextView::~VDKTextView |
( |
| ) |
[virtual] |
Member Function Documentation
void VDKTextView::BackwardDelete |
( |
int |
nchars | ) |
[inline] |
Backward delete chars from insertion point
Sets/Gets text buffer. Several text views can share same text buffer:
void VDKTextView::Clear |
( |
| ) |
[inline] |
Clears text buffer deleting all text.
void VDKTextView::Eol |
( |
| ) |
[inline] |
Inserts a new line at insertion point
void VDKTextView::ForwardDelete |
( |
int |
nchars | ) |
[inline] |
Forward delete chars from insertion point
void VDKTextView::Freeze |
( |
| ) |
[inline] |
maintained for compatibility with old text widgets, but is dummy
gchar* VDKTextView::GetChars |
( |
int |
start = 0 , |
|
|
int |
end = -1 |
|
) |
| [inline] |
Returns a text segment
- Parameters:
-
start | starting position |
end | ending position, if -1 all text buffer from start to end will be returned. |
- Tip
- Invisible chars won't be included. Returned address should be g_free()'d by user.
int VDKTextView::GetLineAtOffset |
( |
int |
offset | ) |
[inline] |
Gets line number at a buffer position
- Parameters:
-
offset | buffer offset position (counting from 0) on error returns -1 |
bool VDKTextView::IsLineVisible |
( |
int |
line | ) |
[inline] |
Answer if a line is visible or not line are counted from 0
- Parameters:
-
bool VDKTextView::LoadFromFile |
( |
char * |
filename | ) |
[inline] |
Load text buffer with a file
- Parameters:
-
bool VDKTextView::SaveToFile |
( |
char * |
filename | ) |
[inline] |
void VDKTextView::ScrollToLine |
( |
int |
line, |
|
|
int |
col, |
|
|
int |
margin = 0 |
|
) |
| |
Scrolls to a line,column leaving <margin> pixels free
void VDKTextView::ScrollToPos |
( |
int |
pointer = -1 , |
|
|
int |
margin = 0 |
|
) |
| |
Scrolls to a pointer pos or (default) to current pointer position, leaving <margin> pixels free
void VDKTextView::SetBackground |
( |
VDKRgb |
color, |
|
|
GtkStateType |
state = GTK_STATE_NORMAL |
|
) |
| [virtual] |
Sets object background
- Parameters:
-
color | a VDKRgb object |
state | can be one of the gtk+ widget states |
Reimplemented from VDKObject.
void VDKTextView::SetFont |
( |
VDKFont * |
f | ) |
[virtual] |
Sets object font
Reimplemented from VDKObject.
void VDKTextView::SetForeground |
( |
VDKRgb |
color, |
|
|
GtkStateType |
state = GTK_STATE_NORMAL |
|
) |
| [virtual] |
Sets object foreground
- Parameters:
-
color | a VDKRgb object |
state | can be one of the gtk+ widget states |
Reimplemented from VDKObject.
void VDKTextView::TextBorder |
( |
int |
size, |
|
|
int |
which = TVB_ALL |
|
) |
| |
Sets borders around text window.
- Parameters:
-
size | border size in pixels |
which | side border should be set
- TVB_LEFT
- TVB_TOP
- TVB_RIGHT
- TVB_BOTTOM that can be ored togheter.
- TVB_ALL (default) use this to set all sides border size.
|
void VDKTextView::TextInsert |
( |
const char * |
txt, |
|
|
int |
nchar = -1 |
|
) |
| [inline] |
Inserts text at cursor position.
- Parameters:
-
txt | null terminating string to be inserted |
nchars | how many chars have to be inserted (-1 means all) |
void VDKTextView::Thaw |
( |
| ) |
[inline] |
maintained for compatibility with old text widgets, but is dummy
void VDKTextView::Undo |
( |
void |
| ) |
[inline] |
Member Data Documentation
Sets/gets text insertion position expressed in column offset
Gets first visible line (lines are counted from 0)
Gets last visible line (lines are counted from 0)
Sets/gets text insertion position expressed in lines
Sets/gets text insertion position expressed in chars from text beginning. (counting from 0, gets -1 on failure)
The documentation for this class was generated from the following files: