From 35e4b9d078a379cd675ad0ea3c8892e1c580904b Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Fri, 15 Apr 2011 17:04:37 +0000 Subject: [PATCH] 2011-04-15 09:59 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbppushbutton.prg ! Fixed: :activate was firing event twice, on press and release, both. * contrib/hbxbp/xbpwindow.prg ! Fixed: to reset window size as per GUI norms. Xbase++ seems wrong on this account where XbpDialog() height is "excluding" window frame-height whereas width is "inclusing" frame-width. --- harbour/ChangeLog | 9 ++++++ harbour/contrib/hbxbp/xbppushbutton.prg | 4 +-- harbour/contrib/hbxbp/xbpwindow.prg | 42 +++++++++++-------------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a0094ac752..6fc3313840 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2011-04-15 09:59 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbppushbutton.prg + ! Fixed: :activate was firing event twice, on press and release, both. + + * contrib/hbxbp/xbpwindow.prg + ! Fixed: to reset window size as per GUI norms. Xbase++ seems + wrong on this account where XbpDialog() height is "excluding" + window frame-height whereas width is "inclusing" frame-width. + 2011-04-15 01:52 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbpwindow.prg ! Depricated: setting fore/background colors of a part via diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index 2b92d85001..22722468f1 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -143,7 +143,7 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible METHOD XbpPushButton:execSlot( cSlot, p ) DO CASE - CASE cSlot == "clicked()" .OR. cSlot == "pressed()" + CASE cSlot == "clicked()" // .OR. cSlot == "pressed()" ::activate() CASE cSlot == "keyPressed()" IF hbxbp_QKeyEventToAppEvent( p ) == xbeK_ENTER @@ -167,14 +167,12 @@ METHOD XbpPushButton:handleEvent( nEvent, mp1, mp2 ) METHOD XbpPushButton:connect() ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) - ::oWidget:connect( "pressed()", {|| ::execSlot( "pressed()" ) } ) RETURN Self /*----------------------------------------------------------------------*/ METHOD XbpPushButton:disconnect() ::oWidget:disconnect( "clicked()" ) - ::oWidget:disconnect( "pressed()" ) RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 8dcfaa1dcd..2ea3256703 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -1062,6 +1062,24 @@ METHOD XbpWindow:setTrackPointer( lTrack ) /*----------------------------------------------------------------------*/ +METHOD XbpWindow:currentPos() + + RETURN { ::oWidget:x(), ::oWidget:y() } + +/*----------------------------------------------------------------------*/ + +METHOD XbpWindow:currentSize() + + IF ::className() == "HBPAPPDESKTOP" + RETURN { ::width(), ::height() } + ELSE + RETURN { ::oWidget:width(), ::oWidget:height() } + ENDIF + + RETURN {} + +/*----------------------------------------------------------------------*/ + METHOD XbpWindow:setPos( aPos, lPaint ) DEFAULT aPos TO ::aPos @@ -1076,7 +1094,6 @@ METHOD XbpWindow:setPos( aPos, lPaint ) /*----------------------------------------------------------------------*/ METHOD XbpWindow:setPosAndSize( aPos, aSize, lPaint ) - LOCAL oSize, oSizeF IF empty( ::qtObject ) DEFAULT aPos TO ::aPos @@ -1085,11 +1102,8 @@ METHOD XbpWindow:setPosAndSize( aPos, aSize, lPaint ) IF hb_isArray( aPos ) .and. hb_isArray( aSize ) DEFAULT lPaint TO .T. - oSize := ::oWidget:size() - oSizeF := ::oWidget:frameSize() - ::oWidget:move( aPos[ 1 ], aPos[ 2 ] ) - ::oWidget:resize( aSize[ 1 ] - ( oSizeF:width()-oSize:width() ), aSize[ 2 ] ) + ::oWidget:resize( aSize[ 1 ], aSize[ 2 ] ) ENDIF ENDIF @@ -1190,24 +1204,6 @@ METHOD XbpWindow:setPresParam( aPPNew ) /*----------------------------------------------------------------------*/ -METHOD XbpWindow:currentPos() - - RETURN { ::oWidget:x(), ::oWidget:y() } - -/*----------------------------------------------------------------------*/ - -METHOD XbpWindow:currentSize() - - IF ::className() == "HBPAPPDESKTOP" - RETURN { ::width(), ::height() } - ELSE - RETURN { ::oWidget:frameGeometry():width(), ::oWidget:frameGeometry():height() } - ENDIF - - RETURN {} - -/*----------------------------------------------------------------------*/ - METHOD XbpWindow:getHWND() LOCAL oError := ErrorNew()