|
Text editor widget. More...
#include <CEditor.h>
Public Member Functions | |
| CEditor (int layoutSize=100, CLayoutAlign layoutAlign=CLayoutAlign::TOP) | |
| ~CEditor () override | |
| Fl_Text_Buffer * | textBuffer () |
| Fl_Text_Buffer * | styleBuffer () |
| bool | preferredSize (int &w, int &h) override |
| void | cursorRowCol (int &row, int &col) |
| bool | wrapMode () const |
| void | wrapMode (bool wm) |
| int | handle (int event) override |
Public Member Functions inherited from sptk::CLayoutClient | |
| CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca) | |
| virtual | ~CLayoutClient () |
| CLayoutAlign | layoutAlign () const |
| void | layoutAlign (CLayoutAlign al) |
| int | layoutSize () const |
| void | layoutSize (int ls) |
| virtual void | label (const String &l) |
| virtual const String & | label () const |
| void | name (const char *aname) |
| void | name (const String &aname) |
| const String & | name () const |
| virtual bool | preferredSize (int &w, int &h) |
| virtual bool | computeSize (int &w, int &h) |
| virtual String | className () const |
| Fl_Widget * | widget () const |
| virtual void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) |
| virtual void | load (const std::shared_ptr< xdoc::Node > &node) |
| virtual void | save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const |
Additional Inherited Members | |
Protected Member Functions inherited from sptk::CLayoutClient | |
| int | lastPreferredH () const |
| int | lastPreferredW () const |
| void | lastPreferredH (int height) |
| void | lastPreferredW (int width) |
Protected Attributes inherited from sptk::CLayoutClient | |
| Fl_Widget * | m_widget |
| String | m_name |
| String | m_label |
| CLayoutAlign | m_layoutAlign |
Text editor widget.
Class CEditor is the Fl_Text_Editor combined with the layout client. It has a modified handle() function to track the current cursor position. It also allocates the text buffer in constructor and destroys it in destructor.
|
explicit |
Constructor in SPTK style
| layoutSize | int, widget align in layout |
| layoutAlign | CLayoutAlign, widget align in layout |
|
override |
Destructor
| void sptk::CEditor::cursorRowCol | ( | int & | row, |
| int & | col | ||
| ) |
Returns current cursor position
| row | int&, row number |
| col | int&, column number |
|
override |
Special version of handle() function
|
overridevirtual |
Computes the optimal widgets size
| w | int&, input - width offered by the program, output - width required by widget |
| h | int&, input - height offered by the program, output - height required by widget |
Reimplemented from sptk::CLayoutClient.
|
inline |
Retruns internal style buffer
|
inline |
Retruns internal text buffer
|
inline |
Returns current wrap mode
| void sptk::CEditor::wrapMode | ( | bool | wm | ) |
Sets current wrap mode