KSpread::FormulaEditorHighlighter Class Reference

#include <kspread_editors.h>

Inherits TQSyntaxHighlighter.

Public Member Functions

 FormulaEditorHighlighter (TQTextEdit *textEdit, Canvas *canvas)
 
virtual int highlightParagraph (const TQString &text, int endStateOfLastPara)
 
const Tokens & formulaTokens () const
 
uint rangeCount () const
 
bool rangeChanged () const
 
void resetRangeChanged ()
 

Protected Member Functions

int findMatchingBrace (int pos)
 
void handleBrace (uint index)
 

Detailed Description

Colours cell references in formulas.

Installed by CellEditor instances in the constructor.

Definition at line 55 of file kspread_editors.h.

Constructor & Destructor Documentation

◆ FormulaEditorHighlighter()

KSpread::FormulaEditorHighlighter::FormulaEditorHighlighter ( TQTextEdit *  textEdit,
Canvas *  canvas 
)

Constructs a FormulaHighlighter to colour-code cell references in a TQTextEdit.

Parameters
textEditThe TQTextEdit widget which the highlighter should operate on
canvasThe Canvas object

Definition at line 83 of file kspread_editors.cpp.

◆ ~FormulaEditorHighlighter()

KSpread::FormulaEditorHighlighter::~FormulaEditorHighlighter ( )
virtual

Definition at line 90 of file kspread_editors.cpp.

Member Function Documentation

◆ findMatchingBrace()

int KSpread::FormulaEditorHighlighter::findMatchingBrace ( int  pos)
protected

Returns the position of the brace matching the one found at position pos.

Definition at line 246 of file kspread_editors.cpp.

◆ formulaTokens()

const Tokens & KSpread::FormulaEditorHighlighter::formulaTokens ( ) const

Definition at line 95 of file kspread_editors.cpp.

◆ handleBrace()

void KSpread::FormulaEditorHighlighter::handleBrace ( uint  index)
protected

Examines the brace (Token::LeftPar or Token::RightPar) operator token at the given index in the token vector ( as returned by formulaTokens() ) and if the cursor is next to it, the token plus any matching brace will be highlighted.

Definition at line 186 of file kspread_editors.cpp.

◆ highlightParagraph()

int KSpread::FormulaEditorHighlighter::highlightParagraph ( const TQString &  text,
int  endStateOfLastPara 
)
virtual

Called automatically by KTextEditor to highlight text when modified.

Definition at line 100 of file kspread_editors.cpp.

◆ rangeChanged()

bool KSpread::FormulaEditorHighlighter::rangeChanged ( ) const

Returns true if any of the ranges or cells in the formula have changed since the last call to FormulaEditorHighlighter::rangeChanged()

Definition at line 282 of file kspread_editors.cpp.

◆ rangeCount()

uint KSpread::FormulaEditorHighlighter::rangeCount ( ) const

Definition at line 277 of file kspread_editors.cpp.

◆ resetRangeChanged()

void KSpread::FormulaEditorHighlighter::resetRangeChanged ( )

Sets the highlighter's range changed flag to false.

Definition at line 287 of file kspread_editors.cpp.


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