Initialize TQScintilla's editor. TabWidth settings is now saved and restored across executions

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 2 years ago
parent 64dc8cad72
commit 658a06d1ee
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -54,3 +54,9 @@ check_cxx_source_compiles(
if( NOT HAVE_SSTREAM AND NOT HAVE_STRSTREAM ) if( NOT HAVE_SSTREAM AND NOT HAVE_STRSTREAM )
message(FATAL_ERROR "\nsstream or strstream support is required, but not found on your system." ) message(FATAL_ERROR "\nsstream or strstream support is required, but not found on your system." )
endif( ) endif( )
# check for tqscintilla
pkg_search_module( TQSCINTILLA tqscintilla )
if( NOT TQSCINTILLA_FOUND )
tde_message_fatal( "tqscintilla is required, but was not found on your system" )
endif( )

@ -44,6 +44,6 @@ set( ${target}_SRCS
tde_add_executable( ${target} AUTOMOC tde_add_executable( ${target} AUTOMOC
SOURCES ${${target}_SRCS} SOURCES ${${target}_SRCS}
LINK ${TQT_LIBRARIES} LINK ${TQT_LIBRARIES} ${TQSCINTILLA_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR} DESTINATION ${BIN_INSTALL_DIR}
) )

@ -22,6 +22,8 @@
///-- #include "debugging/TSLogger.h" ///-- #include "debugging/TSLogger.h"
#include "stdlib.h"
#include "AboutDialog.h" #include "AboutDialog.h"
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include "UiGuiSettings.h" #include "UiGuiSettings.h"
@ -35,13 +37,15 @@
#include <tqaction.h> #include <tqaction.h>
#include <tqapplication.h> #include <tqapplication.h>
#include <tqcheckbox.h> #include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqlocale.h> #include <tqlocale.h>
#include <tqmessagebox.h>
#include <tqpixmap.h> #include <tqpixmap.h>
#include <tqpopupmenu.h> #include <tqpopupmenu.h>
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <tqstatusbar.h>
#include <tqtranslator.h> #include <tqtranslator.h>
///-- #include <tqwidget.h> ///-- #include <tqwidget.h>
///-- #include <tqlabel.h>
///-- #include <tqstring.h> ///-- #include <tqstring.h>
///-- #include <tqscrollbar.h> ///-- #include <tqscrollbar.h>
///-- #include <tqtextcursor.h> ///-- #include <tqtextcursor.h>
@ -56,7 +60,6 @@
///-- #include <tqtextcodec.h> ///-- #include <tqtextcodec.h>
///-- #include <tqdate.h> ///-- #include <tqdate.h>
///-- #include <tqurl.h> ///-- #include <tqurl.h>
///-- #include <tqmessagebox.h>
///-- #include <tqtdebug.h> ///-- #include <tqtdebug.h>
///-- ///--
#include <tqextscintilla.h> #include <tqextscintilla.h>
@ -82,17 +85,18 @@
*/ */
MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) :
MainWindowBase(parent), m_aboutDialog(nullptr), m_qSciSourceCodeEditor(nullptr), MainWindowBase(parent), m_aboutDialog(nullptr), m_qSciSourceCodeEditor(nullptr),
m_qTranslator(nullptr), m_uiGuiTranslator(nullptr) m_qTranslator(nullptr), m_uiGuiTranslator(nullptr), m_textEditLineColumnInfoLabel(nullptr),
m_oldLinesNumber(0)
///- _mainWindowForm(nullptr), _settings(nullptr), _saveEncodedActionGroup(nullptr), ///- _mainWindowForm(nullptr), _settings(nullptr), _saveEncodedActionGroup(nullptr),
///- _highlighter(nullptr), _textEditVScrollBar(nullptr), _aboutDialogGraphicsView( ///- _highlighter(nullptr), _aboutDialogGraphicsView(
///- nullptr), _settingsDialog(nullptr), _encodingActionGroup(nullptr) ///- nullptr), _settingsDialog(nullptr), _encodingActionGroup(nullptr)
///- _highlighterActionGroup(nullptr), _toolBarWidget( ///- _highlighterActionGroup(nullptr), m_textEditVScrollBar(nullptr), _toolBarWidget(
///- nullptr), _indentHandler(nullptr), _textEditLineColumnInfoLabel(nullptr) ///- nullptr), _indentHandler(nullptr)
{ {
// Init of some variables. // Init of some variables.
m_sourceCodeChanged = false; m_sourceCodeChanged = false;
// Create the _settings object, which loads all UiGui settings from a file. // Create the settings object, which loads all UiGui settings from a file.
m_settings = UiGuiSettings::getInstance(); m_settings = UiGuiSettings::getInstance();
// Initialize the language of the application. // Initialize the language of the application.
@ -104,9 +108,9 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) :
// Create toolbar and insert it into the main window. // Create toolbar and insert it into the main window.
initToolBar(); initToolBar();
///-- // Create the text edit component using the TQScintilla widget. // Create the text edit component using the TQScintilla widget.
///-- initTextEditor(); initTextEditor();
///--
///-- // Create and init the syntax highlighter. ///-- // Create and init the syntax highlighter.
///-- initSyntaxHighlighter(); ///-- initSyntaxHighlighter();
///-- ///--
@ -184,7 +188,7 @@ void MainWindow::initMainWindow()
actionShowLog->setIconSet(TQPixmap(ICONS_PATH + "document-properties.png")); actionShowLog->setIconSet(TQPixmap(ICONS_PATH + "document-properties.png"));
actionAboutUniversalIndentGUITQt->setIconSet(TQPixmap(ICONS_PATH + "info.png")); actionAboutUniversalIndentGUITQt->setIconSet(TQPixmap(ICONS_PATH + "info.png"));
// Menu ids // Menu ids
_actionClearRecentlyOpenedListId = popupMenuRecentlyOpenedFiles->idAt( m_actionClearRecentlyOpenedListId = popupMenuRecentlyOpenedFiles->idAt(
popupMenuRecentlyOpenedFiles->count() - 1); popupMenuRecentlyOpenedFiles->count() - 1);
// Handle last opened window size // Handle last opened window size
@ -282,66 +286,70 @@ void MainWindow::initToolBar()
///-- bool)), m_toolBarWidget->cbLivePreview, SLOT(setChecked(bool))); ///-- bool)), m_toolBarWidget->cbLivePreview, SLOT(setChecked(bool)));
} }
///-- /* /*
///-- \brief Create and initialize the text editor component. It uses the TQScintilla widget. \brief Create and initialize the text editor component. It uses the TQScintilla widget.
///-- */ */
///-- void MainWindow::initTextEditor() void MainWindow::initTextEditor()
///-- { {
///-- // Create the TQScintilla widget and add it to the layout. // Create the TQScintilla widget and add it to the layout.
///-- tqDebug() << //tqDebug("Trying to load TQScintilla library. If anything fails during loading, it might be "
///-- "Trying to load TQScintilla library. If anything fails during loading, it might be possible that" // "possible that the debug and release version of TQScintilla are mixed or the library "
///-- << // "cannot be found at all.");
///-- " the debug and release version of TQScintilla are mixed or the library cannot be found at all."; // Try and catch doesn't seem to catch the runtime error when starting UiGUI release with
///-- // Try and catch doesn't seem to catch the runtime error when starting UiGUI release with // TQScintilla debug lib and the other way around.
///-- // TQScintilla debug lib and the other way around. try
///-- try {
///-- { m_qSciSourceCodeEditor = new TQextScintilla(this);
///-- m_qSciSourceCodeEditor = new QsciScintilla(this); }
///-- } catch (...)
///-- catch (...) {
///-- { TQMessageBox::critical(this, "Error creating TQScintilla text editor component!",
///-- TQMessageBox::critical(this, "Error creating TQScintilla text editor component!", "While trying to create the text editor component (based on TQScintilla), an error "
///-- "During trying to create the text editor component, that is based on TQScintilla, an error occurred. Please make sure that you have installed TQScintilla and not mixed release and debug versions."); "occurred. Please make sure that TQScintilla is installed and that release and debug "
///-- exit(1); "versions are not mixed.");
///-- } exit(1);
///-- _mainWindowForm->hboxLayout1->addWidget(m_qSciSourceCodeEditor); }
///-- setCentralWidget(m_qSciSourceCodeEditor);
///-- // Make some _settings for the TQScintilla widget.
///-- m_qSciSourceCodeEditor->setUtf8(true); // Make some _settings for the TQScintilla widget.
///-- m_qSciSourceCodeEditor->setMarginLineNumbers(1, true); m_qSciSourceCodeEditor->setUtf8(true);
///-- m_qSciSourceCodeEditor->setMarginWidth(1, TQString("10000")); m_qSciSourceCodeEditor->setMarginLineNumbers(1, true);
///-- m_qSciSourceCodeEditor->setBraceMatching(m_qSciSourceCodeEditor->SloppyBraceMatch); m_qSciSourceCodeEditor->setMarginWidth(1, TQString("10000"));
///-- m_qSciSourceCodeEditor->setMatchedBraceForegroundColor(TQColor("red")); m_qSciSourceCodeEditor->setBraceMatching(m_qSciSourceCodeEditor->SloppyBraceMatch);
///-- m_qSciSourceCodeEditor->setFolding(QsciScintilla::BoxedTreeFoldStyle); m_qSciSourceCodeEditor->setMatchedBraceForegroundColor(TQColor("red"));
///-- m_qSciSourceCodeEditor->setAutoCompletionSource(QsciScintilla::AcsAll); m_qSciSourceCodeEditor->setFolding(TQextScintilla::BoxedTreeFoldStyle);
///-- m_qSciSourceCodeEditor->setAutoCompletionThreshold(3); m_qSciSourceCodeEditor->setAutoCompletionSource(TQextScintilla::AcsAll);
///-- m_qSciSourceCodeEditor->setAutoCompletionThreshold(3);
///-- // Handle if white space is set to be visible
///-- bool whiteSpaceIsVisible = _settings->getValueByName("whiteSpaceIsVisible").toBool(); // Handle if white space is set to be visible
///-- setWhiteSpaceVisibility(whiteSpaceIsVisible); bool whiteSpaceIsVisible = m_settings->getValueByName("WhiteSpaceIsVisible").toBool();
///-- setWhiteSpaceVisibility(whiteSpaceIsVisible);
///-- // Handle the width of tabs in spaces
///-- int tabWidth = _settings->getValueByName("tabWidth").toInt(); // Handle the width of tabs in spaces
///-- m_qSciSourceCodeEditor->setTabWidth(tabWidth); int tabWidth = m_settings->getValueByName("TabWidth").toInt();
///-- m_qSciSourceCodeEditor->setTabWidth(tabWidth);
///-- // Remember a pointer to the scrollbar of the TQScintilla widget used to keep connect(m_settings, SIGNAL(tabWidth(int)), m_qSciSourceCodeEditor, SLOT(setTabWidth(int)));
///-- // on the same line as before when turning preview on/off.
///-- _textEditVScrollBar = m_qSciSourceCodeEditor->verticalScrollBar(); // TODO not available in TQScintilla 1.71
///-- // Remember a pointer to the scrollbar of the TQScintilla widget used to keep
///-- // Add a column row indicator to the status bar. // on the same line as before when turning preview on/off.
///-- _textEditLineColumnInfoLabel = new TQLabel(tr("Line %1, Column %2").arg(1).arg(1)); //m_textEditVScrollBar = m_qSciSourceCodeEditor->verticalScrollBar();
///-- _mainWindowForm->statusbar->addPermanentWidget(_textEditLineColumnInfoLabel);
///-- connect(m_qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int,int)), this, // Add a column row indicator to the status bar.
///-- SLOT(setStatusBarCursorPosInfo(int, int))); m_textEditLineColumnInfoLabel = new TQLabel(tr("Line %1, Column %2").arg(1).arg(1), this);
///-- statusBar()->addWidget(m_textEditLineColumnInfoLabel, 0, true);
///-- // Connect the text editor to dependent functions. connect(m_qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int,int)),
///-- connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(sourceCodeChangedHelperSlot())); this, SLOT(setStatusBarCursorPosInfo(int, int)));
///-- connect(m_qSciSourceCodeEditor, SIGNAL(linesChanged()), this, SLOT(numberOfLinesChanged()));
///-- //connect( _settings, SIGNAL(tabWidth(int)), m_qSciSourceCodeEditor, SLOT(setTabWidth(int)) ); // Connect the text editor to dependent functions.
///-- _settings->registerObjectSlot(m_qSciSourceCodeEditor, "setTabWidth(int)", "tabWidth"); connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(sourceCodeChangedHelperSlot()));
///-- m_qSciSourceCodeEditor->setTabWidth(_settings->getValueByName("tabWidth").toInt()); // TODO signal 'linesChanged' is not available in TQScintilla 1.71.
///-- } // Use textChanged for now and check for line number changes in the slot
///-- //connect(m_qSciSourceCodeEditor, SIGNAL(linesChanged()), this, SLOT(numberOfLinesChanged()));
connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(numberOfLinesChanged()));
numberOfLinesChanged();
}
///-- /* ///-- /*
///-- \brief Create and init the syntax _highlighter and set it to use the TQScintilla edit component. ///-- \brief Create and init the syntax _highlighter and set it to use the TQScintilla edit component.
///-- */ ///-- */
@ -529,7 +537,7 @@ void MainWindow::openSourceFileDialog(TQString fileName)
///-- updateWindowTitle(); ///-- updateWindowTitle();
///-- updateRecentlyOpenedList(); ///-- updateRecentlyOpenedList();
///-- _textEditLastScrollPos = 0; ///-- _textEditLastScrollPos = 0;
///-- _textEditVScrollBar->setValue(_textEditLastScrollPos); ///-- m_textEditVScrollBar->setValue(_textEditLastScrollPos);
///-- ///--
///-- _savedSourceContent = openedSourceFileContent; ///-- _savedSourceContent = openedSourceFileContent;
///-- m_qSciSourceCodeEditor->setModified(false); ///-- m_qSciSourceCodeEditor->setModified(false);
@ -650,7 +658,7 @@ bool MainWindow::saveSourceFile()
///-- */ ///-- */
///-- void MainWindow::updateSourceView() ///-- void MainWindow::updateSourceView()
///-- { ///-- {
///-- _textEditLastScrollPos = _textEditVScrollBar->value(); ///-- _textEditLastScrollPos = m_textEditVScrollBar->value();
///-- ///--
///-- if (m_toolBarWidget->cbLivePreview->isChecked()) ///-- if (m_toolBarWidget->cbLivePreview->isChecked())
///-- { ///-- {
@ -673,7 +681,7 @@ bool MainWindow::saveSourceFile()
///-- SLOT(sourceCodeChangedHelperSlot())); ///-- SLOT(sourceCodeChangedHelperSlot()));
///-- } ///-- }
///-- ///--
///-- _textEditVScrollBar->setValue(_textEditLastScrollPos); ///-- m_textEditVScrollBar->setValue(_textEditLastScrollPos);
///-- } ///-- }
///-- ///--
///-- /* ///-- /*
@ -707,20 +715,20 @@ void MainWindow::turnHighlightOnOff(bool turnOn)
///-- updateSourceView(); ///-- updateSourceView();
} }
///-- /* /*
///-- \brief Added this slot to avoid multiple calls because of changed text. \brief Added this slot to avoid multiple calls because of changed text.
///-- */ */
///-- void MainWindow::sourceCodeChangedHelperSlot() void MainWindow::sourceCodeChangedHelperSlot()
///-- { {
///-- TQTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot())); TQTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot()));
///-- } }
///--
///-- /* /*
///-- \brief Is emitted whenever the text inside the source view window changes. Calls the indenter \brief Is emitted whenever the text inside the source view window changes. Calls the indenter
///-- to format the changed source code. to format the changed source code.
///-- */ */
///-- void MainWindow::sourceCodeChangedSlot() void MainWindow::sourceCodeChangedSlot()
///-- { {
///-- TQChar enteredCharacter; ///-- TQChar enteredCharacter;
///-- int cursorPos, cursorPosAbsolut, cursorLine; ///-- int cursorPos, cursorPosAbsolut, cursorLine;
///-- TQString text; ///-- TQString text;
@ -863,8 +871,8 @@ void MainWindow::turnHighlightOnOff(bool turnOn)
///-- // Could set cursor this way and use normal linear search in text instead of columns and rows. ///-- // Could set cursor this way and use normal linear search in text instead of columns and rows.
///-- //m_qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETCURRENTPOS, 50); ///-- //m_qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETCURRENTPOS, 50);
///-- //m_qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETANCHOR, 50); ///-- //m_qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETANCHOR, 50);
///-- } }
///--
///-- /* ///-- /*
///-- \brief This slot is called whenever one of the indenter _settings are changed. ///-- \brief This slot is called whenever one of the indenter _settings are changed.
///-- ///--
@ -1348,17 +1356,22 @@ void MainWindow::setWhiteSpaceVisibility(bool visible)
} }
} }
///-- /* /*
///-- \brief This slot is called whenever the number of lines in the editor changes \brief This slot is called whenever the number of lines in the editor changes
///-- and adapts the margin for the displayed line numbers. and adapts the margin for the displayed line numbers.
///-- */ */
///-- void MainWindow::numberOfLinesChanged() void MainWindow::numberOfLinesChanged()
///-- { {
///-- TQString lineNumbers; int lines = m_qSciSourceCodeEditor->lines();
///-- lineNumbers.setNum(m_qSciSourceCodeEditor->lines() * 10); if (lines != m_oldLinesNumber)
///-- m_qSciSourceCodeEditor->setMarginWidth(1, lineNumbers); {
///-- } m_oldLinesNumber = lines;
///-- TQString lineNumbers;
lineNumbers.setNum(lines * 10);
m_qSciSourceCodeEditor->setMarginWidth(1, lineNumbers);
}
}
///-- /* ///-- /*
///-- \brief Catches language change events and retranslates all needed widgets. ///-- \brief Catches language change events and retranslates all needed widgets.
///-- */ ///-- */
@ -1547,7 +1560,7 @@ void MainWindow::openFileFromRecentlyOpenedList(int recentlyOpenedActionId)
{ {
// If the selected action from the recently opened list menu is the clear action // If the selected action from the recently opened list menu is the clear action
// call the slot to clear the list and then leave. // call the slot to clear the list and then leave.
if (recentlyOpenedActionId == _actionClearRecentlyOpenedListId) if (recentlyOpenedActionId == m_actionClearRecentlyOpenedListId)
{ {
clearRecentlyOpenedList(); clearRecentlyOpenedList();
return; return;
@ -1618,12 +1631,12 @@ void MainWindow::showAboutDialog()
m_aboutDialog->show(); m_aboutDialog->show();
} }
///-- /* /*
///-- \brief Sets the label in the status bar to show the \a line and \a column number. \brief Sets the label in the status bar to show the \a line and \a column number.
///-- */ */
///-- void MainWindow::setStatusBarCursorPosInfo(int line, int column) void MainWindow::setStatusBarCursorPosInfo(int line, int column)
///-- { {
///-- _textEditLineColumnInfoLabel->setText(tr("Line %1, Column %2").arg(line + 1).arg(column + 1)); m_textEditLineColumnInfoLabel->setText(tr("Line %1, Column %2").arg(line + 1).arg(column + 1));
///-- } }
#include "MainWindow.moc" #include "MainWindow.moc"

@ -32,10 +32,10 @@ class AboutDialog;
class UiGuiSettings; class UiGuiSettings;
class ToolBarWidget; class ToolBarWidget;
/// ///
/// class TQLabel;
/// class TQScrollBar;
/// class TQActionGroup; /// class TQActionGroup;
class TQextScintilla; class TQextScintilla;
class TQLabel;
class TQScrollBar;
class TQTranslator; class TQTranslator;
@ -61,20 +61,20 @@ class MainWindow : public MainWindowBase
///-- void updateSourceView(); ///-- void updateSourceView();
void turnHighlightOnOff(bool turnOn); void turnHighlightOnOff(bool turnOn);
void setWhiteSpaceVisibility(bool visible); void setWhiteSpaceVisibility(bool visible);
///-- void sourceCodeChangedHelperSlot(); void sourceCodeChangedHelperSlot();
///-- void sourceCodeChangedSlot(); void sourceCodeChangedSlot();
///-- void indentSettingsChangedSlot(); ///-- void indentSettingsChangedSlot();
void previewTurnedOnOff(bool turnOn); void previewTurnedOnOff(bool turnOn);
void exportToPDF(); void exportToPDF();
void exportToHTML(); void exportToHTML();
void languageChanged(int languageIndex); void languageChanged(int languageIndex);
///-- void encodingChanged(TQAction *encodingAction); ///-- void encodingChanged(TQAction *encodingAction);
///-- void numberOfLinesChanged(); void numberOfLinesChanged();
void updateRecentlyOpenedList(); void updateRecentlyOpenedList();
void openFileFromRecentlyOpenedList(int recentlyOpenedActionId); void openFileFromRecentlyOpenedList(int recentlyOpenedActionId);
void clearRecentlyOpenedList(); void clearRecentlyOpenedList();
void showAboutDialog(); void showAboutDialog();
///-- void setStatusBarCursorPosInfo(int line, int column); void setStatusBarCursorPosInfo(int line, int column);
///-- ///--
private: private:
///-- TQString loadFile(TQString filePath); ///-- TQString loadFile(TQString filePath);
@ -88,7 +88,7 @@ class MainWindow : public MainWindowBase
bool initApplicationLanguage(); bool initApplicationLanguage();
void initMainWindow(); void initMainWindow();
void initToolBar(); void initToolBar();
///-- void initTextEditor(); void initTextEditor();
///-- void initSyntaxHighlighter(); ///-- void initSyntaxHighlighter();
///-- void initIndenter(); ///-- void initIndenter();
///-- void changeEvent(TQEvent *event); ///-- void changeEvent(TQEvent *event);
@ -103,13 +103,14 @@ class MainWindow : public MainWindowBase
///-- TQString _sourceFormattedContent; ///-- TQString _sourceFormattedContent;
///-- TQString _sourceViewContent; ///-- TQString _sourceViewContent;
///-- UiGuiHighlighter *_highlighter; ///-- UiGuiHighlighter *_highlighter;
///-- TQScrollBar *_textEditVScrollBar; ///-- TQScrollBar *m_textEditVScrollBar;
AboutDialog *m_aboutDialog; AboutDialog *m_aboutDialog;
///-- AboutDialogGraphicsView *_aboutDialogGraphicsView; ///-- AboutDialogGraphicsView *_aboutDialogGraphicsView;
///-- UiGuiSettingsDialog *_settingsDialog; ///-- UiGuiSettingsDialog *_settingsDialog;
int _actionClearRecentlyOpenedListId; int m_actionClearRecentlyOpenedListId;
///-- int _textEditLastScrollPos; ///-- int _textEditLastScrollPos;
///-- int _currentIndenterID; ///-- int _currentIndenterID;
int m_oldLinesNumber;
///-- bool _loadLastSourceCodeFileOnStartup; ///-- bool _loadLastSourceCodeFileOnStartup;
///-- TQString _currentSourceFile; ///-- TQString _currentSourceFile;
///-- TQString _currentSourceFileExtension; ///-- TQString _currentSourceFileExtension;
@ -127,7 +128,7 @@ class MainWindow : public MainWindowBase
///-- ///--
ToolBarWidget *m_toolBarWidget; ToolBarWidget *m_toolBarWidget;
///-- IndentHandler *_indentHandler; ///-- IndentHandler *_indentHandler;
///-- TQLabel *_textEditLineColumnInfoLabel; TQLabel *m_textEditLineColumnInfoLabel;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

@ -341,7 +341,6 @@ void UiGuiSettings::handleValueChangeFromExtern(bool value)
// Set the value of the setting to the objects value. // Set the value of the setting to the objects value.
setValueByName(settingName, value); setValueByName(settingName, value);
tqWarning("MIKE set="+settingName);
} }
} }
} }
@ -361,6 +360,10 @@ void UiGuiSettings::emitSignalForSetting(TQString settingName)
{ {
emit whiteSpaceIsVisible(m_settings[settingName].toBool()); emit whiteSpaceIsVisible(m_settings[settingName].toBool());
} }
else if (settingName == "TabWidth")
{
emit tabWidth(m_settings[settingName].toInt());
}
else if (settingName == "Language") else if (settingName == "Language")
{ {
emit language(m_settings[settingName].toInt()); emit language(m_settings[settingName].toInt());

@ -93,7 +93,7 @@ class UiGuiSettings : public TQObject
void syntaxHighlightingEnabled(bool value); void syntaxHighlightingEnabled(bool value);
void whiteSpaceIsVisible(bool value); void whiteSpaceIsVisible(bool value);
// [++] void indenterParameterTooltipsEnabled(bool value); // [++] void indenterParameterTooltipsEnabled(bool value);
// [++] void tabWidth(int value); void tabWidth(int value);
void language(int value); void language(int value);
// [++] void lastUpdateCheck(TQDate value); // [++] void lastUpdateCheck(TQDate value);
// [++] void mainWindowState(TQByteArray value); // [++] void mainWindowState(TQByteArray value);

@ -79,13 +79,13 @@
/* /*
\class UiGuiHighlighter \class UiGuiHighlighter
\ingroup grp_EditorComponent \ingroup grp_EditorComponent
\brief UiGuiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component. \brief UiGuiHighlighter used for selecting the syntax highlighter/lexer for the TQextScintilla component.
*/ */
/* /*
\brief The constructor initializes some regular expressions and keywords to identify cpp tokens \brief The constructor initializes some regular expressions and keywords to identify cpp tokens
*/ */
UiGuiHighlighter::UiGuiHighlighter(QsciScintilla *parent) : UiGuiHighlighter::UiGuiHighlighter(TQextScintilla *parent) :
TQObject(parent) TQObject(parent)
{ {
_qsciEditorParent = parent; _qsciEditorParent = parent;

@ -28,7 +28,7 @@
class TQAction; class TQAction;
class TQSettings; class TQSettings;
class QsciScintilla; class TQextScintilla;
class QsciLexer; class QsciLexer;
@ -37,7 +37,7 @@ class UiGuiHighlighter : public TQObject
Q_OBJECT Q_OBJECT
public: public:
UiGuiHighlighter(QsciScintilla *parent); UiGuiHighlighter(TQextScintilla *parent);
void turnHighlightOff(); void turnHighlightOff();
void turnHighlightOn(); void turnHighlightOn();
@ -64,7 +64,7 @@ class UiGuiHighlighter : public TQObject
private: private:
bool _highlightingIsOn; bool _highlightingIsOn;
QsciScintilla *_qsciEditorParent; TQextScintilla *_qsciEditorParent;
TQMap<int, TQFont> _fontForStyles; TQMap<int, TQFont> _fontForStyles;
TQMap<int, TQColor> _colorForStyles; TQMap<int, TQColor> _colorForStyles;
QsciLexer *_lexer; QsciLexer *_lexer;

Loading…
Cancel
Save