2011-05-18 18:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbide/ideeditor.prg
  * contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
  * contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.h
  * contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth
    + Optimized: further the loading time of a source.
      It should be much fatser than before.
This commit is contained in:
Pritpal Bedi
2011-05-19 01:34:58 +00:00
parent d6a8d70a29
commit 1c7712db29
5 changed files with 20 additions and 0 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-05-18 18:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/ideeditor.prg
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.h
* contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth
+ Optimized: further the loading time of a source.
It should be much fatser than before.
2011-05-18 12:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/idedocks.prg
* contrib/hbxbp/xbpdialog.prg

View File

@@ -1576,6 +1576,9 @@ METHOD IdeEditor:setDocumentProperties()
::oUpDn:show()
ENDIF
::qHiliter:hbSetInitialized( .t. )
::qEdit:hbHighlightPage()
::nBlock := qCursor:blockNumber()
::nColumn := qCursor:columnNumber()

View File

@@ -97,6 +97,8 @@ HBQSyntaxHighlighter::HBQSyntaxHighlighter( QTextDocument * parent )
commentSingleLine = QRegExp( "//[^\n]*" );
patternQuotation = QRegExp( "\"[^\"]+\"|\'[^\']+\'" );
initialized = false;
}
void HBQSyntaxHighlighter::hbSetRule( QString name, QString pattern, const QTextCharFormat & format )
@@ -146,6 +148,9 @@ void HBQSyntaxHighlighter::hbSetFormatColumnSelection( int start, int count, con
void HBQSyntaxHighlighter::highlightBlock( const QString &text )
{
if( ! initialized )
return;
int iFirstBlock = editor->firstVisibleBlockNumber();
int iLastBlock = editor->lastVisibleBlockNumber();
int iBlock = currentBlock().blockNumber();

View File

@@ -90,6 +90,8 @@ public:
HBQPlainTextEdit * editor;
bool initialized;
void hbSetMultiLineCommentFormat( const QTextCharFormat & format );
void hbSetSingleLineCommentFormat( const QTextCharFormat & format );
void hbSetRule( QString name, QString pattern, const QTextCharFormat & format );
@@ -97,6 +99,7 @@ public:
void hbSetFormatColumnSelection( int start, int count, const QColor & color );
void hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format );
void hbSetEditor( HBQPlainTextEdit * edit ){ editor = edit; };
void hbSetInitialized( bool bInit ){ initialized = bInit; };
protected:
void highlightBlock( const QString &text );

View File

@@ -52,6 +52,7 @@ void hbSetFormat( QString name, const QTextCharFormat & format )
void hbSetFormatColumnSelection( int start, int count, const QColor & color )
void hbSetRuleWithRegExp( QString name, const QRegExp & reg, const QTextCharFormat & format )
void hbSetEditor( HBQPlainTextEdit * edit )
void hbSetInitialized( bool init )
# QTextBlock currentBlock () const
# int currentBlockState () const