_controls = controls; _style = style; _keywordsStore = _controls->GetKeywordsStore(); _isChanged = false; if (_style & SYNTAX_STYLE_COLORED) { _highlighter = new QspHighlighter(_controls, this->document()); lineNumberArea = new LineNumberArea(this); connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int))); updateLineNumberAreaWidth(0); } connect(this, SIGNAL(textChanged()), this, SLOT(OnTextChange())); connect(this, SIGNAL(textChanged()), _controls->GetParent(), SLOT(OnChangeGame())); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(OnCursorChange())); setMouseTracking(true); Update(); _controls->GetSettings()->AddObserver(this); } void SyntaxTextBox::Update(bool isFromObservable) { setFont(_controls->GetSettings()->GetFont(SYNTAX_BASE)); setStyleSheet( QString("background-color:%1; \ color:%2")
virtual void OnTextChange(wxStyledTextEvent& event) { OnTextChange(); event.Skip(); }