2010-06-06 02:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

+ contrib/hbide/resources/go-bottom.png
  + contrib/hbide/resources/go-down.png
  + contrib/hbide/resources/go-first.png
  + contrib/hbide/resources/go-jump.png
  + contrib/hbide/resources/go-last.png
  + contrib/hbide/resources/go-next.png
  + contrib/hbide/resources/go-prev.png
  + contrib/hbide/resources/go-top.png
  + contrib/hbide/resources/go-up.png
  + contrib/hbide/resources/hilight-all.png
  + contrib/hbide/resources/updown.ui
  + contrib/hbide/resources/updown.uic

  * contrib/hbqt/hbqt_hbqplaintextedit.cpp
    ! An important fix.

  * contrib/hbide/ideedit.prg
  * contrib/hbide/idefindreplace.prg
  * contrib/hbide/idetools.prg
    + Extended: in addition to next/previous buttons to naviagte 
      occurances of selected text, three more buttons are added:
      "first", "last", occurance and "highlight all" occurances.

    + Implemented: macros parsing in "Parameters" list of 
      "Tools and Utilities" protocol. Currently following macros 
      are parsed:
        {source_fullname} => full sourcename of current edit instance
        {source_name}     => mere name of current edit instance
        {source_path}     => only path of source in current edit instance
        {%MY_ENV_VAR%}    => result of hb_GetEnv( "MY_ENV_VAR" )
           C:\temp\mycopy.bat {source_fullname} {source_path}\mysource.bkp
                =>
           C:\temp\mycopy.bat C:\harbour\contrib\hbide\hbide.prg C:\harbour\contrib\hbide\mysource.bkp
             ( assuming that current editor is containe hbide.prg )
This commit is contained in:
Pritpal Bedi
2010-06-06 10:08:55 +00:00
parent 163ee53500
commit 4809712e1b
17 changed files with 388 additions and 16 deletions

View File

@@ -17,6 +17,42 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-06-06 02:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
+ contrib/hbide/resources/go-bottom.png
+ contrib/hbide/resources/go-down.png
+ contrib/hbide/resources/go-first.png
+ contrib/hbide/resources/go-jump.png
+ contrib/hbide/resources/go-last.png
+ contrib/hbide/resources/go-next.png
+ contrib/hbide/resources/go-prev.png
+ contrib/hbide/resources/go-top.png
+ contrib/hbide/resources/go-up.png
+ contrib/hbide/resources/hilight-all.png
+ contrib/hbide/resources/updown.ui
+ contrib/hbide/resources/updown.uic
* contrib/hbqt/hbqt_hbqplaintextedit.cpp
! An important fix.
* contrib/hbide/ideedit.prg
* contrib/hbide/idefindreplace.prg
* contrib/hbide/idetools.prg
+ Extended: in addition to next/previous buttons to naviagte
occurances of selected text, three more buttons are added:
"first", "last", occurance and "highlight all" occurances.
+ Implemented: macros parsing in "Parameters" list of
"Tools and Utilities" protocol. Currently following macros
are parsed:
{source_fullname} => full sourcename of current edit instance
{source_name} => mere name of current edit instance
{source_path} => only path of source in current edit instance
{%MY_ENV_VAR%} => result of hb_GetEnv( "MY_ENV_VAR" )
C:\temp\mycopy.bat {source_fullname} {source_path}\mysource.bkp
=>
C:\temp\mycopy.bat C:\harbour\contrib\hbide\hbide.prg C:\harbour\contrib\hbide\mysource.bkp
( assuming that current editor is containe hbide.prg )
2010-06-06 00:50 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
* external/sqlite3/Makefile

View File

@@ -132,6 +132,7 @@ CLASS IdeEdit INHERIT IdeObject
DATA isColumnSelectionON INIT .F.
DATA lReadOnly INIT .F.
DATA isHighLighted INIT .f.
METHOD new( oEditor, nMode )
METHOD create( oEditor, nMode )
@@ -230,7 +231,9 @@ CLASS IdeEdit INHERIT IdeObject
METHOD spaces2tabs()
METHOD removeTrailingSpaces()
METHOD formatBraces()
METHOD findEx( cText, nFlags )
METHOD findEx( cText, nFlags, nStart )
METHOD highlightAll( cText )
METHOD unHighlight()
ENDCLASS
@@ -286,6 +289,7 @@ METHOD IdeEdit:create( oEditor, nMode )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_KeyPress , {|p| ::execKeyEvent( 101, QEvent_KeyPress, p ) } )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_Wheel , {|p| ::execKeyEvent( 102, QEvent_Wheel , p ) } )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_FocusIn , {| | ::execKeyEvent( 104, QEvent_FocusIn ) } )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_Resize , {| | ::execKeyEvent( 106, QEvent_Resize ) } )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_FocusOut , {| | ::execKeyEvent( 105, QEvent_FocusOut ) } )
Qt_Events_Connect( ::pEvents, ::qEdit, QEvent_MouseButtonDblClick, {|p| ::execKeyEvent( 103, QEvent_MouseButtonDblClick, p ) } )
@@ -473,6 +477,8 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 )
::oDK:setStatusText( SB_PNL_SELECTEDCHARS, len( ::getSelectedText() ) )
::oUpDn:show()
::unHighlight()
EXIT
CASE cursorPositionChanged
@@ -602,6 +608,10 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 )
ENDIF
EXIT
CASE QEvent_Resize
::oUpDn:show()
EXIT
CASE QEvent_Leave
CASE QEvent_FocusOut
::suspendPrototype()
@@ -1475,8 +1485,21 @@ METHOD IdeEdit:find( cText, nPosFrom )
/*----------------------------------------------------------------------*/
/* nFlags will decide the position, case sensitivity and direction
*/
METHOD IdeEdit:findEx( cText, nFlags )
LOCAL qCursor, lFound, cT
METHOD IdeEdit:findEx( cText, nFlags, nStart )
LOCAL qCursor, lFound, cT, nPos
DEFAULT nStart TO 0
qCursor := ::getCursor()
nPos := qCursor:position()
IF nStart == 0
// No need to move cursor
ELSEIF nStart == 1
::qEdit:moveCursor( QTextCursor_Start )
ELSEIF nStart == 2
::qEdit:moveCursor( QTextCursor_End )
ENDIF
IF ( lFound := ::qEdit:find( cText, nFlags ) )
::qEdit:centerCursor()
@@ -1485,12 +1508,75 @@ METHOD IdeEdit:findEx( cText, nFlags )
::qEdit:hbSetSelectionInfo( { qCursor:blockNumber(), qCursor:columnNumber() - len( cT ), ;
qCursor:blockNumber(), qCursor:columnNumber(), 1 } )
::qEdit:setTextCursor( qCursor )
ELSE
qCursor:setPosition( nPos )
::qEdit:setTextCursor( qCursor )
ENDIF
RETURN lFound
/*----------------------------------------------------------------------*/
METHOD IdeEdit:unHighlight()
LOCAL qCursor, nPos, lModified
IF ::isHighLighted
::isHighLighted := .f.
qCursor := ::getCursor()
nPos := qCursor:position()
lModified := QTextDocument():configure( ::qEdit:document() ):isModified()
::qEdit:undo()
IF ! lModified
QTextDocument():configure( ::qEdit:document() ):setModified( .f. )
::oEditor:setTabImage( ::qEdit )
ENDIF
qCursor:setPosition( nPos )
::qEdit:setTextCursor( qCursor )
RETURN .t.
ENDIF
RETURN .f.
/*----------------------------------------------------------------------*/
METHOD IdeEdit:highlightAll( cText )
LOCAL qDoc, qFormat, qCursor, qFormatHL, qCur, lModified
IF ::unHighLight()
RETURN Self
ENDIF
::isHighLighted := .t.
qDoc := ::oEditor:qDocument
lModified := QTextDocument():configure( ::qEdit:document() ):isModified()
qCur := ::getCursor()
qCur:beginEditBlock()
qCursor := QTextCursor():new( "QTextDocument", qDoc )
qFormat := QTextCharFormat():from( qCursor:charFormat() )
qFormatHL := qFormat
qFormatHL:setBackground( QBrush():new( "QColor", QColor():new( Qt_yellow ) ) )
DO WHILE .t.
qCursor := QTextCursor():from( qDoc:find( cText, qCursor, 0 ) )
IF qCursor:isNull()
EXIT
ENDIF
qCursor:mergeCharFormat( qFormatHL )
ENDDO
qCur:endEditBlock()
IF ! lModified
QTextDocument():configure( ::qEdit:document() ):setModified( .f. )
::oEditor:setTabImage( ::qEdit )
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEdit:refresh()
::qEdit:hbRefresh()
RETURN Self

View File

@@ -138,14 +138,28 @@ METHOD IdeUpDown:create( oIde )
::oUI:setWindowFlags( hb_bitOr( Qt_Tool, Qt_FramelessWindowHint ) )
::oUI:setFocusPolicy( Qt_NoFocus )
::oUI:setMaximumWidth( 55 )
//::oUI:setMaximumWidth( 75 )
//::oUI:setMaximumHeight( 25 )
::oUI:q_buttonUp:setIcon( hbide_image( "previous" ) )
::oUI:q_buttonUp:setToolTip( "Find Previous" )
::oUI:signal( "buttonUp", "clicked()", {|| ::execEvent( "buttonUp_clicked" ) } )
::oUI:q_buttonDown:setIcon( hbide_image( "next" ) )
::oUI:q_buttonDown:setToolTip( "Find Next" )
::oUI:signal( "buttonDown", "clicked()", {|| ::execEvent( "buttonDown_clicked" ) } )
::oUI:q_buttonPrev:setIcon( hbide_image( "go-prev" ) )
::oUI:q_buttonPrev:setToolTip( "Find Previous" )
::oUI:signal( "buttonPrev", "clicked()", {|| ::execEvent( "buttonPrev_clicked" ) } )
//
::oUI:q_buttonNext:setIcon( hbide_image( "go-next" ) )
::oUI:q_buttonNext:setToolTip( "Find Next" )
::oUI:signal( "buttonNext", "clicked()", {|| ::execEvent( "buttonNext_clicked" ) } )
//
::oUI:q_buttonFirst:setIcon( hbide_image( "go-first" ) )
::oUI:q_buttonFirst:setToolTip( "Find First" )
::oUI:signal( "buttonFirst", "clicked()", {|| ::execEvent( "buttonFirst_clicked" ) } )
//
::oUI:q_buttonLast:setIcon( hbide_image( "go-last" ) )
::oUI:q_buttonLast:setToolTip( "Find Last" )
::oUI:signal( "buttonLast", "clicked()", {|| ::execEvent( "buttonLast_clicked" ) } )
//
::oUI:q_buttonAll:setIcon( hbide_image( "hilight-all" ) )
::oUI:q_buttonAll:setToolTip( "Highlight All" )
::oUI:signal( "buttonAll", "clicked()", {|| ::execEvent( "buttonAll_clicked" ) } )
RETURN Self
@@ -162,11 +176,20 @@ METHOD IdeUpDown:execEvent( cEvent, p )
IF !empty( cText )
SWITCH cEvent
CASE "buttonUp_clicked"
oEdit:findEx( cText, QTextDocument_FindBackward )
CASE "buttonPrev_clicked"
oEdit:findEx( cText, QTextDocument_FindBackward, 0 )
EXIT
CASE "buttonDown_clicked"
oEdit:findEx( cText, 0 )
CASE "buttonNext_clicked"
oEdit:findEx( cText, 0, 0 )
EXIT
CASE "buttonFirst_clicked"
oEdit:findEx( cText, 0, 1 )
EXIT
CASE "buttonLast_clicked"
oEdit:findEx( cText, QTextDocument_FindBackward, 2 )
EXIT
CASE "buttonAll_clicked"
oEdit:highlightAll( cText )
EXIT
ENDSWITCH
ENDIF

View File

@@ -112,6 +112,8 @@ CLASS IdeToolsManager INHERIT IdeObject
METHOD addPanelsMenu( cPrompt )
METHOD showOutput( cOut, mp2, oHbp )
METHOD finished( nEC, nES, oHbp )
METHOD parseParams( cP )
METHOD macro2value( cMacro )
ENDCLASS
@@ -405,7 +407,7 @@ METHOD IdeToolsManager:execToolByParams( cCmd, cParams, cStartIn, lCapture, lOpe
ELSE
cArg := ""
ENDIF
cArg += cParams
cArg += ::parseParams( cParams )
IF lCapture
IF lOpen
@@ -448,6 +450,7 @@ METHOD IdeToolsManager:execTool( ... )
cCmd := hbide_pathToOSPath( aParam[ 1 ] )
cParams := aParam[ 2 ]
cParams := iif( "http://" $ lower( cParams ), cParams, hbide_pathToOSPath( cParams ) )
cParams := ::parseParams( cParams )
cStayIn := hbide_pathToOSPath( aParam[ 3 ] )
lCapture := iif( hb_isLogical( aParam[ 4 ] ), aParam[ 4 ], aParam[ 4 ] == "YES" )
lOpen := iif( hb_isLogical( aParam[ 5 ] ), aParam[ 5 ], aParam[ 5 ] == "YES" )
@@ -483,3 +486,60 @@ METHOD IdeToolsManager:finished( nEC, nES, oHbp )
/*----------------------------------------------------------------------*/
METHOD IdeToolsManager:parseParams( cP )
LOCAL lHas, n, n1, cMacro
IF !empty( cP )
DO WHILE .t.
lHas := .f.
IF ( n := at( "{" , cP ) ) > 0
IF ( n1 := at( "}" , cP ) ) > 0
lHas := .t.
cMacro := substr( cP, n + 1, n1 - n - 1 )
cP := substr( cP, 1, n - 1 ) + ::macro2value( cMacro ) + substr( cP, n1 + 1 )
ENDIF
ENDIF
IF ! lHas
EXIT
ENDIF
ENDDO
ENDIF
RETURN cP
/*----------------------------------------------------------------------*/
METHOD IdeToolsManager:macro2value( cMacro )
LOCAL cVal, cMacroL, oEdit, cFile, cPath, cExt
cMacro := alltrim( cMacro )
cMacroL := lower( cMacro )
oEdit := ::oEM:getEditorCurrent()
IF !empty( oEdit )
hb_fNameSplit( oEdit:sourceFile, @cPath, @cFile, @cExt )
ELSE
cPath := ""; cFile := ""; cExt := ""
ENDIF
DO CASE
CASE cMacroL == "source_fullname"
cVal := hbide_pathToOSPath( cPath + cFile + cExt )
CASE cMacroL == "source_name"
cVal := cFile + cExt
CASE cMacroL == "source_path"
cVal := hbide_pathToOSPath( cPath )
CASE "%" $ cMacro
cVal := hb_GetEnv( strtran( cMacro, "%", "" ) )
OTHERWISE
cVal := cMacro
ENDCASE
RETURN cVal
/*----------------------------------------------------------------------*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>135</width>
<height>24</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="buttonNext">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonPrev">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonLast">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonFirst">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAll">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,92 @@
/********************************************************************************
** Form generated from reading UI file 'updown.ui'
**
** Created: Sun Jun 6 00:57:17 2010
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UPDOWN_H
#define UPDOWN_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QToolButton>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Form
{
public:
QHBoxLayout *horizontalLayout;
QToolButton *buttonNext;
QToolButton *buttonPrev;
QToolButton *buttonLast;
QToolButton *buttonFirst;
QToolButton *buttonAll;
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(135, 24);
horizontalLayout = new QHBoxLayout(Form);
horizontalLayout->setSpacing(1);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalLayout->setContentsMargins(0, 2, 0, 2);
buttonNext = new QToolButton(Form);
buttonNext->setObjectName(QString::fromUtf8("buttonNext"));
horizontalLayout->addWidget(buttonNext);
buttonPrev = new QToolButton(Form);
buttonPrev->setObjectName(QString::fromUtf8("buttonPrev"));
horizontalLayout->addWidget(buttonPrev);
buttonLast = new QToolButton(Form);
buttonLast->setObjectName(QString::fromUtf8("buttonLast"));
horizontalLayout->addWidget(buttonLast);
buttonFirst = new QToolButton(Form);
buttonFirst->setObjectName(QString::fromUtf8("buttonFirst"));
horizontalLayout->addWidget(buttonFirst);
buttonAll = new QToolButton(Form);
buttonAll->setObjectName(QString::fromUtf8("buttonAll"));
horizontalLayout->addWidget(buttonAll);
retranslateUi(Form);
QMetaObject::connectSlotsByName(Form);
} // setupUi
void retranslateUi(QWidget *Form)
{
Form->setWindowTitle(QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8));
buttonNext->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8));
buttonPrev->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8));
buttonLast->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8));
buttonFirst->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8));
buttonAll->setText(QApplication::translate("Form", "...", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class Form: public Ui_Form {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UPDOWN_H

View File

@@ -987,8 +987,11 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
if( ctrl && event->text().isEmpty() )
{
#if 0
event->ignore();
return true;
#endif
return false;
}
if( ctrl && ( k == Qt::Key_C || k == Qt::Key_V || k == Qt::Key_X ||
@@ -1248,12 +1251,13 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
{
HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i 000", event->key() ) );
if( hbKeyPressSelection( event ) )
{
QApplication::processEvents();
return;
}
HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i", event->key() ) );
if( c && c->popup()->isVisible() )
{
// The following keys are forwarded by the completer to the widget