ubit::UEdit Class Reference

Text editing and caret controller. More...

#include <uedit.hpp>

Inheritance diagram for ubit::UEdit:

ubit::UProp ubit::UBrick ubit::UObject List of all members.

Public Member Functions

 UEdit ()
 creates a new UEdit property.
bool isEditable () const
UEditsetEditable (bool=true)
 get/set text editing mode
bool isCaretVisible () const
UEditsetCaretVisible (bool=true)
 get/set caret visibility.
UColorgetCaretColor () const
UEditsetCaretColor (UColor *)
 get/set the color used to render the caret.
long getCaretPos () const
UEditsetCaretPos (long pos)
 get/sets the caret position.
long getCaretPos (UGroup *container) const
UEditsetCaretPos (long pos, UGroup *container)
 get/sets the caret position of a shared UEdit.
UStrgetCaretStr () const
UStrgetCaretStr (int &pos_in_str) const
 returns the UStr that contains the caret and the position of the caret in this string.
UEditsetCaretStr (UStr *str)
UEditsetCaretStr (UStr *str, int pos_in_str)
 sets the UStr that contains the caret and the position of the caret in this string.
USelectiongetSelection (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 UStrgetPreviousStr (UStr *from, UGroup *container)
static UStrgetNextStr (UStr *from, UGroup *container)
 [unstable] returns the string before/after 'from' in this 'container'.
static UStrgetParagraphFirstStr (UStr *from, int &pos, UGroup *container)
static UStrgetParagraphLastStr (UStr *from, int &pos, UGroup *container)
 [unstable] returns the first/last string in the same paragraph than 'from'.

Friends

UEdituedit ()
 creator shortcutthat returns *new UEdit().

Detailed Description

Text editing and caret controller.

exemple:

   UStr& str = ustr("abcd");
   UBox& box = ubox(uedit() + str);
 
makes'str' editable inside container 'box'


Member Function Documentation

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:

UStr * ubit::UEdit::getNextStr ( UStr from,
UGroup container 
) [static]

[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!

UStr * ubit::UEdit::getParagraphLastStr ( UStr from,
int &  pos,
UGroup container 
) [static]

[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!

void ubit::UEdit::nextLine ( UGroup container,
UView view 
)

[impl] moves the caret in the expected way.

marche pas if (!repainted) scroll(view, +1);

void ubit::UEdit::previousLine ( UGroup container,
UView view 
)

UEdit & ubit::UEdit::setCaretColor ( UColor  ) 

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,
UGroup container 
)

get/sets the caret position of a shared UEdit.

when the UEdit is shared by several containers (a strange idea actually) it is necessary to specify which container we are talking about

UEdit & ubit::UEdit::setCaretPos ( long  pos  ) 

get/sets the caret position.

NOTE that
chars are not visible but count for 1 char!

UEdit & ubit::UEdit::setCaretStr ( UStr str,
int  pos_in_str 
)

sets the UStr that contains the caret and the position of the caret in this string.

details:


The documentation for this class was generated from the following files:
Generated on Mon Jan 29 00:20:49 2007 for Ubit by  doxygen 1.4.7