summaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/class_widget.cpp')
-rw-r--r--src/modules/objects/class_widget.cpp412
1 files changed, 206 insertions, 206 deletions
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp
index d248c98b..6790bbf6 100644
--- a/src/modules/objects/class_widget.cpp
+++ b/src/modules/objects/class_widget.cpp
@@ -33,26 +33,26 @@
#include "kvi_mirccntrl.h"
#include "kvi_app.h"
#include "kvi_string.h"
-#include <qcursor.h>
-#include <qiconset.h>
-#include <qcolor.h>
-#include <qlayout.h>
-#include <qbitmap.h>
-#include <qmetaobject.h>
+#include <tqcursor.h>
+#include <tqiconset.h>
+#include <tqcolor.h>
+#include <tqlayout.h>
+#include <tqbitmap.h>
+#include <tqmetaobject.h>
#include "class_widget.h"
#include "class_pixmap.h"
#ifdef COMPILE_USE_QT4
- #include <QKeyEvent>
- #include <QDesktopWidget>
+ #include <TQKeyEvent>
+ #include <TQDesktopWidget>
#else
- #include <qwidgetlist.h>
+ #include <tqwidgetlist.h>
#endif
-#include <qwidget.h>
-#include <qtooltip.h>
-#include <qfont.h>
-#include <qvariant.h>
+#include <tqwidget.h>
+#include <tqtooltip.h>
+#include <tqfont.h>
+#include <tqvariant.h>
// FIX ME: WFLAGS
const char * const widgettypes_tbl[] = {
@@ -69,11 +69,11 @@ const char * const widgettypes_tbl[] = {
"NoAutoErase"
};
#ifdef COMPILE_USE_QT4
-const Qt::WidgetAttribute widgetattributes_cod[]= {
- Qt::WA_OpaquePaintEvent,
- Qt::WA_NoSystemBackground,
- Qt::WA_PaintOnScreen,
- Qt::WA_NoMousePropagation,
+const TQt::WidgetAttribute widgetattributes_cod[]= {
+ TQt::WA_OpaquePaintEvent,
+ TQt::WA_NoSystemBackground,
+ TQt::WA_PaintOnScreen,
+ TQt::WA_NoMousePropagation,
};
const char * const widgetattributes_tbl[] = {
@@ -85,36 +85,36 @@ const char * const widgetattributes_tbl[] = {
#define widgetattributes_num (sizeof(widgetattributes_tbl) / sizeof(widgetattributes_tbl[0]))
-const Qt::WindowType widgettypes_cod[] = {
+const TQt::WindowType widgettypes_cod[] = {
#else
const int widgettypes_cod[] = {
#endif
- Qt::WType_TopLevel,
- Qt::WType_Dialog,
- Qt::WType_Popup,
- Qt::WType_Desktop,
- Qt::WStyle_Customize,
- Qt::WStyle_Title,
- Qt::WStyle_StaysOnTop,
- Qt::WStyle_SysMenu,
- Qt::WStyle_Minimize,
- Qt::WStyle_Maximize,
- Qt::WNoAutoErase
+ TQt::WType_TopLevel,
+ TQt::WType_Dialog,
+ TQt::WType_Popup,
+ TQt::WType_Desktop,
+ TQt::WStyle_Customize,
+ TQt::WStyle_Title,
+ TQt::WStyle_StaysOnTop,
+ TQt::WStyle_SysMenu,
+ TQt::WStyle_Minimize,
+ TQt::WStyle_Maximize,
+ TQt::WNoAutoErase
};
#ifdef COMPILE_USE_QT4
- #define QT_WIDGET_TABFOCUS Qt::TabFocus
- #define QT_WIDGET_CLICKFOCUS Qt::ClickFocus
- #define QT_WIDGET_STRONGFOCUS Qt::StrongFocus
- #define QT_WIDGET_NOFOCUS Qt::NoFocus
+ #define TQT_WIDGET_TABFOCUS TTQ_TabFocus
+ #define TQT_WIDGET_CLICKFOCUS TTQ_ClickFocus
+ #define TQT_WIDGET_STRONGFOCUS TTQ_StrongFocus
+ #define TQT_WIDGET_NOFOCUS TTQ_NoFocus
#else
- #define QT_WIDGET_TABFOCUS QWidget::TabFocus
- #define QT_WIDGET_CLICKFOCUS QWidget::ClickFocus
- #define QT_WIDGET_STRONGFOCUS QWidget::StrongFocus
- #define QT_WIDGET_NOFOCUS QWidget::NoFocus
+ #define TQT_WIDGET_TABFOCUS TQ_TabFocus
+ #define TQT_WIDGET_CLICKFOCUS TQ_ClickFocus
+ #define TQT_WIDGET_STRONGFOCUS TQ_StrongFocus
+ #define TQT_WIDGET_NOFOCUS TQ_NoFocus
#endif
@@ -137,52 +137,52 @@ const int widgettypes_cod[] = {
All the other widget-type classes inherit from this one.
@functions:
!fn: $show()
- Shows this widget and the children.
+ Shows this widget and the tqchildren.
See also [classfnc]$hide[/classfnc]() and [classfnc]$isVisible[/classfnc].
!fn: $hide()
- Hides this widget (and conseguently all the children).
+ Hides this widget (and conseguently all the tqchildren).
See also [classfnc]$show[/classfnc]() and [classfnc]$isVisible[/classfnc].
- !fn: $repaint(<bool erase>)
+ !fn: $tqrepaint(<bool erase>)
Repaints the widget directly by calling [classfnc]$paintEvent[/classfnc]() immediately.[br]
If erase is TRUE, erases the widget before the $paintEvent() call.
!fn: $x()
Returns the x coordinate of the upper-left corner
- of this widget relative to the parent widget,
+ of this widget relative to the tqparent widget,
or to the desktop if this widget is a toplevel one.
!fn: $y()
Returns the y coordinate of the uspper-left corner
- of this widget relative to the parent widget,
+ of this widget relative to the tqparent widget,
or to the desktop if this widget is a toplevel one.
!fn: $width()
Returns the width of this widget in pixels.
!fn: $height()
Returns the height of this widget in pixels.
- !fn: $geometry()
- Returns the widget geometry in this form:[br]
+ !fn: $tqgeometry()
+ Returns the widget tqgeometry in this form:[br]
x, y, width, height.
!fn: $setGeometry(<x_or_array>,[<y>,<width>,<heigth>])
- Sets the geometry of this widget. <x> and <y> are relative
- to the parent widget or to the desktop (if this widget is
+ Sets the tqgeometry of this widget. <x> and <y> are relative
+ to the tqparent widget or to the desktop (if this widget is
a toplevel one). All the parameters are in pixels.
!fn: $setMinimumWidth(<value>)
Sets the minimum width of this widget to <value>.
The user will not be able to resize the widget to a smaller
- value. This value is also used by the [class:layout]layout class[/class].
+ value. This value is also used by the [class:tqlayout]tqlayout class[/class].
!fn: $setMinimumHeight(<value>)
Sets the minimum height of this widget to <value>.
The user will not be able to resize the widget to a smaller
- value. This value is also used by the [class:layout]layout class[/class].
+ value. This value is also used by the [class:tqlayout]tqlayout class[/class].
!fn: $setMaximumWidth(<value>)
Sets the maximum width of this widget to <value>.
The user will not be able to resize the widget to a bigger
- value. This value is also used by the [class:layout]layout class[/class].
+ value. This value is also used by the [class:tqlayout]tqlayout class[/class].
!fn: $setMaximumHeight(<value>)
Sets the maximum height of this widget to <value>.
The user will not be able to resize the widget to a bigger
- value. This value is also used by the [class:layout]layout class[/class].
+ value. This value is also used by the [class:tqlayout]tqlayout class[/class].
!fn: $move(<x_or_array>[,<y>])
Moves this widget to the coordinate <x> and <y> relative to its
- parent widget (or the desktop if this widget is a toplevel one).
+ tqparent widget (or the desktop if this widget is a toplevel one).
This is equivalent to [classfnc]$setGeometry[/classfnc](<x>,<y>,
[classfnc]$width[/classfnc](),[classfnc]$height[/classfnc]()).
!fn: $resize(<w_or_array>,[height])
@@ -202,7 +202,7 @@ const int widgettypes_cod[] = {
!fn: $window.caption()
Returns the caption text of this widget.
!fn: $isTopLevel()
- Returns '1' if this widget is a toplevel (parentless) one,
+ Returns '1' if this widget is a toplevel (tqparentless) one,
'0' otherwise.
!fn: $isVisible()
Returns '1' if this widget is currently visible (read: is managed
@@ -212,18 +212,18 @@ const int widgettypes_cod[] = {
See also [classfnc]$show[/classfnc]() and [classfnc]$hide[/classfnc]().
!fn: $raise()
Moves this widget to the top of the stack of the widgets relative
- to its parent. See also [classfnc]$lower[/classfnc].
+ to its tqparent. See also [classfnc]$lower[/classfnc].
!fn: $lower()
Moves this widget to the bottom of the stack of the widgets relative
- to its parent. See also [classfnc]$raise[/classfnc]
+ to its tqparent. See also [classfnc]$raise[/classfnc]
!fn: $hasFocus()
Returns '1' if this widget has the keyboard focus.
See also [classfnc]$setFocus[/classfnc].
!fn: $setFocus()
Sets this widget to be the one that receives keyboard events.
See also [classfnc]$hasFocus[/classfnc]
- !fn: $parentWidget()
- Returns the object id of the parent widget, or '0' if this
+ !fn: $tqparentWidget()
+ Returns the object id of the tqparent widget, or '0' if this
widget is a toplevel one.
!fn: $backgroundColor()
Returns the background color of this widget in hexadecimal
@@ -341,7 +341,7 @@ const int widgettypes_cod[] = {
If a tooltip has setted with [classfnc]$setTooltip[/classfnc] the dynamic tooltip will be ignored.
The default implementation does nothing.
!fn: $paintEvent()
- This event handler can be reimplemented to repaint all or part of the widget.
+ This event handler can be reimplemented to tqrepaint all or part of the widget.
It's needed by the Painter class.
It's very useful for drawing flicker free animations or low level special graphic effects.
If you call "[cmd]return[/cmd] $true" you will stop the internal processing
@@ -521,8 +521,8 @@ const int widgettypes_cod[] = {
// but in derived classes WILL be
// ... now that I think about it , it
// may happen that widget() will be zero here too:
- // If the Qt "physical" widget gets destroyed
- // by some external factor (for example when children
+ // If the TQt "physical" widget gets destroyed
+ // by some external factor (for example when tqchildren
// of a wrapper widget destroyed by KVIrc).
//
// as a convention:
@@ -546,7 +546,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object")
// apparence
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"show",function_show)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"hide",function_hide)
- KVSO_REGISTER_HANDLER(KviKvsObject_widget,"repaint",function_repaint)
+ KVSO_REGISTER_HANDLER(KviKvsObject_widget,"tqrepaint",function_tqrepaint)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"isTopLevel",function_isTopLevel)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"isVisible",function_isVisible)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"raise",function_raise)
@@ -567,10 +567,10 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object")
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"fontMetricsWidth",function_fontMetricsWidth)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"fontMetricsHeight",function_fontMetricsHeight)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setFont",function_setFont)
- // geometry
+ // tqgeometry
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"screenResolution",function_screenResolution)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"centerToScreen",function_centerToScreen)
- KVSO_REGISTER_HANDLER(KviKvsObject_widget,"geometry",function_geometry)
+ KVSO_REGISTER_HANDLER(KviKvsObject_widget,"geometry",function_tqgeometry)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setGeometry",function_setGeometry)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"mapToGlobal",function_mapToGlobal)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"mapFromGlobal",function_mapFromGlobal)
@@ -587,7 +587,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object")
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setMaximumWidth",function_setMaximumWidth)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setMaximumHeight",function_setMaximumHeight)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"move",function_move)
- KVSO_REGISTER_HANDLER(KviKvsObject_widget,"sizeHint",function_sizeHint)
+ KVSO_REGISTER_HANDLER(KviKvsObject_widget,"tqsizeHint",function_tqsizeHint)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"resize",function_resize)
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setFocusPolicy",function_setFocusPolicy)
@@ -639,11 +639,11 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_widget)
bool KviKvsObject_widget::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams)
{
- setObject(new QWidget(parentScriptWidget(),getName()),true);
+ setObject(TQT_TQOBJECT(new TQWidget(tqparentScriptWidget(),getName())),true);
return true;
}
-bool KviKvsObject_widget::eventFilter(QObject *o,QEvent *e)
+bool KviKvsObject_widget::eventFilter(TQObject *o,TQEvent *e)
{
if(o == object())
{
@@ -655,203 +655,203 @@ bool KviKvsObject_widget::eventFilter(QObject *o,QEvent *e)
switch(e->type())
{
#ifdef COMPILE_USE_QT4
- case QEvent::ToolTip:
+ case TQEvent::ToolTip:
{
- QHelpEvent *helpEvent = static_cast<QHelpEvent *>(e);
- QPoint point=helpEvent->pos();
- QString szTooltip;
+ TQHelpEvent *helpEvent = static_cast<TQHelpEvent *>(e);
+ TQPoint point=helpEvent->pos();
+ TQString szTooltip;
KviKvsVariant *tipret=new KviKvsVariant(szTooltip);
KviKvsVariantList params(new KviKvsVariant((kvs_int_t)point.x()),new KviKvsVariant((kvs_int_t)point.y()));
callFunction(this,"maybeTipEvent",tipret,&params);
tipret->asString(szTooltip);
- QToolTip::showText(helpEvent->globalPos(),szTooltip);
+ TQToolTip::showText(helpEvent->globalPos(),szTooltip);
break;
}
#endif
- case QEvent::Paint:
+ case TQEvent::Paint:
{
- QRect rect=((QPaintEvent *)e)->rect();
+ TQRect rect=((TQPaintEvent *)e)->rect();
KviKvsVariantList params(new KviKvsVariant((kvs_int_t)rect.x()),new KviKvsVariant((kvs_int_t)rect.y()),new KviKvsVariant((kvs_int_t)rect.width()),new KviKvsVariant((kvs_int_t)rect.height()));
callFunction(this,"paintEvent",retv,&params);
break;
}
- case QEvent::KeyPress:
+ case TQEvent::KeyPress:
{
- QString tmp="";
- switch(((QKeyEvent *)e)->key())
+ TQString tmp="";
+ switch(((TQKeyEvent *)e)->key())
{
- case Qt::Key_Return:
+ case TQt::Key_Return:
tmp="Return";
break;
- case Qt::Key_Down:
+ case TQt::Key_Down:
tmp="Down";
break;
- case Qt::Key_Up:
+ case TQt::Key_Up:
tmp="Up";
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
tmp="Left";
break;
- case Qt::Key_Right:
+ case TQt::Key_Right:
tmp="Right";
break;
- case Qt::Key_Shift:
+ case TQt::Key_Shift:
tmp="Shift";
break;
- case Qt::Key_Control:
+ case TQt::Key_Control:
tmp="Ctrl";
break;
- case Qt::Key_Alt:
+ case TQt::Key_Alt:
tmp="Alt";
break;
- case Qt::Key_CapsLock:
+ case TQt::Key_CapsLock:
tmp="CapsLock";
break;
- case Qt::Key_Backspace:
+ case TQt::Key_Backspace:
tmp="Backspace";
break;
- case Qt::Key_Delete:
+ case TQt::Key_Delete:
tmp="Del";
break;
- case Qt::Key_Enter:
+ case TQt::Key_Enter:
tmp="Enter";
break;
- case Qt::Key_Escape:
+ case TQt::Key_Escape:
tmp="Esc";
break;
- case Qt::Key_0:
+ case TQt::Key_0:
tmp="0";
- case Qt::Key_1:
+ case TQt::Key_1:
tmp="1";
break;
- case Qt::Key_2:
+ case TQt::Key_2:
tmp="2";
break;
- case Qt::Key_3:
+ case TQt::Key_3:
tmp="3";
break;
- case Qt::Key_4:
+ case TQt::Key_4:
tmp="4";
break;
- case Qt::Key_5:
+ case TQt::Key_5:
tmp="5";
break;
- case Qt::Key_6:
+ case TQt::Key_6:
tmp="6";
break;
- case Qt::Key_7:
+ case TQt::Key_7:
tmp="7";
break;
- case Qt::Key_8:
+ case TQt::Key_8:
tmp="8";
break;
- case Qt::Key_9:
+ case TQt::Key_9:
tmp="9";
break;
- case Qt::Key_Plus:
+ case TQt::Key_Plus:
tmp="+";
break;
- case Qt::Key_Minus:
+ case TQt::Key_Minus:
tmp="-";
break;
- case Qt::Key_Slash:
+ case TQt::Key_Slash:
tmp="/";
break;
- case Qt::Key_Asterisk:
+ case TQt::Key_Asterisk:
tmp="*";
break;
- case Qt::Key_Period:
+ case TQt::Key_Period:
tmp=".";
break;
- case Qt::Key_ParenLeft:
+ case TQt::Key_ParenLeft:
tmp="(";
break;
- case Qt::Key_ParenRight:
+ case TQt::Key_ParenRight:
tmp=")";
break;
- case Qt::Key_Equal:
+ case TQt::Key_Equal:
tmp="=";
break;
- case Qt::Key_AsciiCircum:
+ case TQt::Key_AsciiCircum:
tmp="^";
break;
default:
- if (!((QKeyEvent *)e)->text().isEmpty()) tmp = ((QKeyEvent *)e)->text();
+ if (!((TQKeyEvent *)e)->text().isEmpty()) tmp = ((TQKeyEvent *)e)->text();
}
KviKvsVariantList params(new KviKvsVariant(tmp));
callFunction(this,"keyPressEvent",0,&params);
}
break;
- case QEvent::MouseButtonPress:
- if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
+ case TQEvent::MouseButtonPress:
+ if(((TQMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
else {
- if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
+ if(((TQMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
else aparam = 2;
}
- if(!callFunction(this,"mousePressEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())
+ if(!callFunction(this,"mousePressEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().y())
))) brokenhandler = true; // ignore results of a broken event handler
break;
- case QEvent::MouseButtonRelease:
- if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
+ case TQEvent::MouseButtonRelease:
+ if(((TQMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
else {
- if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
+ if(((TQMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
else aparam = 2;
}
- if(!callFunction(this,"mouseReleaseEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())
+ if(!callFunction(this,"mouseReleaseEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().y())
))) brokenhandler = true; // ignore results of a broken event handler
break;
- case QEvent::MouseButtonDblClick:
- if(( (QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
+ case TQEvent::MouseButtonDblClick:
+ if(( (TQMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0;
else {
- if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
+ if(((TQMouseEvent *)e)->button() & Qt::RightButton)aparam = 1;
else aparam = 2;
}
- if(!callFunction(this,"mouseDoubleClickEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())
+ if(!callFunction(this,"mouseDoubleClickEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().y())
))) brokenhandler = true; // ignore results of a broken event handler
break;
- case QEvent::MouseMove:
- if( (((QMouseEvent *)e)->state()) & Qt::LeftButton) aparam = 0;
+ case TQEvent::MouseMove:
+ if( (((TQMouseEvent *)e)->state()) & Qt::LeftButton) aparam = 0;
else
{
- if(((QMouseEvent *)e)->state() & Qt::RightButton)aparam = 1;
+ if(((TQMouseEvent *)e)->state() & Qt::RightButton)aparam = 1;
else
{
- if(((QMouseEvent *)e)->state() & Qt::MidButton)aparam = 2;
+ if(((TQMouseEvent *)e)->state() & Qt::MidButton)aparam = 2;
else aparam = -1;
}
}
- if(!callFunction(this,"mouseMoveEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())
+ if(!callFunction(this,"mouseMoveEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((TQMouseEvent *)e)->pos().y())
))) brokenhandler = true; // ignore results of a broken event handler
break;
- case QEvent::FocusIn:
+ case TQEvent::FocusIn:
if(!callFunction(this,"focusInEvent",retv,0))brokenhandler = true;
break;
- case QEvent::FocusOut:
+ case TQEvent::FocusOut:
if(!callFunction(this,"focusOutEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Resize:
+ case TQEvent::Resize:
if(!callFunction(this,"resizeEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Move:
+ case TQEvent::Move:
if(!callFunction(this,"moveEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Close:
+ case TQEvent::Close:
if(!callFunction(this,"closeEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Enter:
+ case TQEvent::Enter:
if(!callFunction(this,"mouseEnterEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Leave:
+ case TQEvent::Leave:
if(!callFunction(this,"mouseLeaveEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Show:
+ case TQEvent::Show:
if(!callFunction(this,"showEvent",retv,0))brokenhandler = true;
break;
- case QEvent::Hide:
+ case TQEvent::Hide:
if(!callFunction(this,"hideEvent",retv,0))ret =false;
break;
default:
@@ -865,7 +865,7 @@ bool KviKvsObject_widget::eventFilter(QObject *o,QEvent *e)
/*
if(ret.length() == 1)
{
- if(KviQString::equalCI("1",ret))return true;
+ if(KviTQString::equalCI("1",ret))return true;
}
*/
}
@@ -900,7 +900,7 @@ bool KviKvsObject_widget::function_isEnabled(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_fontDescent(KviKvsObjectFunctionCall * c)
{
if(!widget()) return true;
- QFontMetrics fm = widget()->fontMetrics();
+ TQFontMetrics fm = widget()->fontMetrics();
int d = fm.descent();
c->returnValue()->setInteger(d);
return true;
@@ -909,27 +909,27 @@ bool KviKvsObject_widget::function_fontDescent(KviKvsObjectFunctionCall * c)
bool KviKvsObject_widget::function_fontAscent(KviKvsObjectFunctionCall * c)
{
if(!widget()) return true;
- QFontMetrics fm = widget()->fontMetrics();
+ TQFontMetrics fm = widget()->fontMetrics();
int d = fm.ascent();
c->returnValue()->setInteger(d);
return true;
}
-bool KviKvsObject_widget::function_repaint(KviKvsObjectFunctionCall * c)
+bool KviKvsObject_widget::function_tqrepaint(KviKvsObjectFunctionCall * c)
{
bool bEnabled;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled)
KVSO_PARAMETERS_END(c)
if(!widget()) return true;
- widget()->repaint(bEnabled);
+ widget()->tqrepaint(bEnabled);
return true;
}
bool KviKvsObject_widget::function_fontMetricsWidth(KviKvsObjectFunctionCall * c)
{
- QString m_szStr;
+ TQString m_szStr;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("string",KVS_PT_STRING,0,m_szStr)
KVSO_PARAMETERS_END(c)
@@ -955,9 +955,9 @@ bool KviKvsObject_widget::function_screenResolution(KviKvsObjectFunctionCall * c
return true;
}
-bool KviKvsObject_widget::function_geometry(KviKvsObjectFunctionCall *c)
+bool KviKvsObject_widget::function_tqgeometry(KviKvsObjectFunctionCall *c)
{
- QRect r = widget() ? widget()->geometry() : QRect(0,0,0,0);
+ TQRect r = widget() ? widget()->tqgeometry() : TQRect(0,0,0,0);
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)r.x()));
a->set(1,new KviKvsVariant((kvs_int_t)r.y()));
@@ -992,7 +992,7 @@ bool KviKvsObject_widget::function_setGeometry(KviKvsObjectFunctionCall *c)
if(pXOrArray->isArray())
{
- // the user has passed a complete geometry array as first parameter
+ // the user has passed a complete tqgeometry array as first parameter
// make sure it has at least 4 elements
if(pXOrArray->array()->size() < 4)
{
@@ -1009,12 +1009,12 @@ bool KviKvsObject_widget::function_setGeometry(KviKvsObjectFunctionCall *c)
// no parameter was set in that place
if(!(pX && pY && pW && pH))
{
- c->error(__tr2qs("One of the geometry array parameters is empty"));
+ c->error(__tr2qs("One of the tqgeometry array parameters is empty"));
return false;
}
if(!(pX->asInteger(iX) && pY->asInteger(iY) && pW->asInteger(iW) && pH->asInteger(iH)))
{
- c->error(__tr2qs("One of the geometry array parameters didn't evaluate to an integer"));
+ c->error(__tr2qs("One of the tqgeometry array parameters didn't evaluate to an integer"));
return false;
}
// ok: the params are correct
@@ -1049,7 +1049,7 @@ bool KviKvsObject_widget::function_mapToGlobal(KviKvsObjectFunctionCall *c)
KVSO_PARAMETER("x",KVS_PT_INT,0,iX)
KVSO_PARAMETER("y",KVS_PT_INT,0,iY)
KVSO_PARAMETERS_END(c)
- QPoint point=widget()->mapToGlobal(QPoint(iX,iY));
+ TQPoint point=widget()->mapToGlobal(TQPoint(iX,iY));
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)point.x()));
a->set(1,new KviKvsVariant((kvs_int_t)point.y()));
@@ -1066,7 +1066,7 @@ bool KviKvsObject_widget::function_mapFromGlobal(KviKvsObjectFunctionCall *c)
KVSO_PARAMETER("x",KVS_PT_INT,0,iX)
KVSO_PARAMETER("y",KVS_PT_INT,0,iY)
KVSO_PARAMETERS_END(c)
- QPoint point=widget()->mapFromGlobal(QPoint(iX,iY));
+ TQPoint point=widget()->mapFromGlobal(TQPoint(iX,iY));
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)point.x()));
a->set(1,new KviKvsVariant((kvs_int_t)point.y()));
@@ -1115,7 +1115,7 @@ bool KviKvsObject_widget::function_setPaletteForeground(KviKvsObjectFunctionCall
if (c->params()->count()==1)
{
bool bOk,bOk1,bOk2;
- QString value;
+ TQString value;
pColArray->asString(value);
int i=0;
if (value.length()!=6)
@@ -1123,7 +1123,7 @@ bool KviKvsObject_widget::function_setPaletteForeground(KviKvsObjectFunctionCall
c->warning(__tr2qs("A string of 6 digits hex is required"));
return true;
}
- QString buffer(value.mid(0,2));
+ TQString buffer(value.mid(0,2));
iColR=buffer.toInt(&bOk,16);
buffer=value.mid(2,2);
iColG=buffer.toInt(&bOk1,16);
@@ -1134,7 +1134,7 @@ bool KviKvsObject_widget::function_setPaletteForeground(KviKvsObjectFunctionCall
c->warning(__tr2qs("Not an hex digits"));
return true;
}
- if (widget()) widget()->setPaletteForegroundColor(QColor(iColR,iColG,iColB));
+ if (widget()) widget()->setPaletteForegroundColor(TQColor(iColR,iColG,iColB));
return true;
}
@@ -1150,7 +1150,7 @@ bool KviKvsObject_widget::function_setPaletteForeground(KviKvsObjectFunctionCall
return false;
}
}
- if (widget()) widget()->setPaletteForegroundColor(QColor(iColR,iColG,iColB));
+ if (widget()) widget()->setPaletteForegroundColor(TQColor(iColR,iColG,iColB));
return true;
}
@@ -1190,7 +1190,7 @@ bool KviKvsObject_widget::function_setBackgroundColor(KviKvsObjectFunctionCall *
if (c->params()->count()==1)
{
bool bOk,bOk1,bOk2;
- QString value;
+ TQString value;
pColArray->asString(value);
int i=0;
if (value.length()!=6)
@@ -1198,7 +1198,7 @@ bool KviKvsObject_widget::function_setBackgroundColor(KviKvsObjectFunctionCall *
c->warning(__tr2qs("A string of 6 digits hex is required"));
return true;
}
- QString buffer(value.mid(0,2));
+ TQString buffer(value.mid(0,2));
iColR=buffer.toInt(&bOk,16);
buffer=value.mid(2,2);
iColG=buffer.toInt(&bOk1,16);
@@ -1209,7 +1209,7 @@ bool KviKvsObject_widget::function_setBackgroundColor(KviKvsObjectFunctionCall *
c->warning(__tr2qs("Not an hex digits"));
return true;
}
- if (widget()) widget()->setBackgroundColor(QColor(iColR,iColG,iColB));
+ if (widget()) widget()->setBackgroundColor(TQColor(iColR,iColG,iColB));
return true;
}
@@ -1225,14 +1225,14 @@ bool KviKvsObject_widget::function_setBackgroundColor(KviKvsObjectFunctionCall *
return false;
}
}
- if (widget()) widget()->setBackgroundColor(QColor(iColR,iColG,iColB));
+ if (widget()) widget()->setBackgroundColor(TQColor(iColR,iColG,iColB));
return true;
}
bool KviKvsObject_widget::function_backgroundColor(KviKvsObjectFunctionCall *c)
{
if(!widget())return true;
- QColor col = widget()->backgroundColor();
+ TQColor col = widget()->backgroundColor();
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)col.red()));
a->set(1,new KviKvsVariant((kvs_int_t)col.green()));
@@ -1244,7 +1244,7 @@ bool KviKvsObject_widget::function_backgroundColor(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_foregroundColor(KviKvsObjectFunctionCall *c)
{
if(!widget())return true;
- QColor col = widget()->foregroundColor();
+ TQColor col = widget()->foregroundColor();
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)col.red()));
a->set(1,new KviKvsVariant((kvs_int_t)col.green()));
@@ -1256,7 +1256,7 @@ bool KviKvsObject_widget::function_foregroundColor(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_parentWidget(KviKvsObjectFunctionCall *c)
{
if(!widget())return true;
- if(parentScriptWidget()) c->returnValue()->setHObject(parentObject()->handle());
+ if(tqparentScriptWidget()) c->returnValue()->setHObject(tqparentObject()->handle());
else
c->returnValue()->setHObject((kvs_hobject_t)0);
return true;
@@ -1274,7 +1274,7 @@ bool KviKvsObject_widget::function_setMouseTracking(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_setCaption(KviKvsObjectFunctionCall *c)
{
- QString szCaption;
+ TQString szCaption;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("caption",KVS_PT_STRING,0,szCaption)
KVSO_PARAMETERS_END(c)
@@ -1331,11 +1331,11 @@ bool KviKvsObject_widget::function_hide(KviKvsObjectFunctionCall *)
bool KviKvsObject_widget::function_setToolTip(KviKvsObjectFunctionCall *c)
{
- QString szTooltip;
+ TQString szTooltip;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("tooltip",KVS_PT_STRING,0,szTooltip)
KVSO_PARAMETERS_END(c)
- if(widget())QToolTip::add( widget(), szTooltip );
+ if(widget())TQToolTip::add( widget(), szTooltip );
return true;
}
@@ -1447,13 +1447,13 @@ bool KviKvsObject_widget::function_move(KviKvsObjectFunctionCall *c)
}
if(!widget())return true;
- widget()->move(QPoint(iX,iY));
+ widget()->move(TQPoint(iX,iY));
return true;
}
-bool KviKvsObject_widget::function_sizeHint(KviKvsObjectFunctionCall *c)
+bool KviKvsObject_widget::function_tqsizeHint(KviKvsObjectFunctionCall *c)
{
if(!widget())return true;
- QSize sizehint = widget()->sizeHint();
+ TQSize sizehint = widget()->tqsizeHint();
KviKvsArray * a = new KviKvsArray();
a->set(0,new KviKvsVariant((kvs_int_t)sizehint.width()));
a->set(1,new KviKvsVariant((kvs_int_t)sizehint.height()));
@@ -1504,51 +1504,51 @@ bool KviKvsObject_widget::function_resize(KviKvsObjectFunctionCall *c)
}
if(!widget())return true;
- widget()->resize(QSize(iW,iH));
+ widget()->resize(TQSize(iW,iH));
return true;
}
bool KviKvsObject_widget::function_setFocusPolicy(KviKvsObjectFunctionCall *c)
{
- QString szMode;
+ TQString szMode;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("focus",KVS_PT_STRING,0,szMode)
KVSO_PARAMETERS_END(c)
if(!widget())return true;
- if(KviQString::equalCI(szMode, "TabFocus"))
- widget()->setFocusPolicy(QT_WIDGET_TABFOCUS);
+ if(KviTQString::equalCI(szMode, "TabFocus"))
+ widget()->setFocusPolicy(TQT_WIDGET_TABFOCUS);
else
- if(KviQString::equalCI(szMode, "ClickFocus"))
- widget()->setFocusPolicy(QT_WIDGET_CLICKFOCUS);
+ if(KviTQString::equalCI(szMode, "ClickFocus"))
+ widget()->setFocusPolicy(TQT_WIDGET_CLICKFOCUS);
else
- if(KviQString::equalCI(szMode, "StrongFocus"))
- widget()->setFocusPolicy(QT_WIDGET_STRONGFOCUS);
+ if(KviTQString::equalCI(szMode, "StrongFocus"))
+ widget()->setFocusPolicy(TQT_WIDGET_STRONGFOCUS);
else
- if(KviQString::equalCI(szMode, "NoFocus"))
- widget()->setFocusPolicy(QT_WIDGET_NOFOCUS);
+ if(KviTQString::equalCI(szMode, "NoFocus"))
+ widget()->setFocusPolicy(TQT_WIDGET_NOFOCUS);
else c->warning(__tr2qs("Invalid parameters"));
return true;
}
bool KviKvsObject_widget::function_setWFlags(KviKvsObjectFunctionCall *c)
{
- QStringList wflags;
- //Qt::WindowType sum;
+ TQStringList wflags;
+ //TQt::WindowType sum;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget_flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,wflags)
KVSO_PARAMETERS_END(c)
if (!widget()) return true;
#ifdef COMPILE_USE_QT4
- Qt::WindowFlags flag,sum=0;
+ TQt::WindowFlags flag,sum=0;
#else
int flag,sum=0;
#endif
- for ( QStringList::Iterator it = wflags.begin(); it != wflags.end(); ++it )
+ for ( TQStringList::Iterator it = wflags.begin(); it != wflags.end(); ++it )
{
flag=0;
for(unsigned int j = 0; j < widgettypes_num; j++)
{
- if(KviQString::equalCI((*it), widgettypes_tbl[j]))
+ if(KviTQString::equalCI((*it), widgettypes_tbl[j]))
{
flag=widgettypes_cod[j];
break;
@@ -1564,7 +1564,7 @@ bool KviKvsObject_widget::function_setWFlags(KviKvsObjectFunctionCall *c)
#ifdef COMPILE_USE_QT4
widget()->setWindowFlags(sum);
#else
- widget()->reparent(widget()->parentWidget(),sum,QPoint(widget()->x(),widget()->y()));
+ widget()->reparent(widget()->tqparentWidget(),sum,TQPoint(widget()->x(),widget()->y()));
#endif
return true;
}
@@ -1572,7 +1572,7 @@ bool KviKvsObject_widget::function_setWFlags(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_setFont(KviKvsObjectFunctionCall *c)
{
- QString szFamily,szStyle;
+ TQString szFamily,szStyle;
kvs_int_t uSize;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("size",KVS_PT_UNSIGNEDINTEGER,0,uSize)
@@ -1580,15 +1580,15 @@ bool KviKvsObject_widget::function_setFont(KviKvsObjectFunctionCall *c)
KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle)
KVSO_PARAMETERS_END(c)
if(!widget())return true;
- QFont font=widget()->font();
+ TQFont font=widget()->font();
font.setFamily(szFamily);
font.setPointSize(uSize);
- if(KviQString::equalCI(szStyle,"italic")) font.setItalic(TRUE);
- else if(KviQString::equalCI(szStyle,"bold")) font.setBold(TRUE);
- else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(TRUE);
- else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(TRUE);
- else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(TRUE);
- else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(TRUE);
+ if(KviTQString::equalCI(szStyle,"italic")) font.setItalic(TRUE);
+ else if(KviTQString::equalCI(szStyle,"bold")) font.setBold(TRUE);
+ else if(KviTQString::equalCI(szStyle,"underline"))font.setUnderline(TRUE);
+ else if(KviTQString::equalCI(szStyle,"overline")) font.setOverline(TRUE);
+ else if(KviTQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(TRUE);
+ else if(KviTQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(TRUE);
else c->warning(__tr2qs("Unknown style '%Q'"),&szStyle);
widget()->setFont(font);
return true;
@@ -1616,7 +1616,7 @@ bool KviKvsObject_widget::function_addWidgetToWrappedLayout(KviKvsObjectFunction
c->warning(__tr2qs("Widget parameter is not a valid object"));
return true;
}
- QLayout *lay=widget()->layout();
+ TQLayout *lay=widget()->tqlayout();
if (!lay)
{
c->warning(__tr2qs("No Layout associated to the widget "));
@@ -1627,7 +1627,7 @@ bool KviKvsObject_widget::function_addWidgetToWrappedLayout(KviKvsObjectFunction
c->warning(__tr2qs("Can't add a non-widget object"));
return true;
}
- lay->add(((QWidget *)(ob->object())));
+ lay->add(((TQWidget *)(ob->object())));
return true;
}
bool KviKvsObject_widget::function_reparent(KviKvsObjectFunctionCall *c)
@@ -1641,7 +1641,7 @@ bool KviKvsObject_widget::function_reparent(KviKvsObjectFunctionCall *c)
if(!widget()) return true;
if(!ob)
{
- widget()->reparent(0,QPoint(widget()->x(),widget()->y()));
+ widget()->reparent(0,TQPoint(widget()->x(),widget()->y()));
return true;
}
else
@@ -1650,41 +1650,41 @@ bool KviKvsObject_widget::function_reparent(KviKvsObjectFunctionCall *c)
c->warning(__tr("Parent must be a widget object"));
return true;
}
- widget()->reparent(((QWidget *)(ob->object())),QPoint(((QWidget *)(ob->object()))->x(),((QWidget *)(ob->object()))->y()));
+ widget()->reparent(((TQWidget *)(ob->object())),TQPoint(((TQWidget *)(ob->object()))->x(),((TQWidget *)(ob->object()))->y()));
return true;
}
bool KviKvsObject_widget::function_setIcon(KviKvsObjectFunctionCall *c)
{
- QString icon;
+ TQString icon;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("icon",KVS_PT_STRING,0,icon)
KVSO_PARAMETERS_END(c)
if(!widget())return true;
- QPixmap * pix = g_pIconManager->getImage(icon);
+ TQPixmap * pix = g_pIconManager->getImage(icon);
if(pix)widget()->setIcon(*pix);
return true;
}
bool KviKvsObject_widget::function_setBackgroundImage(KviKvsObjectFunctionCall *c)
{
- QString image;
+ TQString image;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("image",KVS_PT_STRING,0,image)
KVSO_PARAMETERS_END(c)
if(!widget())return true;
- QPixmap * pix = g_pIconManager->getImage(image);
+ TQPixmap * pix = g_pIconManager->getImage(image);
if(pix)widget()->setPaletteBackgroundPixmap(*pix);
return true;
}
bool KviKvsObject_widget::function_globalCursorX(KviKvsObjectFunctionCall *c)
{
- if(widget())c->returnValue()->setInteger(QCursor::pos().x());
+ if(widget())c->returnValue()->setInteger(TQCursor::pos().x());
return true;
}
bool KviKvsObject_widget::function_globalCursorY(KviKvsObjectFunctionCall *c)
{
- if(widget())c->returnValue()->setInteger(QCursor::pos().y());
+ if(widget())c->returnValue()->setInteger(TQCursor::pos().y());
return true;
}
bool KviKvsObject_widget::function_setMask(KviKvsObjectFunctionCall *c)
@@ -1706,20 +1706,20 @@ bool KviKvsObject_widget::function_setMask(KviKvsObjectFunctionCall *c)
c->warning(__tr2qs("Pixmap object required"));
return true;
}
- QPixmap * pm=((KviKvsObject_pixmap *)obj)->getPixmap();
+ TQPixmap * pm=((KviKvsObject_pixmap *)obj)->getPixmap();
#ifdef COMPILE_USE_QT4
- QBitmap mask(pm->mask());
+ TQBitmap tqmask(pm->tqmask());
#else
- QBitmap mask(*pm->mask());
+ TQBitmap tqmask(*pm->tqmask());
#endif
- if (mask.isNull()) c->warning(__tr2qs("Null mask"));
- widget()->setMask(mask);
+ if (tqmask.isNull()) c->warning(__tr2qs("Null tqmask"));
+ widget()->setMask(tqmask);
return true;
}
#ifdef COMPILE_USE_QT4
bool KviKvsObject_widget::function_setAttribute(KviKvsObjectFunctionCall *c)
{
- QString attribute;
+ TQString attribute;
bool bFlag;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget_atribute",KVS_PT_STRING,0,attribute)
@@ -1730,7 +1730,7 @@ bool KviKvsObject_widget::function_setAttribute(KviKvsObjectFunctionCall *c)
unsigned int j = 0;
for(; j < widgetattributes_num; j++)
{
- if(KviQString::equalCI(attribute, widgetattributes_tbl[j]))
+ if(KviTQString::equalCI(attribute, widgetattributes_tbl[j]))
{
found=true;
break;