11#include <tqpopupmenu.h>
13#include <tqradiobutton.h>
14#include <tqcheckbox.h>
16#include <tqobjectlist.h>
22#include <tqvaluevector.h>
25#include <kpushbutton.h>
28#include <tdelistbox.h>
30#include <tdelistview.h>
32#include <kiconloader.h>
33#include <kgenericfactory.h>
36#include <tdeversion.h>
38#if TDE_VERSION < TDE_MAKE_VERSION(3,1,9)
39# include <tqdatetimeedit.h>
40# define KTimeWidget TQTimeEdit
41# define KDateWidget TQDateEdit
42# define KDateTimeWidget TQDateTimeEdit
44# include <ktimewidget.h>
45# include <kdatewidget.h>
46# include <kdatetimewidget.h>
52#include "formmanager.h"
53#include "widgetlibrary.h"
54#include "widgetpropertyset.h"
55#include <koproperty/property.h>
57#include "stdwidgetfactory.h"
60KexiPictureLabel::KexiPictureLabel( const TQPixmap &pix, TQWidget *parent, const char *name)
61 : TQLabel(parent, name)
64 setScaledContents( false);
68KexiPictureLabel::setProperty( const char *name, const TQVariant &value)
70 if(TQString(name) == "pixmap")
71 resize(value.toPixmap().height(), value.toPixmap().width());
72 return TQLabel::setProperty(name, value);
75Line::Line(TQt::Orientation orient, TQWidget *parent, const char *name)
76 : TQFrame(parent, name)
78 setFrameShadow(Sunken);
79 if(orient ==TQt::Horizontal)
86Line::setOrientation(TQt::Orientation orient)
88 if(orient ==TQt::Horizontal)
95Line::orientation() const
97 if(frameShape() == HLine)
98 return TQt::Horizontal;
100 return TQt::Vertical;
109 wFormWidget->setPixmap( "form");
110 wFormWidget->setClassName( "FormWidgetBase");
111 wFormWidget->setName(i18n( "Form"));
112 wFormWidget->setNamePrefix(i18n( "This string will be used to name widgets of this class. It must _not_ contain white "
113 "spaces and non latin1 characters.", "form"));
114 wFormWidget->setDescription(i18n( "A simple form widget"));
118 wCustomWidget->setPixmap( "unknown_widget");
119 wCustomWidget->setClassName( "CustomWidget");
120 wCustomWidget->setName(i18n( "Custom Widget"));
121 wCustomWidget->setNamePrefix(i18n( "This string will be used to name widgets of this class. It must _not_ contain white "
122 "spaces and non latin1 characters.", "customWidget"));
123 wCustomWidget->setDescription(i18n( "A custom or non-supported widget"));
127 wLabel->setPixmap( "label");
128 wLabel->setClassName( "TQLabel");
129 wLabel->setName(i18n( "Text Label"));
130 wLabel->setNamePrefix(
131 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"));
132 wLabel->setDescription(i18n( "A widget to display text"));
136 wPixLabel->setPixmap( "pixmaplabel");
137 wPixLabel->setClassName( "KexiPictureLabel");
138 wPixLabel->setName(i18n( "Picture Label"));
142 wPixLabel->setNamePrefix(
143 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"));
144 wPixLabel->setDescription(i18n( "A widget to display pictures"));
148 wLineEdit->setPixmap( "lineedit");
149 wLineEdit->setClassName( "KLineEdit");
152 wLineEdit->setName(i18n( "Line Edit"));
153 wLineEdit->setNamePrefix(
154 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "lineEdit"));
155 wLineEdit->setDescription(i18n( "A widget to input text"));
159 wSpring->setPixmap( "spring");
160 wSpring->setClassName( "Spring");
161 wSpring->setName(i18n( "Spring"));
162 wSpring->setNamePrefix(
163 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "spring"));
164 wSpring->setDescription(i18n( "A spring to place between widgets"));
168 wPushButton->setPixmap( "button");
169 wPushButton->setClassName( "KPushButton");
172 wPushButton->setName(i18n( "Push Button"));
173 wPushButton->setNamePrefix(
174 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "button"));
175 wPushButton->setDescription(i18n( "A simple push button to execute actions"));
179 wRadioButton->setPixmap( "radio");
180 wRadioButton->setClassName( "TQRadioButton");
181 wRadioButton->setName(i18n( "Option Button"));
182 wRadioButton->setNamePrefix(
183 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"));
184 wRadioButton->setDescription(i18n( "An option button with text or pixmap label"));
188 wCheckBox->setPixmap( "check");
189 wCheckBox->setClassName( "TQCheckBox");
190 wCheckBox->setName(i18n( "Check Box"));
191 wCheckBox->setNamePrefix(
192 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"));
193 wCheckBox->setDescription(i18n( "A check box with text or pixmap label"));
197 wSpinBox->setPixmap( "spin");
198 wSpinBox->setClassName( "KIntSpinBox");
201 wSpinBox->setName(i18n( "Spin Box"));
202 wSpinBox->setNamePrefix(
203 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "spinBox"));
204 wSpinBox->setDescription(i18n( "A spin box widget"));
208 wComboBox->setPixmap( "combo");
209 wComboBox->setClassName( "KComboBox");
212 wComboBox->setName(i18n( "Combo Box"));
213 wComboBox->setNamePrefix(
214 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "comboBox"));
215 wComboBox->setDescription(i18n( "A combo box widget"));
219 wListBox->setPixmap( "listbox");
220 wListBox->setClassName( "TDEListBox");
223 wListBox->setName(i18n( "List Box"));
224 wListBox->setNamePrefix(
225 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "listBox"));
226 wListBox->setDescription(i18n( "A simple list widget"));
230 wTextEdit->setPixmap( "textedit");
231 wTextEdit->setClassName( "KTextEdit");
234 wTextEdit->setName(i18n( "Text Editor"));
235 wTextEdit->setNamePrefix(
236 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "textEditor"));
237 wTextEdit->setDescription(i18n( "A simple single-page rich text editor"));
241 wListView->setPixmap( "listview");
242 wListView->setClassName( "TDEListView");
245 wListView->setName(i18n( "List View"));
246 wListView->setNamePrefix(
247 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "listView"));
248 wListView->setDescription(i18n( "A list (or tree) widget"));
252 wSlider->setPixmap( "slider");
253 wSlider->setClassName( "TQSlider");
254 wSlider->setName(i18n( "Slider"));
255 wSlider->setNamePrefix(
256 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"));
257 wSlider->setDescription(i18n( "An horizontal slider"));
261 wProgressBar->setPixmap( "progress");
262 wProgressBar->setClassName( "KProgress");
265 wProgressBar->setName(i18n( "Progress Bar"));
266 wProgressBar->setNamePrefix(
267 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "progressBar"));
268 wProgressBar->setDescription(i18n( "A progress indicator widget"));
272 wLine->setPixmap( "line");
273 wLine->setClassName( "Line");
274 wLine->setName(i18n( "Line"));
275 wLine->setNamePrefix(
276 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "line"));
277 wLine->setDescription(i18n( "A line to be used as a separator"));
281 wDate->setPixmap( "dateedit");
282 wDate->setClassName( "KDateWidget");
283#if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9)
287 wDate->setName(i18n( "Date Widget"));
288 wDate->setNamePrefix(
289 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "dateWidget"));
290 wDate->setDescription(i18n( "A widget to input and display a date"));
294 wTime->setPixmap( "timeedit");
295 wTime->setClassName( "KTimeWidget");
296#if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9)
300 wTime->setName(i18n( "Time Widget"));
301 wTime->setNamePrefix(
302 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "timeWidget"));
303 wTime->setDescription(i18n( "A widget to input and display a time"));
307 wDateTime->setPixmap( "datetimeedit");
308 wDateTime->setClassName( "KDateTimeWidget");
309#if TDE_VERSION >= TDE_MAKE_VERSION(3,1,9)
313 wDateTime->setName(i18n( "Date/Time Widget"));
314 wDateTime->setNamePrefix(
315 i18n( "Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "dateTimeWidget"));
316 wDateTime->setDescription(i18n( "A widget to input and display a time and a date"));
320 m_propDesc[ "autoRepeat"] = i18n( "Auto Repeat");
321 m_propDesc[ "autoDefault"] = i18n( "Auto Default");
325 i18n( "Echo mode for Line Edit widget eg. Normal, NoEcho, Password", "Echo Mode");
328 m_propDesc[ "orientation"] = i18n( "Orientation");
330 m_propDesc[ "checked"] = i18n( "Checked checkbox", "Checked");
331 m_propDesc[ "tristate"] = i18n( "Tristate checkbox", "Tristate");
334 m_propValDesc[ "Normal"] = i18n( "For Echo Mode", "Normal");
335 m_propValDesc[ "NoEcho"] = i18n( "For Echo Mode", "No Echo");
336 m_propValDesc[ "Password"] = i18n( "For Echo Mode", "Password");
342 m_propDesc[ "textFormat"] = i18n( "Text Format");
343 m_propValDesc[ "PlainText"] = i18n( "For Text Format", "Plain");
344 m_propValDesc[ "RichText"] = i18n( "For Text Format", "Hypertext");
345 m_propValDesc[ "AutoText"] = i18n( "For Text Format", "Auto");
346 m_propValDesc[ "LogText"] = i18n( "For Text Format", "Log");
349 m_propDesc[ "tabStopWidth"] = i18n( "Tab Stop Width");
350 m_propDesc[ "tabChangesFocus"] = i18n( "Tab Changes Focus");
351 m_propDesc[ "wrapPolicy"] = i18n( "Word Wrap Policy");
352 m_propValDesc[ "AtWordBoundary"] = i18n( "For Word Wrap Policy", "At Word Boundary");
353 m_propValDesc[ "Anywhere"] = i18n( "For Word Wrap Policy", "Anywhere");
354 m_propValDesc[ "AtWordOrDocumentBoundary"] = i18n( "For Word Wrap Policy", "At Word Boundary If Possible");
355 m_propDesc[ "wordWrap"] = i18n( "Word Wrapping");
356 m_propDesc[ "wrapColumnOrWidth"] = i18n( "Word Wrap Position");
357 m_propValDesc[ "NoWrap"] = i18n( "For Word Wrap Position", "None");
358 m_propValDesc[ "WidgetWidth"] = i18n( "For Word Wrap Position", "Widget's Width");
359 m_propValDesc[ "FixedPixelWidth"] = i18n( "For Word Wrap Position", "In Pixels");
360 m_propValDesc[ "FixedColumnWidth"] = i18n( "For Word Wrap Position", "In Columns");
361 m_propDesc[ "linkUnderline"] = i18n( "Links Underlined");
367 setInternalProperty( "Line", "orientationSelectionPopup:horizontalText",i18n( "Insert &Horizontal Line"));
368 setInternalProperty( "Line", "orientationSelectionPopup:verticalText",i18n( "Insert &Vertical Line"));
372 setInternalProperty( "Spring", "orientationSelectionPopup:horizontalText",i18n( "Insert &Horizontal Spring"));
373 setInternalProperty( "Spring", "orientationSelectionPopup:verticalText",i18n( "Insert &Vertical Spring"));
376StdWidgetFactory::~StdWidgetFactory()
385 TQString text( container-> form()-> library()->textForWidgetName(n, c) );
389 w = new TQLabel(text, p, n);
390 else if(c == "KexiPictureLabel")
391 w = new KexiPictureLabel(DesktopIcon( "image-x-generic"), p, n);
393 else if(c == "KLineEdit")
395 w = new KLineEdit(p, n);
397 w->setCursor(TQCursor(TQt::ArrowCursor));
399 else if(c == "KPushButton")
400 w = new KPushButton(text, p, n);
402 else if(c == "TQRadioButton")
403 w = new TQRadioButton(text, p, n);
405 else if(c == "TQCheckBox")
406 w = new TQCheckBox(text, p, n);
408 else if(c == "KIntSpinBox")
409 w = new KIntSpinBox(p, n);
411 else if(c == "KComboBox")
412 w = new KComboBox(p, n);
414 else if(c == "TDEListBox")
415 w = new TDEListBox(p, n);
417 else if(c == "KTextEdit")
418 w = new KTextEdit(text, TQString(), p, n);
420 else if(c == "TDEListView")
422 w = new TDEListView(p, n);
424 ((TDEListView*)w)->addColumn(i18n( "Column 1"));
425 ((TDEListView*)w)->setRootIsDecorated( true);
427 else if(c == "TQSlider")
428 w = new TQSlider(TQt::Horizontal, p, n);
430 else if(c == "KProgress")
431 w = new KProgress(p, n);
433 else if(c == "KDateWidget")
434 w = new KDateWidget(TQDate::currentDate(), p, n);
436 else if(c == "KTimeWidget")
437 w = new KTimeWidget(TQTime::currentTime(), p, n);
439 else if(c == "KDateTimeWidget")
440 w = new KDateTimeWidget(TQDateTime::currentDateTime(), p, n);
443 w = new Line(options & WidgetFactory::VerticalOrientation ? TQt::Vertical : TQt::Horizontal, p, n);
445 else if(c == "Spring") {
446 w = new Spring(p, n);
447 if (0 == (options & WidgetFactory::AnyOrientation))
448 static_cast<Spring* >(w)->setOrientation(
449 (options & WidgetFactory::VerticalOrientation) ? TQt::Vertical : TQt::Horizontal);
455 kdDebug() << "WARNING :: w == 0 " << endl;
462 if(classname == "Spring") {
463 ((Spring*)widget)->setPreviewMode();
473 if((classname == "TQLabel") || (classname == "KTextEdit"))
475 menu->insertItem(SmallIconSet( "edit"), i18n( "Edit Rich Text"), this, TQ_SLOT(editText()));
478 else if(classname == "TDEListView")
480 menu->insertItem(SmallIconSet( "edit"), i18n( "Edit Listview Contents"), this, TQ_SLOT(editListContents()));
490 setWidget(w, container);
492 if(classname == "KLineEdit")
494 KLineEdit *lineedit = static_cast<KLineEdit* >(w);
495 createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true);
498 else if(classname == "TQLabel")
500 TQLabel *label = static_cast<TQLabel* >(w);
501 if(label->textFormat() == RichText)
508 createEditor(classname, label->text(), label, container, label->geometry(), label->alignment());
511 else if(classname == "KPushButton")
513 KPushButton *push = static_cast<KPushButton* >(w);
514 TQRect r = w->style().subRect(TQStyle::SR_PushButtonContents, w);
515 TQRect editorRect = TQRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height());
520 createEditor(classname, push->text(), push, container, editorRect, TQt::AlignCenter, false, false, TQt::PaletteButton);
523 else if(classname == "TQRadioButton")
525 TQRadioButton *radio = static_cast<TQRadioButton* >(w);
526 TQRect r = w->style().subRect(TQStyle::SR_RadioButtonContents, w);
527 TQRect editorRect = TQRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height());
528 createEditor(classname, radio->text(), radio, container, editorRect, TQt::AlignAuto);
531 else if(classname == "TQCheckBox")
533 TQCheckBox *check = static_cast<TQCheckBox* >(w);
536 TQRect r = w->style().subRect(TQStyle::SR_CheckBoxContents, w);
537 TQRect editorRect = TQRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height());
538 createEditor(classname, check->text(), check, container, editorRect, TQt::AlignAuto);
541 else if((classname == "KComboBox") || (classname == "TDEListBox"))
544 if(classname == "TDEListBox")
546 TDEListBox *listbox = (TDEListBox*)w;
547 for(uint i=0; i < listbox->count(); i++)
548 list.append(listbox->text(i));
550 else if(classname == "KComboBox")
552 KComboBox *combo = (KComboBox*)w;
553 for( int i=0; i < combo->count(); i++)
554 list.append(combo->text(i));
559 if(classname == "TDEListBox")
561 ((TDEListBox*)w)->clear();
562 ((TDEListBox*)w)->insertStringList(list);
564 else if(classname == "KComboBox")
566 ((KComboBox*)w)->clear();
567 ((KComboBox*)w)->insertStringList(list);
572 else if((classname == "KTextEdit") || (classname == "KDateTimeWidget") || (classname == "KTimeWidget") ||
573 (classname == "KDateWidget") || (classname == "KIntSpinBox")) {
581StdWidgetFactory::clearWidgetContent( const TQCString &classname, TQWidget *w)
583 if(classname == "KLineEdit")
584 ((KLineEdit*)w)->clear();
585 else if(classname == "TDEListBox")
586 ((TDEListBox*)w)->clear();
587 else if(classname == "TDEListView")
588 ((TDEListView*)w)->clear();
589 else if(classname == "KComboBox")
590 ((KComboBox*)w)->clear();
591 else if(classname == "KTextEdit")
592 ((KTextEdit*)w)->clear();
601 TQCString n = WidgetFactory::widget()->className();
602 TQWidget *w = WidgetFactory::widget();
603 if(n == "KIntSpinBox")
604 ((KIntSpinBox*)w)->setValue(text.toInt());
630 if(w->width() < width)
632 w->resize(width, w->height() );
642 TQSize s = widget->size();
643 TQPoint p = widget->pos();
646 if(classname == "TQRadioButton")
648 r = widget->style().subRect(TQStyle::SR_RadioButtonContents, widget);
650 s.setWidth(r.width());
652 else if(classname == "TQCheckBox")
654 r = widget->style().subRect(TQStyle::SR_CheckBoxContents, widget);
656 s.setWidth(r.width());
658 else if(classname == "KPushButton")
660 r = widget->style().subRect(TQStyle::SR_PushButtonContents, widget);
672 if(name == "list_items" && classname == "KComboBox")
674 KComboBox *combo = (KComboBox*)w;
675 for( int i=0; i < combo->count(); i++)
677 TQDomElement item = domDoc.createElement( "item");
678 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", combo->text(i));
679 parentNode.appendChild(item);
683 else if(name == "list_items" && classname == "TDEListBox")
685 TDEListBox *listbox = (TDEListBox*)w;
686 for(uint i=0; i < listbox->count(); i++)
688 TQDomElement item = domDoc.createElement( "item");
689 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listbox->text(i));
690 parentNode.appendChild(item);
694 else if(name == "list_contents" && classname == "TDEListView")
696 TDEListView *listview = (TDEListView*)w;
698 for( int i = 0; i < listview->columns(); i++)
700 TQDomElement item = domDoc.createElement( "column");
701 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listview->columnText(i));
702 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "width", listview->columnWidth(i));
703 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "resizable", listview->header()->isResizeEnabled(i));
704 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "clickable", listview->header()->isClickEnabled(i));
705 KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "fullwidth", listview->header()->isStretchEnabled(i));
706 parentNode.appendChild(item);
710 TQListViewItem *item = listview->firstChild();
713 saveListItem(item, parentNode, domDoc);
714 item = item->nextSibling();
723StdWidgetFactory::saveListItem(TQListViewItem *item, TQDomNode &parentNode, TQDomDocument &domDoc)
725 TQDomElement element = domDoc.createElement( "item");
726 parentNode.appendChild(element);
729 for( int i = 0; i < item->listView()->columns(); i++)
730 KFormDesigner::FormIO::savePropertyElement(element, domDoc, "property", "text", item->text(i));
733 TQListViewItem *child = item->firstChild();
736 saveListItem(child, element, domDoc);
737 child = child->nextSibling();
744 TQString tag = node.tagName();
745 TQString name = node.attribute( "name");
747 if((tag == "item") && (classname == "KComboBox"))
749 KComboBox *combo = (KComboBox*)w;
750 TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name);
751 if(val.canCast(TQVariant::Pixmap))
752 combo->insertItem(val.toPixmap());
754 combo->insertItem(val.toString());
758 if((tag == "item") && (classname == "TDEListBox"))
760 TDEListBox *listbox = (TDEListBox*)w;
761 TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name);
762 if(val.canCast(TQVariant::Pixmap))
763 listbox->insertItem(val.toPixmap());
765 listbox->insertItem(val.toString());
769 if((tag == "column") && (classname == "TDEListView"))
771 TDEListView *listview = (TDEListView*)w;
773 for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling())
775 TQString prop = n.toElement().attribute( "name");
776 TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), w, name);
778 id = listview->addColumn(val.toString());
779 else if(prop == "width")
780 listview->setColumnWidth( id, val.toInt());
781 else if(prop == "resizable")
782 listview->header()->setResizeEnabled(val.toBool(), id);
783 else if(prop == "clickable")
784 listview->header()->setClickEnabled(val.toBool(), id);
785 else if(prop == "fullwidth")
786 listview->header()->setStretchEnabled(val.toBool(), id);
790 else if((tag == "item") && (classname == "TDEListView"))
792 TDEListView *listview = (TDEListView*)w;
793 readListItem(node, 0, listview);
801StdWidgetFactory::readListItem(TQDomElement &node, TQListViewItem *parent, TDEListView *listview)
803 TQListViewItem *item;
805 item = new TDEListViewItem(parent);
807 item = new TDEListViewItem(listview);
810 TQListViewItem *last;
812 last = parent->firstChild();
814 last = listview->firstChild();
816 while(last->nextSibling())
817 last = last->nextSibling();
818 item->moveItem(last);
821 for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling())
823 TQDomElement childEl = n.toElement();
824 TQString prop = childEl.attribute( "name");
825 TQString tag = childEl.tagName();
831 readListItem(childEl, item, listview);
834 else if((tag == "property") && (prop == "text"))
836 TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), listview, "item");
837 item->setText(i, val.toString());
845 TQWidget *w, const TQCString &property, bool isTopLevel)
848 if(classname == "FormWidgetBase")
850 if(property == "iconText"
851 || property == "geometry" )
854 else if (classname == "CustomWidget")
857 else if(classname == "Spring")
859 return Spring::isPropertyVisible(property);
861 else if(classname == "KexiPictureLabel")
863 if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment"))
866 else if(classname == "TQLabel")
868 if(property == "pixmap")
871 else if(classname == "KLineEdit")
873 if(property == "vAlign")
876 else if(classname == "KTextEdit")
878 property!= "undoDepth"
879 && property!= "undoRedoEnabled"
880 && property!= "dragAutoScroll"
881 && property!= "overwriteMode"
882 && property!= "resizePolicy"
883 && property!= "autoFormatting"
884#ifdef KEXI_NO_UNFINISHED
888 else if(classname == "Line")
890 if((property == "frameShape") || (property == "font") || (property == "margin"))
893 else if(classname== "TQCheckBox")
897 else if(classname== "TQRadioButton")
901 else if(classname== "KPushButton")
906 return ok && WidgetFactory::isPropertyVisibleInternal(classname, w, property, isTopLevel);
909TQValueList<TQCString>
912 TQValueList<TQCString> l;
914 if(classname == "TQLabel")
916 if(classname == "KPushButton")
918 else if(classname == "KexiPictureLabel")
920 else if(classname == "KComboBox")
922 else if(classname == "TDEListBox")
924 else if(classname == "TDEListView")
925 l << "list_contents";
926 else if(classname == "Line")
928 else if(classname == "KTimeWidget")
930 else if(classname == "KDateWidget")
932 else if(classname == "KDateTimeWidget")
934 else if(classname == "Spring")
935 l << "sizeType" << "orientation";
936 else if(classname == "KTextEdit")
937 l << "textFormat" << "text";
943StdWidgetFactory::editText()
945 TQCString classname = widget()->className();
947 if(classname == "KTextEdit")
948 text = ((KTextEdit*)widget())->text();
949 else if(classname == "TQLabel")
950 text = ((TQLabel*)widget())->text();
958 if(classname == "TQLabel")
959 widget()->resize(widget()->sizeHint());
963StdWidgetFactory::editListContents()
965 if(widget()->inherits( "TQListView"))
975 if (buf.contains( "indent")) {
976 buf[ "indent"].setOption( "min", -1);
977 buf[ "indent"].setOption( "minValueText", i18n( "default indent value", "default"));
983#include "stdwidgetfactory.moc"
|