|
|
|
@ -907,7 +907,7 @@ void MainWindow::showProperties( TQObject *o )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( currentTool() == POINTER_TOOL && fw &&
|
|
|
|
|
( !qworkspace->activeWindow() || !::tqqt_cast<SourceEditor*>(qworkspace->activeWindow()) ) )
|
|
|
|
|
( !qworkspace->activeWindow() || !::tqt_cast<SourceEditor*>(qworkspace->activeWindow()) ) )
|
|
|
|
|
fw->setFocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -924,21 +924,21 @@ void MainWindow::updateProperties( TQObject * )
|
|
|
|
|
|
|
|
|
|
bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
{
|
|
|
|
|
if ( ::tqqt_cast<MenuBarEditor*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ||
|
|
|
|
|
if ( ::tqt_cast<MenuBarEditor*>(o) || ::tqt_cast<PopupMenuEditor*>(o) ||
|
|
|
|
|
( o &&
|
|
|
|
|
( ::tqqt_cast<MenuBarEditor*>(o->parent()) ||
|
|
|
|
|
::tqqt_cast<PopupMenuEditor*>(o->parent()) ) ) ) {
|
|
|
|
|
( ::tqt_cast<MenuBarEditor*>(o->parent()) ||
|
|
|
|
|
::tqt_cast<PopupMenuEditor*>(o->parent()) ) ) ) {
|
|
|
|
|
|
|
|
|
|
if ( e->type() == TQEvent::Accel && ::tqqt_cast<PopupMenuEditor*>(o) ) {
|
|
|
|
|
if ( e->type() == TQEvent::Accel && ::tqt_cast<PopupMenuEditor*>(o) ) {
|
|
|
|
|
return TRUE; // consume accel events
|
|
|
|
|
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<MenuBarEditor*>(o) ) {
|
|
|
|
|
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqt_cast<MenuBarEditor*>(o) ) {
|
|
|
|
|
TQPoint pos = ((TQMouseEvent*)e)->pos();
|
|
|
|
|
MenuBarEditor *m = ::tqqt_cast<MenuBarEditor*>(o);
|
|
|
|
|
MenuBarEditor *m = ::tqt_cast<MenuBarEditor*>(o);
|
|
|
|
|
showProperties( o );
|
|
|
|
|
if ( m->findItem( pos ) >= m->count() )
|
|
|
|
|
m->setFocus();
|
|
|
|
|
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<PopupMenuEditor*>(o) ) {
|
|
|
|
|
PopupMenuEditor *m = ::tqqt_cast<PopupMenuEditor*>(o);
|
|
|
|
|
} else if ( e->type() == TQEvent::MouseButtonPress && ::tqt_cast<PopupMenuEditor*>(o) ) {
|
|
|
|
|
PopupMenuEditor *m = ::tqt_cast<PopupMenuEditor*>(o);
|
|
|
|
|
PopupMenuEditorItem *i = m->at( ((TQMouseEvent*)e)->pos() );
|
|
|
|
|
if ( m->find( i->action() ) != -1 && !i->isSeparator() )
|
|
|
|
|
showProperties( i->action() );
|
|
|
|
@ -957,7 +957,7 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
( ( (TQKeyEvent*)e )->state() & ShiftButton ) != ShiftButton ) {
|
|
|
|
|
w = (TQWidget*)o;
|
|
|
|
|
while ( w ) {
|
|
|
|
|
if ( ::tqqt_cast<PropertyList*>(w) )
|
|
|
|
|
if ( ::tqt_cast<PropertyList*>(w) )
|
|
|
|
|
break;
|
|
|
|
|
w = w->parentWidget( TRUE );
|
|
|
|
|
}
|
|
|
|
@ -973,7 +973,7 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
( (TQKeyEvent*)e )->key() == Key_E ) &&
|
|
|
|
|
( (TQKeyEvent*)e )->state() & ControlButton ) {
|
|
|
|
|
if ( qWorkspace()->activeWindow() &&
|
|
|
|
|
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
|
|
|
|
|
::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
|
|
|
|
|
( (TQKeyEvent*)e )->ignore();
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
@ -982,44 +982,44 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
case TQEvent::ContextMenu:
|
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
|
if ( o && currentTool() == POINTER_TOOL &&
|
|
|
|
|
( ::tqqt_cast<MenuBarEditor*>(o) ||
|
|
|
|
|
::tqqt_cast<PopupMenuEditor*>(o) ||
|
|
|
|
|
::tqqt_cast<QDesignerToolBar*>(o) ||
|
|
|
|
|
( ::tqqt_cast<TQComboBox*>(o) ||
|
|
|
|
|
::tqqt_cast<TQToolButton*>(o) ||
|
|
|
|
|
::tqqt_cast<QDesignerToolBarSeparator*>(o) ) &&
|
|
|
|
|
( ::tqt_cast<MenuBarEditor*>(o) ||
|
|
|
|
|
::tqt_cast<PopupMenuEditor*>(o) ||
|
|
|
|
|
::tqt_cast<QDesignerToolBar*>(o) ||
|
|
|
|
|
( ::tqt_cast<TQComboBox*>(o) ||
|
|
|
|
|
::tqt_cast<TQToolButton*>(o) ||
|
|
|
|
|
::tqt_cast<QDesignerToolBarSeparator*>(o) ) &&
|
|
|
|
|
o->parent()
|
|
|
|
|
&& ( ::tqqt_cast<QDesignerToolBar*>(o->parent())
|
|
|
|
|
|| ::tqqt_cast<QDesignerWidgetStack*>(o->parent())) ) ) {
|
|
|
|
|
&& ( ::tqt_cast<QDesignerToolBar*>(o->parent())
|
|
|
|
|
|| ::tqt_cast<QDesignerWidgetStack*>(o->parent())) ) ) {
|
|
|
|
|
TQWidget *w = (TQWidget*)o;
|
|
|
|
|
if ( ::tqqt_cast<TQToolButton*>(w) ||
|
|
|
|
|
::tqqt_cast<TQComboBox*>(w) ||
|
|
|
|
|
::tqqt_cast<PopupMenuEditor*>(w) ||
|
|
|
|
|
::tqqt_cast<QDesignerToolBarSeparator*>(w) )
|
|
|
|
|
if ( ::tqt_cast<TQToolButton*>(w) ||
|
|
|
|
|
::tqt_cast<TQComboBox*>(w) ||
|
|
|
|
|
::tqt_cast<PopupMenuEditor*>(w) ||
|
|
|
|
|
::tqt_cast<QDesignerToolBarSeparator*>(w) )
|
|
|
|
|
w = w->parentWidget();
|
|
|
|
|
TQWidget *pw = w->parentWidget();
|
|
|
|
|
while ( pw ) {
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(pw) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(pw) ) {
|
|
|
|
|
( (FormWindow*)pw )->emitShowProperties( TQT_TQOBJECT(w) );
|
|
|
|
|
if ( !::tqqt_cast<QDesignerToolBar*>(o) )
|
|
|
|
|
return ( !::tqqt_cast<TQToolButton*>(o) &&
|
|
|
|
|
!::tqqt_cast<MenuBarEditor*>(o) &&
|
|
|
|
|
!::tqqt_cast<TQComboBox*>(o) &&
|
|
|
|
|
!::tqqt_cast<QDesignerToolBarSeparator*>(o) );
|
|
|
|
|
if ( !::tqt_cast<QDesignerToolBar*>(o) )
|
|
|
|
|
return ( !::tqt_cast<TQToolButton*>(o) &&
|
|
|
|
|
!::tqt_cast<MenuBarEditor*>(o) &&
|
|
|
|
|
!::tqt_cast<TQComboBox*>(o) &&
|
|
|
|
|
!::tqt_cast<QDesignerToolBarSeparator*>(o) );
|
|
|
|
|
}
|
|
|
|
|
pw = pw->parentWidget();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( o && ( ::tqqt_cast<QDesignerToolBar*>(o) || o->inherits("TQDockWindowHandle") )
|
|
|
|
|
if ( o && ( ::tqt_cast<QDesignerToolBar*>(o) || o->inherits("TQDockWindowHandle") )
|
|
|
|
|
&& e->type() == TQEvent::ContextMenu )
|
|
|
|
|
break;
|
|
|
|
|
if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
|
|
|
|
|
break;
|
|
|
|
|
if ( ::tqqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
if ( ::tqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( !w->hasFocus() )
|
|
|
|
|
w->setFocus();
|
|
|
|
@ -1044,11 +1044,11 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
lastPressWidget = 0;
|
|
|
|
|
if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
|
|
|
|
|
break;
|
|
|
|
|
if ( ::tqqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
if ( ::tqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
passiveInteractor = WidgetFactory::isPassiveInteractor( o );
|
|
|
|
|
if ( !passiveInteractor )
|
|
|
|
@ -1064,15 +1064,15 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
break;
|
|
|
|
|
w = isAFormWindowChild( o );
|
|
|
|
|
if ( lastPressWidget != (TQWidget*)o && w &&
|
|
|
|
|
!::tqqt_cast<SizeHandle*>(o) && !::tqqt_cast<OrderIndicator*>(o) &&
|
|
|
|
|
!::tqqt_cast<PopupMenuEditor*>(o) && !::tqqt_cast<TQMenuBar*>(o) &&
|
|
|
|
|
!::tqqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
!::tqt_cast<SizeHandle*>(o) && !::tqt_cast<OrderIndicator*>(o) &&
|
|
|
|
|
!::tqt_cast<PopupMenuEditor*>(o) && !::tqt_cast<TQMenuBar*>(o) &&
|
|
|
|
|
!::tqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
return TRUE;
|
|
|
|
|
if ( o && ::tqqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
if ( o && ::tqt_cast<TQSizeGrip*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( lastPressWidget != (TQWidget*)o ||
|
|
|
|
|
( !w || ::tqqt_cast<SizeHandle*>(o) ) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
( !w || ::tqt_cast<SizeHandle*>(o) ) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
passiveInteractor = WidgetFactory::isPassiveInteractor( o );
|
|
|
|
|
if ( !passiveInteractor )
|
|
|
|
@ -1085,14 +1085,14 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
if ( ( (TQKeyEvent*)e )->key() == Key_Escape && incrementalSearch->hasFocus() ) {
|
|
|
|
|
if ( ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
|
|
|
|
|
if ( ::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
|
|
|
|
|
qWorkspace()->activeWindow()->setFocus();
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
( (FormWindow*)w )->handleKeyPress( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
|
|
|
|
|
if ( ((TQKeyEvent*)e)->isAccepted() )
|
|
|
|
@ -1100,10 +1100,10 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
break;
|
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) ) {
|
|
|
|
|
if ( ::tqqt_cast<TQToolButton*>(o) && ((TQToolButton*)o)->isOn() &&
|
|
|
|
|
o->parent() && ::tqqt_cast<TQToolBar*>(o->parent()) && formWindow() )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) ) {
|
|
|
|
|
if ( ::tqt_cast<TQToolButton*>(o) && ((TQToolButton*)o)->isOn() &&
|
|
|
|
|
o->parent() && ::tqt_cast<TQToolBar*>(o->parent()) && formWindow() )
|
|
|
|
|
formWindow()->setToolFixed();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -1117,8 +1117,8 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
return TRUE;
|
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
( (FormWindow*)w )->handleKeyRelease( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
|
|
|
|
|
if ( ((TQKeyEvent*)e)->isAccepted() )
|
|
|
|
@ -1126,8 +1126,8 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
break;
|
|
|
|
|
case TQEvent::Hide:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( ( (FormWindow*)w )->isWidgetSelected( TQT_TQOBJECT(o) ) )
|
|
|
|
|
( (FormWindow*)w )->selectWidget( TQT_TQOBJECT(o), FALSE );
|
|
|
|
@ -1135,16 +1135,16 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
case TQEvent::Enter:
|
|
|
|
|
case TQEvent::Leave:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) ||
|
|
|
|
|
::tqqt_cast<MenuBarEditor*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) ||
|
|
|
|
|
::tqt_cast<MenuBarEditor*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
return TRUE;
|
|
|
|
|
case TQEvent::Resize:
|
|
|
|
|
case TQEvent::Move:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
if ( WidgetFactory::layoutType( (TQWidget*)o->parent() ) != WidgetFactory::NoLayout ) {
|
|
|
|
|
( (FormWindow*)w )->updateSelection( (TQWidget*)o );
|
|
|
|
@ -1190,33 +1190,33 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
return TRUE;
|
|
|
|
|
case TQEvent::Wheel:
|
|
|
|
|
if ( !( w = isAFormWindowChild( o ) ) ||
|
|
|
|
|
::tqqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
::tqt_cast<SizeHandle*>(o) ||
|
|
|
|
|
::tqt_cast<OrderIndicator*>(o) )
|
|
|
|
|
break;
|
|
|
|
|
return TRUE;
|
|
|
|
|
case TQEvent::FocusIn:
|
|
|
|
|
if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
|
|
|
|
|
if ( !::tqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
|
|
|
|
|
return TRUE; //FIXME
|
|
|
|
|
if ( hierarchyView->formDefinitionView()->isRenaming()
|
|
|
|
|
&& ( o->inherits( "Editor" ) || ::tqqt_cast<FormWindow*>(o) ) )
|
|
|
|
|
&& ( o->inherits( "Editor" ) || ::tqt_cast<FormWindow*>(o) ) )
|
|
|
|
|
TQApplication::sendPostedEvents();
|
|
|
|
|
if ( o->inherits( "Editor" ) ) {
|
|
|
|
|
TQWidget *w = (TQWidget*)o;
|
|
|
|
|
while ( w ) {
|
|
|
|
|
if ( ::tqqt_cast<SourceEditor*>(w) )
|
|
|
|
|
if ( ::tqt_cast<SourceEditor*>(w) )
|
|
|
|
|
break;
|
|
|
|
|
w = w->parentWidget( TRUE );
|
|
|
|
|
}
|
|
|
|
|
if ( ::tqqt_cast<SourceEditor*>(w) )
|
|
|
|
|
if ( ::tqt_cast<SourceEditor*>(w) )
|
|
|
|
|
( (SourceEditor*)w )->checkTimeStamp();
|
|
|
|
|
} else if ( ::tqqt_cast<FormWindow*>(o) ) {
|
|
|
|
|
} else if ( ::tqt_cast<FormWindow*>(o) ) {
|
|
|
|
|
FormWindow *fw = (FormWindow*)o;
|
|
|
|
|
if ( fw->formFile() && fw->formFile()->editor() )
|
|
|
|
|
fw->formFile()->editor()->checkTimeStamp();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TQEvent::FocusOut:
|
|
|
|
|
if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
|
|
|
|
|
if ( !::tqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
|
|
|
|
|
return TRUE;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
@ -1228,10 +1228,10 @@ bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
|
|
|
|
|
|
TQWidget *MainWindow::isAFormWindowChild( TQObject *o ) const
|
|
|
|
|
{
|
|
|
|
|
if ( ::tqqt_cast<TQWizard*>(o->parent()) && !::tqqt_cast<TQPushButton*>(o) )
|
|
|
|
|
if ( ::tqt_cast<TQWizard*>(o->parent()) && !::tqt_cast<TQPushButton*>(o) )
|
|
|
|
|
return 0;
|
|
|
|
|
while ( o ) {
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(o) )
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(o) )
|
|
|
|
|
return (TQWidget*)o;
|
|
|
|
|
o = o->parent();
|
|
|
|
|
}
|
|
|
|
@ -1241,9 +1241,9 @@ TQWidget *MainWindow::isAFormWindowChild( TQObject *o ) const
|
|
|
|
|
TQWidget *MainWindow::isAToolBarChild( TQObject *o ) const
|
|
|
|
|
{
|
|
|
|
|
while ( o ) {
|
|
|
|
|
if ( ::tqqt_cast<QDesignerToolBar*>(o) )
|
|
|
|
|
if ( ::tqt_cast<QDesignerToolBar*>(o) )
|
|
|
|
|
return (TQWidget*)o;
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(o) )
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(o) )
|
|
|
|
|
return 0;
|
|
|
|
|
o = o->parent();
|
|
|
|
|
}
|
|
|
|
@ -1254,7 +1254,7 @@ FormWindow *MainWindow::formWindow()
|
|
|
|
|
{
|
|
|
|
|
if ( qworkspace->activeWindow() ) {
|
|
|
|
|
FormWindow *fw = 0;
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(qworkspace->activeWindow()) )
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(qworkspace->activeWindow()) )
|
|
|
|
|
fw = (FormWindow*)qworkspace->activeWindow();
|
|
|
|
|
else if ( lastActiveFormWindow &&
|
|
|
|
|
qworkspace->windowList().find( lastActiveFormWindow ) != -1)
|
|
|
|
@ -1366,7 +1366,7 @@ bool MainWindow::unregisterClient( FormWindow *w )
|
|
|
|
|
void MainWindow::activeWindowChanged( TQWidget *w )
|
|
|
|
|
{
|
|
|
|
|
TQWidget *old = formWindow();
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
FormWindow *fw = (FormWindow*)w;
|
|
|
|
|
FormWindow *ofw = lastActiveFormWindow;
|
|
|
|
|
lastActiveFormWindow = fw;
|
|
|
|
@ -1380,13 +1380,13 @@ void MainWindow::activeWindowChanged( TQWidget *w )
|
|
|
|
|
}
|
|
|
|
|
workspace()->activeFormChanged( fw );
|
|
|
|
|
setAppropriate( (TQDockWindow*)actionEditor->parentWidget(),
|
|
|
|
|
::tqqt_cast<TQMainWindow*>(lastActiveFormWindow->mainContainer()) );
|
|
|
|
|
::tqt_cast<TQMainWindow*>(lastActiveFormWindow->mainContainer()) );
|
|
|
|
|
if ( appropriate( (TQDockWindow*)actionEditor->parentWidget() ) ) {
|
|
|
|
|
if ( actionEditor->wantToBeShown() )
|
|
|
|
|
actionEditor->parentWidget()->show();
|
|
|
|
|
} else {
|
|
|
|
|
TQWidget *mc = 0;
|
|
|
|
|
if ( ofw && (mc = ofw->mainContainer()) && ::tqqt_cast<TQMainWindow*>(mc) )
|
|
|
|
|
if ( ofw && (mc = ofw->mainContainer()) && ::tqt_cast<TQMainWindow*>(mc) )
|
|
|
|
|
actionEditor->setWantToBeShown( !actionEditor->parentWidget()->isHidden() );
|
|
|
|
|
actionEditor->parentWidget()->hide();
|
|
|
|
|
}
|
|
|
|
@ -1421,7 +1421,7 @@ void MainWindow::activeWindowChanged( TQWidget *w )
|
|
|
|
|
|
|
|
|
|
selectionChanged();
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
SourceEditor *se = (SourceEditor*)w;
|
|
|
|
|
TQGuardedPtr<FormWindow> fw = se->formWindow();
|
|
|
|
|
if ( se->formWindow() &&
|
|
|
|
@ -1474,7 +1474,7 @@ void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
|
|
|
|
|
const TQString &undoCmd, const TQString &redoCmd )
|
|
|
|
|
{
|
|
|
|
|
if ( qWorkspace()->activeWindow() &&
|
|
|
|
|
::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
return; // do not set a formWindow related command
|
|
|
|
|
actionEditUndo->setEnabled( undoAvailable );
|
|
|
|
|
actionEditRedo->setEnabled( redoAvailable );
|
|
|
|
@ -1499,7 +1499,7 @@ void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
|
|
|
|
|
void MainWindow::updateEditorUndoRedo()
|
|
|
|
|
{
|
|
|
|
|
if ( !qWorkspace()->activeWindow() ||
|
|
|
|
|
!::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
!::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
return;
|
|
|
|
|
SourceEditor *editor = (SourceEditor*)qWorkspace()->activeWindow();
|
|
|
|
|
actionEditUndo->setEnabled( editor->editIsUndoAvailable() );
|
|
|
|
@ -1575,7 +1575,7 @@ void MainWindow::setupRMBProperties( TQValueList<uint> &ids, TQMap<TQString, int
|
|
|
|
|
ids << ( id = rmbWidgets->insertItem( i18n("Choose Pixmap..."), -1, 0) );
|
|
|
|
|
props.insert( "pixmap", id );
|
|
|
|
|
}
|
|
|
|
|
if ( text && text->designable(w) && !::tqqt_cast<TQTextEdit*>(w) ) {
|
|
|
|
|
if ( text && text->designable(w) && !::tqt_cast<TQTextEdit*>(w) ) {
|
|
|
|
|
ids << ( id = rmbWidgets->insertItem( i18n("Edit Text..."), -1, 0) );
|
|
|
|
|
props.insert( "text", id );
|
|
|
|
|
}
|
|
|
|
@ -1611,7 +1611,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
|
|
|
|
|
{
|
|
|
|
|
int id;
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<TQTabWidget*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<TQTabWidget*>(w) ) {
|
|
|
|
|
if ( ids.isEmpty() )
|
|
|
|
|
ids << rmbWidgets->insertSeparator( 0 );
|
|
|
|
|
if ( ( (QDesignerTabWidget*)w )->count() > 1) {
|
|
|
|
@ -1620,7 +1620,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
|
|
|
|
|
}
|
|
|
|
|
ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
|
|
|
|
|
commands.insert( "add", id );
|
|
|
|
|
} else if ( ::tqqt_cast<QDesignerWidgetStack*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<QDesignerWidgetStack*>(w) ) {
|
|
|
|
|
if ( ids.isEmpty() )
|
|
|
|
|
ids << rmbWidgets->insertSeparator( 0 );
|
|
|
|
|
if ( ( (QDesignerWidgetStack*)w )->count() > 1) {
|
|
|
|
@ -1634,7 +1634,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
|
|
|
|
|
}
|
|
|
|
|
ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
|
|
|
|
|
commands.insert( "add", id );
|
|
|
|
|
} else if ( ::tqqt_cast<TQToolBox*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<TQToolBox*>(w) ) {
|
|
|
|
|
if ( ids.isEmpty() )
|
|
|
|
|
ids << rmbWidgets->insertSeparator( 0 );
|
|
|
|
|
if ( ( (TQToolBox*)w )->count() > 1 ) {
|
|
|
|
@ -1682,7 +1682,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
|
|
|
|
|
{
|
|
|
|
|
int id;
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) {
|
|
|
|
|
if ( ::tqt_cast<TQWizard*>(fw->mainContainer()) ) {
|
|
|
|
|
if ( ids.isEmpty() )
|
|
|
|
|
ids << rmbFormWindow->insertSeparator( 0 );
|
|
|
|
|
|
|
|
|
@ -1700,7 +1700,7 @@ void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
|
|
|
|
|
ids << ( id = rmbFormWindow->insertItem( i18n("Edit Pages..."), -1, 0 ) );
|
|
|
|
|
commands.insert( "edit", id );
|
|
|
|
|
|
|
|
|
|
} else if ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
|
|
|
|
|
} else if ( ::tqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
|
|
|
|
|
if ( ids.isEmpty() )
|
|
|
|
|
ids << rmbFormWindow->insertSeparator( 0 );
|
|
|
|
|
ids << ( id = rmbFormWindow->insertItem( i18n( "Add Menu Item" ), -1, 0 ) );
|
|
|
|
@ -1715,7 +1715,7 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
|
|
|
|
|
if ( id == props[ "text" ] ) {
|
|
|
|
|
bool ok = FALSE;
|
|
|
|
|
bool oldDoWrap = FALSE;
|
|
|
|
|
if ( ::tqqt_cast<TQLabel*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<TQLabel*>(w) ) {
|
|
|
|
|
int align = w->property( "alignment" ).toInt();
|
|
|
|
|
if ( align & WordBreak )
|
|
|
|
|
oldDoWrap = TRUE;
|
|
|
|
@ -1723,8 +1723,8 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
|
|
|
|
|
bool doWrap = oldDoWrap;
|
|
|
|
|
|
|
|
|
|
TQString text;
|
|
|
|
|
if ( ::tqqt_cast<TQTextView*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) {
|
|
|
|
|
text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::tqqt_cast<TQButton*>(w), &doWrap );
|
|
|
|
|
if ( ::tqt_cast<TQTextView*>(w) || ::tqt_cast<TQLabel*>(w) || ::tqt_cast<TQButton*>(w) ) {
|
|
|
|
|
text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::tqt_cast<TQButton*>(w), &doWrap );
|
|
|
|
|
ok = !text.isNull();
|
|
|
|
|
} else {
|
|
|
|
|
text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ),
|
|
|
|
@ -1793,7 +1793,7 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
|
|
|
|
|
|
|
|
|
|
void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, TQWidget *w )
|
|
|
|
|
{
|
|
|
|
|
if ( ::tqqt_cast<TQTabWidget*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<TQTabWidget*>(w) ) {
|
|
|
|
|
TQTabWidget *tw = (TQTabWidget*)w;
|
|
|
|
|
if ( id == commands[ "add" ] ) {
|
|
|
|
|
AddTabPageCommand *cmd =
|
|
|
|
@ -1812,7 +1812,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
|
|
|
|
|
cmd->execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if ( ::tqqt_cast<TQToolBox*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<TQToolBox*>(w) ) {
|
|
|
|
|
TQToolBox *tb = (TQToolBox*)w;
|
|
|
|
|
if ( id == commands[ "add" ] ) {
|
|
|
|
|
AddToolBoxPageCommand *cmd =
|
|
|
|
@ -1832,7 +1832,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
|
|
|
|
|
cmd->execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if ( ::tqqt_cast<TQWidgetStack*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<TQWidgetStack*>(w) ) {
|
|
|
|
|
QDesignerWidgetStack *ws = (QDesignerWidgetStack*)w;
|
|
|
|
|
if ( id == commands[ "add" ] ) {
|
|
|
|
|
AddWidgetStackPageCommand *cmd =
|
|
|
|
@ -1933,7 +1933,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
|
|
|
|
|
|
|
|
|
|
void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, FormWindow *fw )
|
|
|
|
|
{
|
|
|
|
|
if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) {
|
|
|
|
|
if ( ::tqt_cast<TQWizard*>(fw->mainContainer()) ) {
|
|
|
|
|
TQWizard *wiz = (TQWizard*)fw->mainContainer();
|
|
|
|
|
if ( id == commands[ "add" ] ) {
|
|
|
|
|
AddWizardPageCommand *cmd =
|
|
|
|
@ -1971,7 +1971,7 @@ void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &command
|
|
|
|
|
cmd->execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
|
|
|
|
|
} else if ( ::tqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
|
|
|
|
|
TQMainWindow *mw = (TQMainWindow*)fw->mainContainer();
|
|
|
|
|
if ( id == commands[ "add_toolbar" ] ) {
|
|
|
|
|
AddToolBarCommand *cmd =
|
|
|
|
@ -2484,7 +2484,7 @@ void MainWindow::closeEvent( TQCloseEvent *e )
|
|
|
|
|
while ( wit.current() ) {
|
|
|
|
|
TQWidget *w = wit.current();
|
|
|
|
|
++wit;
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ( (FormWindow*)w )->formFile()->editor() )
|
|
|
|
|
windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
|
|
|
|
|
if ( ( (FormWindow*)w )->formFile()->formWindow() )
|
|
|
|
@ -2493,7 +2493,7 @@ void MainWindow::closeEvent( TQCloseEvent *e )
|
|
|
|
|
e->ignore();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else if ( ::tqqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
if ( !( (SourceEditor*)w )->close() ) {
|
|
|
|
|
e->ignore();
|
|
|
|
|
return;
|
|
|
|
@ -2617,7 +2617,7 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
|
|
|
|
|
if ( text && text->designable(w) ) {
|
|
|
|
|
bool ok = FALSE;
|
|
|
|
|
bool oldDoWrap = FALSE;
|
|
|
|
|
if ( ::tqqt_cast<TQLabel*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<TQLabel*>(w) ) {
|
|
|
|
|
int align = w->property( "alignment" ).toInt();
|
|
|
|
|
if ( align & WordBreak )
|
|
|
|
|
oldDoWrap = TRUE;
|
|
|
|
@ -2625,9 +2625,9 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
|
|
|
|
|
bool doWrap = oldDoWrap;
|
|
|
|
|
|
|
|
|
|
TQString text;
|
|
|
|
|
if ( ::tqqt_cast<TQTextEdit*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<TQTextEdit*>(w) || ::tqt_cast<TQLabel*>(w) || ::tqt_cast<TQButton*>(w) ) {
|
|
|
|
|
text = MultiLineEditor::getText( this, w->property( "text" ).toString(),
|
|
|
|
|
!::tqqt_cast<TQButton*>(w), &doWrap );
|
|
|
|
|
!::tqt_cast<TQButton*>(w), &doWrap );
|
|
|
|
|
ok = !text.isNull();
|
|
|
|
|
} else {
|
|
|
|
|
text = TQInputDialog::getText( i18n("Text"), i18n( "New text" ),
|
|
|
|
@ -2741,7 +2741,7 @@ bool MainWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *wid )
|
|
|
|
|
{
|
|
|
|
|
TQWidgetList windows = qWorkspace()->windowList();
|
|
|
|
|
for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ( (FormWindow*)w )->isCustomWidgetUsed( wid ) )
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
@ -2756,7 +2756,7 @@ void MainWindow::setGrid( const TQPoint &p )
|
|
|
|
|
grd = p;
|
|
|
|
|
TQWidgetList windows = qWorkspace()->windowList();
|
|
|
|
|
for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
|
|
|
|
|
if ( !::tqqt_cast<FormWindow*>(w) )
|
|
|
|
|
if ( !::tqt_cast<FormWindow*>(w) )
|
|
|
|
|
continue;
|
|
|
|
|
( (FormWindow*)w )->mainContainer()->update();
|
|
|
|
|
}
|
|
|
|
@ -2769,7 +2769,7 @@ void MainWindow::setShowGrid( bool b )
|
|
|
|
|
sGrid = b;
|
|
|
|
|
TQWidgetList windows = qWorkspace()->windowList();
|
|
|
|
|
for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
|
|
|
|
|
if ( !::tqqt_cast<FormWindow*>(w) )
|
|
|
|
|
if ( !::tqt_cast<FormWindow*>(w) )
|
|
|
|
|
continue;
|
|
|
|
|
( (FormWindow*)w )->mainContainer()->update();
|
|
|
|
|
}
|
|
|
|
@ -2855,48 +2855,48 @@ void MainWindow::showDialogHelp()
|
|
|
|
|
|
|
|
|
|
TQString link = documentationPath() + "/designer-manual-13.html#";
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<NewFormBase*>(w) || ::tqqt_cast<StartDialogBase*>(w) ) // own doc for startdialog?
|
|
|
|
|
if ( ::tqt_cast<NewFormBase*>(w) || ::tqt_cast<StartDialogBase*>(w) ) // own doc for startdialog?
|
|
|
|
|
link += "dialog-file-new";
|
|
|
|
|
else if ( ::tqqt_cast<CreateTemplate*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<CreateTemplate*>(w) )
|
|
|
|
|
link += "dialog-file-create-template";
|
|
|
|
|
else if ( ::tqqt_cast<EditFunctionsBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<EditFunctionsBase*>(w) )
|
|
|
|
|
link += "dialog-edit-functions";
|
|
|
|
|
// else if ( ::tqqt_cast<ConnectionViewerBase*>(w) )
|
|
|
|
|
// else if ( ::tqt_cast<ConnectionViewerBase*>(w) )
|
|
|
|
|
else if ( w->inherits("ConnectionViewerBase") )
|
|
|
|
|
link += "dialog-view-connections";
|
|
|
|
|
else if ( ::tqqt_cast<FormSettingsBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<FormSettingsBase*>(w) )
|
|
|
|
|
link += "dialog-edit-form-settings";
|
|
|
|
|
else if ( ::tqqt_cast<Preferences*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<Preferences*>(w) )
|
|
|
|
|
link += "dialog-edit-preferences";
|
|
|
|
|
else if ( ::tqqt_cast<PixmapCollectionEditor*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<PixmapCollectionEditor*>(w) )
|
|
|
|
|
link += "dialog-image-collection";
|
|
|
|
|
// else if ( ::tqqt_cast<DatabaseConnectionBase*>(w) )
|
|
|
|
|
// else if ( ::tqt_cast<DatabaseConnectionBase*>(w) )
|
|
|
|
|
else if ( w->inherits( "DatabaseConnectionBase" ) )
|
|
|
|
|
link += "dialog-edit-database-connections";
|
|
|
|
|
else if ( ::tqqt_cast<ProjectSettingsBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<ProjectSettingsBase*>(w) )
|
|
|
|
|
link += "dialog-project-settings";
|
|
|
|
|
else if ( ::tqqt_cast<FindDialog*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<FindDialog*>(w) )
|
|
|
|
|
link += "dialog-find-text";
|
|
|
|
|
else if ( ::tqqt_cast<ReplaceDialog*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<ReplaceDialog*>(w) )
|
|
|
|
|
link += "dialog-replace-text";
|
|
|
|
|
else if ( ::tqqt_cast<GotoLineDialog*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<GotoLineDialog*>(w) )
|
|
|
|
|
link += "dialog-go-to-line";
|
|
|
|
|
// else if ( ::tqqt_cast<ConnectionEditorBase*>(w) )
|
|
|
|
|
// else if ( ::tqt_cast<ConnectionEditorBase*>(w) )
|
|
|
|
|
else if ( w->inherits("ConnectionEditorBase") )
|
|
|
|
|
link += "dialog-edit-connections";
|
|
|
|
|
else if ( ::tqqt_cast<CustomWidgetEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<CustomWidgetEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-custom-widgets";
|
|
|
|
|
else if ( ::tqqt_cast<PaletteEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<PaletteEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-palette";
|
|
|
|
|
else if ( ::tqqt_cast<ListBoxEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<ListBoxEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-listbox";
|
|
|
|
|
else if ( ::tqqt_cast<ListViewEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<ListViewEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-listview";
|
|
|
|
|
else if ( ::tqqt_cast<IconViewEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<IconViewEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-iconview";
|
|
|
|
|
else if ( ::tqqt_cast<TableEditorBase*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<TableEditorBase*>(w) )
|
|
|
|
|
link += "dialog-edit-table";
|
|
|
|
|
else if ( ::tqqt_cast<MultiLineEditor*>(w) )
|
|
|
|
|
else if ( ::tqt_cast<MultiLineEditor*>(w) )
|
|
|
|
|
link += "dialog-text";
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
@ -3184,10 +3184,10 @@ void MainWindow::setModified( bool b, TQWidget *window )
|
|
|
|
|
{
|
|
|
|
|
TQWidget *w = window;
|
|
|
|
|
while ( w ) {
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
( (FormWindow*)w )->modificationChanged( b );
|
|
|
|
|
return;
|
|
|
|
|
} else if ( ::tqqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
FormWindow *fw = ( (SourceEditor*)w )->formWindow();
|
|
|
|
|
if ( fw && !fw->isFake() ) {
|
|
|
|
|
//fw->commandHistory()->setModified( b );
|
|
|
|
@ -3222,7 +3222,7 @@ void MainWindow::doFunctionsChanged()
|
|
|
|
|
|
|
|
|
|
void MainWindow::updateFunctionList()
|
|
|
|
|
{
|
|
|
|
|
if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
if ( !qWorkspace()->activeWindow() || !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
return;
|
|
|
|
|
SourceEditor *se = (SourceEditor*)qWorkspace()->activeWindow();
|
|
|
|
|
se->save();
|
|
|
|
@ -3311,9 +3311,9 @@ void MainWindow::showSourceLine( TQObject *o, int line, LineMode lm )
|
|
|
|
|
FormWindow *fw = 0;
|
|
|
|
|
SourceEditor *se = 0;
|
|
|
|
|
SourceFile *sf = 0;
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
fw = (FormWindow*)w;
|
|
|
|
|
} else if ( ::tqqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
se = (SourceEditor*)w;
|
|
|
|
|
if ( !se->object() )
|
|
|
|
|
continue;
|
|
|
|
@ -3381,7 +3381,7 @@ void MainWindow::showSourceLine( TQObject *o, int line, LineMode lm )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<SourceFile*>(o) ) {
|
|
|
|
|
if ( ::tqt_cast<SourceFile*>(o) ) {
|
|
|
|
|
for ( TQPtrListIterator<SourceFile> sources = currentProject->sourceFiles();
|
|
|
|
|
sources.current(); ++sources ) {
|
|
|
|
|
SourceFile* f = sources.current();
|
|
|
|
@ -3443,12 +3443,12 @@ TQObject *MainWindow::findRealObject( TQObject *o )
|
|
|
|
|
{
|
|
|
|
|
TQWidgetList windows = qWorkspace()->windowList();
|
|
|
|
|
for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) && TQString( w->name() ) == TQString( o->name() ) )
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) && TQString( w->name() ) == TQString( o->name() ) )
|
|
|
|
|
return TQT_TQOBJECT(w);
|
|
|
|
|
else if ( ::tqqt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() &&
|
|
|
|
|
else if ( ::tqt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() &&
|
|
|
|
|
TQString( ( (SourceEditor*)w )->formWindow()->name() ) == TQString( o->name() ) )
|
|
|
|
|
return TQT_TQOBJECT(w);
|
|
|
|
|
else if ( ::tqqt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() &&
|
|
|
|
|
else if ( ::tqt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() &&
|
|
|
|
|
( (SourceEditor*)w )->sourceFile() == o )
|
|
|
|
|
return o;
|
|
|
|
|
}
|
|
|
|
@ -3469,7 +3469,7 @@ void MainWindow::breakPointsChanged()
|
|
|
|
|
{
|
|
|
|
|
if ( !inDebugMode )
|
|
|
|
|
return;
|
|
|
|
|
if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
if ( !qWorkspace()->activeWindow() || !::tqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
|
|
|
|
|
return;
|
|
|
|
|
SourceEditor *e = (SourceEditor*)qWorkspace()->activeWindow();
|
|
|
|
|
if ( !e->object() || !e->project() )
|
|
|
|
@ -3636,13 +3636,13 @@ void MainWindow::setSingleProject( Project *pro )
|
|
|
|
|
while ( wit.current() ) {
|
|
|
|
|
TQWidget *w = wit.current();
|
|
|
|
|
++wit;
|
|
|
|
|
if ( ::tqqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ::tqt_cast<FormWindow*>(w) ) {
|
|
|
|
|
if ( ( (FormWindow*)w )->project() == pro ) {
|
|
|
|
|
if ( ( (FormWindow*)w )->formFile()->editor() )
|
|
|
|
|
windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
|
|
|
|
|
( (FormWindow*)w )->formFile()->close();
|
|
|
|
|
}
|
|
|
|
|
} else if ( ::tqqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
} else if ( ::tqt_cast<SourceEditor*>(w) ) {
|
|
|
|
|
( (SourceEditor*)w )->close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|