2009-06-28 19:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* harbour/contrib/hbxbp/xbp.ch
  * harbour/contrib/hbxbp/xbp3state.prg
  * harbour/contrib/hbxbp/xbpcheckbox.prg
  * harbour/contrib/hbxbp/xbpcombobox.prg
  * harbour/contrib/hbxbp/xbpdialog.prg
  * harbour/contrib/hbxbp/xbpmenubar.prg
  * harbour/contrib/hbxbp/xbpmle.prg
  * harbour/contrib/hbxbp/xbpradiobutton.prg
  * harbour/contrib/hbxbp/xbpscrollbar.prg
  * harbour/contrib/hbxbp/xbpsle.prg
  * harbour/contrib/hbxbp/xbpspinbutton.prg
  * harbour/contrib/hbxbp/xbpstatusbar.prg
  * harbour/contrib/hbxbp/xbptabpage.prg
  * harbour/contrib/hbxbp/xbptreeview.prg
  * harbour/contrib/hbxbp/xbpwindow.prg
    + Added :setPointer() method to change the cursor shape for a widget.
    ! Advanced implementation of Presentation Parameters. Now the 
      base structure is almost like Xbase++ one. About to 
      generate a Style Sheet based on PresParametrs array.
    ! Code tweaked more organized.

  * harbour/contrib/hbxbp/tests/demoxbp.prg
    + Demonstrated the use of Cursor Shapes.
This commit is contained in:
Pritpal Bedi
2009-06-29 02:46:22 +00:00
parent c3cbb5ea91
commit b109875df7
17 changed files with 411 additions and 88 deletions

View File

@@ -17,6 +17,31 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-28 19:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbxbp/xbp.ch
* harbour/contrib/hbxbp/xbp3state.prg
* harbour/contrib/hbxbp/xbpcheckbox.prg
* harbour/contrib/hbxbp/xbpcombobox.prg
* harbour/contrib/hbxbp/xbpdialog.prg
* harbour/contrib/hbxbp/xbpmenubar.prg
* harbour/contrib/hbxbp/xbpmle.prg
* harbour/contrib/hbxbp/xbpradiobutton.prg
* harbour/contrib/hbxbp/xbpscrollbar.prg
* harbour/contrib/hbxbp/xbpsle.prg
* harbour/contrib/hbxbp/xbpspinbutton.prg
* harbour/contrib/hbxbp/xbpstatusbar.prg
* harbour/contrib/hbxbp/xbptabpage.prg
* harbour/contrib/hbxbp/xbptreeview.prg
* harbour/contrib/hbxbp/xbpwindow.prg
+ Added :setPointer() method to change the cursor shape for a widget.
! Advanced implementation of Presentation Parameters. Now the
base structure is almost like Xbase++ one. About to
generate a Style Sheet based on PresParametrs array.
! Code tweaked more organized.
* harbour/contrib/hbxbp/tests/demoxbp.prg
+ Demonstrated the use of Cursor Shapes.
2009-06-28 19:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbqt/generator/qt45.qtp
* harbour/contrib/hbqt/Makefile_gen

View File

@@ -70,12 +70,13 @@ PROCEDURE BuildADialog()
LOCAL oDlg, mp1, mp2, oXbp, nEvent, aSize, aTabs, oDa
LOCAL nThread := ThreadID()
LOCAL cThread := hb_ntos( nThread )
LOCAL aPP
/* Create Application Window */
oDlg := GuiStdDialog( "Harbour - Xbase++ - QT Dialog [ "+ hb_ntos( nThread )+" ]" )
oDlg:close := {|| MsgBox( "You can also close me by pressing [ESC]" ), .T. }
oDlg:killDisplayFocus := {|| hb_OutDebug( "Loosing Display Focus" ) }
// oDlg:killDisplayFocus := {|| hb_OutDebug( "Loosing Display Focus" ) }
SetAppWindow( oDlg )
oDlg:show()
@@ -99,7 +100,7 @@ PROCEDURE BuildADialog()
Build_MenuBar()
/* Install Statusbar */
Build_StatusBar( oDlg )
Build_StatusBar( oDa )
/* Install Toolbar */
Build_ToolBar( oDa )
@@ -140,6 +141,9 @@ PROCEDURE BuildADialog()
/* Install TreeView */
Build_TreeView( aTabs[ 4 ] )
//aPP := aTabs[4]:setPresParam()
//hb_outDebug( valtype( aPP ) +' '+ str( len( aPP ) ) )
/* Present the dialog on the screen */
oDlg:Show()
@@ -167,7 +171,7 @@ PROCEDURE AppSys()
/*----------------------------------------------------------------------*/
#ifdef __XPP__
FUNCTION Hb_OutDebug();RETURN nil
FUNCTION Hb_OutDebug( cStr );RETURN nil
FUNCTION Hb_Symbol_Unused();RETURN nil
FUNCTION Hb_NtoS( n );RETURN ltrim( str( n ) )
FUNCTION Hb_ThreadStart();RETURN nil
@@ -235,7 +239,6 @@ STATIC FUNCTION Build_MenuBar()
oSubMenu:setColorBG( GraMakeRGBColor( { 134,128,250 } ) )
oSubMenu:setColorFG( GraMakeRGBColor( { 255, 1, 1 } ) )
#ifdef __HARBOUR__
#if 0
oSubMenu := XbpMenu():new( oMenuBar ):create()
@@ -360,7 +363,6 @@ FUNCTION Build_CheckBox( oWnd )
{| mp1, mp2, oChk| MsgBox( "Checkbox B", ;
IIf( oChk:getData(), "selected", ;
"not selected" ) ) }
RETURN nil
/*----------------------------------------------------------------------*/
@@ -435,6 +437,8 @@ FUNCTION Build_TabPages( oDlg )
oTab1:create()
oTab1:TabActivate := {|| oTab2:minimize(), oTab3:minimize(), oTab4:minimize(), oTab1:maximize() }
oTab1:setPointer( , XBPSTATIC_SYSICON_WAIT, XBPWINDOW_POINTERTYPE_SYSPOINTER )
// Second tab page is minimized
oTab2 := XbpTabPage():new( oDlg:drawingArea, , { 510, 20 }, { 360, nHeight } )
oTab2:caption := "XbpMLE"
@@ -484,11 +488,10 @@ FUNCTION Build_ListBox( oWnd )
// Code block for list box selection:
oListBox:ItemSelected := {|mp1, mp2, obj| mp1:=oListBox:getData(), ;
mp2:=oListBox:getItem( mp1 ), MsgBox( "itemSelected: "+mp2 ) }
#if 1
oListBox:setColorBG( GraMakeRGBColor( {227,12,110} ) )
oListBox:setColorFG( GraMakeRGBColor( {227,12,110} ) )
oListBox:setColorBG( GraMakeRGBColor( { 27,12, 45} ) )
#endif
oListBox:setPointer( , XBPSTATIC_SYSICON_MOVE, XBPWINDOW_POINTERTYPE_SYSPOINTER )
RETURN nil
@@ -504,6 +507,8 @@ FUNCTION Build_StatusBar( oWnd )
oPanel:caption := "Harbour-QT-Xbase++ is Ready"
oPanel:autosize := XBPSTATUSBAR_AUTOSIZE_SPRING
oSBar:setPointer( , XBPSTATIC_SYSICON_SIZEWE, XBPWINDOW_POINTERTYPE_SYSPOINTER )
RETURN nil
/*----------------------------------------------------------------------*/
@@ -768,3 +773,21 @@ PROCEDURE FieldStruct( oItem, aField )
/*----------------------------------------------------------------------*/
STATIC FUNCTION PP_Debug( oXbp )
LOCAL aPP := oXbp:setPresParam()
LOCAL s := ''
aeval( aPP, {|e_| s += ( hb_ntos( e_[ 1 ] ) +' '+ valtype( e_[ 2 ] ) +' '+ ;
IF( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ chr( 13 )+chr( 10 ) ) } )
#ifdef __XPP__
MsgBox( s )
#else
hb_outDebug( s )
#endif
RETURN nil
/*----------------------------------------------------------------------*/

View File

@@ -185,7 +185,9 @@
#define XBPSYSCLR_TRANSPARENT ( -255 )
#define XBP_DISP_MODELESS 1
#define XBP_DISP_APPMODAL 2
#define XBP_DISP_SYSMODAL 3
#define XBPSLE_LEFT 1
#define XBPSLE_RIGHT 2
@@ -232,7 +234,35 @@
#define XBP_MK_CONTROL 8
#define XBP_MK_MBUTTON 16
#define XBPWINDOW_POINTERTYPE_POINTER 1
#define XBPWINDOW_POINTERTYPE_SYSPOINTER 2
#define XBPWINDOW_POINTERTYPE_ICON 3
#define XBPSTATIC_SYSICON_DEFAULT 0
#define XBPSTATIC_SYSICON_ARROW 1
#define XBPSTATIC_SYSICON_TEXT 2
#define XBPSTATIC_SYSICON_WAIT 3
#define XBPSTATIC_SYSICON_SIZE 4
#define XBPSTATIC_SYSICON_MOVE 5
#define XBPSTATIC_SYSICON_SIZENWSE 6
#define XBPSTATIC_SYSICON_SIZENESW 7
#define XBPSTATIC_SYSICON_SIZEWE 8
#define XBPSTATIC_SYSICON_SIZENS 9
#define XBPSTATIC_SYSICON_APPICON 10
#define XBPSTATIC_SYSICON_ICONINFORMATION 11
#define XBPSTATIC_SYSICON_ICONQUESTION 12
#define XBPSTATIC_SYSICON_ICONERROR 13
#define XBPSTATIC_SYSICON_ICONWARNING 14
#define XBPSTATIC_SYSICON_ILLEGAL 18
#define XBPSTATIC_SYSICON_FILE 19
#define XBPSTATIC_SYSICON_FOLDER 20
#define XBPSTATIC_SYSICON_MULTFILE 21
#define XBPSTATIC_SYSICON_PROGRAM 22
#define XBPSTATIC_SYSICON_DISPLAY_PTRS 22
#define XBPSTATIC_SYSICON_PENFIRST 23
#define XBPSTATIC_SYSICON_PENLAST 39
/*----------------------------------------------------------------------*/
#define _XBP_CH
#endif
/*----------------------------------------------------------------------*/

View File

@@ -100,7 +100,7 @@ CLASS Xbp3State INHERIT XbpWindow, XbpDataRef
METHOD Xbp3State:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -100,7 +100,7 @@ CLASS XbpCheckBox INHERIT XbpWindow, XbpDataRef
METHOD XbpCheckBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
@@ -108,7 +108,7 @@ METHOD XbpCheckBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD XbpCheckBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oWidget := QCheckBox():New( QT_PTROF( ::oParent:oWidget ) )
::Connect( ::pWidget, "stateChanged(int)", {|o,i| ::exeBlock( i,o ) } )

View File

@@ -128,7 +128,7 @@ CLASS XbpComboBox INHERIT XbpWindow
METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -213,16 +213,26 @@ METHOD XbpDialog:destroy()
/*----------------------------------------------------------------------*/
METHOD XbpDialog:setFrameState( nState )
LOCAL lSuccess := .f.
LOCAL lSuccess := .T.
LOCAL nCurState := ::getFrameState()
DO CASE
CASE nState == XBPDLG_FRAMESTAT_MINIMIZED
IF nCurState != XBPDLG_FRAMESTAT_MINIMIZED
::oWidget:setWindowState( Qt_WindowMinimized )
ENDIF
CASE nState == XBPDLG_FRAMESTAT_MAXIMIZED
IF nCurState == XBPDLG_FRAMESTAT_MINIMIZED
::oWidget:show()
::oWidget:setWindowState( Qt_WindowMaximized )
ELSEIF nCurState == XBPDLG_FRAMESTAT_NORMALIZED
::oWidget:setWindowState( Qt_WindowMaximized )
ENDIF
CASE nState == XBPDLG_FRAMESTAT_NORMALIZED
IF nCurState != XBPDLG_FRAMESTAT_MINIMIZED
::oWidget:show()
ENDIF
::oWidget:setWindowState( Qt_WindowNoState )
ENDCASE
RETURN lSuccess
@@ -230,15 +240,13 @@ METHOD XbpDialog:setFrameState( nState )
/*----------------------------------------------------------------------*/
METHOD XbpDialog:getFrameState()
LOCAL nState := ::oWidget:windowState()
#if 0
IF Qtc_IsIconic( ::hWnd )
IF ( hb_bitAnd( nState, Qt_WindowMinimized ) == Qt_WindowMinimized )
RETURN XBPDLG_FRAMESTAT_MINIMIZED
ENDIF
IF Qtc_IsZoomed( ::hWnd )
ELSEIF ( hb_bitAnd( nState, Qt_WindowMaximized ) == Qt_WindowMaximized )
RETURN XBPDLG_FRAMESTAT_MAXIMIZED
ENDIF
#endif
RETURN XBPDLG_FRAMESTAT_NORMALIZED

View File

@@ -686,6 +686,8 @@ METHOD xbpMenu:new( oParent, aPresParams, lVisible )
::aPresParams := aPresParams
::visible := lVisible
::xbpWindow:new( ::oParent, , , , ::aPresParams, ::visible )
RETURN Self
/*----------------------------------------------------------------------*/
@@ -700,6 +702,8 @@ METHOD xbpMenu:create( oParent, aPresParams, lVisible )
::aPresParams := aPresParams
::visible := lVisible
::xbpWindow:create( ::oParent, , , , ::aPresParams, ::visible )
::oWidget := QMenu():new( ::pParent )
::oParent:oWidget:addMenu( ::pWidget )

View File

@@ -132,7 +132,7 @@ CLASS XbpMLE INHERIT XbpWindow, XbpDataRef
METHOD XbpMLE:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -99,7 +99,7 @@ CLASS XbpRadioButton INHERIT XbpWindow, XbpDataRef
METHOD XbpRadioButton:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -103,7 +103,7 @@ CLASS XbpScrollBar INHERIT XbpWindow, XbpDataRef
METHOD XbpScrollBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -121,7 +121,7 @@ CLASS XbpSLE INHERIT XbpWindow, XbpDataRef
METHOD XbpSLE:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -131,7 +131,7 @@ CLASS XbpSpinButton INHERIT XbpWindow, XbpDataRef
METHOD XbpSpinButton:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -103,18 +103,31 @@ CLASS XbpStatusBar INHERIT XbpWindow
METHOD XbpStatusBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpStatusBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
LOCAL oPar
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oWidget := QStatusBar():new( ::pParent )
::oParent:oWidget:setStatusBar( ::pWidget )
IF upper( ::oParent:className ) == "XBPDIALOG"
oPar := ::oParent
ELSEIF upper( ::oParent:className ) == "XBPDRAWINGAREA"
oPar := ::oParent:oParent
ELSE
RETURN Self
ENDIF
::oWidget := QToolBar():new( QT_PTROF( oPar:oWidget ) )
oPar:oWidget:addToolBar_1( ::pWidget )
::oWidget := QStatusBar():new( QT_PTROF( oPar:oWidget ) )
oPar:oWidget:setStatusBar( ::pWidget )
::oWidget:setSizeGripEnabled( ::sizeGrip )
IF ::visible

View File

@@ -105,7 +105,7 @@ CLASS XbpTabPage INHERIT XbpWindow
METHOD XbpTabPage:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -132,7 +132,7 @@ CLASS XbpTreeView INHERIT XbpWindow, XbpDataRef
METHOD XbpTreeView:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::xbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self

View File

@@ -103,11 +103,6 @@ CLASS XbpWindow INHERIT XbpPartHandler
DATA helpLink
DATA tooltipText INIT ""
DATA clr_FG
DATA clr_BG
DATA fnt_COMMPOUNDNAME
DATA fnt_hFont
/* CALLBACK SLOTS */
DATA sl_enter
DATA sl_leave
@@ -277,6 +272,8 @@ EXPORTED:
METHOD setStyle() INLINE NIL
DATA lTrack INIT .f.
ENDCLASS
/*----------------------------------------------------------------------*/
@@ -306,6 +303,7 @@ METHOD XbpWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
/*----------------------------------------------------------------------*/
METHOD XbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
LOCAL aPP, i, cClass := __objGetClsName( Self )
DEFAULT oParent TO ::oParent
DEFAULT oOwner TO ::oOwner
@@ -323,6 +321,34 @@ METHOD XbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::XbpPartHandler:create( oParent, oOwner )
aPP := Xbp_PresParam()
FOR i := 1 TO len( ::aPresParams )
Xbp_SetPresParam( aPP, ::aPresParams[ i,1 ], ::aPresParams[ i,2 ] )
NEXT
::aPresParams := aPP
DO CASE
CASE cClass $ 'XBPDIALOG,XBPDRAWINGAREA'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_DIALOGBACKGROUND )
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_DISABLED_BGCLR, XBPSYSCLR_DIALOGBACKGROUND )
CASE cClass $ 'XBPPUSHBUTTON'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_FGCLR , XBPSYSCLR_BUTTONTEXT )
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_BUTTONMIDDLE )
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_DISABLED_BGCLR, XBPSYSCLR_BUTTONMIDDLE )
CASE cClass $ 'XBPTABPAGE'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_BUTTONMIDDLE )
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_DISABLED_BGCLR, XBPSYSCLR_BUTTONMIDDLE )
CASE cClass $ 'XBPLISTBOX'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_ENTRYFIELD )
CASE cClass $ 'XBPSCROLLBAR'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_SCROLLBAR )
CASE cClass $ 'XBPSLE,XBPMLE'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_ENTRYFIELD )
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_DISABLED_BGCLR, XBPSYSCLR_3DFACE )
CASE cClass $ 'XBPSPINBUTTON,XBPCOMBOBOX,XBPTREEVIEW'
Xbp_SetPresParamIfNil( ::aPresParams, XBP_PP_BGCLR , XBPSYSCLR_ENTRYFIELD )
ENDCASE
RETURN Self
/*----------------------------------------------------------------------*/
@@ -432,14 +458,18 @@ METHOD XbpWindow:grabEvent( nEvent, pEvent, oXbp )
ENDCASE
EXIT
CASE QEvent_Enter // :enter()
oEvent := QMouseEvent()
oEvent:pPtr := pEvent
SetAppEvent( xbeM_Enter, { oEvent:x(), oEvent:y() }, NIL, self )
IF ( ::lTrack )
oEvent := QMouseEvent()
oEvent:pPtr := pEvent
SetAppEvent( xbeM_Enter, { oEvent:x(), oEvent:y() }, NIL, self )
ENDIF
EXIT
CASE QEvent_Leave // :leave()
oEvent := QMouseEvent()
oEvent:pPtr := pEvent
SetAppEvent( xbeM_Leave, { oEvent:x(), oEvent:y() }, NIL, self )
IF ( ::lTrack )
oEvent := QMouseEvent()
oEvent:pPtr := pEvent
SetAppEvent( xbeM_Leave, { oEvent:x(), oEvent:y() }, NIL, self )
ENDIF
EXIT
CASE QEvent_Wheel // :wheel()
oEvent := QWheelEvent()
@@ -651,7 +681,7 @@ METHOD XbpWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
METHOD XbpWindow:destroy()
hb_outDebug( "Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ) )
//hb_outDebug( "Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ) )
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {|o| o:destroy() } )
@@ -671,15 +701,25 @@ hb_outDebug( "Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',s
::oWidget:close()
hb_outDebug( " Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ) )
//hb_outDebug( " Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ) )
RETURN NIL
/*----------------------------------------------------------------------*/
METHOD XbpWindow:captureMouse()
METHOD XbpWindow:captureMouse( lCapture )
LOCAL lSuccess := .f.
RETURN Self
IF hb_isLogical( lCapture )
IF lCapture
::oWidget:grabMouse()
ELSE
::oWidget:releaseMouse()
ENDIF
lSuccess := .t. /* QT cannot determine if it succeeded */
ENDIF
RETURN lSuccess
/*----------------------------------------------------------------------*/
@@ -688,7 +728,7 @@ METHOD XbpWindow:disable()
::oWidget:setDisabled( .t. )
::is_enabled := ::oWidget:isEnabled()
RETURN .f.
RETURN ( ! ::is_enabled )
/*----------------------------------------------------------------------*/
@@ -697,7 +737,7 @@ METHOD XbpWindow:enable()
::oWidget:setEnabled( .t. )
::is_enabled := ::oWidget:isEnabled()
RETURN .f.
RETURN ( ::is_enabled )
/*----------------------------------------------------------------------*/
@@ -705,16 +745,17 @@ METHOD XbpWindow:hide()
IF hb_isObject( ::oWidget )
::oWidget:hide()
::is_hidden := .t.
ENDIF
::is_hidden := ::oWidget:isHidden()
RETURN Self
RETURN ::is_hidden
/*----------------------------------------------------------------------*/
METHOD XbpWindow:invalidateRect( aRect )
HB_SYMBOL_UNUSED( aRect )
// TODO:
RETURN self
@@ -722,12 +763,16 @@ METHOD XbpWindow:invalidateRect( aRect )
METHOD XbpWindow:lockPS()
// TODO:
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:lockUpdate()
// TODO:
RETURN Self
/*----------------------------------------------------------------------*/
@@ -742,35 +787,35 @@ METHOD XbpWindow:setStyleSheet( cNewSheet )
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setColorBG( nRGB )
#if 0
LOCAL cClass := __ObjGetClsName( self )
//LOCAL cClass := __ObjGetClsName( self )
LOCAL oColor := QColor():new( nRGB )
LOCAL oldRGB
IF hb_isNumeric( nRGB )
IF empty( ::oPalette )
::oPalette := QPalette()
::oPalette:pPtr := ::oWidget:palette()
ENDIF
DO CASE
CASE cClass $ 'XBPPUSHBUTTON,XBPMENUBAR,XBPMENU,XBPTOOLBAR,XBPTABPAGE,XBPLISTBOX'
::oPalette:setColor( QPalette_Button , QT_PTROF( QColor():new( nRGB ) ) )
OTHERWISE
::oPalette:setColor( QPalette_Background, QT_PTROF( QColor():new( nRGB ) ) )
ENDCASE
::oWidget:setPalette( QT_PTROF( ::oPalette ) )
oldRGB := Xbp_SetPresParam( ::aPresParams, XBP_PP_BGCLR, nRGB )
::setStyleSheet( "background-color: "+ oColor:name +";" )
ELSE
oldRGB := Xbp_SetPresParam( ::aPresParams, XBP_PP_BGCLR )
ENDIF
#endif
LOCAL oColor := QColor():new( nRGB )
::setStyleSheet( "background-color: "+ oColor:name +";" )
RETURN Self
RETURN oldRGB
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setColorFG( nRGB )
//LOCAL cClass := __ObjGetClsName( self )
LOCAL oColor := QColor():new( nRGB )
LOCAL oldRGB
IF hb_isNumeric( nRGB )
oldRGB := Xbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB )
::setStyleSheet( "color: "+ oColor:name +";" )
ELSE
oldRGB := Xbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR )
ENDIF
RETURN oldRGB
#if 0
LOCAL cClass := __ObjGetClsName( self )
@@ -790,13 +835,12 @@ METHOD XbpWindow:setColorFG( nRGB )
::oWidget:setPalette( QT_PTROF( ::oPalette ) )
ENDIF
#endif
LOCAL oColor := QColor():new( nRGB )
Xbp_SetPresParam( ::aPresParams, XBP_PP_FGCLR, nRGB )
::setStyleSheet( "color: "+ oColor:name +";" )
RETURN Self
#endif
/*----------------------------------------------------------------------*/
@@ -804,7 +848,7 @@ METHOD XbpWindow:setFontCompoundName( xFont )
LOCAL cOldFont, s, n, nPoint, cFont, cAttr, cFace
LOCAL aAttr := { "normal","italic","bold" }
cOldFont := ::fnt_COMMPOUNDNAME
cOldFont := Xbp_SetPresParam( ::aPresParams, XBP_PP_COMPOUNDNAME )
IF hb_isNumeric( cFont )
@@ -828,6 +872,8 @@ METHOD XbpWindow:setFontCompoundName( xFont )
ENDIF
cFace := alltrim( cFont )
Xbp_SetPresParam( ::aPresParams, XBP_PP_COMPOUNDNAME, xFont )
::setStyleSheet( 'font-family: "'+ cFace +'"; font-style: '+ cAttr +'; font-size: '+ hb_ntos( nPoint )+'pt;' )
ENDIF
ENDIF
@@ -836,21 +882,107 @@ METHOD XbpWindow:setFontCompoundName( xFont )
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setModalState()
METHOD XbpWindow:setModalState( nState )
DO CASE
CASE nState == XBP_DISP_MODELESS
::oWidget:setWindowModality( Qt_NonModal )
CASE nState == XBP_DISP_APPMODAL
::oWidget:setWindowModality( Qt_ApplicationModal )
CASE nState == XBP_DISP_SYSMODAL
// TODO:
ENDCASE
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setPointer()
STATIC FUNCTION Xbp_SetCursor( oXbp, nShape )
LOCAL oCursor := QCursor():new()
oCursor:setShape( nShape )
oXbp:oWidget:setCursor( oCursor:pPtr )
RETURN nil
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setPointer( cDllName, nResID, nType )
HB_SYMBOL_UNUSED( cDllName )
DEFAULT nType TO XBPWINDOW_POINTERTYPE_POINTER
DO CASE
CASE nType == XBPWINDOW_POINTERTYPE_POINTER
// TODO:
CASE nType == XBPWINDOW_POINTERTYPE_SYSPOINTER
DO CASE
CASE nResID == XBPSTATIC_SYSICON_DEFAULT // Default mouse pointer
CASE nResID == XBPSTATIC_SYSICON_ARROW // Normal arrow
Xbp_SetCursor( Self, Qt_ArrowCursor )
CASE nResID == XBPSTATIC_SYSICON_WAIT // Hour glass or clock
Xbp_SetCursor( Self, Qt_WaitCursor )
CASE nResID == XBPSTATIC_SYSICON_MOVE // Move the window
Xbp_SetCursor( Self, Qt_OpenHandCursor )
CASE nResID == XBPSTATIC_SYSICON_SIZE // Change size (all directions)
Xbp_SetCursor( Self, Qt_SizeAllCursor )
CASE nResID == XBPSTATIC_SYSICON_SIZENWSE // Change size (North west-South east)
Xbp_SetCursor( Self, Qt_SizeFDiagCursor )
CASE nResID == XBPSTATIC_SYSICON_SIZENESW // Change size (North east-South west)
Xbp_SetCursor( Self, Qt_SizeBDiagCursor )
CASE nResID == XBPSTATIC_SYSICON_SIZEWE // Change size (West-East)
Xbp_SetCursor( Self, Qt_SizeHorCursor )
CASE nResID == XBPSTATIC_SYSICON_SIZENS // Change size (North-South)
Xbp_SetCursor( Self, Qt_SizeVerCursor )
/* Possible Harbour-QT extensions */
CASE nResID == Qt_UpArrowCursor
Xbp_SetCursor( Self, Qt_UpArrowCursor )
CASE nResID == Qt_CrossCursor
Xbp_SetCursor( Self, Qt_CrossCursor )
CASE nResID == Qt_IBeamCursor
Xbp_SetCursor( Self, Qt_IBeamCursor )
CASE nResID == Qt_BlankCursor
Xbp_SetCursor( Self, Qt_BlankCursor )
CASE nResID == Qt_SplitVCursor
Xbp_SetCursor( Self, Qt_SplitVCursor )
CASE nResID == Qt_SplitHCursor
Xbp_SetCursor( Self, Qt_SplitHCursor )
CASE nResID == Qt_PointingHandCursor
Xbp_SetCursor( Self, Qt_PointingHandCursor )
CASE nResID == Qt_ForbiddenCursor
Xbp_SetCursor( Self, Qt_ForbiddenCursor )
CASE nResID == Qt_ClosedHandCursor
Xbp_SetCursor( Self, Qt_ClosedHandCursor )
CASE nResID == Qt_WhatsThisCursor
Xbp_SetCursor( Self, Qt_WhatsThisCursor )
CASE nResID == Qt_BusyCursor
Xbp_SetCursor( Self, Qt_BusyCursor )
CASE nResID == Qt_BitmapCursor
Xbp_SetCursor( Self, Qt_BitmapCursor )
ENDCASE
CASE nType == XBPWINDOW_POINTERTYPE_ICON
// TODO:
ENDCASE
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setTrackPointer()
METHOD XbpWindow:setTrackPointer( lTrack )
LOCAL lRet := .f.
RETURN Self
IF hb_isLogical( lTrack )
::lTrack := lTrack
lRet := .T.
ENDIF
RETURN ( lRet )
/*----------------------------------------------------------------------*/
@@ -898,7 +1030,7 @@ METHOD XbpWindow:setSize( aSize, lPaint )
METHOD XbpWindow:isDerivedFrom( cClassORoObject )
LOCAL lTrue := .f.
LOCAL cCls := __ObjGetClsName( self )
LOCAL cCls := __ObjGetClsName( Self )
/* Compares without Xbp or Wvg prefixes */
@@ -929,37 +1061,58 @@ METHOD XbpWindow:show()
METHOD XbpWindow:toBack()
// TODO:
RETURN self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:toFront()
// TODO:
RETURN self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:unlockPS()
// TODO:
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:winDevice()
// TODO:
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setFont()
// TODO:
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpWindow:setPresParam()
METHOD XbpWindow:setPresParam( aPPNew )
LOCAL i, aPP
RETURN Self
aPP := aclone( ::aPresParams )
IF hb_isArray( aPPNew )
FOR i := 1 TO len( aPPNew )
Xbp_SetPresParam( ::aPresParams, aPPNew[ i,1 ], aPPNew[ i,2 ] )
NEXT
ENDIF
// Build Style Sheet
RETURN aPP
/*----------------------------------------------------------------------*/
@@ -982,14 +1135,25 @@ METHOD XbpWindow:getHWND()
/*----------------------------------------------------------------------*/
METHOD XbpWindow:getModalState()
LOCAL nState
RETURN Self
nState := ::oWidget:windowModality()
IF hb_bitAnd( nState, Qt_NonModal ) == Qt_NonModal
RETURN ( XBP_DISP_MODELESS )
ELSEIF hb_bitAnd( nState, Qt_ApplicationModal ) == Qt_ApplicationModal
RETURN ( XBP_DISP_APPMODAL )
ELSE
// TODO: XBP_DISP_SYSMODAL
ENDIF
RETURN -1
/*----------------------------------------------------------------------*/
METHOD XbpWindow:hasInputFocus()
RETURN Self
RETURN ::oWidget:hasFocus()
/*----------------------------------------------------------------------*/
* Callback Methods
@@ -1524,3 +1688,59 @@ METHOD xbpWindow:setStyle()
RETURN self
#endif
/*----------------------------------------------------------------------*/
STATIC FUNCTION Xbp_PresParam()
LOCAL aPP := {}
aadd( aPP, { XBP_PP_FGCLR , NIL } )
aadd( aPP, { XBP_PP_BGCLR , NIL } )
aadd( aPP, { XBP_PP_HILITE_FGCLR , NIL } )
aadd( aPP, { XBP_PP_HILITE_BGCLR , NIL } )
aadd( aPP, { XBP_PP_DISABLED_FGCLR , NIL } )
aadd( aPP, { XBP_PP_DISABLED_BGCLR , NIL } )
aadd( aPP, { XBP_PP_BORDER_CLR , NIL } )
aadd( aPP, { XBP_PP_COMPOUNDNAME , NIL } )
aadd( aPP, { XBP_PP_FONT , NIL } )
aadd( aPP, { XBP_PP_ACTIVE_CLR , NIL } )
aadd( aPP, { XBP_PP_INACTIVE_CLR , NIL } )
aadd( aPP, { XBP_PP_ACTIVETEXT_FGCLR , NIL } )
aadd( aPP, { XBP_PP_ACTIVETEXT_BGCLR , NIL } )
aadd( aPP, { XBP_PP_INACTIVETEXT_FGCLR , NIL } )
aadd( aPP, { XBP_PP_INACTIVETEXT_BGCLR , NIL } )
aadd( aPP, { XBP_PP_CAPTION , NIL } )
aadd( aPP, { XBP_PP_ALIGNMENT , NIL } )
aadd( aPP, { XBP_PP_ORIGIN , NIL } )
RETURN aPP
/*----------------------------------------------------------------------*/
STATIC FUNCTION Xbp_SetPresParamIfNil( aPP, nParam, xValue )
LOCAL n
IF xValue != NIL
IF ( n := ascan( aPP, {|e_| e_[ 1 ] == nParam } ) ) > 0
IF aPP[ n,2 ] == NIL
aPP[ n,2 ] := xValue
ENDIF
ENDIF
ENDIF
RETURN nil
/*----------------------------------------------------------------------*/
STATIC FUNCTION Xbp_SetPresParam( aPP, nParam, xValue )
LOCAL oldValue, n
IF ( n := ascan( aPP, {|e_| e_[ 1 ] == nParam } ) ) > 0
oldValue := aPP[ n,2 ]
IF xValue != NIL
aPP[ n,2 ] := xValue
ENDIF
ENDIF
RETURN oldValue
/*----------------------------------------------------------------------*/