From b7dc6e31e3c5a11bacc2eb5e533614f96f9d75c4 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sun, 24 Jan 2010 21:38:11 +0000 Subject: [PATCH] 2010-01-24 13:32 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbxbp/xbpdataref.prg % Changed the way class is recognized to facilitate sub-classing. Currently only for XbpSLE and XbpMLE. * contrib/hbxbp/xbpwindow.prg ! Method :isDerivedFrom( cClassOrObject ) extended to match the class name of oParent till it matches the given parameter. I am wondering if this functionality be included in class engine itself. Przemek ? --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbxbp/xbpdataref.prg | 9 +++++---- harbour/contrib/hbxbp/xbpwindow.prg | 6 ++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7414ca6bca..fd746a83d4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-24 13:32 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/xbpdataref.prg + % Changed the way class is recognized to facilitate sub-classing. + Currently only for XbpSLE and XbpMLE. + + * contrib/hbxbp/xbpwindow.prg + ! Method :isDerivedFrom( cClassOrObject ) extended to match + the class name of oParent till it matches the given parameter. + I am wondering if this functionality be included in class + engine itself. Przemek ? + 2010-01-24 19:40 UTC+0100 Xavi (jarabal/at/gmail.com) * contrib/hbwin/win_prn1.c + Added support for printing RAW compressed formats JPEG and PNG BitMaps. diff --git a/harbour/contrib/hbxbp/xbpdataref.prg b/harbour/contrib/hbxbp/xbpdataref.prg index c028696166..3b26b49545 100644 --- a/harbour/contrib/hbxbp/xbpdataref.prg +++ b/harbour/contrib/hbxbp/xbpdataref.prg @@ -110,10 +110,11 @@ METHOD XbpDataRef:getData() LOCAL cClass := __ObjGetClsName( self ) DO CASE - CASE cClass $ "XBPMLE" + CASE ::isDerivedFrom( "XBPMLE" ) ::sl_editBuffer := ::oWidget:toPlainText() - CASE cClass $ "XBPSLE" + + CASE ::isDerivedFrom( "XBPSLE" ) ::sl_editBuffer := ::oWidget:text() // CASE cClass $ "XBPCOMBOBOX" @@ -174,11 +175,11 @@ METHOD XbpDataRef:setData( xValue, mp2 ) //Win_TreeView_SelectItem( ::hWnd, ::sl_editBuffer:hItem ) ENDIF - CASE cClass $ "XBPSLE" + CASE ::isDerivedFrom( "XBPSLE" ) IF hb_isChar( ::sl_editBuffer ) ::oWidget:setText( ::sl_editBuffer ) ENDIF - CASE cClass $ "XBPMLE" + CASE ::isDerivedFrom( "XBPMLE" ) IF hb_isChar( ::sl_editBuffer ) ::oWidget:setPlainText( ::sl_editBuffer ) ENDIF diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index ada2a8e57e..c8311e176c 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -1236,6 +1236,12 @@ METHOD XbpWindow:isDerivedFrom( cClassORoObject ) ENDIF ENDIF + IF !( lTrue ) + IF hb_isObject( ::oParent ) + lTrue := ::oParent:isDerivedFrom( cClassORoObject ) + ENDIF + ENDIF + RETURN lTrue /*----------------------------------------------------------------------*/