From bc9d41c93bee33efac8e8ff018258092a8adfc67 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 29 Sep 2010 17:58:23 +0000 Subject: [PATCH] 2010-09-29 10:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbxbp/xbp3state.prg * contrib/hbxbp/xbpappevent.prg * contrib/hbxbp/xbpbitmap.prg * contrib/hbxbp/xbpbrowse.prg * contrib/hbxbp/xbpcheckbox.prg * contrib/hbxbp/xbpclipboard.prg * contrib/hbxbp/xbpcombobox.prg * contrib/hbxbp/xbpdataref.prg * contrib/hbxbp/xbpdialog.prg * contrib/hbxbp/xbpfiledialog.prg * contrib/hbxbp/xbpfontdialog.prg * contrib/hbxbp/xbpgeneric.prg * contrib/hbxbp/xbpgra.prg * contrib/hbxbp/xbphtmlviewer.prg * contrib/hbxbp/xbplistbox.prg * contrib/hbxbp/xbpmenubar.prg * contrib/hbxbp/xbpmle.prg * contrib/hbxbp/xbpparthandler.prg * contrib/hbxbp/xbppresspace.prg * contrib/hbxbp/xbpprintdialog.prg * contrib/hbxbp/xbpprinter.prg * contrib/hbxbp/xbppushbutton.prg * contrib/hbxbp/xbpradiobutton.prg * contrib/hbxbp/xbprtf.prg * contrib/hbxbp/xbpscrollbar.prg * contrib/hbxbp/xbpspinbutton.prg * contrib/hbxbp/xbpstatic.prg * contrib/hbxbp/xbpstatusbar.prg * contrib/hbxbp/xbpstyle.prg * contrib/hbxbp/xbptabpage.prg * contrib/hbxbp/xbptoolbar.prg * contrib/hbxbp/xbptreeview.prg * contrib/hbxbp/xbpwindow.prg ! Class structure re-organized. ! Code normalized. ! Copyright touched. --- harbour/ChangeLog | 38 ++++++++++++++++++ harbour/contrib/hbxbp/xbp3state.prg | 38 ++++++++++-------- harbour/contrib/hbxbp/xbpappevent.prg | 4 +- harbour/contrib/hbxbp/xbpbitmap.prg | 4 +- harbour/contrib/hbxbp/xbpbrowse.prg | 4 +- harbour/contrib/hbxbp/xbpcheckbox.prg | 27 ++++++++++--- harbour/contrib/hbxbp/xbpclipboard.prg | 4 +- harbour/contrib/hbxbp/xbpcombobox.prg | 4 +- harbour/contrib/hbxbp/xbpdataref.prg | 4 +- harbour/contrib/hbxbp/xbpdialog.prg | 4 +- harbour/contrib/hbxbp/xbpfiledialog.prg | 4 +- harbour/contrib/hbxbp/xbpfontdialog.prg | 4 +- harbour/contrib/hbxbp/xbpgeneric.prg | 4 +- harbour/contrib/hbxbp/xbpgra.prg | 4 +- harbour/contrib/hbxbp/xbphtmlviewer.prg | 4 +- harbour/contrib/hbxbp/xbplistbox.prg | 20 +++++----- harbour/contrib/hbxbp/xbpmenubar.prg | 47 ++++------------------ harbour/contrib/hbxbp/xbpmle.prg | 4 +- harbour/contrib/hbxbp/xbpparthandler.prg | 4 +- harbour/contrib/hbxbp/xbppresspace.prg | 4 +- harbour/contrib/hbxbp/xbpprintdialog.prg | 4 +- harbour/contrib/hbxbp/xbpprinter.prg | 4 +- harbour/contrib/hbxbp/xbppushbutton.prg | 45 ++++++++++++++------- harbour/contrib/hbxbp/xbpradiobutton.prg | 35 +++++++++++------ harbour/contrib/hbxbp/xbprtf.prg | 49 +++++++++++++++++------ harbour/contrib/hbxbp/xbpscrollbar.prg | 28 +++++++++---- harbour/contrib/hbxbp/xbpspinbutton.prg | 50 ++++++++++++++++++------ harbour/contrib/hbxbp/xbpstatic.prg | 4 +- harbour/contrib/hbxbp/xbpstatusbar.prg | 4 +- harbour/contrib/hbxbp/xbpstyle.prg | 6 +-- harbour/contrib/hbxbp/xbptabpage.prg | 19 ++++----- harbour/contrib/hbxbp/xbptoolbar.prg | 5 ++- harbour/contrib/hbxbp/xbptreeview.prg | 6 +-- harbour/contrib/hbxbp/xbpwindow.prg | 8 ++-- 34 files changed, 310 insertions(+), 187 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d42d1e319f..a764b76197 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,44 @@ The license applies to all entries newer than 2009-04-28. */ +2010-09-29 10:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbxbp/xbp3state.prg + * contrib/hbxbp/xbpappevent.prg + * contrib/hbxbp/xbpbitmap.prg + * contrib/hbxbp/xbpbrowse.prg + * contrib/hbxbp/xbpcheckbox.prg + * contrib/hbxbp/xbpclipboard.prg + * contrib/hbxbp/xbpcombobox.prg + * contrib/hbxbp/xbpdataref.prg + * contrib/hbxbp/xbpdialog.prg + * contrib/hbxbp/xbpfiledialog.prg + * contrib/hbxbp/xbpfontdialog.prg + * contrib/hbxbp/xbpgeneric.prg + * contrib/hbxbp/xbpgra.prg + * contrib/hbxbp/xbphtmlviewer.prg + * contrib/hbxbp/xbplistbox.prg + * contrib/hbxbp/xbpmenubar.prg + * contrib/hbxbp/xbpmle.prg + * contrib/hbxbp/xbpparthandler.prg + * contrib/hbxbp/xbppresspace.prg + * contrib/hbxbp/xbpprintdialog.prg + * contrib/hbxbp/xbpprinter.prg + * contrib/hbxbp/xbppushbutton.prg + * contrib/hbxbp/xbpradiobutton.prg + * contrib/hbxbp/xbprtf.prg + * contrib/hbxbp/xbpscrollbar.prg + * contrib/hbxbp/xbpspinbutton.prg + * contrib/hbxbp/xbpstatic.prg + * contrib/hbxbp/xbpstatusbar.prg + * contrib/hbxbp/xbpstyle.prg + * contrib/hbxbp/xbptabpage.prg + * contrib/hbxbp/xbptoolbar.prg + * contrib/hbxbp/xbptreeview.prg + * contrib/hbxbp/xbpwindow.prg + ! Class structure re-organized. + ! Code normalized. + ! Copyright touched. + 2010-09-29 16:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * examples/dbu/dbu52.dif * examples/dbu/dbu53.dif diff --git a/harbour/contrib/hbxbp/xbp3state.prg b/harbour/contrib/hbxbp/xbp3state.prg index db9ceb66b5..67fc87e00f 100644 --- a/harbour/contrib/hbxbp/xbp3state.prg +++ b/harbour/contrib/hbxbp/xbp3state.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -56,9 +56,9 @@ * EkOnkar * ( The LORD is ONE ) * - * Xbase++ xbp3State Compatible Class + * Xbase++ xbp3State Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ @@ -85,6 +85,8 @@ CLASS Xbp3State INHERIT XbpWindow, XbpDataRef METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD handleEvent( nEvent, mp1, mp2 ) METHOD setCaption( xCaption ) @@ -108,30 +110,22 @@ METHOD Xbp3State:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget := QCheckBox( ::oParent:oWidget ) - - ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) - ::oWidget:setTriState( .t. ) + ::connect() ::setPosAndSize() IF ::visible ::show() ENDIF + ::oParent:AddChild( Self ) + ::postCreate() ::setCaption( ::caption ) - IF ::selection ::oWidget:setCheckState( 2 ) ENDIF - - IF ::visible - ::show() - ENDIF - ::editBuffer := ::oWidget:checkState() - ::oParent:AddChild( SELF ) - ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -142,7 +136,6 @@ METHOD Xbp3State:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, l IF hb_isPointer( pQtObject ) ::oWidget := QCheckBox():from( pQtObject ) - ENDIF RETURN Self @@ -158,7 +151,7 @@ METHOD Xbp3State:execSlot( cSlot, p ) EXIT ENDSWITCH - RETURN nil + RETURN NIL /*----------------------------------------------------------------------*/ @@ -172,8 +165,21 @@ METHOD Xbp3State:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ +METHOD Xbp3State:connect() + ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Xbp3State:disconnect() + ::oWidget:disconnect( "stateChanged(int)" ) + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD Xbp3State:destroy() + ::disconnect() ::xbpWindow:destroy() RETURN NIL diff --git a/harbour/contrib/hbxbp/xbpappevent.prg b/harbour/contrib/hbxbp/xbpappevent.prg index c6c9e6c122..b1b9e91a37 100644 --- a/harbour/contrib/hbxbp/xbpappevent.prg +++ b/harbour/contrib/hbxbp/xbpappevent.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ appevent.ch translates * - * Pritpal Bedi + * Pritpal Bedi * 26Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpbitmap.prg b/harbour/contrib/hbxbp/xbpbitmap.prg index 0c8e57f892..2df69e388a 100644 --- a/harbour/contrib/hbxbp/xbpbitmap.prg +++ b/harbour/contrib/hbxbp/xbpbitmap.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpBitmap compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 04Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpbrowse.prg b/harbour/contrib/hbxbp/xbpbrowse.prg index 6fcd73d823..7937f8d145 100644 --- a/harbour/contrib/hbxbp/xbpbrowse.prg +++ b/harbour/contrib/hbxbp/xbpbrowse.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * Navigation Based on TBrowse.prg @@ -61,7 +61,7 @@ * * Xbase++ Compatible XbpBrowse Class * - * Pritpal Bedi + * Pritpal Bedi * 10Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpcheckbox.prg b/harbour/contrib/hbxbp/xbpcheckbox.prg index 62cb1cb0b4..b98e665c2d 100644 --- a/harbour/contrib/hbxbp/xbpcheckbox.prg +++ b/harbour/contrib/hbxbp/xbpcheckbox.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpPushButton Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ @@ -87,6 +87,8 @@ CLASS XbpCheckBox INHERIT XbpWindow, XbpDataRef METHOD destroy() METHOD handleEvent( nEvent, mp1, mp2 ) METHOD execSlot( cSlot, p ) + METHOD connect() + METHOD disconnect() METHOD setCaption( xCaption ) METHOD selected( ... ) SETGET @@ -108,21 +110,21 @@ METHOD XbpCheckBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget := QCheckBox( ::oParent:oWidget ) - ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) + ::connect() ::setPosAndSize() IF ::visible ::show() ENDIF ::setCaption( ::caption ) + ::oParent:AddChild( SELF ) + ::postCreate() + IF ::selection ::oWidget:setChecked( .t. ) ENDIF - ::editBuffer := ::oWidget:isChecked() - ::oParent:AddChild( SELF ) - ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -162,8 +164,21 @@ METHOD XbpCheckBox:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ +METHOD XbpCheckBox:connect() + ::oWidget:connect( "stateChanged(int)", {|i| ::execSlot( "stateChanged(int)", i ) } ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpCheckBox:disconnect() + ::oWidget:disconnect( "stateChanged(int)" ) + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpCheckBox:destroy() + ::disconnect() ::xbpWindow:destroy() RETURN NIL diff --git a/harbour/contrib/hbxbp/xbpclipboard.prg b/harbour/contrib/hbxbp/xbpclipboard.prg index 2f0edba91a..b2cc73568c 100644 --- a/harbour/contrib/hbxbp/xbpclipboard.prg +++ b/harbour/contrib/hbxbp/xbpclipboard.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpClipBoard Class * - * Pritpal Bedi + * Pritpal Bedi * 13Mar2010 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpcombobox.prg b/harbour/contrib/hbxbp/xbpcombobox.prg index bae241124f..9175601fe8 100644 --- a/harbour/contrib/hbxbp/xbpcombobox.prg +++ b/harbour/contrib/hbxbp/xbpcombobox.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpComboBox compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 20Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpdataref.prg b/harbour/contrib/hbxbp/xbpdataref.prg index 6174dc0556..4c32ff0b92 100644 --- a/harbour/contrib/hbxbp/xbpdataref.prg +++ b/harbour/contrib/hbxbp/xbpdataref.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ dataRef Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpdialog.prg b/harbour/contrib/hbxbp/xbpdialog.prg index e88eb7df4f..6b1d720e1b 100644 --- a/harbour/contrib/hbxbp/xbpdialog.prg +++ b/harbour/contrib/hbxbp/xbpdialog.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpDialog Class * - * Pritpal Bedi + * Pritpal Bedi * 29May2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfiledialog.prg b/harbour/contrib/hbxbp/xbpfiledialog.prg index fbea99a8bc..6de7076e66 100644 --- a/harbour/contrib/hbxbp/xbpfiledialog.prg +++ b/harbour/contrib/hbxbp/xbpfiledialog.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpFileDialog Class * - * Pritpal Bedi + * Pritpal Bedi * 02Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpfontdialog.prg b/harbour/contrib/hbxbp/xbpfontdialog.prg index 5883266198..86489d141e 100644 --- a/harbour/contrib/hbxbp/xbpfontdialog.prg +++ b/harbour/contrib/hbxbp/xbpfontdialog.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpFontDialog Class * - * Pritpal Bedi + * Pritpal Bedi * 02Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpgeneric.prg b/harbour/contrib/hbxbp/xbpgeneric.prg index a97ad24004..95b54d5b4e 100644 --- a/harbour/contrib/hbxbp/xbpgeneric.prg +++ b/harbour/contrib/hbxbp/xbpgeneric.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible Function * - * Pritpal Bedi + * Pritpal Bedi * 08Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpgra.prg b/harbour/contrib/hbxbp/xbpgra.prg index 4bc31a0e74..08345b960e 100644 --- a/harbour/contrib/hbxbp/xbpgra.prg +++ b/harbour/contrib/hbxbp/xbpgra.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2010 Pritpal Bedi + * Copyright 2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible Gra*() Functions * - * Pritpal Bedi + * Pritpal Bedi * 13Mar2010 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbphtmlviewer.prg b/harbour/contrib/hbxbp/xbphtmlviewer.prg index 65f07244b0..bf7190348e 100644 --- a/harbour/contrib/hbxbp/xbphtmlviewer.prg +++ b/harbour/contrib/hbxbp/xbphtmlviewer.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpHtmlViewer compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 02Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbplistbox.prg b/harbour/contrib/hbxbp/xbplistbox.prg index 7bb91e1c3c..e65aacdf68 100644 --- a/harbour/contrib/hbxbp/xbplistbox.prg +++ b/harbour/contrib/hbxbp/xbplistbox.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Wvg*Classes * - * Copyright 2008 Pritpal Bedi + * Copyright 2008-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpTreeView compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 26Nov2008 */ /*----------------------------------------------------------------------*/ @@ -147,7 +147,7 @@ CLASS XbpListBox INHERIT XbpWindow, XbpDataRef METHOD XbpListBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + ::initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) RETURN Self @@ -168,9 +168,7 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) IF ::markMode == XBPLISTBOX_MM_MULTIPLE ::oWidget:setSelectionMode( QAbstractItemView_MultiSelection ) ENDIF - ::oWidget:setEditTriggers( QAbstractItemView_NoEditTriggers ) - IF ! ::horizScroll ::oWidget:setHorizontalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ENDIF @@ -178,11 +176,6 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget:setVerticalScrollBarPolicy( Qt_ScrollBarAlwaysOff ) ENDIF - ::sl_editBuffer := {} - - /* Window Events */ - ::oWidget:connect( QEvent_ContextMenu, {|e| ::grabEvent( QEvent_ContextMenu, e ) } ) - ::connect() ::setPosAndSize() IF ::visible @@ -190,12 +183,17 @@ METHOD XbpListBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF ::oParent:AddChild( SELF ) ::postCreate() + + ::sl_editBuffer := {} + RETURN Self /*----------------------------------------------------------------------*/ METHOD XbpListBox:connect() + ::oWidget:connect( QEvent_ContextMenu, {|e| ::grabEvent( QEvent_ContextMenu, e ) } ) + ::oWidget:connect( "currentItemChanged(QLWItem,QLWItem)", {|p,p1| ::execSlot( "currentItemChanged(QLWItem,QLWItem)", p, p1 ) } ) ::oWidget:connect( "currentRowChanged(int)" , {|p,p1| ::execSlot( "currentRowChanged(int)" , p, p1 ) } ) ::oWidget:connect( "currentTextChanged(QString)" , {|p,p1| ::execSlot( "currentTextChanged(QString)" , p, p1 ) } ) @@ -213,6 +211,8 @@ METHOD XbpListBox:connect() METHOD XbpListBox:disConnect() + ::oWidget:disconnect( QEvent_ContextMenu ) + ::oWidget:disConnect( "currentItemChanged(QLWItem,QLWItem)" ) ::oWidget:disConnect( "currentRowChanged(int)" ) ::oWidget:disConnect( "currentTextChanged(QString)" ) diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index c23d50a8aa..169afe697f 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpMenuBar Class * - * Pritpal Bedi + * Pritpal Bedi * 08Jun2009 */ /*----------------------------------------------------------------------*/ @@ -156,15 +156,7 @@ CLASS xbpMenuBar INHERIT xbpWindow METHOD xbpMenuBar:new( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible - - ::oParent := oParent - ::aPresParams := aPresParams - ::visible := lVisible - - ::xbpWindow:new( ::oParent, , , , ::aPresParams, ::visible ) + ::xbpWindow:init( oParent, , , , aPresParams, lVisible ) RETURN Self @@ -172,15 +164,7 @@ METHOD xbpMenuBar:new( oParent, aPresParams, lVisible ) METHOD xbpMenuBar:create( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible - - ::oParent := oParent - ::aPresParams := aPresParams - ::visible := lVisible - - ::xbpWindow:create( ::oParent, , , , ::aPresParams, ::visible ) + ::xbpWindow:create( oParent, , , , aPresParams, lVisible ) ::oWidget := QMenuBar() ::oParent:oWidget:setMenuBar( ::oWidget ) @@ -188,9 +172,9 @@ METHOD xbpMenuBar:create( oParent, aPresParams, lVisible ) if !empty( ::oWidget ) ::oParent:oMenu := Self endif - ::oParent:addChild( self ) ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ @@ -713,15 +697,7 @@ CLASS xbpMenu INHERIT xbpMenuBar METHOD xbpMenu:new( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible - - ::oParent := oParent - ::aPresParams := aPresParams - ::visible := lVisible - - ::xbpWindow:new( ::oParent, , , , ::aPresParams, ::visible ) + ::xbpWindow:init( oParent, , , , aPresParams, lVisible ) RETURN Self @@ -729,21 +705,14 @@ METHOD xbpMenu:new( oParent, aPresParams, lVisible ) METHOD xbpMenu:create( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible - - ::oParent := oParent - ::aPresParams := aPresParams - ::visible := lVisible - - ::xbpWindow:create( ::oParent, , , , ::aPresParams, ::visible ) + ::xbpWindow:create( oParent, , , , aPresParams, lVisible ) ::oWidget := QMenu() ::oParent:oWidget:addMenu( ::oWidget ) ::oParent:addChild( self ) ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpmle.prg b/harbour/contrib/hbxbp/xbpmle.prg index 02081b85ef..33e337bd8e 100644 --- a/harbour/contrib/hbxbp/xbpmle.prg +++ b/harbour/contrib/hbxbp/xbpmle.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpMLE compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 19Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpparthandler.prg b/harbour/contrib/hbxbp/xbpparthandler.prg index 897e309e8d..0b8cd39423 100644 --- a/harbour/contrib/hbxbp/xbpparthandler.prg +++ b/harbour/contrib/hbxbp/xbpparthandler.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2008 Pritpal Bedi + * Copyright 2008-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpPartHandler Class * - * Pritpal Bedi + * Pritpal Bedi * 08Nov2008 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbppresspace.prg b/harbour/contrib/hbxbp/xbppresspace.prg index 92c0b7f7d1..f40ec4cba6 100644 --- a/harbour/contrib/hbxbp/xbppresspace.prg +++ b/harbour/contrib/hbxbp/xbppresspace.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpPresSpace Class * - * Pritpal Bedi + * Pritpal Bedi * 08Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpprintdialog.prg b/harbour/contrib/hbxbp/xbpprintdialog.prg index 2942264652..23ff68f6a6 100644 --- a/harbour/contrib/hbxbp/xbpprintdialog.prg +++ b/harbour/contrib/hbxbp/xbpprintdialog.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpPrintDialog Class * - * Pritpal Bedi + * Pritpal Bedi * 08Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpprinter.prg b/harbour/contrib/hbxbp/xbpprinter.prg index 07dbbba90a..30e4bc1703 100644 --- a/harbour/contrib/hbxbp/xbpprinter.prg +++ b/harbour/contrib/hbxbp/xbpprinter.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible XbpPrinter Class * - * Pritpal Bedi + * Pritpal Bedi * 08Jul2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbppushbutton.prg b/harbour/contrib/hbxbp/xbppushbutton.prg index 7e37a80631..74ebd45184 100644 --- a/harbour/contrib/hbxbp/xbppushbutton.prg +++ b/harbour/contrib/hbxbp/xbppushbutton.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpPushButton Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 13Jun2009 */ /*----------------------------------------------------------------------*/ @@ -93,6 +93,8 @@ CLASS XbpPushButton INHERIT XbpWindow METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD handleEvent( nEvent, mp1, mp2 ) METHOD execSlot( cSlot, p ) METHOD setStyle() VIRTUAL @@ -121,22 +123,20 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::oWidget := QPushButton( ::oParent:oWidget ) ::oWidget:setFocusPolicy( Qt_StrongFocus ) - - ::setPosAndSize() - IF ::visible - ::oWidget:show() - ENDIF - - ::setCaption( ::caption ) - IF ::default ::oWidget:setDefault( .t. ) ENDIF - ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) - ::oWidget:connect( "pressed()", {|| ::execSlot( "pressed()" ) } ) - + ::connect() + ::setPosAndSize() + IF ::visible + ::oWidget:show() + ENDIF ::oParent:AddChild( SELF ) + ::postCreate() + + ::setCaption( ::caption ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -163,10 +163,10 @@ METHOD XbpPushButton:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParam ENDIF - ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) - + ::connect() ::addAsChild() ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ @@ -196,8 +196,23 @@ 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 + +/*----------------------------------------------------------------------*/ + METHOD XbpPushButton:destroy() + ::disconnect() ::xbpWindow:destroy() RETURN NIL diff --git a/harbour/contrib/hbxbp/xbpradiobutton.prg b/harbour/contrib/hbxbp/xbpradiobutton.prg index 727a921913..e1b9027a80 100644 --- a/harbour/contrib/hbxbp/xbpradiobutton.prg +++ b/harbour/contrib/hbxbp/xbpradiobutton.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpPushButton Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ @@ -85,6 +85,8 @@ CLASS XbpRadioButton INHERIT XbpWindow, XbpDataRef METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD handleEvent( nEvent, mp1, mp2 ) METHOD execSlot( cSlot, p ) @@ -108,21 +110,20 @@ METHOD XbpRadioButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisibl ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget := QRadioButton( ::oParent:oWidget ) - - ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) - - ::setPosAndSize() - IF ::visible - ::show() - ENDIF - ::setCaption( ::caption ) - IF ::selection ::oWidget:setChecked( .t. ) ENDIF + ::connect() + ::setPosAndSize() + IF ::visible + ::show() + ENDIF ::oParent:AddChild( SELF ) ::postCreate() + + ::setCaption( ::caption ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -162,6 +163,18 @@ METHOD XbpRadioButton:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ +METHOD XbpRadioButton:connect() + ::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpRadioButton:disconnect() + ::oWidget:disconnect( "clicked()" ) + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpRadioButton:destroy() ::xbpWindow:destroy() diff --git a/harbour/contrib/hbxbp/xbprtf.prg b/harbour/contrib/hbxbp/xbprtf.prg index 579dfb2601..c8a6465019 100644 --- a/harbour/contrib/hbxbp/xbprtf.prg +++ b/harbour/contrib/hbxbp/xbprtf.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible XbpRtf Class * - * Pritpal Bedi + * Pritpal Bedi * 10Jul2009 */ /*----------------------------------------------------------------------*/ @@ -81,6 +81,8 @@ CLASS XbpRtf INHERIT XbpWindow METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure() METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD handleEvent( nEvent, mp1, mp2 ) VIRTUAL METHOD execSlot( cSlot, p ) METHOD setStyle() VIRTUAL @@ -171,25 +173,18 @@ METHOD XbpRtf:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oWidget := QTextEdit( ::pParent ) -* ::oWidget:connect( "copyAvailable(bool)" , {|p| ::execSlot( "copyAvailable(bool)" , p ) } ) - ::oWidget:connect( "currentCharFormatChanged(QTextCharFormat)", {|p| ::execSlot( "currentCharFormatChanged(QTextCharFormat)", p ) } ) - ::oWidget:connect( "cursorPositionChanged()" , {|p| ::execSlot( "cursorPositionChanged()", p ) } ) - ::oWidget:connect( "redoAvailable(bool)" , {|p| ::execSlot( "redoAvailable(bool)" , p ) } ) - ::oWidget:connect( "undoAvailable(bool)" , {|p| ::execSlot( "undoAvailable(bool)" , p ) } ) - ::oWidget:connect( "textChanged()" , {|p| ::execSlot( "textChanged()" , p ) } ) - ::oWidget:connect( "selectionChanged()" , {|p| ::execSlot( "selectionChanged()" , p ) } ) - + ::connect() ::setPosAndSize() IF ::visible ::show() ENDIF ::oParent:AddChild( SELF ) + ::postCreate() ::oTextDocument := ::oWidget:document() ::oTextCursor := ::oWidget:textCursor() ::oTextCharFormat := ::oTextCursor:charFormat() - ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -201,9 +196,10 @@ METHOD XbpRtf:hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVis IF hb_isPointer( pQtObject ) ::oWidget := QTextEdit() ::oWidget := pQtObject - ENDIF + ::connect() + RETURN Self /*----------------------------------------------------------------------*/ @@ -239,8 +235,37 @@ METHOD XbpRtf:configure() /*----------------------------------------------------------------------*/ +METHOD XbpRtf:connect() + +* ::oWidget:connect( "copyAvailable(bool)" , {|p| ::execSlot( "copyAvailable(bool)" , p ) } ) + ::oWidget:connect( "currentCharFormatChanged(QTextCharFormat)", {|p| ::execSlot( "currentCharFormatChanged(QTextCharFormat)", p ) } ) + ::oWidget:connect( "cursorPositionChanged()" , {|p| ::execSlot( "cursorPositionChanged()", p ) } ) + ::oWidget:connect( "redoAvailable(bool)" , {|p| ::execSlot( "redoAvailable(bool)" , p ) } ) + ::oWidget:connect( "undoAvailable(bool)" , {|p| ::execSlot( "undoAvailable(bool)" , p ) } ) + ::oWidget:connect( "textChanged()" , {|p| ::execSlot( "textChanged()" , p ) } ) + ::oWidget:connect( "selectionChanged()" , {|p| ::execSlot( "selectionChanged()" , p ) } ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpRtf:disconnect() + +* ::oWidget:disconnect( "copyAvailable(bool)" ) + ::oWidget:disconnect( "currentCharFormatChanged(QTextCharFormat)" ) + ::oWidget:disconnect( "cursorPositionChanged()" ) + ::oWidget:disconnect( "redoAvailable(bool)" ) + ::oWidget:disconnect( "undoAvailable(bool)" ) + ::oWidget:disconnect( "textChanged()" ) + ::oWidget:disconnect( "selectionChanged()" ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpRtf:destroy() + ::disconnect() ::xbpWindow:destroy() ::oTextDocument := NIL diff --git a/harbour/contrib/hbxbp/xbpscrollbar.prg b/harbour/contrib/hbxbp/xbpscrollbar.prg index 1633eb0ed2..d2c7f03517 100644 --- a/harbour/contrib/hbxbp/xbpscrollbar.prg +++ b/harbour/contrib/hbxbp/xbpscrollbar.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpScrollBar Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 15Jun2009 */ /*----------------------------------------------------------------------*/ @@ -88,6 +88,8 @@ CLASS XbpScrollBar INHERIT XbpWindow, XbpDataRef METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) VIRTUAL METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD scroll( ... ) SETGET @@ -117,17 +119,16 @@ METHOD XbpScrollBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::oWidget:setOrientation( IF( ::type == XBPSCROLL_VERTICAL, 2, 1 ) ) ::oWidget:setTracking( ::autoTrack ) - ::oWidget:connect( "actionTriggered(int)", {|i| ::execSlot( "actionTriggered(int)", i ) } ) - + ::connect() ::setPosAndSize() - ::setRange( ::range ) - IF ::visible ::show() ENDIF - ::oParent:AddChild( SELF ) ::postCreate() + + ::setRange( ::range ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -196,8 +197,21 @@ METHOD XbpScrollBar:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ +METHOD XbpScrollBar:connect() + ::oWidget:connect( "actionTriggered(int)", {|i| ::execSlot( "actionTriggered(int)", i ) } ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpScrollBar:disconnect() + ::oWidget:disconnect( "actionTriggered(int)" ) + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpScrollBar:destroy() + ::disconnect() ::xbpWindow:destroy() RETURN NIL diff --git a/harbour/contrib/hbxbp/xbpspinbutton.prg b/harbour/contrib/hbxbp/xbpspinbutton.prg index 7349d7b145..a626dc84e1 100644 --- a/harbour/contrib/hbxbp/xbpspinbutton.prg +++ b/harbour/contrib/hbxbp/xbpspinbutton.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -56,9 +56,9 @@ * EkOnkar * ( The LORD is ONE ) * - * Xbase++ XbpSpinButton compatible Class + * Xbase++ XbpSpinButton compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 17Jun2009 */ /*----------------------------------------------------------------------*/ @@ -95,6 +95,8 @@ CLASS XbpSpinButton INHERIT XbpWindow, XbpDataRef METHOD hbCreateFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject ) METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) VIRTUAL METHOD destroy() + METHOD connect() + METHOD disconnect() METHOD handleEvent( nEvent, mp1, mp2 ) METHOD execSlot( cSlot, p ) @@ -147,23 +149,16 @@ METHOD XbpSpinButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ::oWidget:setFrame( ::border ) ::oWidget:setAlignment( es_[ ::align ] ) - #if 0 - ::oWidget:connect( QEvent_FocusIn , {|| ::execSlot( "QEvent_FocusIn" ) } ) - ::oWidget:connect( QEvent_FocusOut, {|| ::execSlot( "QEvent_FocusOut" ) } ) - ::oWidget:connect( QEvent_KeyPress, {|| ::execSlot( "QEvent_KeyPress" ) } ) - #endif - - ::oWidget:connect( "valueChanged(int)" , {|i| ::execSlot( "valueChanged(int)", i ) } ) - + ::connect() ::setPosAndSize() IF ::visible ::show() ENDIF + ::oParent:addChild( Self ) + ::postCreate() ::setData() - ::oParent:addChild( Self ) - ::postCreate() RETURN Self /*----------------------------------------------------------------------*/ @@ -219,8 +214,37 @@ METHOD XbpSpinButton:handleEvent( nEvent, mp1, mp2 ) /*----------------------------------------------------------------------*/ +METHOD XbpSpinButton:connect() + + #if 0 + ::oWidget:connect( QEvent_FocusIn , {|| ::execSlot( "QEvent_FocusIn" ) } ) + ::oWidget:connect( QEvent_FocusOut, {|| ::execSlot( "QEvent_FocusOut" ) } ) + ::oWidget:connect( QEvent_KeyPress, {|| ::execSlot( "QEvent_KeyPress" ) } ) + #endif + + ::oWidget:connect( "valueChanged(int)" , {|i| ::execSlot( "valueChanged(int)", i ) } ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD XbpSpinButton:disconnect() + + #if 0 + ::oWidget:connect( QEvent_FocusIn ) + ::oWidget:connect( QEvent_FocusOut ) + ::oWidget:connect( QEvent_KeyPress ) + #endif + + ::oWidget:connect( "valueChanged(int)" ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD XbpSpinButton:destroy() + ::disconnect() ::xbpWindow:destroy() RETURN NIL diff --git a/harbour/contrib/hbxbp/xbpstatic.prg b/harbour/contrib/hbxbp/xbpstatic.prg index 10bc490527..aae6c0c6b6 100644 --- a/harbour/contrib/hbxbp/xbpstatic.prg +++ b/harbour/contrib/hbxbp/xbpstatic.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpStatic compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 29Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpstatusbar.prg b/harbour/contrib/hbxbp/xbpstatusbar.prg index 76242e0b3e..5a2263eb1b 100644 --- a/harbour/contrib/hbxbp/xbpstatusbar.prg +++ b/harbour/contrib/hbxbp/xbpstatusbar.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpStatusBar Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpstyle.prg b/harbour/contrib/hbxbp/xbpstyle.prg index 3fef4e5f8d..5e65e6f7c1 100644 --- a/harbour/contrib/hbxbp/xbpstyle.prg +++ b/harbour/contrib/hbxbp/xbpstyle.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -56,9 +56,9 @@ * EkOnkar * ( The LORD is ONE ) * - Class XbpStyle() + * Class XbpStyle() * - * Pritpal Bedi + * Pritpal Bedi * 21Jun2009 */ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptabpage.prg b/harbour/contrib/hbxbp/xbptabpage.prg index 988372751a..dc3fb17cbd 100644 --- a/harbour/contrib/hbxbp/xbptabpage.prg +++ b/harbour/contrib/hbxbp/xbptabpage.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpTabPage compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 14Jun2009 */ /*----------------------------------------------------------------------*/ @@ -145,8 +145,8 @@ METHOD XbpTabPage:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) IF ::visible ::show() ENDIF - oPar:addChild( SELF ) + ::postCreate() RETURN Self @@ -330,16 +330,15 @@ METHOD XbpTabWidget:destroy() /*----------------------------------------------------------------------*/ METHOD XbpTabWidget:execSlot( cSlot, p ) - LOCAL qTab, nIndex, oTab, pWidget, qPoint, qApp - LOCAL iIndex + LOCAL qTab, nIndex, oTab, qWidget, qPoint, iIndex IF hb_isPointer( p ) qPoint := ::oWidget:mapToGlobal( p ) - qApp := QApplication() - pWidget := qApp:widgetAt( qPoint ) + qWidget := QApplication():widgetAt( qPoint ) - iIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, pWidget:pPtr ) } ) - 1 -HB_TRACE( HB_TR_DEBUG, "iIndex", iIndex, pWidget:objectName() ) + iIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, qWidget:pPtr ) } ) - 1 +// iIndex := ascan( ::aChildren, {|o| hbqt_areEqualObjects( o:oWidget, qWidget ) } ) - 1 +HB_TRACE( HB_TR_ALWAYS, "iIndex", iIndex, qWidget:objectName() ) ELSE iIndex := p ENDIF @@ -348,6 +347,8 @@ HB_TRACE( HB_TR_DEBUG, "iIndex", iIndex, pWidget:objectName() ) qTab := ::oWidget:widget( iIndex ) IF ( nIndex := ascan( ::aChildren, {|o| hbqt_IsEqualGcQtPointer( o:oWidget:pPtr, qTab:pPtr ) } ) ) > 0 +// IF ( nIndex := ascan( ::aChildren, {|o| hbqt_areEqualObjects( o:oWidget, qTab ) } ) ) > 0 +//HB_TRACE( HB_TR_ALWAYS, "hurray", iIndex, nIndex ) oTab := ::aChildren[ nIndex ] DO CASE diff --git a/harbour/contrib/hbxbp/xbptoolbar.prg b/harbour/contrib/hbxbp/xbptoolbar.prg index b2657a4568..c1618dfeaa 100644 --- a/harbour/contrib/hbxbp/xbptoolbar.prg +++ b/harbour/contrib/hbxbp/xbptoolbar.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpToolBar Compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 13Jun2009 */ /*----------------------------------------------------------------------*/ @@ -189,6 +189,7 @@ METHOD XbpToolbar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ENDIF ::oParent:AddChild( SELF ) ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbptreeview.prg b/harbour/contrib/hbxbp/xbptreeview.prg index 2588134a5b..dc94457bd2 100644 --- a/harbour/contrib/hbxbp/xbptreeview.prg +++ b/harbour/contrib/hbxbp/xbptreeview.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2009 Pritpal Bedi + * Copyright 2009-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ xbpTreeView compatible Class * - * Pritpal Bedi + * Pritpal Bedi * 20Jun2009 */ /*----------------------------------------------------------------------*/ @@ -161,13 +161,13 @@ METHOD XbpTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::oRootItem:oWidget := ::oWidget:invisibleRootItem() ::connect() - ::setPosAndSize() IF ::visible ::show() ENDIF ::oParent:AddChild( SELF ) ::postCreate() + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbxbp/xbpwindow.prg b/harbour/contrib/hbxbp/xbpwindow.prg index df8cb2927f..b5d0edc249 100644 --- a/harbour/contrib/hbxbp/xbpwindow.prg +++ b/harbour/contrib/hbxbp/xbpwindow.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Source file for the Xbp*Classes * - * Copyright 2008 Pritpal Bedi + * Copyright 2008-2010 Pritpal Bedi * http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ * * Xbase++ Compatible xbpWindow Class * - * Pritpal Bedi + * Pritpal Bedi * 29May2009 */ /*----------------------------------------------------------------------*/ @@ -1285,7 +1285,9 @@ METHOD XbpWindow:currentSize() METHOD XbpWindow:getHWND() - RETURN ::oWidget:pPtr + MsgBox( "hbQT is a not a Windows only solution !" ) + + RETURN NIL /*----------------------------------------------------------------------*/