2010-01-18 17:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbqt/hbqt_base.cpp
  * contrib/hbqt/hbqt_hbevents.cpp
  * contrib/hbqt/hbqt_hbslots.cpp
    ! HB_TRUE/FALSE <=> true/false.

  * contrib/hbide/hbide.prg
  * contrib/hbide/ideeditor.prg
    ! Updated to manage split windows properly.
      Presently the behavior is as such:
        Horizontal Split - Top row is columns are splitted
        Vertical Split - More row is added at the bottom.
        Delete Splitted Window - Focus is always shifted to 
           main edit window. i.e., parent of all.
      Please comment.
This commit is contained in:
Pritpal Bedi
2010-01-19 02:03:23 +00:00
parent 67c143f7f4
commit 146b37e8e5
6 changed files with 99 additions and 34 deletions

View File

@@ -17,6 +17,22 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-18 17:52 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/hbqt_base.cpp
* contrib/hbqt/hbqt_hbevents.cpp
* contrib/hbqt/hbqt_hbslots.cpp
! HB_TRUE/FALSE <=> true/false.
* contrib/hbide/hbide.prg
* contrib/hbide/ideeditor.prg
! Updated to manage split windows properly.
Presently the behavior is as such:
Horizontal Split - Top row is columns are splitted
Vertical Split - More row is added at the bottom.
Delete Splitted Window - Focus is always shifted to
main edit window. i.e., parent of all.
Please comment.
2010-01-19 00:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/gtwvt/gtwvt.c
* contrib/gtwvg/gtwvg.c

View File

@@ -365,6 +365,10 @@ METHOD HbIde:create( cProjIni )
ENDIF
ENDCASE
ELSEIF ::nEvent == xbeM_Wheel
::oEM:zoom( iif( ::mp2[ 2 ] < 0, 1, 0 ) )
ENDIF
::oXbp:handleEvent( ::nEvent, ::mp1, ::mp2 )

View File

@@ -579,11 +579,12 @@ METHOD IdeEditsManager:insertText( cKey )
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:zoom( nKey )
LOCAL nPointSize, oEdit, qFont
LOCAL nPointSize, qFont, oEdit, oEditor
IF empty( oEdit := ::getEditObjectCurrent() )
IF empty( oEditor := ::getEditorCurrent() )
RETURN Self
ENDIF
oEdit := oEditor:oEdit
qFont := QFont():configure( oEdit:qEdit:font() )
qFont:setFamily( "Courier New" )
@@ -593,10 +594,15 @@ METHOD IdeEditsManager:zoom( nKey )
IF nPointSize > 4 .AND. nPointSize < 37
qFont:setPointSize( nPointSize )
oEdit:qEdit:setFont( qFont )
oEdit:qLineNos:setFont( qFont )
ENDIF
FOR EACH oEdit IN oEditor:aEdits
oEdit:qEdit:setFont( qFont )
oEdit:qLineNos:setFont( qFont )
NEXT
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
@@ -739,6 +745,7 @@ CLASS IdeEditor INHERIT IdeObject
METHOD new( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
METHOD create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
METHOD split( nOrient, oEditP )
METHOD relay( oEdit )
METHOD destroy()
METHOD exeEvent( nMode, o, p, p1, p2 )
METHOD setDocumentProperties()
@@ -860,25 +867,56 @@ METHOD IdeEditor:exeEvent( nMode, o, p, p1, p2 )
/*----------------------------------------------------------------------*/
METHOD IdeEditor:relay( oEdit )
LOCAL nCols, oEdt, nR, nC
::qLayout:removeItem( ::oEdit:qHLayout )
FOR EACH oEdt IN ::aEdits
::qLayout:removeItem( oEdt:qHLayout )
//
oEdt:qHLayout:removeWidget( oEdt:qLineNos )
oEdt:qHLayout:removeWidget( oEdt:qEdit )
oEdt:qHLayout := QHBoxLayout():new()
oEdt:qHLayout:addWidget( oEdt:qLineNos )
oEdt:qHLayout:addWidget( oEdt:qEdit )
NEXT
IF hb_isObject( oEdit )
aadd( ::aEdits, oEdit )
ENDIF
::qLayout:addLayout( ::oEdit:qHLayout, 0, 0 )
// Now we know how many rows and columns
//
nR := 0 ; nC := 0
FOR EACH oEdt IN ::aEdits
IF oEdt:nOrient == 1 // Horiz
nC++
::qLayout:addLayout_1( oEdt:qHLayout, 0, nC, 1, 1, Qt_Vertical )
ENDIF
NEXT
nCols := ::qLayout:columnCount()
FOR EACH oEdt IN ::aEdits
IF oEdt:nOrient == 2 // Verti
nR++
::qLayout:addLayout_1( oEdt:qHLayout, nR, 0, 1, nCols, Qt_Horizontal )
ENDIF
NEXT
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEditor:split( nOrient, oEditP )
LOCAL oEdit, nRows, nCols
LOCAL oEdit
HB_SYMBOL_UNUSED( oEditP )
HB_SYMBOL_UNUSED( nOrient )
oEdit := IdeEdit():new( Self, 1 ):create()
oEdit:qEdit:setDocument( ::qDocument )
oEdit:nOrient := nOrient
aadd( ::aEdits, oEdit )
nRows := ::qLayout:rowCount()
nCols := ::qLayout:columnCount()
IF nOrient == 1
::qLayout:addLayout( oEdit:qHLayout, nRows -1 , nCols )
ELSEIF nOrient == 2
::qLayout:addLayout( oEdit:qHLayout, nRows, nCols - 1 )
ENDIF
::relay( oEdit )
RETURN Self
@@ -1078,6 +1116,7 @@ CLASS IdeEdit INHERIT IdeObject
DATA qEdit
DATA qHLayout
DATA qLineNos
DATA nOrient INIT 0
DATA nMode INIT 0
DATA nLineNo INIT -99
@@ -1177,6 +1216,8 @@ METHOD IdeEdit:destroy()
::disConnectEditSlots( Self )
::oEditor:qLayout:removeItem( ::qHLayout )
//
::qHLayout:removeWidget( ::qEdit )
::qHLayout:removeWidget( ::qLineNos )
@@ -1186,7 +1227,7 @@ METHOD IdeEdit:destroy()
//::qEdit:pPtr := 0
::qEdit := NIL
::qHLayout:pPtr := 0
//::qHLayout:pPtr := 0
::qHLayout := NIL
RETURN Self
@@ -1250,6 +1291,10 @@ METHOD IdeEdit:exeEvent( nMode, oEdit, o, p, p1 )
oo := ::oEditor:aEdits[ n ]
hb_adel( ::oEditor:aEdits, n, .t. )
oo:destroy()
::oEditor:relay()
::oEditor:qCqEdit := ::oEditor:qEdit
::oEditor:qCoEdit := ::oEditor:oEdit
::oIde:manageFocusInEditor()
ENDIF
CASE qAct:text() == "Apply Theme"
::oEditor:applyTheme()

View File

@@ -83,9 +83,9 @@ HB_FUNC( HBQT_ISEMPTYQTPOINTER )
QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
if( p && p->ph )
hb_retl( false );
hb_retl( HB_FALSE );
else
hb_retl( true );
hb_retl( HB_TRUE );
}
HB_FUNC( HBQT_ISEQUALGCQTPOINTER )
@@ -98,14 +98,14 @@ HB_FUNC( HBQT_ISEQUALGCQTPOINTER )
if( p->ph && q->ph )
hb_retl( p->ph == q->ph );
else
hb_retl( false );
hb_retl( HB_FALSE );
}
else
{
if( p && p->ph )
hb_retl( p->ph == hb_parptr( 2 ) );
else
hb_retl( false );
hb_retl( HB_FALSE );
}
}

View File

@@ -110,9 +110,9 @@ bool HBEvents::hbConnect( PHB_ITEM pObj, int iEvent, PHB_ITEM bBlock )
object->setProperty( prop, ( int ) listBlock.size() );
return HB_TRUE;
return true;
}
return HB_FALSE;
return false;
}
bool HBEvents::hbDisconnect( PHB_ITEM pObj, int iEvent )
@@ -135,10 +135,10 @@ bool HBEvents::hbDisconnect( PHB_ITEM pObj, int iEvent )
object->setProperty( prop, QVariant() );
HB_TRACE( HB_TR_DEBUG, ( " QT_EVENTS_DISCONNECT: %i", iEvent ) );
return HB_TRUE;
return true;
}
}
return HB_FALSE;
return false;
}
bool HBEvents::hbClear()
@@ -156,7 +156,7 @@ bool HBEvents::hbClear()
}
}
listBlock.clear();
return HB_TRUE;
return true;
}
bool HBEvents::eventFilter( QObject * object, QEvent * event )

View File

@@ -678,11 +678,11 @@ bool HBSlots::isConnected( QObject * object, const char * slot )
{
if( object->property( slot ).toInt() == i + 1 )
{
return HB_TRUE;
return true;
}
}
}
return HB_FALSE;
return false;
}
bool HBSlots::hbConnect( PHB_ITEM pObj, const char * slot, PHB_ITEM bBlock )
@@ -690,7 +690,8 @@ bool HBSlots::hbConnect( PHB_ITEM pObj, const char * slot, PHB_ITEM bBlock )
HB_SYMBOL_UNUSED( pObj );
HB_SYMBOL_UNUSED( bBlock );
QObject * object = ( QObject * ) hbqt_pPtrFromItem( pObj ); /* get sender */
//QObject * object = ( QObject * ) hbqt_pPtrFromItem( pObj ); /* get sender */
QObject * object = ( QObject * ) hbqt_pPtrFromObj( 1 ); /* get sender */
if( object )
{
@@ -701,19 +702,18 @@ HB_TRACE( HB_TR_ALWAYS, ( "AAA 3 %s %p", slot, object ) );
HB_TRACE( HB_TR_ALWAYS, ( "AAA 4" ) );
if( bConnected )
{
//PHB_ITEM pBlock = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) ); /* get codeblock */
PHB_ITEM pBlock = hb_itemNew( bBlock ); /* get codeblock */
HB_TRACE( HB_TR_ALWAYS, ( "AAA 5" ) );
listBlock << pBlock;
listObj << object;
object->setProperty( hb_parcx( 2 ), ( int ) listBlock.size() );
object->setProperty( slot, ( int ) listBlock.size() );
return HB_TRUE;
return true;
}
}
}
return HB_FALSE;
return false;
}
bool HBSlots::hbDisconnect( PHB_ITEM pObj, const char * signal )
@@ -739,7 +739,7 @@ bool HBSlots::hbDisconnect( PHB_ITEM pObj, const char * signal )
return bRet;
}
}
return HB_FALSE;
return false;
}
bool HBSlots::hbClear()
@@ -755,7 +755,7 @@ bool HBSlots::hbClear()
}
}
listBlock.clear();
return HB_TRUE;
return true;
}
/* Generic Key and Mouse Events emitted by subclass objects */
void HBSlots::customContextMenuRequested( const QPoint & pos ) { hbqt_SlotsExecQPoint( this, qobject_cast<QObject *>( sender() ), "customContextMenuRequested(QPoint)", pos ); }