diff options
Diffstat (limited to 'kommander/editor/command.cpp')
-rw-r--r-- | kommander/editor/command.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kommander/editor/command.cpp b/kommander/editor/command.cpp index c1b8db31..41ea2b23 100644 --- a/kommander/editor/command.cpp +++ b/kommander/editor/command.cpp @@ -36,7 +36,7 @@ #include <tqwidget.h> #include <tqmetaobject.h> #include <tqapplication.h> -#include <tqlayout.h> +#include <layout.h> #include <tqmessagebox.h> #include <tqlistbox.h> #include <tqiconview.h> @@ -253,19 +253,19 @@ void ResizeCommand::unexecute() InsertCommand::InsertCommand( const TQString &n, FormWindow *fw, TQWidget *w, const TQRect &g ) - : Command( n, fw ), widget( w ), tqgeometry( g ) + : Command( n, fw ), widget( w ), geometry( g ) { } void InsertCommand::execute() { - if ( tqgeometry.size() == TQSize( 0, 0 ) ) { - widget->move( tqgeometry.topLeft() ); + if ( geometry.size() == TQSize( 0, 0 ) ) { + widget->move( geometry.topLeft() ); widget->adjustSize(); } else { - TQSize s = tqgeometry.size().expandedTo( widget->tqminimumSize() ); - s = s.expandedTo( widget->tqminimumSizeHint() ); - TQRect r( tqgeometry.topLeft(), s ); + TQSize s = geometry.size().expandedTo( widget->minimumSize() ); + s = s.expandedTo( widget->minimumSizeHint() ); + TQRect r( geometry.topLeft(), s ); widget->setGeometry( r ); } widget->show(); @@ -461,7 +461,7 @@ bool SetPropertyCommand::canMerge( Command *c ) { SetPropertyCommand *cmd = (SetPropertyCommand*)c; const TQMetaProperty *p = - widget->tqmetaObject()->property( widget->tqmetaObject()->findProperty( propName, true ), true ); + widget->metaObject()->property( widget->metaObject()->findProperty( propName, true ), true ); if ( !p ) { if ( propName == "toolTip" || propName == "whatsThis" ) return true; @@ -532,26 +532,26 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ editor->propertyList()->setCurrentProperty( propName ); const TQMetaProperty *p = - widget->tqmetaObject()->property( widget->tqmetaObject()->findProperty( propName, true ), true ); + widget->metaObject()->property( widget->metaObject()->findProperty( propName, true ), true ); if ( !p ) { if ( propName == "hAlign" ) { - p = widget->tqmetaObject()->property( widget->tqmetaObject()->findProperty( "tqalignment", true ), true ); - int align = widget->property( "tqalignment" ).toInt(); + p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", true ), true ); + int align = widget->property( "alignment" ).toInt(); align &= ~( AlignHorizontal_Mask ); align |= p->keyToValue( currentItemText ); - widget->setProperty( "tqalignment", TQVariant( align ) ); + widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "vAlign" ) { - p = widget->tqmetaObject()->property( widget->tqmetaObject()->findProperty( "tqalignment", true ), true ); - int align = widget->property( "tqalignment" ).toInt(); + p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", true ), true ); + int align = widget->property( "alignment" ).toInt(); align &= ~( AlignVertical_Mask ); align |= p->keyToValue( currentItemText ); - widget->setProperty( "tqalignment", TQVariant( align ) ); + widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "wordwrap" ) { - int align = widget->property( "tqalignment" ).toInt(); + int align = widget->property( "alignment" ).toInt(); align &= ~WordBreak; if ( v.toBool() ) align |= WordBreak; - widget->setProperty( "tqalignment", TQVariant( align ) ); + widget->setProperty( "alignment", TQVariant( align ) ); } else if ( propName == "layoutSpacing" ) { MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( TQT_TQWIDGET(editor->widget()) )), v.toInt() ); } else if ( propName == "layoutMargin" ) { @@ -630,21 +630,21 @@ void SetPropertyCommand::setProperty( const TQVariant &v, const TQString ¤ LayoutHorizontalCommand::LayoutHorizontalCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } void LayoutHorizontalCommand::execute() { formWindow()->clearSelection( false ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutHorizontalCommand::unexecute() { formWindow()->clearSelection( false ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -653,21 +653,21 @@ void LayoutHorizontalCommand::unexecute() LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, true, true ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, true, true ) { } void LayoutHorizontalSplitCommand::execute() { formWindow()->clearSelection( false ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutHorizontalSplitCommand::unexecute() { formWindow()->clearSelection( false ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -676,21 +676,21 @@ void LayoutHorizontalSplitCommand::unexecute() LayoutVerticalCommand::LayoutVerticalCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase ) { } void LayoutVerticalCommand::execute() { formWindow()->clearSelection( false ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutVerticalCommand::unexecute() { formWindow()->clearSelection( false ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -699,21 +699,21 @@ void LayoutVerticalCommand::unexecute() LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, true, true ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, true, true ) { } void LayoutVerticalSplitCommand::execute() { formWindow()->clearSelection( false ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutVerticalSplitCommand::unexecute() { formWindow()->clearSelection( false ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -722,21 +722,21 @@ void LayoutVerticalSplitCommand::unexecute() LayoutGridCommand::LayoutGridCommand( const TQString &n, FormWindow *fw, TQWidget *parent, TQWidget *layoutBase, const TQWidgetList &wl, int xres, int yres ) - : Command( n, fw ), tqlayout( wl, parent, fw, layoutBase, TQSize( TQMAX(5,xres), TQMAX(5,yres) ) ) + : Command( n, fw ), layout( wl, parent, fw, layoutBase, TQSize( TQMAX(5,xres), TQMAX(5,yres) ) ) { } void LayoutGridCommand::execute() { formWindow()->clearSelection( false ); - tqlayout.doLayout(); + layout.doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } void LayoutGridCommand::unexecute() { formWindow()->clearSelection( false ); - tqlayout.undoLayout(); + layout.undoLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); } @@ -749,21 +749,21 @@ BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw, WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase ); spacing = MetaDataBase::spacing( TQT_TQOBJECT(layoutBase) ); margin = MetaDataBase::margin( TQT_TQOBJECT(layoutBase) ); - tqlayout = 0; + layout = 0; if ( lay == WidgetFactory::HBox ) - tqlayout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); + layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); else if ( lay == WidgetFactory::VBox ) - tqlayout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); + layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, false, layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ); else if ( lay == WidgetFactory::Grid ) - tqlayout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), false ); + layout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), false ); } void BreakLayoutCommand::execute() { - if ( !tqlayout ) + if ( !layout ) return; formWindow()->clearSelection( false ); - tqlayout->breakLayout(); + layout->breakLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) w->resize( TQMAX( 16, w->width() ), TQMAX( 16, w->height() ) ); @@ -771,10 +771,10 @@ void BreakLayoutCommand::execute() void BreakLayoutCommand::unexecute() { - if ( !tqlayout ) + if ( !layout ) return; formWindow()->clearSelection( false ); - tqlayout->doLayout(); + layout->doLayout(); formWindow()->mainWindow()->objectHierarchy()->rebuild(); MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), spacing ); MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( lb )), margin ); |