2012-08-06 17:09 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbide/sources.prg
    % Remoded: redundant code parts and organized with more options.

  * contrib/hbqt/qtgui/hbqtgui.hbx
  * contrib/hbqt/qtgui/qth/filelist.hbm
  + contrib/hbqt/qtgui/qth/QToolTip.qth
    + Added: class QToolTip(). Note that this class is usable from within
       QEvent_ToolTip signal which will post QHelpEvent() object like:
        oWidget:connect( QEvent_ToolTip, {|oEvent| ::execEvent( QEvent_Help, oEvent ) } )
           Then 
        METHOD myClass:execEvent( nEvent, oEvent )
           LOCAL oToolTip
           IF oEvent:type() == QEvent_ToolTip 
              oToolTip := QToolTip()
              oToolTip:setText( "some other text" )
              RETURN .T.  /* To stop the event chain */
           ENDIF 
           RETURN .F.
This commit is contained in:
Pritpal Bedi
2012-08-07 00:12:34 +00:00
parent 06a094209c
commit 238893024f
5 changed files with 139 additions and 7 deletions

View File

@@ -16,6 +16,26 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-08-06 17:09 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/sources.prg
% Remoded: redundant code parts and organized with more options.
* contrib/hbqt/qtgui/hbqtgui.hbx
* contrib/hbqt/qtgui/qth/filelist.hbm
+ contrib/hbqt/qtgui/qth/QToolTip.qth
+ Added: class QToolTip(). Note that this class is usable from within
QEvent_ToolTip signal which will post QHelpEvent() object like:
oWidget:connect( QEvent_ToolTip, {|oEvent| ::execEvent( QEvent_Help, oEvent ) } )
Then
METHOD myClass:execEvent( nEvent, oEvent )
LOCAL oToolTip
IF oEvent:type() == QEvent_ToolTip
oToolTip := QToolTip()
oToolTip:setText( "some other text" )
RETURN .T. /* To stop the event chain */
ENDIF
RETURN .F.
2012-08-04 21:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/tools.prg
+ Implemented: removal of a editng panel with confirmation.

View File

@@ -483,17 +483,27 @@ METHOD IdeSourcesManager:openSource()
/*----------------------------------------------------------------------*/
METHOD IdeSourcesManager:selectSource( cMode, cFile, cTitle, cDftPath )
LOCAL oDlg, cPath
LOCAL oDlg, cPath, aFltr := {}
DEFAULT cDftPath TO ::cLastFileOpenPath
AAdd( aFltr, { "All Files" , "*.*" } )
AAdd( aFltr, { "PRG Sources", "*.prg" } )
AAdd( aFltr, { "C Sources" , "*.c" } )
AAdd( aFltr, { "CPP Sources", "*.cpp" } )
AAdd( aFltr, { "H Headers" , "*.h" } )
AAdd( aFltr, { "CH Headers" , "*.ch" } )
AAdd( aFltr, { "UI Files" , "*.ui" } )
AAdd( aFltr, { "QRC Files" , "*.qrc" } )
AAdd( aFltr, { "HBC Files" , "*.hbc" } )
oDlg := XbpFileDialog():new():create( ::oDlg, , { 10,10 } )
IF cMode == "open"
oDlg:title := "Select a Source File"
oDlg:center := .t.
oDlg:fileFilters := { { "All Files" , "*.*" }, { "PRG Sources", "*.prg" }, { "C Sources" , "*.c" },;
{ "CPP Sources", "*.cpp" }, { "H Headers" , "*.h" }, { "CH Headers", "*.ch" } }
oDlg:fileFilters := aFltr
cFile := oDlg:open( cDftPath, , .f. )
IF !empty( cFile )
::oIde:cLastFileOpenPath := cFile
@@ -503,8 +513,8 @@ METHOD IdeSourcesManager:selectSource( cMode, cFile, cTitle, cDftPath )
oDlg:title := "Select Sources"
oDlg:center := .t.
oDlg:defExtension:= 'prg'
oDlg:fileFilters := { { "All Files" , "*.*" }, { "PRG Sources", "*.prg" }, { "C Sources" , "*.c" },;
{ "CPP Sources", "*.cpp" }, { "H Headers" , "*.h" }, { "CH Headers", "*.ch" } }
oDlg:fileFilters := aFltr
cFile := oDlg:open( cDftPath, , .t. )
IF !empty( cFile ) .AND. !empty( cFile[ 1 ] )
::oIde:cLastFileOpenPath := cFile[ 1 ]
@@ -523,8 +533,7 @@ METHOD IdeSourcesManager:selectSource( cMode, cFile, cTitle, cDftPath )
Endif
Endif
oDlg:fileFilters := { { "PRG Sources", "*.prg" }, { "C Sources", "*.c" }, { "CPP Sources", "*.cpp" }, ;
{ "H Headers", "*.h" }, { "CH Headers", "*.ch" } }
oDlg:fileFilters := aFltr
cFile := oDlg:saveAs( cPath )
ELSE

View File

@@ -290,6 +290,7 @@ DYNAMIC HB_QTIMEEDIT
DYNAMIC HB_QTOOLBAR
DYNAMIC HB_QTOOLBOX
DYNAMIC HB_QTOOLBUTTON
DYNAMIC HB_QTOOLTIP
DYNAMIC HB_QTRANSFORM
DYNAMIC HB_QTREEVIEW
DYNAMIC HB_QTREEWIDGET
@@ -551,6 +552,7 @@ DYNAMIC QTIMEEDIT
DYNAMIC QTOOLBAR
DYNAMIC QTOOLBOX
DYNAMIC QTOOLBUTTON
DYNAMIC QTOOLTIP
DYNAMIC QTRANSFORM
DYNAMIC QTREEVIEW
DYNAMIC QTREEWIDGET

View File

@@ -0,0 +1,100 @@
/*
* $Id$
*/
/*
* Harbour Qt wrapper generator control file
*
* Copyright 2009-2012 Pritpal Bedi <bedipritpal@hotmail.com>
* www - http://www.harbour-project.org
*
* See COPYING for licensing terms.
*/
<CLASS>
Inherit =
New =
QObject = no
</CLASS>
<CODE>
#include <QtGui/QToolTip>
/*
* QToolTip()
* ~QToolBox ()
*/
HB_FUNC( QT_QTOOLTIP )
{
HB_FUNC_EXEC( HB_QTOOLTIP );
}
</CODE>
<PROTOS>
QFont font (){
hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, new QFont( QToolTip::font() ), "HB_QFONT", hbqt_del_QFont, HBQT_BIT_OWNER ) );
}
void hideText (){
QToolTip::hideText();
}
bool isVisible (){
hb_retl( QToolTip::isVisible() );
}
QPalette palette (){
hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, new QPalette( QToolTip::palette() ), "HB_QPALETTE", hbqt_del_QFont, HBQT_BIT_OWNER ) );
}
void setFont ( const QFont & font ){
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "HB_QFONT" ) )
{
QToolTip::setFont( *hbqt_par_QFont( 1 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
void setPalette ( const QPalette & palette ){
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "HB_QPALETTE" ) )
{
QToolTip::setPalette( *hbqt_par_QPalette( 1 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
void showText ( const QPoint & pos, const QString & text, QWidget * w, const QRect & rect ){
if( hb_pcount() == 4 && hbqt_par_isDerivedFrom( 1, "QPOINT" ) && HB_ISCHAR( 2 ) && hbqt_par_isDerivedFrom( 3, "QWIDGET" ) && hbqt_par_isDerivedFrom( 4, "QRECT" ) )
{
void * pText01 = NULL;
QToolTip::showText( *hbqt_par_QPoint( 1 ), ( QString ) hb_parstr_utf8( 2, &pText01, NULL ), hbqt_par_QWidget( 3 ), *hbqt_par_QRect( 4 ) );
hb_strfree( pText01 );
}
else if( hb_pcount() == 3 && hbqt_par_isDerivedFrom( 1, "QPOINT" ) && HB_ISCHAR( 2 ) && hbqt_par_isDerivedFrom( 3, "QWIDGET" ) )
{
void * pText01 = NULL;
QToolTip::showText( *hbqt_par_QPoint( 1 ), ( QString ) hb_parstr_utf8( 2, &pText01, NULL ), hbqt_par_QWidget( 3 ) );
hb_strfree( pText01 );
}
else if( hb_pcount() == 2 && hbqt_par_isDerivedFrom( 1, "QPOINT" ) && HB_ISCHAR( 2 ) )
{
void * pText01 = NULL;
QToolTip::showText( *hbqt_par_QPoint( 1 ), ( QString ) hb_parstr_utf8( 2, &pText01, NULL ) );
hb_strfree( pText01 );
}
else
{
hb_errRT_BASE( EG_ARG, 9999, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
QString text (){
hb_retstr_utf8( QToolTip::text().toUtf8().data() );
}
</PROTOS>
<SLOTS>
</SLOTS>
<SIGNALS>
</SIGNALS>

View File

@@ -277,3 +277,4 @@ QWindowsStyle.qth
QWindowStateChangeEvent.qth
QWizard.qth
QWizardPage.qth
QToolTip.qth