2012-07-19 19:39 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/hbqreportsmanager.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/idebrowse.prg
* contrib/hbide/idefindreplace.prg
* contrib/hbide/idehome.prg
* contrib/hbide/idemain.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/idesaveload.prg
* contrib/hbide/ideshortcuts.prg
* contrib/hbide/idethemes.prg
! Changed: hbIDE => HbIDE.
Formatting and code cleanup.
* contrib/hbide/ideedit.prg
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
! Optimized: Column selection mode.
% Code cleanup.
This commit is contained in:
@@ -16,6 +16,26 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-07-19 19:39 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
* contrib/hbide/ideactions.prg
|
||||
* contrib/hbide/idebrowse.prg
|
||||
* contrib/hbide/idefindreplace.prg
|
||||
* contrib/hbide/idehome.prg
|
||||
* contrib/hbide/idemain.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
* contrib/hbide/idesaveload.prg
|
||||
* contrib/hbide/ideshortcuts.prg
|
||||
* contrib/hbide/idethemes.prg
|
||||
! Changed: hbIDE => HbIDE.
|
||||
Formatting and code cleanup.
|
||||
|
||||
* contrib/hbide/ideedit.prg
|
||||
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
|
||||
! Optimized: Column selection mode.
|
||||
% Code cleanup.
|
||||
|
||||
2012-07-19 22:09 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbfbird/tests/testapi.c
|
||||
* uncrustified
|
||||
|
||||
@@ -227,7 +227,7 @@ CLASS HbqReportsManager
|
||||
DATA symposis INIT "HBReports Designer"
|
||||
DATA version INIT 0.1
|
||||
DATA title INIT "Report"
|
||||
DATA author INIT "hbIDE"
|
||||
DATA author INIT "HbIDE"
|
||||
DATA created INIT date()
|
||||
DATA modified INIT date()
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ METHOD IdeActions:loadActions()
|
||||
// Name Text Image Shortcut Checkable IconVisInMenu
|
||||
//
|
||||
aadd( aAct, { "TB_Exit" , "E~xit" , "exit3" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "TB_Home" , "~Home" , "home3"/*"dc_home"*/, "" , "No", "Yes" } )
|
||||
aadd( aAct, { "TB_Home" , "~Home" , "home3"/*"dc_home"*/, "" , "No", "Yes" } )
|
||||
aadd( aAct, { "TB_New" , "~Source" , "new" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "TB_Open" , "~Open" , "open3" , "" , "No", "Yes" } )
|
||||
aadd( aAct, { "TB_Save" , "~Save" , "save3" , "" , "No", "Yes" } )
|
||||
|
||||
@@ -130,12 +130,12 @@
|
||||
#define TBL_CURSOR 7
|
||||
#define TBL_GEOMETRY 8
|
||||
#define TBL_ROWPOS 9
|
||||
#define TBL_COLPOS 10
|
||||
#define TBL_HZSCROLL 11
|
||||
#define TBL_CONXN 12
|
||||
#define TBL_NEXT 13
|
||||
#define TBL_COLPOS 10
|
||||
#define TBL_HZSCROLL 11
|
||||
#define TBL_CONXN 12
|
||||
#define TBL_NEXT 13
|
||||
|
||||
#define TBL_VRBLS 13
|
||||
#define TBL_VRBLS 13
|
||||
|
||||
#define SUB_ID 1
|
||||
#define SUB_WINDOW 2
|
||||
|
||||
@@ -214,8 +214,8 @@ CLASS IdeEdit INHERIT IdeObject
|
||||
METHOD markCurrentFunction()
|
||||
METHOD copyBlockContents()
|
||||
METHOD pasteBlockContents()
|
||||
METHOD insertBlockContents( aCord )
|
||||
METHOD deleteBlockContents( k )
|
||||
METHOD insertBlockContents( oKey )
|
||||
METHOD cutBlockContents( k )
|
||||
METHOD zoom( nKey )
|
||||
METHOD blockConvert( cMode )
|
||||
METHOD dispStatusInfo()
|
||||
@@ -309,11 +309,11 @@ METHOD IdeEdit:create( oIde, oEditor, nMode )
|
||||
|
||||
::connectEditSignals()
|
||||
|
||||
::qEdit:connect( QEvent_KeyPress , {|p| ::execKeyEvent( 101, QEvent_KeyPress, p ) } )
|
||||
::qEdit:connect( QEvent_Wheel , {|p| ::execKeyEvent( 102, QEvent_Wheel , p ) } )
|
||||
::qEdit:connect( QEvent_FocusIn , {| | ::execKeyEvent( 104, QEvent_FocusIn ) } )
|
||||
::qEdit:connect( QEvent_Resize , {| | ::execKeyEvent( 106, QEvent_Resize ) } )
|
||||
::qEdit:connect( QEvent_FocusOut , {| | ::execKeyEvent( 105, QEvent_FocusOut ) } )
|
||||
::qEdit:connect( QEvent_KeyPress , {|p| ::execKeyEvent( 101, QEvent_KeyPress , p ) } )
|
||||
::qEdit:connect( QEvent_Wheel , {|p| ::execKeyEvent( 102, QEvent_Wheel , p ) } )
|
||||
::qEdit:connect( QEvent_FocusIn , {| | ::execKeyEvent( 104, QEvent_FocusIn ) } )
|
||||
::qEdit:connect( QEvent_Resize , {| | ::execKeyEvent( 106, QEvent_Resize ) } )
|
||||
::qEdit:connect( QEvent_FocusOut , {| | ::execKeyEvent( 105, QEvent_FocusOut ) } )
|
||||
::qEdit:connect( QEvent_MouseButtonDblClick, {|p| ::execKeyEvent( 103, QEvent_MouseButtonDblClick, p ) } )
|
||||
|
||||
::qEdit:hbSetEventBlock( {|p,p1| ::execKeyEvent( 115, 1001, p, p1 ) } )
|
||||
@@ -570,13 +570,11 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 )
|
||||
::oFR:find( .f. )
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE Qt_Key_Insert
|
||||
IF lCtrl
|
||||
::copy()
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE Qt_Key_Backspace
|
||||
IF ! lCtrl .AND. ! lAlt
|
||||
IF ::getLineNo() == ::nProtoLine .AND. ::getColumnNo() <= ::nProtoCol + 1
|
||||
@@ -615,73 +613,66 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p, p1 )
|
||||
ENDIF
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
|
||||
EXIT
|
||||
|
||||
CASE QEvent_Enter
|
||||
CASE QEvent_FocusIn
|
||||
IF key == QEvent_FocusIn
|
||||
::oUpDn:show()
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE QEvent_Resize
|
||||
::oUpDn:show()
|
||||
EXIT
|
||||
|
||||
CASE QEvent_Leave
|
||||
CASE QEvent_FocusOut
|
||||
EXIT
|
||||
|
||||
CASE QEvent_Wheel
|
||||
EXIT
|
||||
|
||||
CASE QEvent_MouseButtonDblClick
|
||||
::lCopyWhenDblClicked := .t.
|
||||
EXIT
|
||||
|
||||
CASE 1001
|
||||
IF p == QEvent_MouseButtonDblClick
|
||||
CASE 1001 /* Fired from hbqt_hbqplaintextedit.cpp */
|
||||
SWITCH p
|
||||
CASE QEvent_MouseButtonDblClick
|
||||
::lCopyWhenDblClicked := .f. /* not intuitive */
|
||||
::clickFuncHelp()
|
||||
|
||||
ELSEIF p == QEvent_Paint
|
||||
EXIT
|
||||
CASE QEvent_Paint
|
||||
// ::oIde:testPainter( p1 )
|
||||
|
||||
ELSEIF p == 21000 /* Sends Block Info { t,l,b,r,mode,state } hbGetBlockInfo() */
|
||||
EXIT
|
||||
CASE 21000 /* Sends Block Info { t,l,b,r,mode,state } hbGetBlockInfo() */
|
||||
::aSelectionInfo := p1
|
||||
::oDK:setButtonState( "SelectionMode", ::aSelectionInfo[ 5 ] > 1 )
|
||||
|
||||
ELSEIF p == 21001
|
||||
EXIT
|
||||
CASE 21001
|
||||
::handlePreviousWord( .t. )
|
||||
|
||||
ELSEIF p == 21002
|
||||
EXIT
|
||||
CASE 21002
|
||||
::loadFuncHelp()
|
||||
|
||||
ELSEIF p == 21011
|
||||
EXIT
|
||||
CASE 21011
|
||||
::copyBlockContents()
|
||||
|
||||
ELSEIF p == 21012
|
||||
::pasteBlockContents()// p1 )
|
||||
|
||||
ELSEIF p == 21013
|
||||
EXIT
|
||||
CASE 21012
|
||||
::pasteBlockContents()
|
||||
EXIT
|
||||
CASE 21013
|
||||
::insertBlockContents( p1 )
|
||||
|
||||
ELSEIF p == 21014 /* ->hbCut() */
|
||||
::deleteBlockContents( p1 )
|
||||
|
||||
ELSEIF p == 21017 /* Sends Block Info { t,l,b,r,mode,state } hbGetBlockInfo() */
|
||||
EXIT
|
||||
CASE 21014 /* ->hbCut() */
|
||||
::cutBlockContents( p1 )
|
||||
EXIT
|
||||
CASE 21017 /* Sends Block Info { t,l,b,r,mode,state } hbGetBlockInfo() */
|
||||
::aViewportInfo := p1
|
||||
|
||||
ELSEIF p == 21041
|
||||
EXIT
|
||||
CASE 21041
|
||||
::qEdit:hbSetFieldsListActive( ::oEM:updateFieldsList( p1 ) )
|
||||
|
||||
ELSEIF p == 21042
|
||||
EXIT
|
||||
CASE 21042
|
||||
::qEdit:hbSetFieldsListActive( ::oEM:updateFieldsList() )
|
||||
|
||||
ENDIF
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
ENDSWITCH
|
||||
|
||||
RETURN .F. /* Important - NEVER CHANGE IT TO .T. */
|
||||
@@ -996,19 +987,19 @@ METHOD IdeEdit:pasteBlockContents()
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:insertBlockContents( aCord )
|
||||
LOCAL nT, nL, nB, nR, nW, i, cLine, cKey, qCursor
|
||||
METHOD IdeEdit:insertBlockContents( oKey )
|
||||
LOCAL nT, nL, nB, nR, nW, i, cLine, cKey, qCursor, aCord
|
||||
|
||||
IF ::lReadOnly
|
||||
RETURN Self
|
||||
ENDIF
|
||||
|
||||
cKey := chr( hbxbp_QKeyEventToAppEvent( oKey ) )
|
||||
|
||||
aCord := ::aSelectionInfo
|
||||
hbide_normalizeRect( aCord, @nT, @nL, @nB, @nR )
|
||||
|
||||
nW := nR - nL
|
||||
|
||||
cKey := chr( hbxbp_QKeyEventToAppEvent( aCord[ 7 ] ) )
|
||||
|
||||
qCursor := ::qEdit:textCursor()
|
||||
qCursor:beginEditBlock()
|
||||
|
||||
@@ -1039,7 +1030,7 @@ METHOD IdeEdit:insertBlockContents( aCord )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEdit:deleteBlockContents( k )
|
||||
METHOD IdeEdit:cutBlockContents( k )
|
||||
LOCAL nT, nL, nB, nR, i, cLine, qCursor, nSelMode, aCord
|
||||
|
||||
IF ::lReadOnly
|
||||
@@ -1075,7 +1066,8 @@ METHOD IdeEdit:deleteBlockContents( k )
|
||||
cLine := pad( substr( cLine, 1, nL ), nL ) + substr( cLine, nR + 1 )
|
||||
hbide_qReplaceLine( qCursor, i, cLine )
|
||||
NEXT
|
||||
hbide_qPositionCursor( qCursor, nT, nL )
|
||||
//hbide_qPositionCursor( qCursor, nT, nL )
|
||||
::qEdit:hbSetSelectionInfo( { -1, -1, -1, -1, __selectionMode_column__ } )
|
||||
|
||||
ELSEIF nSelMode == __selectionMode_stream__
|
||||
hbide_qPositionCursor( qCursor, nT, nL )
|
||||
@@ -1083,20 +1075,20 @@ METHOD IdeEdit:deleteBlockContents( k )
|
||||
qCursor:movePosition( QTextCursor_StartOfLine, QTextCursor_KeepAnchor )
|
||||
qCursor:movePosition( QTextCursor_Right , QTextCursor_KeepAnchor, nR )
|
||||
qCursor:removeSelectedText()
|
||||
::qEdit:hbSetSelectionInfo( { -1, -1, -1, -1, 1 } )
|
||||
::qEdit:hbSetSelectionInfo( { -1, -1, -1, -1, __selectionMode_stream__ } )
|
||||
|
||||
ELSEIF nSelMode == __selectionMode_line__
|
||||
hbide_qPositionCursor( qCursor, nT, nL )
|
||||
qCursor:movePosition( QTextCursor_Down , QTextCursor_KeepAnchor, nB - nT + 1 )
|
||||
qCursor:movePosition( QTextCursor_StartOfLine, QTextCursor_KeepAnchor )
|
||||
qCursor:removeSelectedText()
|
||||
::qEdit:hbSetSelectionInfo( { -1, -1, -1, -1, 1 } )
|
||||
::qEdit:hbSetSelectionInfo( { -1, -1, -1, -1, __selectionMode_stream__ } )
|
||||
::isLineSelectionON := .f.
|
||||
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
//
|
||||
|
||||
::qEdit:setTextCursor( qCursor )
|
||||
qCursor:endEditBlock()
|
||||
|
||||
@@ -1531,7 +1523,7 @@ METHOD IdeEdit:cut()
|
||||
IF ::lReadOnly
|
||||
RETURN Self
|
||||
ENDIF
|
||||
::deleteBlockContents( Qt_Key_X )
|
||||
::cutBlockContents( Qt_Key_X )
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -1548,7 +1540,7 @@ METHOD IdeEdit:paste()
|
||||
RETURN Self
|
||||
ENDIF
|
||||
IF ::aSelectionInfo[ 1 ] > -1
|
||||
::deleteBlockContents( Qt_Key_Delete )
|
||||
::cutBlockContents( Qt_Key_Delete )
|
||||
ENDIF
|
||||
::pasteBlockContents()
|
||||
|
||||
@@ -1667,6 +1659,8 @@ METHOD IdeEdit:find( cText, nPosFrom )
|
||||
METHOD IdeEdit:findEx( cText, nFlags, nStart )
|
||||
LOCAL qCursor, lFound, nPos
|
||||
|
||||
DEFAULT cText TO ::getSelectedText()
|
||||
DEFAULT nFlags TO 0
|
||||
DEFAULT nStart TO 0
|
||||
|
||||
qCursor := ::getCursor()
|
||||
|
||||
@@ -572,22 +572,22 @@ METHOD IdeHome:buildFaqTab()
|
||||
STATIC FUNCTION hbide_getFaqs()
|
||||
LOCAL a_:= {}, b_:= {}
|
||||
|
||||
aadd( a_, 'Does hbIDE support editing of same source at more than one place simultaneously ?' )
|
||||
aadd( b_, 'Yes. hbIDE provides for splitting an editing window, horizontally and vertically, ' + ;
|
||||
aadd( a_, 'Does HbIDE support editing of same source at more than one place simultaneously ?' )
|
||||
aadd( b_, 'Yes. HbIDE provides for splitting an editing window, horizontally and vertically, ' + ;
|
||||
'both ways. Right-click anywhere in the editor, point to "Split..." and then ' + ;
|
||||
'click on required option.' )
|
||||
|
||||
aadd( a_, 'Does hbIDE support session management ?' )
|
||||
aadd( a_, 'Does HbIDE support session management ?' )
|
||||
aadd( b_, 'Yes. And in a unique way. It provides to construct n number of "Panels" where you can spread ' + ;
|
||||
'sources. Each panel is given a name as well as corresponding button on the left-toolbar, a colored ' + ;
|
||||
'circle, to bring it forward. New panel can be created from selecting "New..." from drop-down ' + ;
|
||||
'list on top-toolbar and providing a name in the editing dialog. For this reason you will never ' + ;
|
||||
'need to exit hbIDE and reenter again. It is a big productivity boost.' )
|
||||
'need to exit HbIDE and reenter again. It is a big productivity boost.' )
|
||||
|
||||
aadd( a_, 'Does hbIDE allows to compile a project for different compilers and/or environments ?' )
|
||||
aadd( b_, 'Yes. Infact this feature had been the one of the main reasons of hbIDEs existance. ' + ;
|
||||
aadd( a_, 'Does HbIDE allows to compile a project for different compilers and/or environments ?' )
|
||||
aadd( b_, 'Yes. Infact this feature had been the one of the main reasons of HbIDEs existance. ' + ;
|
||||
'All you have to do is to enter different environment settings in _ONE_ hbide.env file which ' + ;
|
||||
'resides alongside hbide.ini. hbIDE provides the interface to manipulate this .env settings ' + ;
|
||||
'resides alongside hbide.ini. HbIDE provides the interface to manipulate this .env settings ' + ;
|
||||
'which can be invoked from right-toolbar icon "Compiler Environments". Follow the input fields. ' + ;
|
||||
'A template is provided in "hbide.env", inspect it and you are through. Once hbide.env ' + ;
|
||||
'is ready, you will simply need to switch over the other environment which can be invoked ' + ;
|
||||
@@ -595,13 +595,13 @@ STATIC FUNCTION hbide_getFaqs()
|
||||
'and click on listed options. Next step is just to build the project.' )
|
||||
|
||||
aadd( a_, 'Can we keep any other content in hbide.ini ?' )
|
||||
aadd( b_, 'No. hbide.ini is always re-written at the time hbIDE exits. Also this action is executed ' + ;
|
||||
aadd( b_, 'No. hbide.ini is always re-written at the time HbIDE exits. Also this action is executed ' + ;
|
||||
'several times depending upon the underlying needs. However, you can alter the contents in some ' + ;
|
||||
'sections, i.e., [Files], [Projects], etc., but only before running hbIDE. At exit, it will ' + ;
|
||||
'sections, i.e., [Files], [Projects], etc., but only before running HbIDE. At exit, it will ' + ;
|
||||
're-write it again.' )
|
||||
|
||||
aadd( a_, 'Does hbIDE provides "intellisense" ? If yes, in what aspects ?' )
|
||||
aadd( b_, 'Yes. Not so powerful yet, but "yes". hbIDE embeds two components as the basis of this intellisense, ' + ;
|
||||
aadd( a_, 'Does HbIDE provides "intellisense" ? If yes, in what aspects ?' )
|
||||
aadd( b_, 'Yes. Not so powerful yet, but "yes". HbIDE embeds two components as the basis of this intellisense, ' + ;
|
||||
hb_eol() + ;
|
||||
' 1. Harbour Documentation, and ' + hb_eol() + ;
|
||||
' 2. Project(s) Prototype Tagging. ' + hb_eol() + ;
|
||||
@@ -609,12 +609,12 @@ STATIC FUNCTION hbide_getFaqs()
|
||||
'only when requested. Prototype Tagging extends one step forward as to offer to load only those ' + ;
|
||||
'projects which a developer will be working on during that session. Both components can be aligned ' + ;
|
||||
'on the side corners to provide always-on view of the actual contents. The moment you press "(" ' + ;
|
||||
'hbIDE examines the contents of these components, if the function is available in Harbour Docs, ' + ;
|
||||
'HbIDE examines the contents of these components, if the function is available in Harbour Docs, ' + ;
|
||||
'its details are dumped into the viewer, otherwise if the function is contained in the tagged ' + ;
|
||||
'prototypes, it is made current in the list, and a html formatted prototype is displayed as tooltip ' + ;
|
||||
'beneth the current caret position. ' + hb_eol() + ;
|
||||
hb_eol() + ;
|
||||
'Code completion tool is almost done with, and probably will make up its presence in the hbIDE soon. ' )
|
||||
'Code completion tool is almost done with, and probably will make up its presence in the HbIDE soon. ' )
|
||||
|
||||
RETURN { a_, b_ }
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ METHOD HbIde:create( aParams )
|
||||
/* Console Editor */
|
||||
::oCUI := IdeConsole():new():create( Self )
|
||||
|
||||
::oDlg:show() /* Shifted here - it gives the effect that time opening hbIDE is much less */
|
||||
::oDlg:show() /* Shifted here - it gives the effect that time opening HbIDE is much less */
|
||||
qSplash:raise()
|
||||
|
||||
/* Fill various elements of the IDE */
|
||||
|
||||
@@ -989,7 +989,7 @@ FUNCTION hbide_help( nOption )
|
||||
SWITCH nOption
|
||||
CASE 1
|
||||
tit_ := 'About hbIde'
|
||||
AAdd( txt_, "<b>Harbour IDE ( hbIDE )</b>" )
|
||||
AAdd( txt_, "<b>Harbour IDE ( HbIDE )</b>" )
|
||||
AAdd( txt_, "Developed by" )
|
||||
AAdd( txt_, "Pritpal Bedi ( bedipritpal@hotmail.com )" )
|
||||
AAdd( txt_, "" )
|
||||
|
||||
@@ -495,7 +495,7 @@ METHOD IdeProjManager:pullHbpData( cHbp )
|
||||
cType := "Executable"
|
||||
ENDIF
|
||||
|
||||
/* Separate hbIDE specific flags */
|
||||
/* Separate HbIDE specific flags */
|
||||
FOR EACH s IN aOptns
|
||||
IF ( n := at( c3rd, s ) ) > 0
|
||||
IF ( n1 := hb_at( " ", s, n ) ) > 0
|
||||
|
||||
@@ -1969,11 +1969,9 @@ METHOD IdeSetup:execEvent( nEvent, p, p1 )
|
||||
p:buttonSaveAs:disconnect( "clicked()" )
|
||||
p:buttonSave:disconnect( "clicked()" )
|
||||
p:buttonClose:disconnect( "clicked()" )
|
||||
|
||||
p:close()
|
||||
p := NIL /* Must Destroy It */
|
||||
p:setParent( QWidget() ) /* Must Destroy It */
|
||||
EXIT
|
||||
|
||||
/* Docking Widgets */
|
||||
CASE __comboTabsShape_currentIndexChanged__
|
||||
::oINI:nDocksTabShape := p
|
||||
|
||||
@@ -601,17 +601,17 @@ METHOD IdeShortcuts:buildUI()
|
||||
|
||||
METHOD IdeShortcuts:buildSignals()
|
||||
|
||||
::oUI:buttonNew :connect( "clicked()" , {| | ::execEvent( __buttonNew_clicked__ ) } )
|
||||
::oUI:buttonSet :connect( "clicked()" , {| | ::execEvent( __buttonSet_clicked__ ) } )
|
||||
::oUI:buttonTest :connect( "clicked()" , {| | ::execEvent( __buttonTest_clicked__ ) } )
|
||||
::oUI:buttonLoad :connect( "clicked()" , {| | ::execEvent( __buttonLoad_clicked__ ) } )
|
||||
::oUI:buttonSave :connect( "clicked()" , {| | ::execEvent( __buttonSave_clicked__ ) } )
|
||||
::oUI:buttonSaveAs:connect( "clicked()" , {| | ::execEvent( __buttonSaveAs_clicked__ ) } )
|
||||
::oUI:buttonDelete:connect( "clicked()" , {| | ::execEvent( __buttonDelete_clicked__ ) } )
|
||||
::oUI:listMethods :connect( "itemDoubleClicked(QListWidgetItem*)", {|p| ::execEvent( __listMethods_itemDoubleClicked__, p ) } )
|
||||
::oUI:listMethods :connect( "currentRowChanged(int)" , {|p| ::execEvent( __listMethods_currentRowChanged__, p ) } )
|
||||
::oUI:tableMacros :connect( "itemSelectionChanged()" , {| | ::execEvent( __tableMacros_itemSelectionChanged__ ) } )
|
||||
::oUI:tableMacros :connect( "itemDoubleClicked(QTableWidgetItem*)", {|p| ::execEvent( __tableMacros_itemDoubleClicked__, p ) } )
|
||||
::oUI:buttonNew :connect( "clicked()" , {| | ::execEvent( __buttonNew_clicked__ ) } )
|
||||
::oUI:buttonSet :connect( "clicked()" , {| | ::execEvent( __buttonSet_clicked__ ) } )
|
||||
::oUI:buttonTest :connect( "clicked()" , {| | ::execEvent( __buttonTest_clicked__ ) } )
|
||||
::oUI:buttonLoad :connect( "clicked()" , {| | ::execEvent( __buttonLoad_clicked__ ) } )
|
||||
::oUI:buttonSave :connect( "clicked()" , {| | ::execEvent( __buttonSave_clicked__ ) } )
|
||||
::oUI:buttonSaveAs:connect( "clicked()" , {| | ::execEvent( __buttonSaveAs_clicked__ ) } )
|
||||
::oUI:buttonDelete:connect( "clicked()" , {| | ::execEvent( __buttonDelete_clicked__ ) } )
|
||||
::oUI:listMethods :connect( "itemDoubleClicked(QListWidgetItem*)" , {|p| ::execEvent( __listMethods_itemDoubleClicked__ , p ) } )
|
||||
::oUI:listMethods :connect( "currentRowChanged(int)" , {|p| ::execEvent( __listMethods_currentRowChanged__ , p ) } )
|
||||
::oUI:tableMacros :connect( "itemSelectionChanged()" , {| | ::execEvent( __tableMacros_itemSelectionChanged__ ) } )
|
||||
::oUI:tableMacros :connect( "itemDoubleClicked(QTableWidgetItem*)", {|p| ::execEvent( __tableMacros_itemDoubleClicked__ , p ) } )
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -749,7 +749,7 @@ METHOD IdeShortcuts:test( cString, lWarn )
|
||||
ENDIF
|
||||
RECOVER USING oErr
|
||||
MsgBox( "Wrongly defined script, try: |v| ::method( v )", oErr:description )
|
||||
ENDSEQUENCE
|
||||
END SEQUENCE
|
||||
|
||||
ErrorBlock( bError )
|
||||
::oUI:raise()
|
||||
@@ -1092,6 +1092,9 @@ METHOD IdeShortcuts:togglePersistentSelection()
|
||||
METHOD IdeShortcuts:clearSelection()
|
||||
RETURN ::oEdit:clearSelection()
|
||||
/*----------------------------------------------------------------------*/
|
||||
METHOD IdeShortcuts:findAgain()
|
||||
RETURN ::oEdit:findEx()
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Navigation
|
||||
/*----------------------------------------------------------------------*/
|
||||
METHOD IdeShortcuts:home()
|
||||
@@ -1135,12 +1138,6 @@ METHOD IdeShortcuts:find( cString, nPosFrom )
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Other Cpmponents
|
||||
/*----------------------------------------------------------------------*/
|
||||
METHOD IdeShortcuts:findAgain()
|
||||
IF !empty( ::qCurEdit )
|
||||
::oFR:find()
|
||||
ENDIF
|
||||
RETURN Self
|
||||
/*----------------------------------------------------------------------*/
|
||||
METHOD IdeShortcuts:replace()
|
||||
IF !empty( ::qCurEdit )
|
||||
::oFR:replace()
|
||||
@@ -1156,7 +1153,7 @@ METHOD IdeShortcuts:help( cTopic )
|
||||
/*----------------------------------------------------------------------*/
|
||||
METHOD IdeShortcuts:exit( lWarn )
|
||||
IF HB_ISLOGICAL( lWarn ) .AND. lWarn
|
||||
IF hbide_getYesNo( "Exit hbIDE ?", , "Macro Executed" )
|
||||
IF hbide_getYesNo( "Exit HbIDE ?", , "Macro Executed" )
|
||||
PostAppEvent( xbeP_Close, NIL, NIL, ::oDlg )
|
||||
ENDIF
|
||||
ELSE
|
||||
@@ -1361,7 +1358,7 @@ METHOD IdeShortcuts:loadMethods()
|
||||
'Initiates a blank source file in an editing instance on the current panel.' } )
|
||||
aadd( ::aMethods, { 'open()', ;
|
||||
'open()', ;
|
||||
'Invokes "Open File" dialog and if a selection is made and such selection is a hbIDE supported valid text file, that is opened in a new editor instance on visible panel.' } )
|
||||
'Invokes "Open File" dialog and if a selection is made and such selection is a HbIDE supported valid text file, that is opened in a new editor instance on visible panel.' } )
|
||||
aadd( ::aMethods, { 'save()', ;
|
||||
'save()', ;
|
||||
'Saves the current editing instance if in modified state. Visual artifacts are updated accordingly.' } )
|
||||
@@ -1593,7 +1590,7 @@ METHOD IdeShortcuts:loadDftSCuts()
|
||||
aadd( b_, { "Redo" , "Y" , "NO", "YES", "NO" , "", '::redo()' , "redo" , "", "" } )
|
||||
aadd( b_, { "SelectAll" , "A" , "NO", "YES", "NO" , "", '::selectAll()' , "selectall" , "", "" } )
|
||||
|
||||
aadd( b_, { "New Source" , "N" , "NO", "YES", "NO" , "", '::newSource( "" )' , "new" , "", "" } )
|
||||
aadd( b_, { "New Source" , "N" , "YES","NO" , "NO" , "", '::newSource( "" )' , "new" , "", "" } )
|
||||
aadd( b_, { "Open" , "O" , "NO", "YES", "NO" , "", '::open()' , "open" , "", "" } )
|
||||
aadd( b_, { "Save" , "S" , "NO", "YES", "NO" , "", '::save()' , "save" , "", "" } )
|
||||
aadd( b_, { "Save All" , "S" , "NO", "YES", "YES", "", '::saveAll()' , "saveall" , "", "" } )
|
||||
|
||||
@@ -1048,7 +1048,7 @@ STATIC FUNCTION hbide_loadDefaultThemes()
|
||||
IF .t.
|
||||
aadd( aIni, "[ Controls ] " )
|
||||
aadd( aIni, " " )
|
||||
aadd( aIni, "dialogTitle = HBIDE - Source Syntax Highlighting " )
|
||||
aadd( aIni, "dialogTitle = HbIDE - Source Syntax Highlighting " )
|
||||
aadd( aIni, "labelItem = Item " )
|
||||
aadd( aIni, "labelTheme = Theme " )
|
||||
aadd( aIni, "checkItalic = Italic " )
|
||||
|
||||
@@ -705,8 +705,6 @@ void HBQPlainTextEdit::hbCut( int k )
|
||||
hb_vmEvalBlockV( block, 2, p1, p2 );
|
||||
hb_itemRelease( p1 );
|
||||
hb_itemRelease( p2 );
|
||||
|
||||
hbClearSelection();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1211,7 +1209,7 @@ bool HBQPlainTextEdit::hbKeyPressSelectionByApplication( QKeyEvent * event )
|
||||
bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
{
|
||||
int k;
|
||||
bool ctrl, shift;
|
||||
bool ctrl, shift, isNavable;
|
||||
|
||||
if( isSelectionByApplication ) {
|
||||
return hbKeyPressSelectionByApplication( event );
|
||||
@@ -1220,11 +1218,12 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
k = event->key();
|
||||
ctrl = event->modifiers() & Qt::ControlModifier;
|
||||
shift = event->modifiers() & Qt::ShiftModifier;
|
||||
isNavable = isNavableKey( k );
|
||||
|
||||
if( ctrl && shift && ! isNavableKey( k ) ) {
|
||||
if( ctrl && shift && ! isNavable ) {
|
||||
return false;
|
||||
}
|
||||
if( ctrl && event->text().isEmpty() && ! isNavableKey( k ) ) {
|
||||
if( ctrl && event->text().isEmpty() && ! isNavable ) {
|
||||
return false;
|
||||
}
|
||||
if( ctrl && ( k == Qt::Key_C || k == Qt::Key_V || k == Qt::Key_X ||
|
||||
@@ -1235,7 +1234,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
|
||||
bool bClear = false;
|
||||
|
||||
if( shift && isNavableKey( k ) )
|
||||
if( shift && isNavable )
|
||||
{
|
||||
if( selectionMode == selectionMode_line )
|
||||
{
|
||||
@@ -1274,14 +1273,13 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
return true;
|
||||
}
|
||||
|
||||
if( isShiftPressed && isNavableKey( k ) )
|
||||
if( isShiftPressed && isNavable )
|
||||
{
|
||||
isShiftPressed = false;
|
||||
|
||||
if( selectionMode == selectionMode_stream )
|
||||
{
|
||||
QPlainTextEdit::keyPressEvent( event );
|
||||
|
||||
rowEnds = textCursor().blockNumber();
|
||||
columnEnds = textCursor().columnNumber();
|
||||
}
|
||||
@@ -1293,24 +1291,15 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
{
|
||||
QTextCursor c( textCursor() );
|
||||
c.movePosition( QTextCursor::EndOfLine );
|
||||
if( c.columnNumber() <= columnEnds ){
|
||||
setTextCursor( c );
|
||||
if( columnEnds < c.columnNumber() )
|
||||
{
|
||||
QPlainTextEdit::keyPressEvent( event );
|
||||
ensureCursorVisible();
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0 /* Tobe Matured */
|
||||
int v = horizontalScrollBar()->value();
|
||||
int m = horizontalScrollBar()->maximum();
|
||||
int w = fontMetrics().averageCharWidth();
|
||||
if( ( ( columnEnds + 1 ) * w ) > m ){
|
||||
if( v == m )
|
||||
horizontalScrollBar()->setMaximum( m + w );
|
||||
}
|
||||
horizontalScrollBar()->setValue( v + w );
|
||||
#endif
|
||||
event->ignore();
|
||||
}
|
||||
event->ignore();
|
||||
columnEnds++;
|
||||
break;
|
||||
}
|
||||
@@ -1318,14 +1307,15 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
{
|
||||
QTextCursor c( textCursor() );
|
||||
int col = c.columnNumber();
|
||||
if( col < columnEnds - 1 ){
|
||||
c.movePosition( QTextCursor::Left );
|
||||
if( col > 0 )
|
||||
{
|
||||
QPlainTextEdit::keyPressEvent( event );
|
||||
columnEnds--;
|
||||
}
|
||||
else if( columnEnds - 1 >= 0 ){
|
||||
columnEnds--;
|
||||
else
|
||||
{
|
||||
event->ignore();
|
||||
}
|
||||
event->ignore();
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Home:
|
||||
@@ -1339,12 +1329,11 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
case Qt::Key_PageUp:
|
||||
case Qt::Key_Down:
|
||||
case Qt::Key_PageDown:
|
||||
{
|
||||
QPlainTextEdit::keyPressEvent( event );
|
||||
rowEnds = textCursor().blockNumber();
|
||||
break;
|
||||
default:
|
||||
event->ignore();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
hbPostSelectionInfo();
|
||||
@@ -1358,28 +1347,19 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
if( block )
|
||||
{
|
||||
PHB_ITEM p1 = hb_itemPutNI( NULL, 21013 );
|
||||
PHB_ITEM p2 = hb_itemNew( NULL );
|
||||
PHB_ITEM pObj = hbqt_bindGetHbObject( NULL, ( void * ) event, "HB_QKEYEVENT", NULL, 0 ) ;
|
||||
|
||||
hb_arrayNew( p2, 7 );
|
||||
hb_arraySetNI( p2, 1, rowBegins );
|
||||
hb_arraySetNI( p2, 2, columnBegins );
|
||||
hb_arraySetNI( p2, 3, rowEnds );
|
||||
hb_arraySetNI( p2, 4, columnEnds );
|
||||
hb_arraySetNI( p2, 5, selectionMode );
|
||||
hb_arraySetNI( p2, 6, selectionState );
|
||||
hb_arraySet( p2, 7, pObj );
|
||||
PHB_ITEM p2 = hbqt_bindGetHbObject( NULL, ( void * ) event, "HB_QKEYEVENT", NULL, 0 ) ;
|
||||
hb_vmEvalBlockV( block, 2, p1, p2 );
|
||||
hb_itemRelease( pObj );
|
||||
hb_itemRelease( p1 );
|
||||
hb_itemRelease( p2 );
|
||||
|
||||
if( columnBegins == columnEnds ){
|
||||
if( columnBegins == columnEnds )
|
||||
{
|
||||
columnBegins++;
|
||||
columnEnds++;
|
||||
hbPostSelectionInfo();
|
||||
}
|
||||
repaint();
|
||||
event->accept();
|
||||
repaint();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1388,40 +1368,49 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
bClear = true;
|
||||
}
|
||||
}
|
||||
else if( ! ctrl && ( k == Qt::Key_Backspace || k == Qt::Key_Delete ) && columnBegins >= 0 && selectionState > 0 && selectionMode == selectionMode_column )
|
||||
else if( ! ctrl && ( k == Qt::Key_Backspace || k == Qt::Key_Delete ) && columnBegins >= 0 && selectionState > 0 )
|
||||
{
|
||||
hbCut( k );
|
||||
if( k == Qt::Key_Backspace )
|
||||
if( selectionMode == selectionMode_column )
|
||||
{
|
||||
columnBegins--;
|
||||
columnEnds--;
|
||||
}
|
||||
else
|
||||
{
|
||||
columnEnds = columnBegins;
|
||||
}
|
||||
repaint();
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
else if( ! ctrl && ( k == Qt::Key_Backspace || k == Qt::Key_Delete ) && columnBegins >= 0 && selectionState > 0 && ( selectionMode == selectionMode_stream || selectionMode == selectionMode_line ) )
|
||||
{
|
||||
hbCut( Qt::Key_Delete );
|
||||
repaint();
|
||||
selectionState = 0;
|
||||
if( k == Qt::Key_Delete ){
|
||||
hbCut( k );
|
||||
if( k == Qt::Key_Backspace )
|
||||
{
|
||||
columnBegins--;
|
||||
columnEnds--;
|
||||
}
|
||||
else
|
||||
{
|
||||
columnEnds = columnBegins;
|
||||
}
|
||||
hbPostSelectionInfo();
|
||||
event->accept();
|
||||
repaint();
|
||||
return true;
|
||||
}
|
||||
else /* selectionMode == selectionMode_stream || selectionMode == selectionMode_line */
|
||||
{
|
||||
hbCut( Qt::Key_Delete );
|
||||
repaint();
|
||||
selectionState = 0;
|
||||
hbPostSelectionInfo();
|
||||
if( k == Qt::Key_Delete )
|
||||
{
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( ! ctrl && k >= ' ' && k < 127 && columnBegins >= 0 && selectionMode == selectionMode_stream ) //selectionState > 0
|
||||
else if( ! ctrl && k >= ' ' && k < 127 && columnBegins >= 0 && selectionMode == selectionMode_stream )
|
||||
{
|
||||
hbCut( Qt::Key_Delete );
|
||||
hbClearSelection();
|
||||
// repaint();
|
||||
selectionState = 0;
|
||||
}
|
||||
else if( isNavableKey( k ) || ( k >= ' ' && k < 127 ) )
|
||||
else if( ! ctrl && k >= ' ' && k < 127 )
|
||||
{
|
||||
bClear = true;
|
||||
}
|
||||
else if( isNavable )
|
||||
{
|
||||
bClear = true;
|
||||
}
|
||||
@@ -1454,31 +1443,6 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
#if 0
|
||||
else if( selectionMode == selectionMode_line )
|
||||
{
|
||||
if( isLineSelectionON && isNavableKey( k ) )
|
||||
{
|
||||
QPlainTextEdit::keyPressEvent( event );
|
||||
QTextCursor c( textCursor() );
|
||||
rowEnds = c.blockNumber();
|
||||
//repaint();
|
||||
return true;
|
||||
}
|
||||
else if( ! isSelectionPersistent )
|
||||
{
|
||||
if( selectionState > 0 )
|
||||
{
|
||||
emit selectionChanged();
|
||||
setCursorWidth( 1 );
|
||||
selectionState = 0;
|
||||
hbClearSelection();
|
||||
// repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user