Vaca::SciEditor Class Reference

#include <Scintilla.h>

Inheritance diagram for Vaca::SciEditor:

Vaca::SciRegister Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable

List of all members.


Detailed Description

Controls a Scintilla text editor.

This is the class with more methods, but each method only wrap an Scintilla (SCI_) message.

Public Member Functions

 SciEditor (Widget *parent, Style style=SciEditorStyle)
virtual ~SciEditor ()
virtual void setFont (Font font)
 Sets the font used to paint text inside the editor.
virtual String getText ()
 Returns the widget's text, label, or frame's title.
virtual void setText (const String &str)
 Changes the widget's text, label, or frame's title.
void setSavePoint ()
String getLine (int line)
 Returns a lien of text.
void replaceSel (const String &str)
void setReadOnly (bool readOnly)
bool getReadOnly ()
void addText (const char *str, int length)
 Adds the first length characters of str string at the current position of the document.
void addText (const String &str)
 Adds the string str at the current position of the document.
void appendText (const char *str, int length)
 Adds the first length characters of str string to the end of the document.
void appendText (const String &str)
 Adds the string str to the end of the document.
void insertText (int pos, const String &str)
void clearAll ()
Character getCharAt (int pos)
void searchAnchor ()
bool searchNext (int flags, String &str)
bool searchPrev (int flags, String &str)
void setOverwriteMode (bool state)
bool getOverwriteMode ()
void cutTextToClipboard ()
void copyTextToClipboard ()
void pasteTextFromClipboard ()
void clearText ()
void undo ()
bool canUndo ()
void redo ()
bool canRedo ()
void emptyUndoBuffer ()
void beginUndoAction ()
void endUndoAction ()
int getTextLength ()
int getLineCount ()
 Returns the number of lines that has the text.
int getFirstVisibleLine ()
int getLinesOnScreen ()
bool isModified ()
void goToPos (int pos)
void goToLine (int line)
void setCurrentPos (int pos)
int getCurrentPos ()
void setAnchor (int pos)
int getAnchor ()
int getSelectionStart ()
int getSelectionEnd ()
int getLineLength (int line)
 Returns the length of the line (including the end of line).
String getSelText ()
void setEolMode (int eolMode)
int getEolMode ()
void convertEols (int eolMode)
void setViewEol (bool visible)
bool getViewEol ()
void * getDocPointer ()
void setDocPointer (void *doc)
void zoomIn ()
void zoomOut ()
void setZoom (int zoomInPoints)
int getZoom ()

Public Attributes

Signal0< void > UpdateUI

Protected Member Functions

virtual bool onReflectedNotify (LPNMHDR lpnmhdr, LRESULT &lResult)
 This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.
virtual void onUpdateUI ()
 Called when the text or the selection range change (SCN_UPDATEUI).


Constructor & Destructor Documentation

SciEditor::SciEditor ( Widget parent,
Style  style = SciEditorStyle 
)

SciEditor::~SciEditor (  )  [virtual]


Member Function Documentation

void SciEditor::setFont ( Font  font  )  [virtual]

Sets the font used to paint text inside the editor.

WARNING: this sets the default style of the Scintilla editor (see for STYLE_DEFAULT in the Scintilla documentation).

Reimplemented from Vaca::Widget.

String SciEditor::getText (  )  [virtual]

Returns the widget's text, label, or frame's title.

Win32 Specific:
It uses GetWindowTextLength(W32) and GetWindowText(W32).

See also:
setText

Reimplemented from Vaca::Widget.

void SciEditor::setText ( const String str  )  [virtual]

Changes the widget's text, label, or frame's title.

Win32 Specific:
It uses the SetWindowText(W32).

Reimplemented from Vaca::Widget.

void SciEditor::setSavePoint (  ) 

String SciEditor::getLine ( int  line  ) 

Returns a lien of text.

Line 0 is the first line. The text returned includes the new line character.

void SciEditor::replaceSel ( const String str  ) 

void SciEditor::setReadOnly ( bool  readOnly  ) 

bool SciEditor::getReadOnly (  ) 

void SciEditor::addText ( const char *  str,
int  length 
)

Adds the first length characters of str string at the current position of the document.

void SciEditor::addText ( const String str  ) 

Adds the string str at the current position of the document.

void SciEditor::appendText ( const char *  str,
int  length 
)

Adds the first length characters of str string to the end of the document.

void SciEditor::appendText ( const String str  ) 

Adds the string str to the end of the document.

void SciEditor::insertText ( int  pos,
const String str 
)

void SciEditor::clearAll (  ) 

Character SciEditor::getCharAt ( int  pos  ) 

void SciEditor::searchAnchor (  ) 

bool SciEditor::searchNext ( int  flags,
String str 
)

bool SciEditor::searchPrev ( int  flags,
String str 
)

void SciEditor::setOverwriteMode ( bool  state  ) 

bool SciEditor::getOverwriteMode (  ) 

void SciEditor::cutTextToClipboard (  ) 

void SciEditor::copyTextToClipboard (  ) 

void SciEditor::pasteTextFromClipboard (  ) 

void SciEditor::clearText (  ) 

void SciEditor::undo (  ) 

bool SciEditor::canUndo (  ) 

void SciEditor::redo (  ) 

bool SciEditor::canRedo (  ) 

void SciEditor::emptyUndoBuffer (  ) 

void SciEditor::beginUndoAction (  ) 

void SciEditor::endUndoAction (  ) 

int SciEditor::getTextLength (  ) 

int SciEditor::getLineCount (  ) 

Returns the number of lines that has the text.

Warning:
The last line doesn't have a end of line (\n) character.

int SciEditor::getFirstVisibleLine (  ) 

int SciEditor::getLinesOnScreen (  ) 

bool SciEditor::isModified (  ) 

void SciEditor::goToPos ( int  pos  ) 

void SciEditor::goToLine ( int  line  ) 

void SciEditor::setCurrentPos ( int  pos  ) 

int SciEditor::getCurrentPos (  ) 

void SciEditor::setAnchor ( int  pos  ) 

int SciEditor::getAnchor (  ) 

int SciEditor::getSelectionStart (  ) 

int SciEditor::getSelectionEnd (  ) 

int SciEditor::getLineLength ( int  line  ) 

Returns the length of the line (including the end of line).

The first line is 0.

String SciEditor::getSelText (  ) 

void SciEditor::setEolMode ( int  eolMode  ) 

Parameters:
eolMode 
  • SC_EOL_CRLF
  • SC_EOL_CR
  • SC_EOL_LF

int SciEditor::getEolMode (  ) 

void SciEditor::convertEols ( int  eolMode  ) 

void SciEditor::setViewEol ( bool  visible  ) 

bool SciEditor::getViewEol (  ) 

void * SciEditor::getDocPointer (  ) 

void SciEditor::setDocPointer ( void *  doc  ) 

void SciEditor::zoomIn (  ) 

void SciEditor::zoomOut (  ) 

void SciEditor::setZoom ( int  zoomInPoints  ) 

int SciEditor::getZoom (  ) 

bool SciEditor::onReflectedNotify ( LPNMHDR  lpnmhdr,
LRESULT &  lResult 
) [protected, virtual]

This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.

Parameters:
lpnmhdr Information about the notification message.
lResult Result to return by the wndProc method.
Returns:
False if it doesn't use the notification.

Reimplemented from Vaca::Widget.

void SciEditor::onUpdateUI (  )  [protected, virtual]

Called when the text or the selection range change (SCN_UPDATEUI).

In response to this event you should update your UI elements. The default implementation fires the UpdateUI signal.


Member Data Documentation

See also:
onUpdateUI