vdk 2.4.0
|
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>
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) |
![]() | |
int | BorderWidth (int w=-1) |
virtual void | Add (VDKObject *obj, int justify=l_justify, int expand=TRUE, int fill=TRUE, int padding=0) |
void | RemoveObject (VDKObject *obj) |
virtual void | RemoveObjectFromContainer (VDKObject *obj) |
void | RemoveObjects () |
VDKObject * | FindTag (int tag) |
void | ForEachDo (void(*action)(VDKObject *)) |
![]() | |
VDKRgb | GetBackground (GtkStateType state=GTK_STATE_NORMAL) |
VDKRgb | GetForeground (GtkStateType state=GTK_STATE_NORMAL) |
VDKObject (VDKForm *owner=NULL) | |
VDKObject (VDKForm *owner, GtkWidget *widget) | |
virtual | ~VDKObject () |
bool | Destroy () |
virtual int | isA () |
VDKForm * | Owner () |
virtual GtkWidget * | Widget () |
GtkWidget * | ConnectingWidget () |
GtkWidget * | WrappedWidget () |
VDKFont * | GetFont () |
void | SetVisible (bool visible) |
bool | GetVisible () |
void | SetCursor (VDKCursorType) |
VDKCursorType | GetCursor () |
void | SetSize (int w, int h) |
void | SetUsize (VDKPoint s) |
virtual void | SetTip (char *) |
ItemList & | Items () |
void | Draw (GdkRectangle *area=NULL) |
virtual void | Setup () |
void | SignalEmit (int signal) |
void | SignalEmit (char *sig) |
void | SignalEmitParent (int signal) |
void | SignalEmitParent (char *sig) |
void | GrabFocus () |
VDKObject * | Parent (VDKObject *p=NULL) |
int | SignalConnect (VDKObject *obj, char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false) |
int | SignalConnect (char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false) |
bool | SignalDisconnect (int connection) |
int | EventConnect (VDKObject *obj, char *event, bool(VDKObject::*method)(VDKObject *, GdkEvent *), bool after=false) |
int | EventConnect (char *, bool(VDKObject::*)(VDKObject *, GdkEvent *), bool after=false) |
bool | EventDisconnect (int connection) |
Public Attributes | |
VDKReadWriteValueProp < VDKTextView, int > | Pointer |
VDKReadWriteValueProp < VDKTextView, int > | Column |
VDKReadWriteValueProp < VDKTextView, int > | Line |
VDKReadOnlyValueProp < VDKTextView, int > | FirstVisibleLine |
VDKReadOnlyValueProp < VDKTextView, int > | LastVisibleLine |
VDKReadWriteValueProp < VDKTextView, bool > | Changed |
Additional Inherited Members | |
![]() | |
VDKObjectSignal | s_clicked |
GtkWidget * | widget |
GtkWidget * | sigwid |
VDKObject * | parent |
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.
VDKTextView::VDKTextView | ( | VDKForm * | owner, |
VDKTextBuffer * | buffer = NULL , |
||
int | left_border = 0 |
||
) |
Constructor
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 |
|
virtual |
Destructor
|
inline |
Backward delete chars from insertion point
VDKTextBuffer * VDKTextView::Buffer | ( | VDKTextBuffer * | buff = NULL | ) |
Sets/Gets text buffer. Several text views can share same text buffer:
|
inline |
Clears text buffer deleting all text.
|
inline |
Inserts a new line at insertion point
|
inline |
Forward delete chars from insertion point
|
inline |
maintained for compatibility with old text widgets, but is dummy
|
inline |
Returns a text segment
start | starting position |
end | ending position, if -1 all text buffer from start to end will be returned. |
|
inline |
Gets line number at a buffer position
offset | buffer offset position (counting from 0) on error returns -1 |
|
inline |
Answer if a line is visible or not line are counted from 0
line |
|
inline |
Load text buffer with a file
filename |
|
inline |
Save buffer to file
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
|
virtual |
|
virtual |
void VDKTextView::TextBorder | ( | int | size, |
int | which = TVB_ALL |
||
) |
Sets borders around text window.
size | border size in pixels |
which | side border should be set
|
|
inline |
Inserts text at cursor position.
txt | null terminating string to be inserted |
nchars | how many chars have to be inserted (-1 means all) |
|
inline |
maintained for compatibility with old text widgets, but is dummy
|
inline |
Undoes last operation
VDKReadWriteValueProp<VDKTextView,bool> VDKTextView::Changed |
Sets/gets modified flag
VDKReadWriteValueProp<VDKTextView,int> VDKTextView::Column |
Sets/gets text insertion position expressed in column offset
VDKReadOnlyValueProp<VDKTextView,int> VDKTextView::FirstVisibleLine |
Gets first visible line (lines are counted from 0)
VDKReadOnlyValueProp<VDKTextView,int> VDKTextView::LastVisibleLine |
Gets last visible line (lines are counted from 0)
VDKReadWriteValueProp<VDKTextView,int> VDKTextView::Line |
Sets/gets text insertion position expressed in lines
VDKReadWriteValueProp<VDKTextView,int> VDKTextView::Pointer |
Sets/gets text insertion position expressed in chars from text beginning. (counting from 0, gets -1 on failure)