sptk2 logo
SPTK Home Page

sptk::CEditor Class Reference
[GUI Classes]

Text editor widget. More...

#include <CEditor.h>

Inheritance diagram for sptk::CEditor:

sptk::CLayoutClient

List of all members.

Public Member Functions

 CEditor (int layoutSize=100, CLayoutAlign layoutAlign=SP_ALIGN_TOP)
 ~CEditor ()
 Destructor.
Fl_Text_Buffer * textBuffer ()
 Retruns internal text buffer.
Fl_Text_Buffer * styleBuffer ()
 Retruns internal style buffer.
virtual bool preferredSize (int &w, int &h)
void cursorRowCol (int &row, int &col)
bool wrapMode ()
 Returns current wrap mode.
void wrapMode (bool wm)
 Sets current wrap mode.
int handle (int event)
 Special version of handle() function.


Detailed Description

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.


Constructor & Destructor Documentation

sptk::CEditor::CEditor ( int  layoutSize = 100,
CLayoutAlign  layoutAlign = SP_ALIGN_TOP 
)

Constructor in SPTK style

Parameters:
layoutSize int, widget align in layout
layoutAlign CLayoutAlign, widget align in layout


Member Function Documentation

void sptk::CEditor::cursorRowCol ( int &  row,
int &  col 
)

Returns current cursor position

Parameters:
row int&, row number
col int&, column number

virtual bool sptk::CEditor::preferredSize ( int &  w,
int &  h 
) [virtual]

Computes the optimal widgets size

Parameters:
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
Returns:
true if the size is stable (doesn't depend on input sizes)

Reimplemented from sptk::CLayoutClient.


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:13 2012: SPTK 3.5.7