diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a83b060657..f38a0ef608 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,29 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-18 18:05 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + contrib/hbide/resources/closetab.png + + contrib/hbide/resources/down.png + + contrib/hbide/resources/minus.png + + contrib/hbide/resources/previous.png + + contrib/hbide/resources/up.png + * contrib/hbide/resources/searchreplacepanel.ui + * contrib/hbide/resources/searchreplacepanel.uic + + * contrib/hbide/hbide.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/idefindreplace.prg + + Implemented ( partial ) extended search/replace panel like Qt itself. + This can be activated via or Ctrl+Sh+F. + The panel is anchored beneth editor area and above status-bar, + or above any other dock-widget at the bottom area is open. + It implements incremental search with visual color differentiation. + Try typing in some text to find. Still other buttons are inactive. + It may take a day to synchronize everything. + + This implementation adds another value to "Find/Replace". + Ctrl+F implementation is there as is. You can take advantage of both. + 2010-02-18 23:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/extrap.c + Added MIPS32, MIPS64, IA64, SH CPU dump code. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 29e48e5628..e31b264638 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -469,7 +469,9 @@ METHOD HbIde:create( cProjIni ) hbide_dbg( " " ) ::oFindInFiles:destroy() + ::oSearchReplace:destroy() ::oFR:destroy() + ::oPM:destroy() ::oEM:destroy() ::oDK:destroy() @@ -542,6 +544,7 @@ METHOD HbIde:execAction( cKey ) CASE "switchReadOnly" CASE "Search" CASE "Find" + CASE "FindEx" CASE "SetMark" CASE "GotoMark" CASE "Goto" @@ -642,6 +645,11 @@ METHOD HbIde:execEditorAction( cKey ) ::oFR:show() ENDIF EXIT + CASE "FindEx" + IF !Empty( ::qCurEdit ) + ::oSearchReplace:beginFind() + ENDIF + EXIT CASE "Search" ::oFindInFiles:show() EXIT diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 249e674d3b..0acc6aa94a 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -230,6 +230,7 @@ METHOD IdeActions:loadActions() aadd( aAct, { "SelectAll" , "Select ~All" , "selectall" , "" , "No", "Yes" } ) aadd( aAct, { "SelectionMode" , "Toggle Selection Mode" , "stream" , "" , "No", "Yes" } ) aadd( aAct, { "Find" , "~Find / Replace" , "find" , "^F" , "No", "Yes" } ) + aadd( aAct, { "FindEx" , "~Find / Replace Ex" , "find" , "Sh+^F", "No", "Yes" } ) aadd( aAct, { "Search" , "F~ind in Files" , "search" , "" , "No", "Yes" } ) aadd( aAct, { "SetMark" , "Set Mark" , "placeremovemark", "" , "No", "Yes" } ) aadd( aAct, { "GotoMark" , "Goto Mark" , "gotomark" , "" , "No", "Yes" } ) @@ -478,6 +479,7 @@ METHOD IdeActions:buildMainMenu() oSubMenu:addItem( { ::getAction( "SelectAll" ), {|| oIde:execAction( "SelectAll" ) } } ) hbide_menuAddSep( oSubMenu ) oSubMenu:addItem( { ::getAction( "Find" ), {|| oIde:execAction( "Find" ) } } ) + oSubMenu:addItem( { ::getAction( "FindEx" ), {|| oIde:execAction( "FindEx" ) } } ) oSubMenu:addItem( { ::getAction( "FindInFiles" ), {|| oIde:execAction( "FindInFiles" ) } } ) oSubMenu:addItem( { ::getAction( "Goto" ), {|| oIde:execAction( "Goto" ) } } ) hbide_menuAddSep( oSubMenu ) diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index 0b1f299137..c1d0e8a63c 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -73,8 +73,16 @@ CLASS IdeSearchReplace INHERIT IdeObject + DATA qFindLineEdit + DATA qReplLineEdit + + DATA cFind INIT "" + METHOD new( oIde ) METHOD create( oIde ) + METHOD destroy() + METHOD beginFind() + METHOD setFindString( cText ) ENDCLASS @@ -95,12 +103,92 @@ METHOD IdeSearchReplace:create( oIde ) ::oIde := oIde ::oUI := HbQtUI():new( ::oIde:resPath + "searchreplacepanel.uic", ::oIde:oDlg:oWidget ):build() + //::oUI := HbQtUI():new( ::oIde:resPath + "searchreplace.uic", ::oIde:oDlg:oWidget ):build() + //::oUI:setStyleSheet( "QWidget { border: 1px solid red; }" ) + ::oUI:setFocusPolicy( Qt_StrongFocus ) + + ::oUI:q_buttonClose:setIcon( ::resPath + "closetab.png" ) + ::oUI:signal( "buttonClose", "clicked()", {|| ::oUI:hide() } ) + + ::oUI:q_buttonNext:setIcon( ::resPath + "next.png" ) + ::oUI:q_buttonNext:setToolTip( "Find Next" ) + + ::oUI:q_buttonPrev:setIcon( ::resPath + "previous.png" ) + ::oUI:q_buttonPrev:setToolTip( "Find Previous" ) + + ::oUI:q_buttonTop :setIcon( ::resPath + "up.png" ) + ::oUI:q_buttonTop :setToolTip( "Start from Top" ) + + ::qFindLineEdit := QLineEdit():from( ::oUI:q_comboFind:lineEdit() ) + ::qFindLineEdit:setFocusPolicy( Qt_StrongFocus ) + ::connect( ::qFindLineEdit, "textChanged(QString)", {|cText| ::setFindString( cText ) } ) + + ::qReplLineEdit := QLineEdit():from( ::oUI:q_comboReplace:lineEdit() ) + ::qReplLineEdit:setFocusPolicy( Qt_StrongFocus ) RETURN Self /*----------------------------------------------------------------------*/ + +METHOD IdeSearchReplace:destroy() + + ::disconnect( ::qFindLineEdit, "textChanged(QString)" ) + + ::oUI:destroy() + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeSearchReplace:beginFind() + + ::oUI:show() + + ::cFind := "" + + ::qFindLineEdit:selectAll() + ::qFindLineEdit:setFocus( Qt_TabFocusReason ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeSearchReplace:setFindString( cText ) + LOCAL nFlags, lFound, qCursor, nPos + + IF empty( cText ) + RETURN .f. + ENDIF + + qCursor := QTextCursor():configure( ::qCurEdit:textCursor() ) + nPos := qCursor:position() + qCursor:setPosition( 0 ) + ::qCurEdit:setTextCursor( qCursor ) + + nFlags := 0 + nFlags += iif( ::oUI:q_checkMatchCase:isChecked(), QTextDocument_FindCaseSensitively, 0 ) + lFound := ::oEM:getEditCurrent():find( cText, nFlags ) + + IF ! lFound + qCursor:setPosition( nPos ) + ::qCurEdit:setTextCursor( qCursor ) + ::cFind := "" + ::qFindLineEdit:setStyleSheet( "background-color: rgba( 240,120,120,255 );" ) + ELSE + //::qCurEdit:setTextCursor( qCursor ) + ::cFind := cText + ::qFindLineEdit:setStyleSheet( "" ) + ENDIF + + RETURN lFound + +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ // IdeFindReplace /*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ CLASS IdeFindReplace INHERIT IdeObject @@ -176,8 +264,6 @@ METHOD IdeFindReplace:create( oIde ) METHOD IdeFindReplace:show() LOCAL cText, qLineEdit - ::oSearchReplace:oUI:show() - ::oUI:q_buttonReplace:setEnabled( .f. ) ::oUI:q_checkGlobal:setEnabled( .f. ) ::oUI:q_checkNoPrompting:setEnabled( .f. ) diff --git a/harbour/contrib/hbide/resources/closetab.png b/harbour/contrib/hbide/resources/closetab.png new file mode 100644 index 0000000000..ef9e02086c Binary files /dev/null and b/harbour/contrib/hbide/resources/closetab.png differ diff --git a/harbour/contrib/hbide/resources/down.png b/harbour/contrib/hbide/resources/down.png new file mode 100644 index 0000000000..29d1d4439a Binary files /dev/null and b/harbour/contrib/hbide/resources/down.png differ diff --git a/harbour/contrib/hbide/resources/minus.png b/harbour/contrib/hbide/resources/minus.png new file mode 100644 index 0000000000..d6f233d739 Binary files /dev/null and b/harbour/contrib/hbide/resources/minus.png differ diff --git a/harbour/contrib/hbide/resources/previous.png b/harbour/contrib/hbide/resources/previous.png new file mode 100644 index 0000000000..0780bc23dd Binary files /dev/null and b/harbour/contrib/hbide/resources/previous.png differ diff --git a/harbour/contrib/hbide/resources/searchreplacepanel.ui b/harbour/contrib/hbide/resources/searchreplacepanel.ui index 599d596055..7afc8b4e00 100644 --- a/harbour/contrib/hbide/resources/searchreplacepanel.ui +++ b/harbour/contrib/hbide/resources/searchreplacepanel.ui @@ -6,10 +6,22 @@ 0 0 - 572 + 916 38 + + + 0 + 30 + + + + + 16777215 + 38 + + Form @@ -17,19 +29,18 @@ border-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); - - - - ... - - - + + 2 + + + 2 + 25 - 16777215 + 20 @@ -38,7 +49,13 @@ - + + + + 0 + 0 + + 200 @@ -47,24 +64,134 @@ - 100 + 16777215 16777215 - - - - - - ... + + true - + ... + + true + + + + + + + ... + + + true + + + + + + + ... + + + true + + + + + + + Case + + + + + + + RegEx + + + + + + + + 30 + 20 + + + + + 30 + 20 + + + + + + + + + + + + 62 + 0 + + + + + 62 + 16777215 + + + + Replace: + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 16777215 + 16777215 + + + + true + + + + + + + Global + + + + + + + NoPrompt + @@ -81,18 +208,12 @@ - - - - 200 - 0 - + + + ... - - - 200 - 16777215 - + + true diff --git a/harbour/contrib/hbide/resources/searchreplacepanel.uic b/harbour/contrib/hbide/resources/searchreplacepanel.uic index d51e7687bf..19f51d464e 100644 --- a/harbour/contrib/hbide/resources/searchreplacepanel.uic +++ b/harbour/contrib/hbide/resources/searchreplacepanel.uic @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading ui file 'searchreplacepanel.ui' ** -** Created: Thu Feb 18 05:42:14 2010 -** by: Qt User Interface Compiler version 4.5.2 +** Created: Thu Feb 18 17:15:26 2010 +** by: Qt User Interface Compiler version 4.5.3 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! ********************************************************************************/ @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -28,60 +29,122 @@ class Ui_Form { public: QHBoxLayout *horizontalLayout; - QToolButton *buttonClose; QLabel *label; - QComboBox *comboBox; - QToolButton *toolButton_2; - QToolButton *toolButton_3; + QComboBox *comboFind; + QToolButton *buttonNext; + QToolButton *buttonPrev; + QToolButton *buttonTop; + QCheckBox *checkMatchCase; + QCheckBox *checkRegEx; + QLabel *label_2; + QCheckBox *checkReplace; + QComboBox *comboReplace; + QCheckBox *checkGlobal; + QCheckBox *checkNoPrompt; QSpacerItem *horizontalSpacer; - QComboBox *comboBox_2; + QToolButton *buttonClose; void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) Form->setObjectName(QString::fromUtf8("Form")); - Form->resize(572, 38); + Form->resize(916, 38); + Form->setMinimumSize(QSize(0, 30)); + Form->setMaximumSize(QSize(16777215, 38)); Form->setStyleSheet(QString::fromUtf8("border-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));")); horizontalLayout = new QHBoxLayout(Form); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); - buttonClose = new QToolButton(Form); - buttonClose->setObjectName(QString::fromUtf8("buttonClose")); - - horizontalLayout->addWidget(buttonClose); - + horizontalLayout->setContentsMargins(-1, 2, -1, 2); label = new QLabel(Form); label->setObjectName(QString::fromUtf8("label")); - label->setMaximumSize(QSize(25, 16777215)); + label->setMaximumSize(QSize(25, 20)); horizontalLayout->addWidget(label); - comboBox = new QComboBox(Form); - comboBox->setObjectName(QString::fromUtf8("comboBox")); - comboBox->setMinimumSize(QSize(200, 0)); - comboBox->setMaximumSize(QSize(100, 16777215)); + comboFind = new QComboBox(Form); + comboFind->setObjectName(QString::fromUtf8("comboFind")); + QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(comboFind->sizePolicy().hasHeightForWidth()); + comboFind->setSizePolicy(sizePolicy); + comboFind->setMinimumSize(QSize(200, 0)); + comboFind->setMaximumSize(QSize(16777215, 16777215)); + comboFind->setEditable(true); - horizontalLayout->addWidget(comboBox); + horizontalLayout->addWidget(comboFind); - toolButton_2 = new QToolButton(Form); - toolButton_2->setObjectName(QString::fromUtf8("toolButton_2")); + buttonNext = new QToolButton(Form); + buttonNext->setObjectName(QString::fromUtf8("buttonNext")); + buttonNext->setAutoRaise(true); - horizontalLayout->addWidget(toolButton_2); + horizontalLayout->addWidget(buttonNext); - toolButton_3 = new QToolButton(Form); - toolButton_3->setObjectName(QString::fromUtf8("toolButton_3")); + buttonPrev = new QToolButton(Form); + buttonPrev->setObjectName(QString::fromUtf8("buttonPrev")); + buttonPrev->setAutoRaise(true); - horizontalLayout->addWidget(toolButton_3); + horizontalLayout->addWidget(buttonPrev); + + buttonTop = new QToolButton(Form); + buttonTop->setObjectName(QString::fromUtf8("buttonTop")); + buttonTop->setAutoRaise(true); + + horizontalLayout->addWidget(buttonTop); + + checkMatchCase = new QCheckBox(Form); + checkMatchCase->setObjectName(QString::fromUtf8("checkMatchCase")); + + horizontalLayout->addWidget(checkMatchCase); + + checkRegEx = new QCheckBox(Form); + checkRegEx->setObjectName(QString::fromUtf8("checkRegEx")); + + horizontalLayout->addWidget(checkRegEx); + + label_2 = new QLabel(Form); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setMinimumSize(QSize(30, 20)); + label_2->setMaximumSize(QSize(30, 20)); + + horizontalLayout->addWidget(label_2); + + checkReplace = new QCheckBox(Form); + checkReplace->setObjectName(QString::fromUtf8("checkReplace")); + checkReplace->setMinimumSize(QSize(62, 0)); + checkReplace->setMaximumSize(QSize(62, 16777215)); + + horizontalLayout->addWidget(checkReplace); + + comboReplace = new QComboBox(Form); + comboReplace->setObjectName(QString::fromUtf8("comboReplace")); + sizePolicy.setHeightForWidth(comboReplace->sizePolicy().hasHeightForWidth()); + comboReplace->setSizePolicy(sizePolicy); + comboReplace->setMinimumSize(QSize(200, 0)); + comboReplace->setMaximumSize(QSize(16777215, 16777215)); + comboReplace->setEditable(true); + + horizontalLayout->addWidget(comboReplace); + + checkGlobal = new QCheckBox(Form); + checkGlobal->setObjectName(QString::fromUtf8("checkGlobal")); + + horizontalLayout->addWidget(checkGlobal); + + checkNoPrompt = new QCheckBox(Form); + checkNoPrompt->setObjectName(QString::fromUtf8("checkNoPrompt")); + + horizontalLayout->addWidget(checkNoPrompt); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer); - comboBox_2 = new QComboBox(Form); - comboBox_2->setObjectName(QString::fromUtf8("comboBox_2")); - comboBox_2->setMinimumSize(QSize(200, 0)); - comboBox_2->setMaximumSize(QSize(200, 16777215)); + buttonClose = new QToolButton(Form); + buttonClose->setObjectName(QString::fromUtf8("buttonClose")); + buttonClose->setAutoRaise(true); - horizontalLayout->addWidget(comboBox_2); + horizontalLayout->addWidget(buttonClose); retranslateUi(Form); @@ -92,10 +155,17 @@ public: void retranslateUi(QWidget *Form) { Form->setWindowTitle(QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8)); - buttonClose->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); label->setText(QApplication::translate("Form", "Find:", 0, QApplication::UnicodeUTF8)); - toolButton_2->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); - toolButton_3->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); + buttonNext->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); + buttonPrev->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); + buttonTop->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); + checkMatchCase->setText(QApplication::translate("Form", "Case", 0, QApplication::UnicodeUTF8)); + checkRegEx->setText(QApplication::translate("Form", "RegEx", 0, QApplication::UnicodeUTF8)); + label_2->setText(QString()); + checkReplace->setText(QApplication::translate("Form", "Replace:", 0, QApplication::UnicodeUTF8)); + checkGlobal->setText(QApplication::translate("Form", "Global", 0, QApplication::UnicodeUTF8)); + checkNoPrompt->setText(QApplication::translate("Form", "NoPrompt", 0, QApplication::UnicodeUTF8)); + buttonClose->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8)); Q_UNUSED(Form); } // retranslateUi diff --git a/harbour/contrib/hbide/resources/up.png b/harbour/contrib/hbide/resources/up.png new file mode 100644 index 0000000000..e437312217 Binary files /dev/null and b/harbour/contrib/hbide/resources/up.png differ