summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/factories/containerfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/formeditor/factories/containerfactory.cpp')
-rw-r--r--kexi/formeditor/factories/containerfactory.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/formeditor/factories/containerfactory.cpp b/kexi/formeditor/factories/containerfactory.cpp
index 8b0d5fc5..b0005dd9 100644
--- a/kexi/formeditor/factories/containerfactory.cpp
+++ b/kexi/formeditor/factories/containerfactory.cpp
@@ -244,11 +244,11 @@ InsertPageCommand::execute()
TQWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget();
if(m_name.isEmpty()) {
m_name = container->form()->objectTree()->generateUniqueName(
- container->form()->library()->displayName(TQWIDGET_OBJECT_NAME_STRING).latin1(),
+ container->form()->library()->displayName("TQWidget").latin1(),
/*!numberSuffixRequired*/false);
}
- TQWidget *page = container->form()->library()->createWidget(TQWIDGET_OBJECT_NAME_STRING, parent, m_name.latin1(), container);
+ TQWidget *page = container->form()->library()->createWidget("TQWidget", parent, m_name.latin1(), container);
// TQWidget *page = new ContainerWidget(parent, m_name.latin1());
// new KFormDesigner::Container(container, page, parent);
@@ -263,7 +263,7 @@ InsertPageCommand::execute()
KFormDesigner::ObjectTreeItem *item = container->form()->objectTree()->lookup(m_name);
item->addModifiedProperty("title", n);
}
- else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING)
+ else if(classname == "TQWidgetStack")
{
TQWidgetStack *stack = (TQWidgetStack*)parent;
stack->addWidget(page, m_pageid);
@@ -291,7 +291,7 @@ InsertPageCommand::unexecute()
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent);
tab->removePage(page);
}
- else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING)
+ else if(classname == "TQWidgetStack")
{
TQWidgetStack *stack = (TQWidgetStack*)parent;
int id = stack->id(page) - 1;
@@ -357,7 +357,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
{
KFormDesigner::WidgetInfo *wBtnGroup = new KFormDesigner::WidgetInfo(this);
wBtnGroup->setPixmap("frame");
- wBtnGroup->setClassName(TQBUTTONGROUP_OBJECT_NAME_STRING);
+ wBtnGroup->setClassName("TQButtonGroup");
wBtnGroup->setName(i18n("Button Group"));
wBtnGroup->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "buttonGroup"));
@@ -369,11 +369,11 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
wTabWidget->setClassName("KFDTabWidget");
#if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9)
wTabWidget->addAlternateClassName("KTabWidget");
- wTabWidget->addAlternateClassName(TQTABWIDGET_OBJECT_NAME_STRING);
-//tmp: wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING);
+ wTabWidget->addAlternateClassName("TQTabWidget");
+//tmp: wTabWidget->setSavingName("TQTabWidget");
wTabWidget->setSavingName("KTabWidget");
#else
- wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING);
+ wTabWidget->setSavingName("TQTabWidget");
#endif
wTabWidget->setIncludeFileName("ktabwidget.h");
wTabWidget->setName(i18n("Tab Widget"));
@@ -384,7 +384,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
KFormDesigner::WidgetInfo *wWidget = new KFormDesigner::WidgetInfo(this);
wWidget->setPixmap("frame");
- wWidget->setClassName(TQWIDGET_OBJECT_NAME_STRING);
+ wWidget->setClassName("TQWidget");
wWidget->addAlternateClassName("ContainerWidget");
wWidget->setName(i18n("Basic container"));
wWidget->setNamePrefix(
@@ -394,7 +394,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
KFormDesigner::WidgetInfo *wGroupBox = new KFormDesigner::WidgetInfo(this);
wGroupBox->setPixmap("groupbox");
- wGroupBox->setClassName(TQGROUPBOX_OBJECT_NAME_STRING);
+ wGroupBox->setClassName("TQGroupBox");
wGroupBox->addAlternateClassName("GroupBox");
wGroupBox->setName(i18n("Group Box"));
wGroupBox->setNamePrefix(
@@ -404,7 +404,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
KFormDesigner::WidgetInfo *wFrame = new KFormDesigner::WidgetInfo(this);
wFrame->setPixmap("frame");
- wFrame->setClassName(TQFRAME_OBJECT_NAME_STRING);
+ wFrame->setClassName("TQFrame");
wFrame->setName(i18n("Frame"));
wFrame->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "frame"));
@@ -413,7 +413,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
KFormDesigner::WidgetInfo *wWidgetStack = new KFormDesigner::WidgetInfo(this);
wWidgetStack->setPixmap("widgetstack");
- wWidgetStack->setClassName(TQWIDGETSTACK_OBJECT_NAME_STRING);
+ wWidgetStack->setClassName("TQWidgetStack");
wWidgetStack->setName(i18n("Widget Stack"));
wWidgetStack->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "widgetStack"));
@@ -451,7 +451,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin
//! @todo horizontal/vertical splitter icons
wSplitter->setPixmap("frame");
wSplitter->setClassName("Splitter");
- wSplitter->addAlternateClassName(TQSPLITTER_OBJECT_NAME_STRING);
+ wSplitter->addAlternateClassName("TQSplitter");
wSplitter->setName(i18n("Splitter"));
wSplitter->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "splitter"));
@@ -508,7 +508,7 @@ TQWidget*
ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
KFormDesigner::Container *container, int options)
{
- if(c == TQBUTTONGROUP_OBJECT_NAME_STRING)
+ if(c == "TQButtonGroup")
{
TQString text = container->form()->library()->textForWidgetName(n, c);
TQButtonGroup *w = new TQButtonGroup(/*i18n("Button Group")*/text, p, n);
@@ -538,20 +538,20 @@ ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
return tab;
}
- else if(c == TQWIDGET_OBJECT_NAME_STRING || c=="ContainerWidget")
+ else if(c == "TQWidget" || c=="ContainerWidget")
{
TQWidget *w = new ContainerWidget(p, n);
new KFormDesigner::Container(container, w, TQT_TQOBJECT(p));
return w;
}
- else if(c == TQGROUPBOX_OBJECT_NAME_STRING || c == "GroupBox")
+ else if(c == "TQGroupBox" || c == "GroupBox")
{
TQString text = container->form()->library()->textForWidgetName(n, c);
TQGroupBox *w = new GroupBox(text, p, n);
new KFormDesigner::Container(container, w, container);
return w;
}
- else if(c == TQFRAME_OBJECT_NAME_STRING)
+ else if(c == "TQFrame")
{
TQFrame *w = new TQFrame(p, n);
w->setLineWidth(2);
@@ -559,7 +559,7 @@ ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
new KFormDesigner::Container(container, w, container);
return w;
}
- else if(c == TQWIDGETSTACK_OBJECT_NAME_STRING)
+ else if(c == "TQWidgetStack")
{
TQWidgetStack *stack = new TQWidgetStack(p, n);
stack->setLineWidth(2);
@@ -606,7 +606,7 @@ ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
SubForm *subform = new SubForm(p, n);
return subform;
}
- else if(c == TQSPLITTER_OBJECT_NAME_STRING) {
+ else if(c == "TQSplitter") {
TQSplitter *split = new TQSplitter(p, n);
if (0 == (options & WidgetFactory::AnyOrientation))
split->setOrientation(
@@ -651,9 +651,9 @@ ContainerFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQP
//m_widget = w;
// m_container = container;
- if((classname == "KFDTabWidget") || (w->parentWidget()->parentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
+ if((classname == "KFDTabWidget") || (w->parentWidget()->parentWidget()->inherits("TQTabWidget")))
{
- if(w->parentWidget()->parentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+ if(w->parentWidget()->parentWidget()->inherits("TQTabWidget"))
{
//m_widget = w->parentWidget()->parentWidget();
setWidget(w->parentWidget()->parentWidget(), m_container->toplevel());
@@ -668,7 +668,7 @@ ContainerFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQP
menu->setItemEnabled(id, false);
return true;
}
- else if(w->parentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING) && !w->parentWidget()->parentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+ else if(w->parentWidget()->isA("TQWidgetStack") && !w->parentWidget()->parentWidget()->inherits("TQTabWidget"))
{
//m_widget = w->parentWidget();
TQWidgetStack *stack = (TQWidgetStack*)w->parentWidget(); //m_widget;
@@ -702,14 +702,14 @@ bool
ContainerFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container)
{
m_container = container;
- if(classname == TQBUTTONGROUP_OBJECT_NAME_STRING)
+ if(classname == "TQButtonGroup")
{
TQButtonGroup *group = static_cast<TQButtonGroup*>(w);
TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
createEditor(classname, group->title(), group, container, r, TQt::AlignAuto);
return true;
}
- if(classname == TQGROUPBOX_OBJECT_NAME_STRING || classname == "GroupBox")
+ if(classname == "TQGroupBox" || classname == "GroupBox")
{
TQGroupBox *group = static_cast<TQGroupBox*>(w);
TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
@@ -722,12 +722,12 @@ ContainerFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes
bool
ContainerFactory::saveSpecialProperty(const TQCString &, const TQString &name, const TQVariant &, TQWidget *w, TQDomElement &parentNode, TQDomDocument &parent)
{
- if((name == "title") && (w->parentWidget()->parentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
+ if((name == "title") && (w->parentWidget()->parentWidget()->inherits("TQTabWidget")))
{
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget()->parentWidget());
KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "title", tab->tabLabel(w));
}
- else if((name == "id") && (w->parentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)))
+ else if((name == "id") && (w->parentWidget()->isA("TQWidgetStack")))
{
TQWidgetStack *stack = (TQWidgetStack*)w->parentWidget();
KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "id", stack->id(w));
@@ -741,7 +741,7 @@ bool
ContainerFactory::readSpecialProperty(const TQCString &, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item)
{
TQString name = node.attribute("name");
- if((name == "title") && (item->parent()->widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
+ if((name == "title") && (item->parent()->widget()->inherits("TQTabWidget")))
{
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget());
tab->addTab(w, node.firstChild().toElement().text());
@@ -749,7 +749,7 @@ ContainerFactory::readSpecialProperty(const TQCString &, TQDomElement &node, TQW
return true;
}
- if((name == "id") && (w->parentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)))
+ if((name == "id") && (w->parentWidget()->isA("TQWidgetStack")))
{
TQWidgetStack *stack = (TQWidgetStack*)w->parentWidget();
int id = KFormDesigner::FormIO::readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt();
@@ -768,7 +768,7 @@ ContainerFactory::autoSaveProperties(const TQCString &c)
TQValueList<TQCString> lst;
// if(c == "SubForm")
// lst << "formName";
- if(c == TQSPLITTER_OBJECT_NAME_STRING)
+ if(c == "TQSplitter")
lst << "orientation";
return lst;
}
@@ -784,7 +784,7 @@ ContainerFactory::isPropertyVisibleInternal(const TQCString &classname,
{
return property == "name" || property == "geometry";
}
- else if (classname == TQGROUPBOX_OBJECT_NAME_STRING || classname=="GroupBox") {
+ else if (classname == "TQGroupBox" || classname=="GroupBox") {
ok =
#ifdef KEXI_NO_UNFINISHED
/*! @todo Hidden for now in Kexi. "checkable" and "checked" props need adding
@@ -821,8 +821,8 @@ ContainerFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCStri
void ContainerFactory::addTabPage()
{
-// if (!m_widget->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
- if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+// if (!m_widget->inherits("TQTabWidget"))
+ if (!widget()->inherits("TQTabWidget"))
return;
KCommand *com = new InsertPageCommand(m_container, widget());
if(dynamic_cast<TabWidgetBase*>(widget())->count() == 0)
@@ -836,7 +836,7 @@ void ContainerFactory::addTabPage()
void ContainerFactory::removeTabPage()
{
- if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+ if (!widget()->inherits("TQTabWidget"))
return;
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget());
TQWidget *w = tab->currentPage();
@@ -850,7 +850,7 @@ void ContainerFactory::removeTabPage()
void ContainerFactory::renameTabPage()
{
- if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+ if (!widget()->inherits("TQTabWidget"))
return;
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget());
TQWidget *w = tab->currentPage();
@@ -878,7 +878,7 @@ void ContainerFactory::reorderTabs(int oldpos, int newpos)
void ContainerFactory::addStackPage()
{
- if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))
+ if (!widget()->isA("TQWidgetStack"))
return;
KCommand *com = new InsertPageCommand(m_container, widget());
if(!((TQWidgetStack*)widget())->visibleWidget())
@@ -892,7 +892,7 @@ void ContainerFactory::addStackPage()
void ContainerFactory::removeStackPage()
{
- if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))
+ if (!widget()->isA("TQWidgetStack"))
return;
TQWidgetStack *stack = (TQWidgetStack*)widget();
TQWidget *page = stack->visibleWidget();