diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 02f9cbee10..4eeca8a153 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,36 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-20 14:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + - harbour/contrib/hbxbp/apig.ch + - harbour/contrib/hbxbp/xbp_temp.prg + - Delted dummy constants and functions. + + * harbour/contrib/hbxbp/Makefile + * harbour/contrib/hbxbp/xbp.ch + * harbour/contrib/hbxbp/xbp3state.prg + * harbour/contrib/hbxbp/xbpcheckbox.prg + * harbour/contrib/hbxbp/xbpdataref.prg + * harbour/contrib/hbxbp/xbpdialog.prg + * harbour/contrib/hbxbp/xbpgeneric.prg + * harbour/contrib/hbxbp/xbplistbox.prg + * harbour/contrib/hbxbp/xbpmenubar.prg + + harbour/contrib/hbxbp/xbpmle.prg + * harbour/contrib/hbxbp/xbpparthandler.prg + * harbour/contrib/hbxbp/xbppushbutton.prg + * harbour/contrib/hbxbp/xbpradiobutton.prg + * harbour/contrib/hbxbp/xbpscrollbar.prg + * harbour/contrib/hbxbp/xbpsle.prg + * harbour/contrib/hbxbp/xbpstatusbar.prg + * harbour/contrib/hbxbp/xbptabpage.prg + * harbour/contrib/hbxbp/xbptoolbar.prg + * harbour/contrib/hbxbp/xbpwindow.prg + ! Cleaned classes from dummy constants and functions. + + Implemented XhbMLE() class - a work-in-progress but mainly functional. + + * harbour/contrib/hbxbp/tests/demoxbp.prg + ! Demonstrated XbpMLE() implementation - click on tab#2. + 2009-06-20 14:34 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/hbqt.ch * harbour/contrib/hbqt/hbqt_qlineedit.cpp diff --git a/harbour/contrib/hbxbp/Makefile b/harbour/contrib/hbxbp/Makefile index fa3cd2700a..a6f797fd03 100644 --- a/harbour/contrib/hbxbp/Makefile +++ b/harbour/contrib/hbxbp/Makefile @@ -56,6 +56,7 @@ PRG_SOURCES=\ xbpstatusbar.prg \ xbpscrollbar.prg \ xbpsle.prg \ + xbpmle.prg \ PRG_HEADERS=\ xbp.ch \ diff --git a/harbour/contrib/hbxbp/apig.ch b/harbour/contrib/hbxbp/apig.ch deleted file mode 100644 index 25e91be842..0000000000 --- a/harbour/contrib/hbxbp/apig.ch +++ /dev/null @@ -1,144 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * Source file for the Xbp*Classes - * - * Copyright 2009 Pritpal Bedi - * http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/* - * EkOnkar - * ( The LORD is ONE ) - * - * Pritpal Bedi - * 29May2009 - */ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ - -#ifndef _APIG_CH - -#define QT_PTROF( oObj ) ( oObj:pPtr ) - -#define QWS_THICKFRAME 0 -#define QWS_OVERLAPPED 1 -#define QWS_CAPTION 2 -#define QWS_SYSMENU 3 -#define QWS_MINIMIZEBOX 4 -#define QWS_MAXIMIZEBOX 5 -#define QWS_OVERLAPPEDWINDOW 6 -#define QWS_CHILD 7 - -#define QSW_NORMAL 1 -#define QSW_HIDE 2 - -#define QWM_CTLCOLORLISTBOX 1 -#define QWM_CTLCOLORMSGBOX 2 -#define QWM_CTLCOLOREDIT 3 -#define QWM_CTLCOLORBTN 4 -#define QWM_CTLCOLORDLG 5 -#define QWM_CTLCOLORSCROLLBAR 6 -#define QWM_CTLCOLORSTATIC 7 -#define QWM_NOTIFY 8 -#define QWM_ACTIVATE 9 -#define QWM_SYSCOMMAND 10 -#define QWM_SETFONT 11 -#define QWM_ERASEBKGND 12 -#define QWM_COMMAND 13 -#define QWM_HSCROLL 14 -#define QWM_VSCROLL 15 -#define QWM_CAPTURECHANGED 16 -#define QWM_MOUSEMOVE 17 -#define QWM_MOUSEHOVER 18 -#define QWM_MOUSELEAVE 19 -#define QWM_NCMOUSEMOVE 20 -#define QWM_MOUSEWHEEL 21 -#define QWM_MBUTTONDBLCLK 22 -#define QWM_MBUTTONUP 23 -#define QWM_MBUTTONDOWN 24 -#define QWM_LBUTTONDBLCLK 25 -#define QWM_RBUTTONDBLCLK 26 -#define QWM_LBUTTONUP 27 -#define QWM_RBUTTONUP 28 -#define QWM_LBUTTONDOWN 29 -#define QWM_RBUTTONDOWN 30 - - -#define QSC_MAXIMIZE 1 -#define QSC_MINIMIZE 2 -#define QSC_RESTORE 3 - -#define QBS_SOLID 1 - -#define QDEFAULT_GUI_FONT 1 - - -#define QMF_POPUP 1 -#define QMF_BYPOSITION 2 -#define QMF_SEPARATOR 3 -#define QMF_STRING 4 -#define QMF_CHECKED 5 -#define QMF_UNCHECKED 6 -#define QMF_ENABLED 7 -#define QMF_GRAYED 8 - -#define TPM_LEFTALIGN 1 -#define TPM_TOPALIGN 2 -#define TPM_RETURNCMD 9 - -#define QTC_MENU_TYPE 1 -#define QTC_MENU_MENUOBJ 2 -#define QTC_MENU_IDENTIFIER 3 -#define QTC_MENU_ACTION 4 - -/*----------------------------------------------------------------------*/ - -#define _APIG_CH -#endif diff --git a/harbour/contrib/hbxbp/tests/demoxbp.prg b/harbour/contrib/hbxbp/tests/demoxbp.prg index 41eca8e599..8589e86792 100644 --- a/harbour/contrib/hbxbp/tests/demoxbp.prg +++ b/harbour/contrib/hbxbp/tests/demoxbp.prg @@ -113,6 +113,9 @@ FUNCTION BuildADialog() /* Install Single Line Edits */ Build_SLEs( oDlg:drawingArea ) + /* Install Multi-Line Edit */ + Build_MLE( aTabs[ 2 ] ) + /* Install ScrollBar */ Build_ScrollBar( aTabs[ 1 ] ) @@ -491,8 +494,9 @@ FUNCTION Build_SLEs( oWnd ) oXbp:dataLink := {|x| IIf( x==NIL, cVarA, cVarA := x ) } oXbp:create() oXbp:setData() - oXbp:setInputFocus := { |x,y,oSLE| oSLE:getData(), Qt_QDebug( "Var A =" + cVarA ) } - + //oXbp:setInputFocus := { |x,y,oSLE| oSLE:getData(), Qt_QDebug( "Var A =" + cVarA ) } + //oXbp:setInputFocus := { |x,y,oSLE| oSLE:getData() } +hb_outDebug("nnnn") oXbp := XbpSLE():new() oXbp:autoTab := .T. oXbp:bufferLength := 20 @@ -507,3 +511,23 @@ FUNCTION Build_SLEs( oWnd ) RETURN nil /*----------------------------------------------------------------------*/ + +FUNCTION Build_MLE( oWnd ) + LOCAL oMLE + LOCAL cText := 'This is Xbase++ compatible implementation of XbpMLE()' + + // Create MLE, specify position using :create() and + // assign data code block accessing LOCAL variable + oMLE := XbpMLE():new() + oMLE:wordWrap := .F. + oMLE:dataLink := {|x| IIf( x==NIL, cText, cText := x ) } + oMLE:create( oWnd, , {10,10}, {oWnd:currentSize()[1]-25,oWnd:currentSize()[2]-45} ) + + // Copy text from LOCAL variable into edit buffer + // via :dataLink + oMLE:setData() + + RETURN nil + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbxbp/xbp.ch b/harbour/contrib/hbxbp/xbp.ch index 666ca3827a..78e537f0bc 100644 --- a/harbour/contrib/hbxbp/xbp.ch +++ b/harbour/contrib/hbxbp/xbp.ch @@ -10,34 +10,10 @@ #xtranslate HB_OUTDEBUG( [] ) => #endif -#define DA_MODE 1 /* Experimental */ - -#define objTypeNone 0 -#define objTypeCrt 1 -#define objTypeWindow 2 -#define objTypeActiveX 3 -#define objTypeDialog 4 -#define objTypeToolBar 5 -#define objTypeToolBarButton 6 -#define objTypeMenu 7 -#define objTypeStatusBar 8 -#define objTypePushButton 9 -#define objTypeComboBox 10 -#define objTypeListBox 11 -#define objTypeStatic 12 -#define objTypeTreeView 13 -#define objTypeTreeViewItem 14 -#define objTypeCheckBox 15 -#define objTypeRadioButton 16 -#define objType3State 17 -#define objTypeSLE 18 -#define objTypeMLE 19 -#define objTypeDA 20 -#define objTypeScrollBar 21 -#define objTypeTabPage 22 - /*----------------------------------------------------------------------*/ +#define QT_PTROF( oObj ) ( oObj:pPtr ) + #define HBXBP_EVENT_HANDLED 0 #define HBXBP_EVENT_UNHANDLED 1 diff --git a/harbour/contrib/hbxbp/xbp3state.prg b/harbour/contrib/hbxbp/xbp3state.prg index d419cb7eb1..c9662b265a 100644 --- a/harbour/contrib/hbxbp/xbp3state.prg +++ b/harbour/contrib/hbxbp/xbp3state.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -103,9 +102,6 @@ METHOD Xbp3State:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "Xbp3State" - ::objType := objType3State - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbp_temp.prg b/harbour/contrib/hbxbp/xbp_temp.prg deleted file mode 100644 index 907ee15306..0000000000 --- a/harbour/contrib/hbxbp/xbp_temp.prg +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * Source file for the Wvg*Classes - * - * Copyright 2009 Pritpal Bedi - * http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/* - * EkOnkar - * ( The LORD is ONE ) - * - * Pritpal Bedi - * 29May2009 - */ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ - -PROCEDURE QTC_SHOWWINDOW() ; RETURN -PROCEDURE QTC_ISICONIC() ; RETURN -PROCEDURE QTC_ISWINDOW() ; RETURN -PROCEDURE QTC_DESTROYWINDOW() ; RETURN -PROCEDURE QTC_GETWINDOWRECT() ; RETURN -PROCEDURE QTC_GETCLIENTRECT() ; RETURN -PROCEDURE QTC_ENABLEWINDOW() ; RETURN -PROCEDURE QTC_INVALIDATERECT() ; RETURN -PROCEDURE QTC_DELETEOBJECT() ; RETURN -PROCEDURE QTC_CREATEBRUSH() ; RETURN -PROCEDURE QTC_SETWINDOWPOSITION() ; RETURN -PROCEDURE QTC_SETWINDOWPOSANDSIZE() ; RETURN -PROCEDURE QTC_SETWINDOWSIZE() ; RETURN -PROCEDURE QTC_SETWINDOWPOSTOBACK() ; RETURN -PROCEDURE QTC_SETWINDOWPOSTOTOP() ; RETURN -PROCEDURE QTC_SENDMESSAGE() ; RETURN -PROCEDURE QTC_CREATEWINDOWEX() ; RETURN -PROCEDURE QTC_GETSTOCKOBJECT() ; RETURN -PROCEDURE QTC_CALLWINDOWPROC() ; RETURN -PROCEDURE QTC_LOWORD() ; RETURN -PROCEDURE QTC_HIWORD() ; RETURN -PROCEDURE QTG_RELEASEWINDOWPROCBLOCK() ; RETURN -PROCEDURE QTG_SETWINDOWPROCBLOCK() ; RETURN -PROCEDURE QTC_N2P() ; RETURN -PROCEDURE QTC_P2N() ; RETURN -PROCEDURE QTG_SETCURRENTBRUSH() ; RETURN -PROCEDURE QTC_SETTEXTCOLOR() ; RETURN -PROCEDURE QTC_SETBKCOLOR() ; RETURN -PROCEDURE QTC_SETBKMODE() ; RETURN -PROCEDURE QTC_ISZOOMED() ; RETURN -PROCEDURE QTC_FILLRECT() ; RETURN -PROCEDURE QTC_DELETEMENU() ; RETURN -PROCEDURE QTC_TRACKPOPUPMENU() ; RETURN -PROCEDURE HB_TOOUTDEBUG() ; RETURN -PROCEDURE QTC_SENDTOOLBARMESSAGE() ; RETURN - - diff --git a/harbour/contrib/hbxbp/xbpcheckbox.prg b/harbour/contrib/hbxbp/xbpcheckbox.prg index c57f157f0a..2b7b33da1a 100644 --- a/harbour/contrib/hbxbp/xbpcheckbox.prg +++ b/harbour/contrib/hbxbp/xbpcheckbox.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -103,9 +102,6 @@ METHOD XbpCheckBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpCheckBox" - ::objType := objTypeCheckBox - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpdataref.prg b/harbour/contrib/hbxbp/xbpdataref.prg index 561c39e93b..0dbe63b621 100644 --- a/harbour/contrib/hbxbp/xbpdataref.prg +++ b/harbour/contrib/hbxbp/xbpdataref.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -170,7 +169,7 @@ METHOD XbpDataRef:setData( xValue, mp2 ) ::oWidget:setText( ::sl_editBuffer ) ENDIF - CASE ::className == "XBPSCROLLBAR" + CASE cClass == "XBPSCROLLBAR" IF ::sl_editBuffer <> NIL ::oWidget:setValue( ::sl_editBuffer ) ENDIF diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index 8289e98317..1bb7d8499b 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -72,7 +72,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -92,17 +91,15 @@ CLASS XbpDialog FROM XbpWindow METHOD destroy() METHOD showModal() INLINE NIL - METHOD setTitle( cTitle ) INLINE ::title := cTitle, hb_gtInfo( HB_GTI_WINTITLE, cTitle ) - METHOD getTitle() INLINE hb_gtInfo( HB_GTI_WINTITLE ) + METHOD setTitle( cTitle ) INLINE ::title := cTitle, ::oWidget:setWindowTitle( cTitle ) + METHOD getTitle() INLINE ::oWidget:windowTitle() METHOD menuBar() METHOD setFrameState( nState ) METHOD getFrameState() - METHOD calcClientRect() INLINE ::aRect := Qtc_GetClientRect( ::hWnd ), ; - { 0, 0, ::aRect[ 3 ], ::aRect[ 4 ] } - METHOD calcFrameRect() INLINE ::aRect := Qtc_GetWindowRect( ::hWnd ),; - { ::aRect[ 1 ], ::aRect[ 2 ], ; - ::aRect[ 3 ]-::aRect[ 1 ], ::aRect[ 4 ]-::aRect[ 2 ] } + METHOD calcClientRect() INLINE { 0, 0, ::oWidget:width(), ::oWidget:height() } + METHOD calcFrameRect() INLINE { ::oWidget:x(), ::oWidget:y(), ; + ::oWidget:x()+::oWidget:width(), ::oWidget:y()+::oWidget:height() } ENDCLASS /*----------------------------------------------------------------------*/ @@ -111,10 +108,8 @@ METHOD XbpDialog:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpDialog" ::resizeMode := 0 ::mouseMode := 0 - ::objType := objTypeDialog RETURN Self @@ -191,6 +186,8 @@ METHOD XbpDialog:destroy() METHOD XbpDialog:setFrameState( nState ) LOCAL lSuccess := .f. + HB_SYMBOL_UNUSED( nState ) + #if 0 DO CASE CASE nState == XBPDLG_FRAMESTAT_MINIMIZED @@ -203,6 +200,7 @@ METHOD XbpDialog:setFrameState( nState ) RETURN ( ::sendMessage( QWM_SYSCOMMAND, QSC_RESTORE, 0 ) <> 0 ) ENDCASE + #endif RETURN lSuccess @@ -210,12 +208,14 @@ METHOD XbpDialog:setFrameState( nState ) METHOD XbpDialog:getFrameState() + #if 0 IF Qtc_IsIconic( ::hWnd ) RETURN XBPDLG_FRAMESTAT_MINIMIZED ENDIF IF Qtc_IsZoomed( ::hWnd ) RETURN XBPDLG_FRAMESTAT_MAXIMIZED ENDIF + #endif RETURN XBPDLG_FRAMESTAT_NORMALIZED @@ -255,10 +255,6 @@ CLASS XbpDrawingArea INHERIT XbpWindow METHOD XbpDrawingArea:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - - ::exStyle := 0 - ::className := "XbpDrawingArea" - ::objType := objTypeDA ::visible := .t. RETURN Self diff --git a/harbour/contrib/hbxbp/xbpgeneric.prg b/harbour/contrib/hbxbp/xbpgeneric.prg index a73a4d522b..a6f3077ecf 100644 --- a/harbour/contrib/hbxbp/xbpgeneric.prg +++ b/harbour/contrib/hbxbp/xbpgeneric.prg @@ -68,7 +68,6 @@ #include "common.ch" #include "xbp.ch" -#include "apig.ch" /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index 1dd41055e6..d67376da75 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -153,9 +152,6 @@ METHOD XbpListBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XBPLISTBOX" - ::objType := objTypeListBox - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index b48c264a96..109b3fd176 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -72,19 +72,27 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ -#define QTC_MENITEM_CAPTION 1 -#define QTC_MENITEM_BLOCK 2 -#define QTC_MENITEM_STYLE 3 -#define QTC_MENITEM_ATTRIB 4 +#define QTC_MENITEM_CAPTION 1 +#define QTC_MENITEM_BLOCK 2 +#define QTC_MENITEM_STYLE 3 +#define QTC_MENITEM_ATTRIB 4 -#define QTC_MENUITEM_ADD 1 -#define QTC_MENUITEM_INSERT 2 -#define QTC_MENUITEM_REPLACE 3 +#define QTC_MENUITEM_ADD 1 +#define QTC_MENUITEM_INSERT 2 +#define QTC_MENUITEM_REPLACE 3 + +#define QMF_POPUP 1 +#define QMF_BYPOSITION 2 +#define QMF_SEPARATOR 3 +#define QMF_STRING 4 +#define QMF_CHECKED 5 +#define QMF_UNCHECKED 6 +#define QMF_ENABLED 7 +#define QMF_GRAYED 8 /*----------------------------------------------------------------------*/ @@ -238,6 +246,9 @@ METHOD xbpMenuBar:delAllItems() METHOD xbpMenuBar:delItem( nItemIndex ) LOCAL lResult:= .F. + HB_SYMBOL_UNUSED( nItemIndex ) + + #if 0 IF nItemIndex > 0 .AND. nItemIndex <= ::numItems() IF ::aMenuItems[ nItemIndex,QTC_MENU_TYPE ] == QMF_POPUP ::aMenuItems[ nItemIndex,QTC_MENU_MENUOBJ ]:Destroy() @@ -249,7 +260,7 @@ METHOD xbpMenuBar:delItem( nItemIndex ) ELSE ENDIF ENDIF - + #endif RETURN lResult /*----------------------------------------------------------------------*/ @@ -638,8 +649,6 @@ METHOD xbpMenu:new( oParent, aPresParams, lVisible ) ::aPresParams := aPresParams ::visible := lVisible - ::className := "XbpMenu" - RETURN Self /*----------------------------------------------------------------------*/ @@ -675,18 +684,12 @@ METHOD xbpMenu:setTitle( cTitle ) /*----------------------------------------------------------------------*/ METHOD xbpMenu:popUp( oXbp, aPos, nDefaultItem, nControl ) - LOCAL nCmd, aMenuItem + HB_SYMBOL_UNUSED( oXbp ) + HB_SYMBOL_UNUSED( aPos ) HB_SYMBOL_UNUSED( nDefaultItem ) HB_SYMBOL_UNUSED( nControl ) - nCmd := Qtc_TrackPopupMenu( ::hMenu, TPM_LEFTALIGN + TPM_TOPALIGN + TPM_RETURNCMD, aPos[ 1 ], aPos[ 2 ], oXbp:hWnd ) - - aMenuItem := ::findMenuItemById( nCmd ) - IF hb_isArray( aMenuItem ) .and. hb_isBlock( aMenuItem[ 2 ] ) - Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] ) - ENDIF - RETURN 0 /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmle.prg b/harbour/contrib/hbxbp/xbpmle.prg new file mode 100644 index 0000000000..e2b420011c --- /dev/null +++ b/harbour/contrib/hbxbp/xbpmle.prg @@ -0,0 +1,265 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Source file for the Xbp*Classes + * + * Copyright 2009 Pritpal Bedi + * http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* + * EkOnkar + * ( The LORD is ONE ) + * + * Xbase++ xbpMLE compatible Class + * + * Pritpal Bedi + * 19Jun2009 + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ + +#include "hbclass.ch" +#include "common.ch" + +#include "xbp.ch" +#include "appevent.ch" +#include "hbqt.ch" + +/*----------------------------------------------------------------------*/ + +CLASS XbpMLE INHERIT XbpWindow, XbpDataRef + + DATA border INIT .T. + DATA editable INIT .T. + DATA horizScroll INIT .T. + DATA vertScroll INIT .T. + DATA wordWrap INIT .T. + DATA ignoreTab INIT .F. + + DATA changed INIT .F. + + METHOD new() + METHOD create() + METHOD configure() VIRTUAL + METHOD destroy() + METHOD exeBlock() + METHOD handleEvent() + + METHOD clear() VIRTUAL + METHOD copyMarked() VIRTUAL + METHOD cutMarked() VIRTUAL + METHOD deleteMarked() VIRTUAL + METHOD delete() VIRTUAL + METHOD pasteMarked() VIRTUAL + METHOD queryFirstChar() VIRTUAL + METHOD queryMarked() VIRTUAL + METHOD setFirstChar() VIRTUAL + METHOD setMarked() VIRTUAL + METHOD insert() VIRTUAL + METHOD charFromLine() VIRTUAL + METHOD lineFromChar() VIRTUAL + METHOD pos() VIRTUAL + + DATA sl_undo INIT .T. + ACCESS undo INLINE IF( ::sl_undo, NIL, NIL ) + ASSIGN undo() INLINE ::sl_undo := .t. + + METHOD setEditable( lYes ) INLINE ::xDummy := ::oWidget:readOnly(), ; + ::oWidget:setReadOnly( !lYes ), ::xDummy + METHOD setWrap( lWrap ) INLINE ::xDummy := ::oWidget:lineWrapMode(),; + ::oWidget:setLineWrapMode( IF( lWrap,1,0 ) ),; + ::xDummy == 1 + + DATA sl_hScroll + ACCESS hScroll INLINE ::sl_hScroll + ASSIGN hScroll( bBlock ) INLINE ::sl_hScroll := bBlock + + DATA sl_vScroll + ACCESS vScroll INLINE ::sl_vScroll + ASSIGN vScroll( bBlock ) INLINE ::sl_vScroll := bBlock + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD XbpMLE:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpMLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + ::oWidget := QTextEdit():new( ::pParent ) + + IF !( ::editable ) + ::oWidget:setReadOnly( .t. ) + ELSE + ::oWidget:setReadOnly( .f. ) + ENDIF + + IF !( ::wordWrap ) + ::oWidget:setLineWrapMode( 0 ) + ELSE + ::oWidget:setLineWrapMode( 1 ) + ENDIF + + #if 0 + IF ::tabStop + ::style += WS_TABSTOP + ENDIF + IF ::border + ::style += WS_BORDER + ENDIF + IF !( ::wordWrap ) + IF ::horizScroll + ::style += WS_HSCROLL + ELSE + ::style += ES_AUTOHSCROLL + ENDIF + ENDIF + IF ::vertScroll + ::style += WS_VSCROLL + ELSE + ::style += ES_AUTOVSCROLL + ENDIF + #endif + + ::setPosAndSize() + IF ::visible + ::show() + ENDIF + + IF hb_isBlock( ::datalink ) + eval( ::datalink ) + ENDIF + + ::oParent:addChild( Self ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpMLE:exeBlock() + + RETURN .t. + +/*----------------------------------------------------------------------*/ + +METHOD XbpMLE:handleEvent( nEvent, mp1, mp2 ) + + HB_SYMBOL_UNUSED( nEvent ) + HB_SYMBOL_UNUSED( mp1 ) + HB_SYMBOL_UNUSED( mp2 ) + + RETURN HBXBP_EVENT_UNHANDLED + +/*----------------------------------------------------------------------*/ + + + #if 0 + DO CASE + CASE nMessage == HB_GTE_COMMAND + DO CASE + CASE aNM[ NMH_code ] == EN_CHANGE + ::changed := .t. + + CASE aNM[ NMH_code ] == EN_UPDATE + + CASE aNM[ NMH_code ] == EN_MAXTEXT + + CASE aNM[ NMH_code ] == EN_KILLFOCUS + IF hb_isBlock( ::sl_killInputFocus ) + eval( ::sl_killInputFocus, NIL, NIL, Self ) + ENDIF + + CASE aNM[ NMH_code ] == EN_SETFOCUS + IF hb_isBlock( ::sl_setInputFocus ) + eval( ::sl_setInputFocus, NIL, NIL, Self ) + ENDIF + + CASE aNM[ NMH_code ] == EN_HSCROLL + IF hb_isBlock( ::sl_hScroll ) + eval( ::sl_hScroll, NIL, NIL, Self ) + ENDIF + + CASE aNM[ NMH_code ] == EN_VSCROLL + IF hb_isBlock( ::sl_vScroll ) + eval( ::sl_vScroll, NIL, NIL, Self ) + ENDIF + + ENDCASE + + CASE nMessage == HB_GTE_CTLCOLOR + IF hb_isNumeric( ::clr_FG ) + WVG_SetTextColor( aNM[ 1 ], ::clr_FG ) + ENDIF + IF hb_isNumeric( ::hBrushBG ) + WVG_SetBkMode( aNM[ 1 ], 1 ) + RETURN ( ::hBrushBG ) + ELSE + RETURN WVG_GetCurrentBrush( aNM[ 1 ] ) + ENDIF + + ENDCASE + #endif + +/*----------------------------------------------------------------------*/ + +METHOD XbpMLE:destroy() + + ::xbpWindow:destroy() + + RETURN NIL + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpparthandler.prg b/harbour/contrib/hbxbp/xbpparthandler.prg index fd73536ff7..8f26ac1397 100644 --- a/harbour/contrib/hbxbp/xbpparthandler.prg +++ b/harbour/contrib/hbxbp/xbpparthandler.prg @@ -71,19 +71,6 @@ #include "hbgtinfo.ch" #include "xbp.ch" -#include "apig.ch" - -/* TOFIX: Replace these with QT solutions */ -#define HB_GTE_MOUSE 6 -#define HB_GTE_KEYBOARD 7 -#define HB_GTE_MENU 9 -#define HB_GTE_NOTIFY 10 -#define HB_GTE_COMMAND 11 -#define HB_GTE_CTLCOLOR 12 -#define HB_GTE_PAINT 13 -#define HB_GTE_GUIPARTS 14 -#define HB_GTE_HSCROLL 15 -#define HB_GTE_VSCROLL 16 /*----------------------------------------------------------------------*/ @@ -253,203 +240,8 @@ METHOD setParent( oXbp ) CLASS XbpPartHandler /*----------------------------------------------------------------------*/ -METHOD notifier( nEvent, xParams ) CLASS XbpPartHandler - Local aPos, aMenuItem, nIndex, nCtrlID, oObj - LOCAL nReturn := 0 +METHOD notifier() CLASS XbpPartHandler - DO CASE - - CASE nEvent == HB_GTE_MOUSE - IF xParams[ 1 ] == QWM_MOUSEHOVER - aPos := { xParams[ 3 ], xParams[ 4 ] } - elseif xParams[ 1 ] == QWM_MOUSELEAVE - /* Nothing */ - else - aPos := if( ::mouseMode == 2, { xParams[ 3 ], xParams[ 4 ] }, { xParams[ 5 ], xParams[ 6 ] } ) - ENDIF - - SWITCH xParams[ 1 ] - - CASE QWM_MOUSEHOVER - IF hb_isBlock( ::sl_enter ) - eval( ::sl_enter, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MOUSELEAVE - IF hb_isBlock( ::sl_leave ) - eval( ::sl_leave, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_RBUTTONDOWN - IF hb_isBlock( ::sl_rbDown ) - eval( ::sl_rbDown, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_LBUTTONDOWN - IF hb_isBlock( ::sl_lbDown ) - eval( ::sl_lbDown, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_RBUTTONUP - IF hb_isBlock( ::sl_rbUp ) - eval( ::sl_rbUp, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_LBUTTONUP - IF hb_isBlock( ::sl_lbUp ) - eval( ::sl_lbUp, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_RBUTTONDBLCLK - IF hb_isBlock( ::sl_rbDblClick ) - eval( ::sl_rbDblClick, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_LBUTTONDBLCLK - IF hb_isBlock( ::sl_lbDblClick ) - eval( ::sl_lbDblClick, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MBUTTONDOWN - IF hb_isBlock( ::sl_mbDown ) - eval( ::sl_mbDown, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MBUTTONUP - IF hb_isBlock( ::sl_mbClick ) - eval( ::sl_mbClick, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MBUTTONDBLCLK - IF hb_isBlock( ::sl_mbDblClick ) - eval( ::sl_mbDblClick, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MOUSEMOVE - IF hb_isBlock( ::sl_motion ) - eval( ::sl_motion, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_MOUSEWHEEL - IF hb_isBlock( ::sl_wheel ) - eval( ::sl_wheel, aPos, NIL, self ) - ENDIF - EXIT - CASE QWM_NCMOUSEMOVE - EXIT - END - - CASE nEvent == HB_GTE_KEYBOARD - IF hb_isBlock( ::keyboard ) - eval( ::keyboard, xParams, NIL, Self ) - ENDIF - - CASE nEvent == HB_GTE_SETFOCUS - /* aeval( ::aChildren, {|o| Win_InvalidateRect( o:hWnd ) } ) */ - - IF hb_isBlock( ::sl_setInputFocus ) - eval( ::sl_setInputFocus, NIL, NIL, Self ) - ENDIF - ::lHasInputFocus := .t. - - CASE nEvent == HB_GTE_KILLFOCUS - IF hb_isBlock( ::sl_killInputFocus ) - eval( ::sl_killInputFocus, NIL, NIL, Self ) - ENDIF - ::lHasInputFocus := .f. - - CASE nEvent == HB_GTE_PAINT - /* aeval( ::aChildren, {|o| Win_InvalidateRect( o:hWnd ) } ) */ - - CASE nEvent == HB_GTE_GUIPARTS - /* Eventally every window be checked if it falls within returned rectangle or not - * then it will avoid a lot of flickering - */ - aeval( ::aChildren, {|o| Qtc_InvalidateRect( o:hWnd ) } ) - - CASE nEvent == HB_GTE_CLOSE - IF hb_isBlock( ::close ) - nReturn := eval( ::close, NIL, NIL, Self ) - ENDIF - - CASE nEvent == HB_GTE_MENU - DO CASE - CASE xParams[ 1 ] == 0 /* menu selected */ - IF hb_isObject( ::oMenu ) - IF !empty( aMenuItem := ::oMenu:FindMenuItemById( xParams[ 2 ] ) ) - IF hb_isBlock( aMenuItem[ 2 ] ) - Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] ) - - ELSEIF hb_isBlock( aMenuItem[ 3 ] ) - Eval( aMenuItem[ 3 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] ) - - ENDIF - ENDIF - ENDIF - - CASE xParams[ 1 ] == 1 .and. hb_isObject( ::oMenu ) /* enter menu loop */ - IF hb_isBlock( ::oMenu:sl_beginMenu ) - Eval( ::oMenu:sl_beginMenu, NIL, NIL, Self ) - ENDIF - - CASE xParams[ 1 ] == 2 .and. hb_isObject( ::oMenu ) /* exit menu loop */ - IF hb_isBlock( ::oMenu:sl_endMenu ) - Eval( ::oMenu:sl_endMenu, NIL, NIL, Self ) - ENDIF - - ENDCASE - - CASE nEvent == HB_GTE_RESIZED - IF ::objType == objTypeDialog - IF ::drawingArea:objType == objTypeDA - ::drawingArea:setPosAndSize( {0,0}, ::currentSize(), .f. ) - ENDIF - ENDIF - IF hb_isBlock( ::sl_resize ) - eval( ::sl_resize, { xParams[ 1 ], xParams[ 2 ] }, { xParams[ 3 ], xParams[ 4 ] }, Self ) - ENDIF - aeval( ::aChildren, {|o| o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } ) - - CASE nEvent == HB_GTE_NOTIFY - nCtrlID := xParams[ 1 ] - IF ( nIndex := ascan( ::aChildren, {|o| o:nID == nCtrlID } ) ) > 0 - RETURN ( ::aChildren[ nIndex ]:handleEvent( HB_GTE_NOTIFY, xParams ) ) - ENDIF - - CASE nEvent == HB_GTE_COMMAND - nCtrlID := xParams[ 2 ] - IF ( nIndex := ascan( ::aChildren, {|o| o:nID == nCtrlID } ) ) > 0 - RETURN ::aChildren[ nIndex ]:handleEvent( HB_GTE_COMMAND, xParams ) - ENDIF - - CASE nEvent == HB_GTE_CTLCOLOR - oObj := ::findObjectByHandle( xParams[ 2 ] ) - IF hb_isObject( oObj ) - RETURN oObj:handleEvent( HB_GTE_CTLCOLOR, xParams ) - ENDIF - - CASE nEvent == HB_GTE_HSCROLL - IF xParams[ 3 ] == ::hWnd - RETURN ::handleEvent( HB_GTE_VSCROLL, xParams ) - ELSE - oObj := ::findObjectByHandle( xParams[ 3 ] ) - IF hb_isObject( oObj ) - RETURN oObj:handleEvent( HB_GTE_VSCROLL, xParams ) - ENDIF - ENDIF - - CASE nEvent == HB_GTE_VSCROLL - IF xParams[ 3 ] == ::hWnd - RETURN ::handleEvent( HB_GTE_VSCROLL, xParams ) - ELSE - oObj := ::findObjectByHandle( xParams[ 3 ] ) - IF hb_isObject( oObj ) - RETURN oObj:handleEvent( HB_GTE_VSCROLL, xParams ) - ENDIF - ENDIF - - ENDCASE - - RETURN nReturn + RETURN self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index 31df76ee63..fc06867300 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -72,7 +72,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -111,9 +110,6 @@ METHOD XbpPushButton:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XBPPUSHBUTTON" - ::objType := objTypePushButton - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpradiobutton.prg b/harbour/contrib/hbxbp/xbpradiobutton.prg index 93bfd4c3c6..9d517c7ddd 100644 --- a/harbour/contrib/hbxbp/xbpradiobutton.prg +++ b/harbour/contrib/hbxbp/xbpradiobutton.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -102,9 +101,6 @@ METHOD XbpRadioButton:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpRadioButton" - ::objType := objTypeRadioButton - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpscrollbar.prg b/harbour/contrib/hbxbp/xbpscrollbar.prg index 4983aad165..3f840be0cc 100644 --- a/harbour/contrib/hbxbp/xbpscrollbar.prg +++ b/harbour/contrib/hbxbp/xbpscrollbar.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -106,9 +105,6 @@ METHOD XbpScrollBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XBPSCROLLBAR" - ::objType := objTypeScrollBar - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpsle.prg b/harbour/contrib/hbxbp/xbpsle.prg index 93e10869ae..bd9671dbe4 100644 --- a/harbour/contrib/hbxbp/xbpsle.prg +++ b/harbour/contrib/hbxbp/xbpsle.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -124,9 +123,6 @@ METHOD XbpSLE:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XBPSLE" - ::objType := objTypeSLE - RETURN Self /*----------------------------------------------------------------------*/ @@ -156,10 +152,10 @@ METHOD XbpSLE:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::connectEvent( ::pWidget, QEvent_FocusOut, {|o,e| ::exeBlock( 8, e, o ) } ) ::connect( ::pWidget, "cursorPositionChanged(int,int)" , {|o,i,ii| ::exeBlock( 1, i, ii, o ) } ) - //::connect( ::pWidget, "editingFinished()" , {| | ::exeBlock( 2 ) } ) - //::connect( ::pWidget, "returnPressed()" , {| | ::exeBlock( 3 ) } ) - //::connect( ::pWidget, "selectionChanged()" , {| | ::exeBlock( 4 ) } ) - ::connect( ::pWidget, "textChanged(QString)" , {|o,s | ::exeBlock( 5, s, o ) } ) + // ::connect( ::pWidget, "editingFinished()" , {| | ::exeBlock( 2 ) } ) + // ::connect( ::pWidget, "returnPressed()" , {| | ::exeBlock( 3 ) } ) + // ::connect( ::pWidget, "selectionChanged()" , {| | ::exeBlock( 4 ) } ) + // ::connect( ::pWidget, "textChanged(QString)" , {|o,s | ::exeBlock( 5, s, o ) } ) ::connect( ::pWidget, "textEdited(QString)" , {|o,s | ::exeBlock( 6, s, o ) } ) ::setPosAndSize() @@ -231,7 +227,9 @@ METHOD XbpSLE:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ METHOD XbpSLE:destroy() + ::xbpWindow:destroy() + RETURN NIL /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpstatusbar.prg b/harbour/contrib/hbxbp/xbpstatusbar.prg index 94812d8936..71b9ab7e09 100644 --- a/harbour/contrib/hbxbp/xbpstatusbar.prg +++ b/harbour/contrib/hbxbp/xbpstatusbar.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -106,9 +105,6 @@ METHOD XbpStatusBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpStatusBar" - ::objType := objTypeStatusBar - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptabpage.prg b/harbour/contrib/hbxbp/xbptabpage.prg index 00a4b44ee4..740afc6c72 100644 --- a/harbour/contrib/hbxbp/xbptabpage.prg +++ b/harbour/contrib/hbxbp/xbptabpage.prg @@ -70,7 +70,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -109,9 +108,6 @@ METHOD XbpTabPage:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpTabPage" - ::objType := objTypeTabPage - RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index 17e2fac9f8..7f3712f78e 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -72,7 +72,6 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" /*----------------------------------------------------------------------*/ @@ -133,9 +132,6 @@ METHOD XbpToolbar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := "XbpToolBar" - ::objType := objTypeToolBar - RETURN Self /*----------------------------------------------------------------------*/ @@ -153,10 +149,7 @@ METHOD XbpToolbar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) RETURN Self ENDIF - /* Create Toolbar Widget */ ::oWidget := QToolBar():new( QT_PTROF( oPar:oWidget ) ) - - /* Add this toolbar with parent */ oPar:oWidget:addToolBar_1( ::pWidget ) #if 0 @@ -226,9 +219,9 @@ METHOD XbpToolbar:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible /*----------------------------------------------------------------------*/ -METHOD XbpToolbar:sendToolbarMessage( nMsg, p1, p2 ) +METHOD XbpToolbar:sendToolbarMessage() - RETURN QTC_SendToolbarMessage( ::pWnd, nMsg, p1, p2 ) + RETURN self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index 46c53fad0c..de2252f8ee 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -71,25 +71,8 @@ #include "xbp.ch" #include "appevent.ch" -#include "apig.ch" #include "hbqt.ch" -/* TOFIX: Replace these with QT solutions */ -#define HB_GTE_NOTIFY 10 -#define HB_GTE_COMMAND 11 -#define HB_GTE_CTLCOLOR 12 -#define HB_GTE_HSCROLL 15 -#define HB_GTE_VSCROLL 16 - -/*----------------------------------------------------------------------*/ - * To Switch Over from ASCALLBACK() to SET/GET_Prop() calls - * -#if 0 - #define __BYASCALLBACK__ -#else - #define __BYSETPROP__ -#endif - /*----------------------------------------------------------------------*/ CLASS XbpWindow INHERIT XbpPartHandler @@ -238,13 +221,7 @@ EXPORTED: DATA closable INIT .T. DATA resizable INIT .t. DATA resizeMode INIT 0 - DATA style INIT QWS_OVERLAPPEDWINDOW - DATA exStyle INIT 0 DATA lModal INIT .f. - DATA pGTp - DATA pGT - DATA objType INIT objTypeNone - DATA className INIT "" METHOD setFocus() METHOD sendMessage() @@ -262,9 +239,6 @@ EXPORTED: DATA mouseMode INIT 1 DATA nID INIT 0 - DATA nControlID INIT 5000 - METHOD createControl() - METHOD getControlID() INLINE ++::nControlID METHOD Initialize() @@ -273,14 +247,9 @@ EXPORTED: DATA oMenu METHOD HandleEvent() INLINE ( HBXBP_EVENT_UNHANDLED ) - METHOD ControlWndProc() - METHOD findObjectByHandle( hWnd ) - + METHOD grabEvent() METHOD isDerivedFrom() - METHOD setWindowProcCallback() - - METHOD grabEvent() DATA oWidget ACCESS pWidget INLINE IF( empty( ::oWidget ), NIL, QT_PTROF( ::oWidget ) ) @@ -426,12 +395,6 @@ METHOD XbpWindow:grabEvent( pEvent ) /*----------------------------------------------------------------------*/ -METHOD XbpWindow:SetWindowProcCallback() - - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD XbpWindow:captureMouse() RETURN Self @@ -440,10 +403,8 @@ METHOD XbpWindow:captureMouse() METHOD XbpWindow:disable() - IF Qtc_EnableWindow( ::hWnd, .f. ) - ::is_enabled := .f. - RETURN .t. - ENDIF + ::oWidget:setDisabled( .t. ) + ::is_enabled := ::oWidget:isEnabled() RETURN .f. @@ -451,10 +412,8 @@ METHOD XbpWindow:disable() METHOD XbpWindow:enable() - IF Qtc_EnableWindow( ::hWnd, .t. ) - ::is_enabled := .t. - RETURN .t. - ENDIF + ::oWidget:setEnabled( .t. ) + ::is_enabled := ::oWidget:isEnabled() RETURN .f. @@ -473,7 +432,9 @@ METHOD XbpWindow:hide() METHOD XbpWindow:invalidateRect( aRect ) - RETURN Qtc_InvalidateRect( ::hWnd, aRect ) + HB_SYMBOL_UNUSED( aRect ) + + RETURN self /*----------------------------------------------------------------------*/ @@ -629,14 +590,13 @@ METHOD XbpWindow:show() METHOD XbpWindow:toBack() - RETURN Qtc_SetWindowPosToBack( ::hWnd ) + RETURN self /*----------------------------------------------------------------------*/ METHOD XbpWindow:toFront() - /*RETURN Win_SetForegroundWindow( ::hWnd ) */ - RETURN Qtc_SetWindowPosToTop( ::hWnd ) + RETURN self /*----------------------------------------------------------------------*/ @@ -995,17 +955,12 @@ METHOD XbpWindow:wheel( xParam ) /*----------------------------------------------------------------------*/ METHOD XbpWindow:close( xParam ) - if ::objType == objTypeCrt - if hb_isNil( xParam ) .and. hb_isBlock( ::sl_close ) - eval( ::sl_close, NIL, NIL, Self ) - RETURN Self - endif - if hb_isBlock( xParam ) .or. hb_isNil( xParam ) - ::sl_close := xParam - RETURN NIL - endif + if hb_isBlock( xParam ) .or. hb_isNil( xParam ) + ::sl_close := xParam + RETURN NIL endif + RETURN Self /*----------------------------------------------------------------------*/ @@ -1042,18 +997,8 @@ METHOD XbpWindow:keyboard( xParam ) /*----------------------------------------------------------------------*/ -METHOD XbpWindow:killDisplayFocus( xParam ) - if ::objType == objTypeCrt - if hb_isNil( xParam ) .and. hb_isBlock( ::sl_killDisplayFocus ) - eval( ::sl_killDisplayFocus, NIL, NIL, Self ) - RETURN Self - endif +METHOD XbpWindow:killDisplayFocus() - if hb_isBlock( xParam ) .or. hb_isNil( xParam ) - ::sl_killDisplayFocus := xParam - RETURN NIL - endif - endif RETURN Self /*----------------------------------------------------------------------*/ @@ -1138,19 +1083,8 @@ METHOD XbpWindow:resize( xParam, xParam1 ) /*----------------------------------------------------------------------*/ -METHOD XbpWindow:setDisplayFocus( xParam ) +METHOD XbpWindow:setDisplayFocus() - if ::objType == objTypeCrt - if hb_isNil( xParam ) .and. hb_isBlock( ::setDisplayFocus ) - eval( ::setDisplayFocus, NIL, NIL, Self ) - RETURN Self - endif - - if hb_isBlock( xParam ) .or. hb_isNil( xParam ) - ::setDisplayFocus := xParam - RETURN NIL - endif - endif RETURN Self /*----------------------------------------------------------------------*/ @@ -1257,173 +1191,18 @@ METHOD XbpWindow:Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible METHOD XbpWindow:setFocus() - ::sendMessage( QWM_ACTIVATE, 1, 0 ) + ::oWidget:setFocus() RETURN Self /*----------------------------------------------------------------------*/ -METHOD XbpWindow:sendMessage( nMessage, nlParam, nwParam ) +METHOD XbpWindow:sendMessage()// nMessage, nlParam, nwParam ) - RETURN Qtc_SendMessage( ::hWnd, nMessage, nlParam, nwParam ) + RETURN self /*----------------------------------------------------------------------*/ - -METHOD XbpWindow:findObjectByHandle( hWnd ) - LOCAL nObj - - IF len( ::aChildren ) > 0 - IF ( nObj := ascan( ::aChildren, {|o| o:hWnd == hWnd } ) ) > 0 - RETURN ::aChildren[ nObj ] - ENDIF - ENDIF - - RETURN NIL - /*----------------------------------------------------------------------*/ - -METHOD XbpWindow:createControl() - LOCAL hWnd - - ::nID := ::oParent:GetControlId() - - hWnd := Qtc_CreateWindowEx( ::exStyle, ; - ::className, ; - "", ; /* window name */ - ::style, ; - ::aPos[ 1 ], ::aPos[ 2 ],; - ::aSize[ 1 ], ::aSize[ 2 ],; - ::oParent:hWnd,; - ::nID,; /* hMenu */ - NIL,; /* hInstance */ - NIL ) /* lParam */ - - - IF ( hWnd <> 0 ) - ::hWnd := hWnd - ::pWnd := QTC_n2p( hWnd ) - ::sendMessage( QWM_SETFONT, Qtc_GetStockObject( QDEFAULT_GUI_FONT ), 1 ) - ENDIF - - RETURN Self -/*----------------------------------------------------------------------*/ - -METHOD XbpWindow:ControlWndProc( hWnd, nMessage, nwParam, nlParam ) - LOCAL nCtrlID, nNotifctn, hWndCtrl, nObj, aMenuItem, oObj, nReturn - - #if 1 - hb_ToOutDebug( "%s:wndProc( %i %i %i %i )", __ObjGetClsName( self ), hWnd, nMessage, nwParam, nlParam ) - #endif - - SWITCH nMessage - - CASE QWM_ERASEBKGND - IF ::objType == objTypeDA .and. !empty( ::hBrushBG ) - ::handleEvent( HB_GTE_CTLCOLOR, { nwParam, nlParam } ) - ENDIF - EXIT - - CASE QWM_COMMAND - nCtrlID := Qtc_LOWORD( nwParam ) - nNotifctn := Qtc_HIWORD( nwParam ) - hWndCtrl := nlParam - - IF hWndCtrl == 0 /* It is menu */ - IF hb_isObject( ::oMenu ) - IF !empty( aMenuItem := ::oMenu:FindMenuItemById( nCtrlID ) ) - IF hb_isBlock( aMenuItem[ 2 ] ) - Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] ) - - ELSEIF hb_isBlock( aMenuItem[ 3 ] ) - Eval( aMenuItem[ 3 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] ) - - ENDIF - ENDIF - ENDIF - RETURN 0 - ELSE - IF ( nObj := ascan( ::aChildren, {|o| o:nID == nCtrlID } ) ) > 0 - nReturn := ::aChildren[ nObj ]:handleEvent( HB_GTE_COMMAND, { nNotifctn, nCtrlID, hWndCtrl } ) - IF hb_isNumeric( nReturn ) .and. nReturn == 0 - RETURN 0 - ENDIF - ENDIF - ENDIF - EXIT - - CASE QWM_NOTIFY - IF ( nObj := ascan( ::aChildren, {| o | o:nID == nwParam } ) ) > 0 - nReturn := ::aChildren[ nObj ]:handleEvent( HB_GTE_NOTIFY, { nwParam, nlParam } ) - IF hb_isNumeric( nReturn ) .and. nReturn == HBXBP_EVENT_HANDLED - RETURN HBXBP_EVENT_HANDLED - ENDIF - ENDIF - EXIT - - CASE QWM_CTLCOLORLISTBOX - CASE QWM_CTLCOLORMSGBOX - CASE QWM_CTLCOLOREDIT - CASE QWM_CTLCOLORBTN - CASE QWM_CTLCOLORDLG - CASE QWM_CTLCOLORSCROLLBAR - CASE QWM_CTLCOLORSTATIC - - oObj := ::findObjectByHandle( nlParam ) - IF hb_isObject( oObj ) - nReturn := oObj:handleEvent( HB_GTE_CTLCOLOR, { nwParam, nlParam } ) - - IF nReturn == 1 - RETURN Qtc_CallWindowProc( ::nOldProc, hWnd, nMessage, nwParam, nlParam ) - ELSE - RETURN nReturn - ENDIF - ENDIF - EXIT - - CASE QWM_HSCROLL - ::handleEvent( HB_GTE_HSCROLL, { Qtc_LoWord( nwParam ), Qtc_HiWord( nwParam ), nlParam } ) - RETURN 0 - - CASE QWM_VSCROLL - nReturn := ::handleEvent( HB_GTE_VSCROLL, { Qtc_LoWord( nwParam ), Qtc_HiWord( nwParam ), nlParam } ) - IF nReturn == HBXBP_EVENT_HANDLED - RETURN 0 - ENDIF - EXIT - - CASE QWM_CAPTURECHANGED - EXIT -#if 0 - CASE QWM_MOUSEMOVE - IF ::objType == objTypeScrollBar - IF !( ::lTracking ) - ::lTracking := Wvg_BeginMouseTracking( ::hWnd ) - ENDIF - ENDIF - EXIT - - CASE QWM_MOUSEHOVER - IF ::objType == objTypeScrollBar - IF ::oParent:objType == objTypeCrt - WAPI_SetFocus( ::oParent:hWnd ) - ENDIF - RETURN 0 - ENDIF - EXIT - - CASE QWM_MOUSELEAVE - IF ::objType == objTypeScrollBar - ::lTracking := .f. - IF ::oParent:objType == objTypeCrt - WAPI_SetFocus( ::oParent:hWnd ) - ENDIF - ENDIF - EXIT -#endif - END - - RETURN Qtc_CallWindowProc( ::nOldProc, hWnd, nMessage, nwParam, nlParam ) - /*----------------------------------------------------------------------*/ CLASS XbpObject