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