2010-02-27 19:16 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbide/resources/harbour_splash.png
  * contrib/hbide/resources/hbidesplash.png
  * contrib/hbide/resources/togglelinenumber.png

  * contrib/hbqt/hbqt_hbqplaintextedit.cpp
  * contrib/hbqt/hbqt_hbqplaintextedit.h

  * contrib/hbide/hbide.prg
  * contrib/hbide/idedocks.prg
  * contrib/hbide/ideeditor.prg
    + Implemented: toggling the line-numbers visibility in editors.
      Slot is provided with left-hand toolbar button.
      Toggling is availabler per one editor tab.

    + Entered: copy-right information in hbIDE splash screen.
This commit is contained in:
Pritpal Bedi
2010-02-28 03:21:43 +00:00
parent 8e5c8e5ff5
commit 9fae196788
9 changed files with 92 additions and 18 deletions

View File

@@ -17,6 +17,23 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-02-27 19:16 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/resources/harbour_splash.png
* contrib/hbide/resources/hbidesplash.png
* contrib/hbide/resources/togglelinenumber.png
* contrib/hbqt/hbqt_hbqplaintextedit.cpp
* contrib/hbqt/hbqt_hbqplaintextedit.h
* contrib/hbide/hbide.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/ideeditor.prg
+ Implemented: toggling the line-numbers visibility in editors.
Slot is provided with left-hand toolbar button.
Toggling is availabler per one editor tab.
+ Entered: copy-right information in hbIDE splash screen.
2010-02-27 15:59 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/gtqtc/gtqtc.cpp
! Fix to warning: QFont::setPointSize: Point size <= 0 (0), must be greater than 0

View File

@@ -305,7 +305,7 @@ METHOD HbIde:create( cProjIni )
#if 1
LOCAL qPixmap, qSplash, nStart
qPixmap := QPixmap():new( hb_dirBase() + "resources" + hb_osPathSeparator() + "harbour_splash.png" )
qPixmap := QPixmap():new( hb_dirBase() + "resources" + hb_osPathSeparator() + "hbidesplash.png" )
qSplash := QSplashScreen():new()
qSplash:setWindowFlags( hb_bitOr( Qt_WindowStaysOnTopHint, qSplash:windowFlags() ) )
qSplash:setPixmap( qPixmap )

View File

@@ -304,7 +304,7 @@ METHOD IdeDocks:buildDialog()
LOCAL s, aSize
::oIde:oDlg := XbpDialog():new()
::oDlg:icon := ::resPath + "hbide.png" // "vr.png"
::oDlg:icon := hbide_image( "hbide" )
::oDlg:title := "Harbour IDE"
::oDlg:qtObject := HbQtUI():new( ::resPath + "mainwindow.uic" ):build()
::oDlg:create( , , , , , .f. )
@@ -533,19 +533,25 @@ METHOD IdeDocks:buildToolBarPanels()
::oDlg:oWidget:addToolBar( Qt_LeftToolBarArea, ::qTBarLines )
aBtns := {}
aadd( aBtns, { "movelineup" , "Move Current Line Up" , {|| ::oEM:moveLine( -1 ) } } )
aadd( aBtns, { "movelinedown" , "Move Current Line Down", {|| ::oEM:moveLine( 1 ) } } )
aadd( aBtns, { "deleteline" , "Delete Current Line" , {|| ::oEM:deleteLine() } } )
aadd( aBtns, { "duplicateline", "Duplicate Current Line", {|| ::oEM:duplicateLine() } } )
aadd( aBtns, { "movelineup" , "Move Current Line Up" , {|| ::oEM:moveLine( -1 ) } } )
aadd( aBtns, { "movelinedown" , "Move Current Line Down" , {|| ::oEM:moveLine( 1 ) } } )
aadd( aBtns, { "deleteline" , "Delete Current Line" , {|| ::oEM:deleteLine() } } )
aadd( aBtns, { "duplicateline", "Duplicate Current Line" , {|| ::oEM:duplicateLine() } } )
aadd( aBtns, {} )
aadd( aBtns, { "togglelinenumber", "Toggle Line Numbers" , {|| ::oEM:toggleLineNumbers() } } )
FOR EACH a_ IN aBtns
qTBtn := QToolButton():new()
qTBtn:setTooltip( a_[ 2 ] )
qTBtn:setIcon( ::resPath + a_[ 1 ] + ".png" )
qTBtn:setMaximumWidth( 20 )
qTBtn:setMaximumHeight( 20 )
::connect( qTBtn, "clicked()", a_[ 3 ] )
::qTBarLines:addWidget( qTBtn )
aadd( ::aBtnLines, qTBtn )
IF empty( a_ )
::qTBarLines:addSeparator()
ELSE
qTBtn := QToolButton():new()
qTBtn:setTooltip( a_[ 2 ] )
qTBtn:setIcon( ::resPath + a_[ 1 ] + ".png" )
qTBtn:setMaximumWidth( 20 )
qTBtn:setMaximumHeight( 20 )
::connect( qTBtn, "clicked()", a_[ 3 ] )
::qTBarLines:addWidget( qTBtn )
aadd( ::aBtnLines, qTBtn )
ENDIF
NEXT
::qTBarLines:addSeparator()
@@ -562,7 +568,6 @@ METHOD IdeDocks:buildToolBarPanels()
aadd( aBtns, {} )
aadd( aBtns, { "sgl2dblquote" , "Single to Double Quotes", {|| ::oEM:convertDQuotes() } } )
aadd( aBtns, { "dbl2sglquote" , "Double to Single Quotes", {|| ::oEM:convertQuotes() } } )
aadd( aBtns, {} )
FOR EACH a_ IN aBtns
IF empty( a_ )
::qTBarLines:addSeparator()
@@ -577,6 +582,7 @@ METHOD IdeDocks:buildToolBarPanels()
aadd( ::aBtnLines, qTBtn )
ENDIF
NEXT
::qTBarLines:addSeparator()
/* Right-hand docks toolbar */
::oIde:qTBarDocks := QToolBar():new()

View File

@@ -144,6 +144,7 @@ CLASS IdeEditsManager INHERIT IdeObject
METHOD convertQuotes()
METHOD convertDQuotes()
METHOD toggleSelectionMode()
METHOD toggleLineNumbers()
ENDCLASS
@@ -589,6 +590,17 @@ METHOD IdeEditsManager:switchToReadOnly()
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:toggleLineNumbers()
LOCAL oEdit
IF !empty( oEdit := ::getEditObjectCurrent() )
oEdit:toggleLineNumbers()
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:convertSelection( cKey )
LOCAL oEdit
@@ -1355,6 +1367,7 @@ CLASS IdeEdit INHERIT IdeObject
DATA lUpdatePrevWord INIT .f.
DATA lCopyWhenDblClicked INIT .f.
DATA cCurLineText INIT ""
DATA lLineNumbersVisible INIT .t.
METHOD new( oEditor, nMode )
METHOD create( oEditor, nMode )
@@ -1381,6 +1394,7 @@ CLASS IdeEdit INHERIT IdeObject
METHOD handleCurrentIndent()
METHOD handlePreviousWord( lUpdatePrevWord )
METHOD loadFuncHelp()
METHOD toggleLineNumbers()
ENDCLASS
@@ -1729,6 +1743,15 @@ METHOD IdeEdit:presentSkeletons()
/*----------------------------------------------------------------------*/
METHOD IdeEdit:toggleLineNumbers()
::lLineNumbersVisible := ! ::lLineNumbersVisible
::qEdit:numberBlockVisible( ::lLineNumbersVisible )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEdit:gotoMark( nIndex )
IF len( ::aBookMarks ) >= nIndex
::qEdit:gotoBookmark( ::aBookMarks[ nIndex ] )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

View File

@@ -333,6 +333,27 @@ void HBQPlainTextEdit::prevBookmark( int block )
}
}
void HBQPlainTextEdit::numberBlockVisible( bool b )
{
numberBlock = b;
if( b )
{
lineNumberArea->show();
updateLineNumberAreaWidth( lineNumberAreaWidth() );
}
else
{
lineNumberArea->hide();
updateLineNumberAreaWidth( 0 );
}
update();
}
bool HBQPlainTextEdit::numberBlockVisible()
{
return numberBlock;
}
int HBQPlainTextEdit::lineNumberAreaWidth()
{
int digits = 1;
@@ -348,7 +369,14 @@ int HBQPlainTextEdit::lineNumberAreaWidth()
void HBQPlainTextEdit::updateLineNumberAreaWidth( int )
{
setViewportMargins( lineNumberAreaWidth(), 0, 0, 0 );
if( numberBlock )
{
setViewportMargins( lineNumberAreaWidth(), 0, 0, 0 );
}
else
{
setViewportMargins( 0, 0, 0, 0 );
}
}
void HBQPlainTextEdit::updateLineNumberArea( const QRect &rect, int dy )

View File

@@ -100,8 +100,6 @@ public:
void nextBookmark( int block );
void prevBookmark( int block );
void gotoBookmark( int block );
void numberBlockVisible( bool b ) { numberBlock = b; }
bool numberBlockVisible() { return numberBlock; }
void highlightCurrentLine( bool b ) { highlightCurLine = b; }
bool highlightCurrentLine() { return highlightCurLine; }
void hbSetEventBlock( PHB_ITEM pBlock );
@@ -153,6 +151,8 @@ public slots:
void insertTab( int mode );
void highlightSelectedColumns( bool yes );
QString getSelectedText();
void numberBlockVisible( bool b );
bool numberBlockVisible();
private slots:
void slotCursorPositionChanged();