|
|
|
@ -36,7 +36,7 @@ using namespace Diff2;
|
|
|
|
|
|
|
|
|
|
KompareSplitter::KompareSplitter( ViewSettings *settings, TQWidget * tqparent,
|
|
|
|
|
const char *name) :
|
|
|
|
|
KQSplitter(Qt::Horizontal, tqparent, name ),
|
|
|
|
|
TQSplitter(Qt::Horizontal, tqparent, name ),
|
|
|
|
|
m_settings( settings )
|
|
|
|
|
{
|
|
|
|
|
TQFrame *scrollFrame = new TQFrame( tqparent, "scrollFrame" );
|
|
|
|
@ -99,17 +99,17 @@ KompareSplitter::~KompareSplitter(){}
|
|
|
|
|
\a prepend is TRUE, then recalcId() is very probably needed.)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
KQSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool prepend )
|
|
|
|
|
TQSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool prepend )
|
|
|
|
|
{
|
|
|
|
|
/* This function is *not* a good place to make connections to and from
|
|
|
|
|
* the KompareListView. Make them in the KompareListViewFrame constructor
|
|
|
|
|
* instad - that way the connections get made upon creation, not upon the
|
|
|
|
|
* next processing of the event queue. */
|
|
|
|
|
|
|
|
|
|
KQSplitterLayoutStruct *s;
|
|
|
|
|
TQSplitterLayoutStruct *s;
|
|
|
|
|
KompareConnectWidgetFrame *newHandle = 0;
|
|
|
|
|
if ( d->list.count() > 0 ) {
|
|
|
|
|
s = new KQSplitterLayoutStruct;
|
|
|
|
|
s = new TQSplitterLayoutStruct;
|
|
|
|
|
s->resizeMode = KeepSize;
|
|
|
|
|
TQString tmp = "qt_splithandle_";
|
|
|
|
|
tmp += w->name();
|
|
|
|
@ -127,7 +127,7 @@ KQSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, boo
|
|
|
|
|
else
|
|
|
|
|
d->list.append( s );
|
|
|
|
|
}
|
|
|
|
|
s = new KQSplitterLayoutStruct;
|
|
|
|
|
s = new TQSplitterLayoutStruct;
|
|
|
|
|
s->resizeMode = DefaultResizeMode;
|
|
|
|
|
s->wid = w;
|
|
|
|
|
s->isHandle = FALSE;
|
|
|
|
@ -153,7 +153,7 @@ void KompareSplitter::childEvent( TQChildEvent *c )
|
|
|
|
|
if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
KQSplitterLayoutStruct *s = d->list.first();
|
|
|
|
|
TQSplitterLayoutStruct *s = d->list.first();
|
|
|
|
|
while ( s ) {
|
|
|
|
|
if ( s->wid == c->child() )
|
|
|
|
|
return;
|
|
|
|
@ -162,10 +162,10 @@ void KompareSplitter::childEvent( TQChildEvent *c )
|
|
|
|
|
addWidget( (KompareListViewFrame*)c->child() );
|
|
|
|
|
recalc( isVisible() );
|
|
|
|
|
} else if ( c->type() == TQEvent::ChildRemoved ) {
|
|
|
|
|
KQSplitterLayoutStruct *prev = 0;
|
|
|
|
|
TQSplitterLayoutStruct *prev = 0;
|
|
|
|
|
if ( d->list.count() > 1 )
|
|
|
|
|
prev = d->list.at( 1 ); // yes, this is correct
|
|
|
|
|
KQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
TQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
while ( curr ) {
|
|
|
|
|
if ( curr->wid == c->child() ) {
|
|
|
|
|
d->list.removeRef( curr );
|
|
|
|
@ -218,7 +218,7 @@ static TQPoint bottomRight( TQWidget *w )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::moveSplitter( TQCOORD p, int id )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *s = d->list.at( id );
|
|
|
|
|
TQSplitterLayoutStruct *s = d->list.at( id );
|
|
|
|
|
int farMin;
|
|
|
|
|
int min;
|
|
|
|
|
int max;
|
|
|
|
@ -259,7 +259,7 @@ void KompareSplitter::moveSplitter( TQCOORD p, int id )
|
|
|
|
|
void KompareSplitter::doMove( bool backwards, int pos, int id, int delta,
|
|
|
|
|
bool mayCollapse, int* positions, int* widths )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *s;
|
|
|
|
|
TQSplitterLayoutStruct *s;
|
|
|
|
|
TQWidget *w;
|
|
|
|
|
for ( ; id >= 0 && id < (int)d->list.count();
|
|
|
|
|
id = backwards ? id - delta : id + delta ) {
|
|
|
|
@ -294,7 +294,7 @@ void KompareSplitter::doMove( bool backwards, int pos, int id, int delta,
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotSetSelection( const DiffModel* model, const Difference* diff )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
{
|
|
|
|
|
if ( curr->isHandle )
|
|
|
|
@ -314,7 +314,7 @@ void KompareSplitter::slotSetSelection( const DiffModel* model, const Difference
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotSetSelection( const Difference* diff )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( curr->isHandle )
|
|
|
|
|
((KompareConnectWidgetFrame*)
|
|
|
|
@ -328,7 +328,7 @@ void KompareSplitter::slotSetSelection( const Difference* diff )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotApplyDifference( bool apply )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
((KompareListViewFrame*)
|
|
|
|
@ -338,7 +338,7 @@ void KompareSplitter::slotApplyDifference( bool apply )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotApplyAllDifferences( bool apply )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
((KompareListViewFrame*)
|
|
|
|
@ -349,7 +349,7 @@ void KompareSplitter::slotApplyAllDifferences( bool apply )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotApplyDifference( const Difference* diff, bool apply )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
((KompareListViewFrame*)
|
|
|
|
@ -359,7 +359,7 @@ void KompareSplitter::slotApplyDifference( const Difference* diff, bool apply )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotDifferenceClicked( const Difference* diff )
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
((KompareListViewFrame*)
|
|
|
|
@ -369,7 +369,7 @@ void KompareSplitter::slotDifferenceClicked( const Difference* diff )
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotConfigChanged()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() ) {
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
{
|
|
|
|
@ -385,7 +385,7 @@ void KompareSplitter::slotConfigChanged()
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::slotDelayedRepaintHandles()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( curr->isHandle )
|
|
|
|
|
((KompareConnectWidgetFrame*)curr->wid)->wid()->slotDelayedRepaint();
|
|
|
|
@ -393,7 +393,7 @@ void KompareSplitter::slotDelayedRepaintHandles()
|
|
|
|
|
|
|
|
|
|
void KompareSplitter::repaintHandles()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( curr->isHandle )
|
|
|
|
|
((KompareConnectWidgetFrame*)curr->wid)->wid()->tqrepaint();
|
|
|
|
@ -557,7 +557,7 @@ void KompareSplitter::slotUpdateVScrollValue()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::scrollId()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
TQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
return ((KompareListViewFrame*) curr->wid)->view()->scrollId();
|
|
|
|
@ -566,7 +566,7 @@ int KompareSplitter::scrollId()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::lineSpacing()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
TQSplitterLayoutStruct *curr = d->list.first();
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
|
return ((KompareListViewFrame*)
|
|
|
|
@ -576,7 +576,7 @@ int KompareSplitter::lineSpacing()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::pageSize()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
{
|
|
|
|
|
if ( !curr->isHandle )
|
|
|
|
@ -590,7 +590,7 @@ int KompareSplitter::pageSize()
|
|
|
|
|
|
|
|
|
|
bool KompareSplitter::needVScrollBar()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int pagesize = pageSize();
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
{
|
|
|
|
@ -607,7 +607,7 @@ bool KompareSplitter::needVScrollBar()
|
|
|
|
|
int KompareSplitter::minVScrollId()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int min = -1;
|
|
|
|
|
int mSId;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
@ -623,7 +623,7 @@ int KompareSplitter::minVScrollId()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::maxVScrollId()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int max = 0;
|
|
|
|
|
int mSId;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
@ -640,7 +640,7 @@ int KompareSplitter::maxVScrollId()
|
|
|
|
|
|
|
|
|
|
bool KompareSplitter::needHScrollBar()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|
{
|
|
|
|
|
if( !curr->isHandle )
|
|
|
|
@ -655,7 +655,7 @@ bool KompareSplitter::needHScrollBar()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::maxHScrollId()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int max = 0;
|
|
|
|
|
int mHSId;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
@ -673,7 +673,7 @@ int KompareSplitter::maxHScrollId()
|
|
|
|
|
|
|
|
|
|
int KompareSplitter::maxContentsX()
|
|
|
|
|
{
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int max = 0;
|
|
|
|
|
int mCX;
|
|
|
|
|
for ( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
@ -695,7 +695,7 @@ int KompareSplitter::minVisibleWidth()
|
|
|
|
|
// despite the fact that *noone* has a pgright and pgleft key :P
|
|
|
|
|
// But we do have mousewheels with horizontal scrolling functionality,
|
|
|
|
|
// pressing shift and scrolling then goes left and right one page at the time
|
|
|
|
|
KQSplitterLayoutStruct *curr;
|
|
|
|
|
TQSplitterLayoutStruct *curr;
|
|
|
|
|
int min = -1;
|
|
|
|
|
int vW;
|
|
|
|
|
for( curr = d->list.first(); curr; curr = d->list.next() )
|
|
|
|
|