diff options
Diffstat (limited to 'kexi/formeditor/factories/stdwidgetfactory.cpp')
-rw-r--r-- | kexi/formeditor/factories/stdwidgetfactory.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/formeditor/factories/stdwidgetfactory.cpp b/kexi/formeditor/factories/stdwidgetfactory.cpp index adb4d1bf..a74097a0 100644 --- a/kexi/formeditor/factories/stdwidgetfactory.cpp +++ b/kexi/formeditor/factories/stdwidgetfactory.cpp @@ -125,7 +125,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this); wLabel->setPixmap("label"); - wLabel->setClassName(TQLABEL_OBJECT_NAME_STRING); + wLabel->setClassName("TQLabel"); wLabel->setName(i18n("Text Label")); wLabel->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.", "label")); @@ -137,7 +137,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin wPixLabel->setClassName("KexiPictureLabel"); wPixLabel->setName(i18n("Picture Label")); //! @todo TQt designer compatibility: maybe use this class when TQLabel has a pixmap set...? - //wPixLabel->addAlternateClassName(TQLABEL_OBJECT_NAME_STRING); + //wPixLabel->addAlternateClassName("TQLabel"); wPixLabel->setSavingName("KexiPictureLabel"); wPixLabel->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.", "picture")); @@ -147,7 +147,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wLineEdit = new KFormDesigner::WidgetInfo(this); wLineEdit->setPixmap("lineedit"); wLineEdit->setClassName("KLineEdit"); - wLineEdit->addAlternateClassName(TQLINEEDIT_OBJECT_NAME_STRING); + wLineEdit->addAlternateClassName("TQLineEdit"); wLineEdit->setIncludeFileName("klineedit.h"); wLineEdit->setName(i18n("Line Edit")); wLineEdit->setNamePrefix( @@ -167,7 +167,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wPushButton = new KFormDesigner::WidgetInfo(this); wPushButton->setPixmap("button"); wPushButton->setClassName("KPushButton"); - wPushButton->addAlternateClassName(TQPUSHBUTTON_OBJECT_NAME_STRING); + wPushButton->addAlternateClassName("TQPushButton"); wPushButton->setIncludeFileName("kpushbutton.h"); wPushButton->setName(i18n("Push Button")); wPushButton->setNamePrefix( @@ -177,7 +177,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wRadioButton = new KFormDesigner::WidgetInfo(this); wRadioButton->setPixmap("radio"); - wRadioButton->setClassName(TQRADIOBUTTON_OBJECT_NAME_STRING); + wRadioButton->setClassName("TQRadioButton"); wRadioButton->setName(i18n("Option Button")); wRadioButton->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.", "optionButton")); @@ -186,7 +186,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wCheckBox = new KFormDesigner::WidgetInfo(this); wCheckBox->setPixmap("check"); - wCheckBox->setClassName(TQCHECKBOX_OBJECT_NAME_STRING); + wCheckBox->setClassName("TQCheckBox"); wCheckBox->setName(i18n("Check Box")); wCheckBox->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.", "checkBox")); @@ -196,7 +196,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wSpinBox = new KFormDesigner::WidgetInfo(this); wSpinBox->setPixmap("spin"); wSpinBox->setClassName("KIntSpinBox"); - wSpinBox->addAlternateClassName(TQSPINBOX_OBJECT_NAME_STRING); + wSpinBox->addAlternateClassName("TQSpinBox"); wSpinBox->setIncludeFileName("knuminput.h"); wSpinBox->setName(i18n("Spin Box")); wSpinBox->setNamePrefix( @@ -207,7 +207,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wComboBox = new KFormDesigner::WidgetInfo(this); wComboBox->setPixmap("combo"); wComboBox->setClassName("KComboBox"); - wComboBox->addAlternateClassName(TQCOMBOBOX_OBJECT_NAME_STRING); + wComboBox->addAlternateClassName("TQComboBox"); wComboBox->setIncludeFileName("kcombobox.h"); wComboBox->setName(i18n("Combo Box")); wComboBox->setNamePrefix( @@ -218,7 +218,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wListBox = new KFormDesigner::WidgetInfo(this); wListBox->setPixmap("listbox"); wListBox->setClassName("TDEListBox"); - wListBox->addAlternateClassName(TQLISTBOX_OBJECT_NAME_STRING); + wListBox->addAlternateClassName("TQListBox"); wListBox->setIncludeFileName("tdelistbox.h"); wListBox->setName(i18n("List Box")); wListBox->setNamePrefix( @@ -229,7 +229,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wTextEdit = new KFormDesigner::WidgetInfo(this); wTextEdit->setPixmap("textedit"); wTextEdit->setClassName("KTextEdit"); - wTextEdit->addAlternateClassName(TQTEXTEDIT_OBJECT_NAME_STRING); + wTextEdit->addAlternateClassName("TQTextEdit"); wTextEdit->setIncludeFileName("ktextedit.h"); wTextEdit->setName(i18n("Text Editor")); wTextEdit->setNamePrefix( @@ -240,7 +240,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wListView = new KFormDesigner::WidgetInfo(this); wListView->setPixmap("listview"); wListView->setClassName("TDEListView"); - wListView->addAlternateClassName(TQLISTVIEW_OBJECT_NAME_STRING); + wListView->addAlternateClassName("TQListView"); wListView->setIncludeFileName("tdelistview.h"); wListView->setName(i18n("List View")); wListView->setNamePrefix( @@ -250,7 +250,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wSlider = new KFormDesigner::WidgetInfo(this); wSlider->setPixmap("slider"); - wSlider->setClassName(TQSLIDER_OBJECT_NAME_STRING); + wSlider->setClassName("TQSlider"); wSlider->setName(i18n("Slider")); wSlider->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.", "slider")); @@ -260,7 +260,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin KFormDesigner::WidgetInfo *wProgressBar = new KFormDesigner::WidgetInfo(this); wProgressBar->setPixmap("progress"); wProgressBar->setClassName("KProgress"); - wProgressBar->addAlternateClassName(TQPROGRESSBAR_OBJECT_NAME_STRING); + wProgressBar->addAlternateClassName("TQProgressBar"); wProgressBar->setIncludeFileName("kprogress.h"); wProgressBar->setName(i18n("Progress Bar")); wProgressBar->setNamePrefix( @@ -281,7 +281,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin wDate->setPixmap("dateedit"); wDate->setClassName("KDateWidget"); #if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9) - wDate->addAlternateClassName(TQDATEEDIT_OBJECT_NAME_STRING); + wDate->addAlternateClassName("TQDateEdit"); wDate->setIncludeFileName("kdatewidget.h"); #endif wDate->setName(i18n("Date Widget")); @@ -294,7 +294,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin wTime->setPixmap("timeedit"); wTime->setClassName("KTimeWidget"); #if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9) - wTime->addAlternateClassName(TQTIMEEDIT_OBJECT_NAME_STRING); + wTime->addAlternateClassName("TQTimeEdit"); wTime->setIncludeFileName("ktimewidget.h"); #endif wTime->setName(i18n("Time Widget")); @@ -307,7 +307,7 @@ StdWidgetFactory::StdWidgetFactory(TQObject *parent, const char *, const TQStrin wDateTime->setPixmap("datetimeedit"); wDateTime->setClassName("KDateTimeWidget"); #if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9) - wDateTime->addAlternateClassName(TQDATETIMEEDIT_OBJECT_NAME_STRING); + wDateTime->addAlternateClassName("TQDateTimeEdit"); wDateTime->setIncludeFileName("kdatetimewidget.h"); #endif wDateTime->setName(i18n("Date/Time Widget")); @@ -385,7 +385,7 @@ StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, TQString text( container->form()->library()->textForWidgetName(n, c) ); const bool designMode = options & KFormDesigner::WidgetFactory::DesignViewMode; - if(c == TQLABEL_OBJECT_NAME_STRING) + if(c == "TQLabel") w = new TQLabel(text, p, n); else if(c == "KexiPictureLabel") w = new KexiPictureLabel(DesktopIcon("image-x-generic"), p, n); @@ -399,10 +399,10 @@ StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, else if(c == "KPushButton") w = new KPushButton(/*i18n("Button")*/text, p, n); - else if(c == TQRADIOBUTTON_OBJECT_NAME_STRING) + else if(c == "TQRadioButton") w = new TQRadioButton(/*i18n("Radio Button")*/text, p, n); - else if(c == TQCHECKBOX_OBJECT_NAME_STRING) + else if(c == "TQCheckBox") w = new TQCheckBox(/*i18n("Check Box")*/text, p, n); else if(c == "KIntSpinBox") @@ -424,7 +424,7 @@ StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, ((TDEListView*)w)->addColumn(i18n("Column 1")); ((TDEListView*)w)->setRootIsDecorated(true); } - else if(c == TQSLIDER_OBJECT_NAME_STRING) + else if(c == "TQSlider") w = new TQSlider(Qt::Horizontal, p, n); else if(c == "KProgress") @@ -470,7 +470,7 @@ bool StdWidgetFactory::createMenuActions(const TQCString &classname, TQWidget *, TQPopupMenu *menu, KFormDesigner::Container *) { - if((classname == TQLABEL_OBJECT_NAME_STRING) || (classname == "KTextEdit")) + if((classname == "TQLabel") || (classname == "KTextEdit")) { menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, TQT_SLOT(editText())); return true; @@ -495,7 +495,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true); return true; } - else if(classname == TQLABEL_OBJECT_NAME_STRING) + else if(classname == "TQLabel") { TQLabel *label = static_cast<TQLabel*>(w); if(label->textFormat() == RichText) @@ -520,7 +520,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes createEditor(classname, push->text(), push, container, editorRect, TQt::AlignCenter, false, false, TQt::PaletteButton); return true; } - else if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) + else if(classname == "TQRadioButton") { TQRadioButton *radio = static_cast<TQRadioButton*>(w); TQRect r = w->style().subRect(TQStyle::SR_RadioButtonContents, w); @@ -528,7 +528,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes createEditor(classname, radio->text(), radio, container, editorRect, TQt::AlignAuto); return true; } - else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) + else if(classname == "TQCheckBox") { TQCheckBox *check = static_cast<TQCheckBox*>(w); //TQRect r(check->geometry()); @@ -609,7 +609,7 @@ StdWidgetFactory::changeText(const TQString &text) TQFontMetrics fm = w->fontMetrics(); TQSize s(fm.width( text ), fm.height()); int width; - if(n == TQLABEL_OBJECT_NAME_STRING) // labels are resized to fit the text + if(n == "TQLabel") // labels are resized to fit the text { w->resize(w->sizeHint()); WidgetFactory::m_editor->resize(w->size()); @@ -618,9 +618,9 @@ StdWidgetFactory::changeText(const TQString &text) // and other widgets are just enlarged if needed else if(n == "KPushButton") width = w->style().sizeFromContents( TQStyle::CT_PushButton, w, s).width(); - else if(n == TQCHECKBOX_OBJECT_NAME_STRING) + else if(n == "TQCheckBox") width = w->style().sizeFromContents( TQStyle::CT_CheckBox, w, s).width(); - else if(n == TQRADIOBUTTON_OBJECT_NAME_STRING) + else if(n == "TQRadioButton") width = w->style().sizeFromContents( TQStyle::CT_RadioButton, w, s).width(); else return; @@ -643,13 +643,13 @@ StdWidgetFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCStri TQPoint p = widget->pos(); TQRect r; - if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) + if(classname == "TQRadioButton") { r = widget->style().subRect(TQStyle::SR_RadioButtonContents, widget); p += r.topLeft(); s.setWidth(r.width()); } - else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) + else if(classname == "TQCheckBox") { r = widget->style().subRect(TQStyle::SR_CheckBoxContents, widget); p += r.topLeft(); @@ -863,7 +863,7 @@ StdWidgetFactory::isPropertyVisibleInternal(const TQCString &classname, if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) return false; } - else if(classname == TQLABEL_OBJECT_NAME_STRING) + else if(classname == "TQLabel") { if(property == "pixmap") return false; @@ -890,11 +890,11 @@ StdWidgetFactory::isPropertyVisibleInternal(const TQCString &classname, if((property == "frameShape") || (property == "font") || (property == "margin")) return false; } - else if(classname==TQCHECKBOX_OBJECT_NAME_STRING) + else if(classname=="TQCheckBox") { ok = m_showAdvancedProperties || (property != "autoRepeat"); } - else if(classname==TQRADIOBUTTON_OBJECT_NAME_STRING) + else if(classname=="TQRadioButton") { ok = m_showAdvancedProperties || (property != "autoRepeat"); } @@ -911,7 +911,7 @@ StdWidgetFactory::autoSaveProperties(const TQCString &classname) { TQValueList<TQCString> l; - if(classname == TQLABEL_OBJECT_NAME_STRING) + if(classname == "TQLabel") l << "text"; if(classname == "KPushButton") l << "text"; @@ -946,7 +946,7 @@ StdWidgetFactory::editText() TQString text; if(classname == "KTextEdit") text = ((KTextEdit*)widget())->text(); - else if(classname == TQLABEL_OBJECT_NAME_STRING) + else if(classname == "TQLabel") text = ((TQLabel*)widget())->text(); if(editRichText(widget(), text)) @@ -955,14 +955,14 @@ StdWidgetFactory::editText() changeProperty("text", text, m_container->form()); } - if(classname == TQLABEL_OBJECT_NAME_STRING) + if(classname == "TQLabel") widget()->resize(widget()->sizeHint()); } void StdWidgetFactory::editListContents() { - if(widget()->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) + if(widget()->inherits("TQListView")) editListView((TQListView*)widget()); } |