diff options
Diffstat (limited to 'src/modules/objects/class_dockwindow.cpp')
-rw-r--r-- | src/modules/objects/class_dockwindow.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/src/modules/objects/class_dockwindow.cpp b/src/modules/objects/class_dockwindow.cpp index fc439b23..35d9c070 100644 --- a/src/modules/objects/class_dockwindow.cpp +++ b/src/modules/objects/class_dockwindow.cpp @@ -28,13 +28,13 @@ #include "kvi_locale.h" #include "kvi_qstring.h" #ifdef COMPILE_USE_QT4 - #include <QDockWidget> - #define QT_DOCK_WINDOW QDockWidget + #include <TQDockWidget> + #define TQT_DOCK_WINDOW TQDockWidget #else - #include <qdockwindow.h> - #define QT_DOCK_WINDOW QDockWindow + #include <tqdockwindow.h> + #define TQT_DOCK_WINDOW TQDockWindow #endif -#include <qlayout.h> +#include <tqlayout.h> /* @doc: dockwindow @@ -49,11 +49,11 @@ [class]widget[/class] @description: A window dockable to the KVIrc main frame borders (like a toolbar). - The window has an implicit layout that will automatically manage - the children depending on the dock window's orientation. + The window has an implicit tqlayout that will automatically manage + the tqchildren depending on the dock window's orientation. @functions: !fn: $addWidget(<widget:hobject>) - Adds <widget> to the internal layout of this dock window.[br] + Adds <widget> to the internal tqlayout of this dock window.[br] The widget must be a child of this dock window (otherwise strange things may happen). !fn: <string> $orientation() Returns the string "vertical" or "horizontal" depending on the orientation of this dock window. @@ -92,16 +92,16 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_dockwindow) KVSO_BEGIN_DESTRUCTOR(KviKvsObject_dockwindow) KVSO_END_DESTRUCTOR(KviKvsObject_dockwindow) -#define _pDockWindow ((QT_DOCK_WINDOW *)widget()) +#define _pDockWindow ((TQT_DOCK_WINDOW *)widget()) bool KviKvsObject_dockwindow::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) { #ifdef COMPILE_USE_QT4 - QDockWidget * pWidget = new QDockWidget(g_pFrame); + TQDockWidget * pWidget = new TQDockWidget(g_pFrame); pWidget->setObjectName(getName()); setObject(pWidget); #else //!COMPILE_USE_QT4 - setObject(new QT_DOCK_WINDOW(g_pFrame,getName()),true); + setObject(TQT_TQOBJECT(new TQT_DOCK_WINDOW(g_pFrame,getName())),true); #endif //!COMPILE_USE_QT4 return true; } @@ -141,16 +141,16 @@ bool KviKvsObject_dockwindow::function_addWidget(KviKvsObjectFunctionCall *c) return true; } - if(((QWidget *)(pWidget->object()))->parent() != (QObject *)_pDockWindow) + if(((TQWidget *)(pWidget->object()))->tqparent() != (TQObject *)_pDockWindow) { c->warning(__tr2qs("The added widget is not a child of this dock window")); } #ifdef COMPILE_USE_QT4 - _pDockWindow->setWidget((QWidget *)(pWidget->object())); + _pDockWindow->setWidget((TQWidget *)(pWidget->object())); #else //!COMPILE_USE_QT4 - _pDockWindow->boxLayout()->addWidget((QWidget *)(pWidget->object())); - ((QWidget *)(pWidget->object()))->show(); + _pDockWindow->boxLayout()->addWidget((TQWidget *)(pWidget->object())); + ((TQWidget *)(pWidget->object()))->show(); #endif //!COMPILE_USE_QT4 return true; } @@ -159,23 +159,23 @@ bool KviKvsObject_dockwindow::function_orientation(KviKvsObjectFunctionCall * c) { if(!widget())return true; // hum ? dead ? #ifdef COMPILE_USE_QT4 - c->returnValue()->setString(QString("horizontal")); + c->returnValue()->setString(TQString("horizontal")); #else //!COMPILE_USE_QT4 - c->returnValue()->setString(_pDockWindow->orientation() == Qt::Horizontal ? QString("horizontal") : QString("vertical")); + c->returnValue()->setString(_pDockWindow->orientation() == Qt::Horizontal ? TQString("horizontal") : TQString("vertical")); #endif //!COMPILE_USE_QT4 return true; } bool KviKvsObject_dockwindow::function_setOrientation(KviKvsObjectFunctionCall * c) { - QString szOrientation; + TQString szOrientation; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("orientation",KVS_PT_NONEMPTYSTRING,0,szOrientation) KVSO_PARAMETERS_END(c) if(!widget())return true; // hum ? dead ? #ifndef COMPILE_USE_QT4 - _pDockWindow->setOrientation(KviQString::equalCI(szOrientation,"vertical") ? Qt::Vertical : Qt::Horizontal); + _pDockWindow->setOrientation(KviTQString::equalCI(szOrientation,"vertical") ? Qt::Vertical : Qt::Horizontal); #endif //!COMPILE_USE_QT4 return true; } @@ -208,7 +208,7 @@ bool KviKvsObject_dockwindow::function_setResizeEnabled(KviKvsObjectFunctionCall bool KviKvsObject_dockwindow::function_setAllowedDockAreas(KviKvsObjectFunctionCall * c) { - QString szFlags; + TQString szFlags; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("docks",KVS_PT_STRING,0,szFlags) KVSO_PARAMETERS_END(c) @@ -216,26 +216,26 @@ bool KviKvsObject_dockwindow::function_setAllowedDockAreas(KviKvsObjectFunctionC if(!widget())return true; // hum ? dead ? #ifdef COMPILE_USE_QT4 - Qt::DockWidgetAreas fAreas = Qt::NoDockWidgetArea; - if(szFlags.find('t',false))fAreas |= Qt::TopDockWidgetArea; - if(szFlags.find('l',false))fAreas |= Qt::LeftDockWidgetArea; - if(szFlags.find('r',false))fAreas |= Qt::RightDockWidgetArea; - if(szFlags.find('b',false))fAreas |= Qt::BottomDockWidgetArea; + TQt::DockWidgetAreas fAreas = TQt::NoDockWidgetArea; + if(szFlags.tqfind('t',false))fAreas |= TQt::TopDockWidgetArea; + if(szFlags.tqfind('l',false))fAreas |= TQt::LeftDockWidgetArea; + if(szFlags.tqfind('r',false))fAreas |= TQt::RightDockWidgetArea; + if(szFlags.tqfind('b',false))fAreas |= TQt::BottomDockWidgetArea; _pDockWindow->setAllowedAreas(fAreas); - QDockWidget::DockWidgetFeatures fFeatures = _pDockWindow->features(); - if(szFlags.find('f',false)) - fFeatures |= QDockWidget::DockWidgetFloatable; + TQDockWidget::DockWidgetFeatures fFeatures = _pDockWindow->features(); + if(szFlags.tqfind('f',false)) + fFeatures |= TQDockWidget::DockWidgetFloatable; else - fFeatures &= ~QDockWidget::DockWidgetFloatable; + fFeatures &= ~TQDockWidget::DockWidgetFloatable; // no support for minimized dock widgets _pDockWindow->setFeatures(fFeatures); #else //!COMPILE_USE_QT4 - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockTop,szFlags.find('t',false) != -1); - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockLeft,szFlags.find('l',false) != -1); - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockRight,szFlags.find('r',false) != -1); - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockBottom,szFlags.find('b',false) != -1); - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockTornOff,szFlags.find('f',false) != -1); - g_pFrame->setDockEnabled(_pDockWindow,Qt::DockMinimized,szFlags.find('m',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockTop,szFlags.tqfind('t',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockLeft,szFlags.tqfind('l',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockRight,szFlags.tqfind('r',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockBottom,szFlags.tqfind('b',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockTornOff,szFlags.tqfind('f',false) != -1); + g_pFrame->setDockEnabled(_pDockWindow,TQt::DockMinimized,szFlags.tqfind('m',false) != -1); #endif //!COMPILE_USE_QT4 return true; @@ -244,7 +244,7 @@ bool KviKvsObject_dockwindow::function_setAllowedDockAreas(KviKvsObjectFunctionC bool KviKvsObject_dockwindow::function_dock(KviKvsObjectFunctionCall * c) { - QString szDock; + TQString szDock; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("dock",KVS_PT_STRING,0,szDock) KVSO_PARAMETERS_END(c) @@ -252,22 +252,22 @@ bool KviKvsObject_dockwindow::function_dock(KviKvsObjectFunctionCall * c) if(!widget())return true; // hum ? dead ? #ifdef COMPILE_USE_QT4 g_pFrame->removeDockWidget(_pDockWindow); - if(szDock.find('m',false) == -1)_pDockWindow->setFloating(false); - if(szDock.find('t',false) != -1)g_pFrame->addDockWidget(Qt::TopDockWidgetArea,_pDockWindow); - else if(szDock.find('l',false) != -1)g_pFrame->addDockWidget(Qt::LeftDockWidgetArea,_pDockWindow); - else if(szDock.find('r',false) != -1)g_pFrame->addDockWidget(Qt::RightDockWidgetArea,_pDockWindow); - else if(szDock.find('b',false) != -1)g_pFrame->addDockWidget(Qt::BottomDockWidgetArea,_pDockWindow); - else if(szDock.find('f',false) != -1)_pDockWindow->setFloating(true); - else if(szDock.find('m',false) != -1)qDebug("Sorry: no support for minimized dock widgets in Qt4"); + if(szDock.tqfind('m',false) == -1)_pDockWindow->setFloating(false); + if(szDock.tqfind('t',false) != -1)g_pFrame->addDockWidget(TQt::TopDockWidgetArea,_pDockWindow); + else if(szDock.tqfind('l',false) != -1)g_pFrame->addDockWidget(TQt::LeftDockWidgetArea,_pDockWindow); + else if(szDock.tqfind('r',false) != -1)g_pFrame->addDockWidget(TQt::RightDockWidgetArea,_pDockWindow); + else if(szDock.tqfind('b',false) != -1)g_pFrame->addDockWidget(TQt::BottomDockWidgetArea,_pDockWindow); + else if(szDock.tqfind('f',false) != -1)_pDockWindow->setFloating(true); + else if(szDock.tqfind('m',false) != -1)qDebug("Sorry: no support for minimized dock widgets in TQt4"); else c->warning(__tr2qs("Invalid dock area specified")); #else //!COMPILE_USE_QT4 - if(szDock.find('t',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockTop,false,100); - else if(szDock.find('l',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockLeft,false,100); - else if(szDock.find('r',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockRight,false,100); - else if(szDock.find('b',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockBottom,false,100); - else if(szDock.find('f',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockTornOff,false,100); - else if(szDock.find('m',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,Qt::DockMinimized,false,100); + if(szDock.tqfind('t',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockTop,false,100); + else if(szDock.tqfind('l',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockLeft,false,100); + else if(szDock.tqfind('r',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockRight,false,100); + else if(szDock.tqfind('b',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockBottom,false,100); + else if(szDock.tqfind('f',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockTornOff,false,100); + else if(szDock.tqfind('m',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockMinimized,false,100); else c->warning(__tr2qs("Invalid dock area specified")); #endif //!COMPILE_USE_QT4 return true; |