#include <uedit.hpp>
Inheritance diagram for ubit::UEdit:
Public Member Functions | |
UEdit () | |
creates a new UEdit property. | |
bool | isEditable () const |
UEdit & | setEditable (bool=true) |
get/set text editing mode | |
bool | isCaretVisible () const |
UEdit & | setCaretVisible (bool=true) |
get/set caret visibility. | |
UColor * | getCaretColor () const |
UEdit & | setCaretColor (UColor *) |
get/set the color used to render the caret. | |
long | getCaretPos () const |
UEdit & | setCaretPos (long pos) |
get/sets the caret position. | |
long | getCaretPos (UGroup *container) const |
UEdit & | setCaretPos (long pos, UGroup *container) |
get/sets the caret position of a shared UEdit. | |
UStr * | getCaretStr () const |
UStr * | getCaretStr (int &pos_in_str) const |
returns the UStr that contains the caret and the position of the caret in this string. | |
UEdit & | setCaretStr (UStr *str) |
UEdit & | setCaretStr (UStr *str, int pos_in_str) |
sets the UStr that contains the caret and the position of the caret in this string. | |
USelection * | getSelection (UEvent &e, UStr &sel_text) |
void | deleteSelection (USelection *sel, UStr &sel_text, UGroup *container) |
void | deletePreviousChar (UGroup *container, UView *view) |
void | deleteChar (UGroup *container, UView *view) |
bool | nextChar (UGroup *container, UView *view) |
bool | previousChar (UGroup *container, UView *view) |
void | beginningOfLine (UGroup *container, UView *view) |
void | endOfLine (UGroup *container, UView *view) |
void | previousLine (UGroup *container, UView *view) |
void | nextLine (UGroup *container, UView *view) |
[impl] moves the caret in the expected way. | |
virtual void | update () |
updates parents graphics. | |
Static Public Member Functions | |
static UStr * | getPreviousStr (UStr *from, UGroup *container) |
static UStr * | getNextStr (UStr *from, UGroup *container) |
[unstable] returns the string before/after 'from' in this 'container'. | |
static UStr * | getParagraphFirstStr (UStr *from, int &pos, UGroup *container) |
static UStr * | getParagraphLastStr (UStr *from, int &pos, UGroup *container) |
[unstable] returns the first/last string in the same paragraph than 'from'. | |
Friends | |
UEdit & | uedit () |
creator shortcutthat returns *new UEdit(). |
exemple:
UStr& str = ustr("abcd"); UBox& box = ubox(uedit() + str);makes'str' editable inside container 'box'
UStr * ubit::UEdit::getCaretStr | ( | int & | pos_in_str | ) | const |
returns the UStr that contains the caret and the position of the caret in this string.
details:
[unstable] returns the string before/after 'from' in this 'container'.
returns null if no previous/next string. [unstable] this fct is not defined at the right place!
[unstable] returns the first/last string in the same paragraph than 'from'.
returns the beginning/ending string contained in the same line than 'from' in this parent. returns 'from' itself if it is the beginning/ending string. [unstable] this fct is not defined at the right place!
[impl] moves the caret in the expected way.
marche pas if (!repainted) scroll(view, +1);
get/set the color used to render the caret.
a value of null means that the caret has the same color as the text
UEdit & ubit::UEdit::setCaretPos | ( | long | pos | ) |
get/sets the caret position.
NOTE that
chars are not visible but count for 1 char!
sets the UStr that contains the caret and the position of the caret in this string.
details: