diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f0ca4c898a..de22091122 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-16 16:30 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/gtwvg/wvgdatar.prg + ! Synchronized: WvgListBox():getData() method. + + * contrib/gtwvg/wvglistb.prg + * contrib/gtwvg/wvgtreev.prg + * contrib/gtwvg/wvgwnd.prg + + Implemented: oXbp:pointerFocus instance variable for + WvtListBox() and WvtTreeView() objects. + If a control is laid onto a WvgCrt(), then this variable + can be set to FALSE to keep focus on console window. + INCOMPATIBLE: this behavior is not available in Xbase++. + 2012-01-16 16:26 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/hbqtcore.hbx * contrib/hbqt/qtcore/qth/filelist.hbm diff --git a/harbour/contrib/gtwvg/wvgdatar.prg b/harbour/contrib/gtwvg/wvgdatar.prg index c223796c78..0a3c1a941d 100644 --- a/harbour/contrib/gtwvg/wvgdatar.prg +++ b/harbour/contrib/gtwvg/wvgdatar.prg @@ -120,6 +120,8 @@ METHOD DataRef:getData() DO CASE CASE ::className == "EDIT" ::sl_editBuffer := WVG_GetMessageText( ::hWnd, WM_GETTEXT, ::bufferLength + 1 ) + CASE ::className == "LISTBOX" + ::sl_editBuffer := WVG_LBGetCurSel( ::hWnd )+ 1 ENDCASE IF hb_isBlock( ::dataLink ) diff --git a/harbour/contrib/gtwvg/wvglistb.prg b/harbour/contrib/gtwvg/wvglistb.prg index 516af35046..ec6017f160 100644 --- a/harbour/contrib/gtwvg/wvglistb.prg +++ b/harbour/contrib/gtwvg/wvglistb.prg @@ -144,8 +144,8 @@ METHOD WvgListBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::wvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::style := WS_CHILD + WS_OVERLAPPED + WS_TABSTOP - ::exStyle := WS_EX_CLIENTEDGE + WS_EX_LEFT + WS_EX_LTRREADING + WS_EX_RIGHTSCROLLBAR + ::style := WS_CHILD + WS_OVERLAPPED + WS_TABSTOP + WS_CLIPSIBLINGS + ::exStyle := WS_EX_CLIENTEDGE //+ WS_EX_LEFT + WS_EX_LTRREADING + WS_EX_RIGHTSCROLLBAR ::className := "LISTBOX" ::objType := objTypeListBox @@ -196,29 +196,32 @@ METHOD WvgListBox:handleEvent( nMessage, aNM ) CASE nMessage == HB_GTE_COMMAND IF aNM[ 1 ] == LBN_SELCHANGE ::nCurSelected := WVG_LBGetCurSel( ::hWnd )+ 1 + IF ::isParentCrt() + ::oParent:setFocus() + ENDIF IF hb_isBlock( ::sl_itemMarked ) - IF ::isParentCrt() - ::oParent:setFocus() - ENDIF eval( ::sl_itemMarked, NIL, NIL, self ) - IF ::isParentCrt() + ENDIF + IF ::isParentCrt() + IF ::pointerFocus ::setFocus() ENDIF - RETURN EVENT_UNHANDELLED ENDIF ELSEIF aNM[ 1 ] == LBN_DBLCLK ::editBuffer := ::nCurSelected + IF ::isParentCrt() + ::oParent:setFocus() + ENDIF IF hb_isBlock( ::sl_itemSelected ) - IF ::isParentCrt() - ::oParent:setFocus() - ENDIF eval( ::sl_itemSelected, NIL, NIL, self ) - IF ::isParentCrt() + ENDIF + IF ::isParentCrt() + IF ::pointerFocus ::setFocus() ENDIF - RETURN EVENT_UNHANDELLED ENDIF + ENDIF CASE nMessage == HB_GTE_NOTIFY @@ -234,7 +237,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM ) RETURN WVG_GetCurrentBrush( aNM[ 1 ] ) ENDIF - CASE nMessage == HB_GTE_ANY + CASE nMessage == HB_GTE_ANY /* This will never be reached */ IF aNM[ 1 ] == WM_LBUTTONUP ::nCurSelected := WVG_LBGetCurSel( ::hWnd ) + 1 IF hb_isBlock( ::sl_itemMarked ) diff --git a/harbour/contrib/gtwvg/wvgtreev.prg b/harbour/contrib/gtwvg/wvgtreev.prg index 9011b4812b..9825fd1ea4 100644 --- a/harbour/contrib/gtwvg/wvgtreev.prg +++ b/harbour/contrib/gtwvg/wvgtreev.prg @@ -197,27 +197,35 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM ) DO CASE CASE aHdr[ NMH_code ] == NM_DBLCLK .OR. aHdr[ NMH_code ] == NM_RETURN ::editBuffer := ::oItemSelected + IF ::isParentCrt() + ::oParent:setFocus() + ENDIF IF hb_isBlock( ::sl_itemSelected ) - IF ::isParentCrt() - ::oParent:setFocus() - ENDIF Eval( ::sl_itemSelected, ::oItemSelected, { 0,0,0,0 }, Self ) - IF ::isParentCrt() + ENDIF + IF ::isParentCrt() + IF ::pointerFocus ::setFocus() ENDIF + ELSE + ::setFocus() ENDIF RETURN .f. CASE aHdr[ NMH_code ] == TVN_SELCHANGED ::getSelectionInfo( aNM[ 2 ] ) + IF ::isParentCrt() + ::oParent:setFocus() + ENDIF IF hb_isBlock( ::sl_itemMarked ) - IF ::isParentCrt() - ::oParent:setFocus() - ENDIF Eval( ::sl_itemMarked, ::oItemSelected, { 0,0,0,0 }, Self ) - IF ::isParentCrt() + ENDIF + IF ::isParentCrt() + IF ::pointerFocus ::setFocus() ENDIF + ELSE + ::setFocus() ENDIF RETURN .t. diff --git a/harbour/contrib/gtwvg/wvgwnd.prg b/harbour/contrib/gtwvg/wvgwnd.prg index fd917a9539..183d658d7c 100644 --- a/harbour/contrib/gtwvg/wvgwnd.prg +++ b/harbour/contrib/gtwvg/wvgwnd.prg @@ -97,6 +97,8 @@ CLASS WvgWindow INHERIT WvgPartHandler DATA tabStop INIT .F. DATA visible INIT .T. + DATA pointerFocus INIT .T. + /* RUNTIME DATA */ DATA dropZone INIT .F. DATA helpLink