20#include "widgetpropertyset.h"
22#include <tqstringlist.h>
24#include <tqmetaobject.h>
28#include <tqapplication.h>
29#include <tqeventloop.h>
33#include <tdemessagebox.h>
35#include "objecttree.h"
38#include "formmanager.h"
39#include "widgetlibrary.h"
41#include "widgetwithsubpropertiesinterface.h"
43#include <kexiutils/utils.h>
44#include <kexiutils/identifier.h>
51typedef TQValueList< TQGuardedPtr<TQWidget> > TQGuardedWidgetList;
54class WidgetPropertySetPrivate
57 WidgetPropertySetPrivate()
58 : lastCommand(0), lastGeoCommand(0),
59 isUndoing(false), slotPropertyChangedEnabled(true),
60 slotPropertyChanged_addCommandEnabled(true),
63 ~WidgetPropertySetPrivate()
65 delete origActiveColors;
70 TQStringList properties;
72 TQGuardedWidgetList widgets;
76 PropertyCommand *lastCommand;
77 GeometryPropertyCommand *lastGeoCommand;
79 bool slotPropertyChangedEnabled : 1;
80 bool slotPropertyChanged_addCommandEnabled : 1;
83 TQColorGroup* origActiveColors;
86 TQMap<TQCString, TQString> propCaption;
87 TQMap<TQCString, TQString> propValCaption;
91WidgetPropertySet::WidgetPropertySet(TQObject *parent)
92 : TQObject(parent,
"kfd_widgetPropertySet")
94 d =
new WidgetPropertySetPrivate();
97 connect(&d->set, TQ_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)),
98 this, TQ_SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&)));
99 connect(&d->set, TQ_SIGNAL(propertyReset(KoProperty::Set&, KoProperty::Property&)),
100 this, TQ_SLOT(slotPropertyReset(KoProperty::Set&, KoProperty::Property&)));
102 initPropertiesDescription();
105WidgetPropertySet::~WidgetPropertySet()
117WidgetPropertySet::operator[](
const TQCString &name)
123WidgetPropertySet::property(
const TQCString &name)
129WidgetPropertySet::contains(
const TQCString &property)
131 return d->set.contains(property);
135WidgetPropertySet::set()
141WidgetPropertySet::clearSet(
bool dontSignalShowPropertySet)
143 saveModifiedProperties();
145 if (!dontSignalShowPropertySet)
149 d->lastGeoCommand = 0;
150 d->properties.clear();
153 if(!d->widgets.isEmpty()) {
154 d->widgets.first()->removeEventFilter(
this);
155 disconnect(d->widgets.first(), 0,
this, 0);
160WidgetPropertySet::saveModifiedProperties()
162 TQWidget * w = d->widgets.first();
169 for(KoProperty::Set::Iterator it(d->set); it.current(); ++it) {
170 if(it.current()->isModified())
176WidgetPropertySet::setUndoing(
bool isUndoing)
178 d->isUndoing = isUndoing;
182WidgetPropertySet::isUndoing()
190WidgetPropertySet::setSelectedWidget(TQWidget *w,
bool add,
bool forceReload,
bool moreWillBeSelected)
198 if(!forceReload && d->widgets.contains(TQGuardedPtr<TQWidget>(w))) {
199 kdWarning() <<
"WidgetPropertySet::setSelectedWidget() Widget is already selected" << endl;
203 if(d->widgets.count() == 0)
206 TQCString prevProperty;
212 prevProperty = d->set.prevSelection();
215 d->widgets.append(TQGuardedPtr<TQWidget>(w));
216 createPropertiesForWidget(w);
218 w->installEventFilter(
this);
219 connect(w, TQ_SIGNAL(destroyed()),
this, TQ_SLOT(slotWidgetDestroyed()));
222 if (!moreWillBeSelected)
227WidgetPropertySet::addWidget(TQWidget *w)
229 d->widgets.append(TQGuardedPtr<TQWidget>(w));
233 d->lastGeoCommand = 0;
234 d->properties.clear();
237 if(d->widgets.first()->className() == w->className())
238 classname = d->widgets.first()->className();
246 for(KoProperty::Set::Iterator it(d->set); it.current(); ++it) {
247 kdDebug() << it.currentKey() << endl;
248 if(!isPropertyVisible(it.currentKey(), isTopLevel, classname))
249 d->set[it.currentKey()].setVisible(
false);
252 if (d->widgets.count()>=2) {
254 d->set[
"this:className"].setValue(
"special:multiple");
255 d->set[
"this:classString"].setValue(
256 i18n(
"Multiple Widgets") + TQString(
" (%1)").arg(d->widgets.count()) );
257 d->set[
"this:iconName"].setValue(
"multiple_obj");
259 d->set[
"name"].setValue(
"");
264WidgetPropertySet::createPropertiesForWidget(TQWidget *w)
271 kdWarning() <<
"WidgetPropertySet::createPropertiesForWidget() no manager or active form!!!" << endl;
279 TQStringVariantMapConstIterator modifiedPropertiesIt;
282 KoProperty::Property *newProp = 0;
283 WidgetInfo *winfo = form->
library()->widgetInfoForClassName(w->className());
285 kdWarning() <<
"WidgetPropertySet::createPropertiesForWidget() no widget info for class "
286 << w->className() << endl;
290 TQStrList pList = w->metaObject()->propertyNames(
true);
291 TQStrListIterator it(pList);
294 WidgetWithSubpropertiesInterface* subpropIface =
dynamic_cast<WidgetWithSubpropertiesInterface*
>(w);
297 TQValueList<TQCString> subproperies(
299 foreach(TQValueListConstIterator<TQCString>, it, subproperies ) {
300 tmpList.append( *it );
301 pList.append( tmpList.last() );
302 kdDebug() <<
"Added subproperty: " << *it << endl;
307 for(; it.current() != 0; ++it) {
309 const TQMetaProperty *subMeta =
311 const TQMetaProperty *meta = subMeta ? subMeta
312 : w->metaObject()->property( w->metaObject()->findProperty(*it,
true),
true);
315 const char* propertyName = meta->name();
316 TQWidget *subwidget = subMeta ? subpropIface->
subwidget() : w;
317 WidgetInfo *subwinfo = form->
library()->widgetInfoForClassName(subwidget->className());
320 if(subwinfo && meta->designable(subwidget) && !d->set.contains(propertyName)) {
322 TQString desc( d->propCaption[meta->name()] );
327 modifiedPropertiesIt = modifiedProperties->find(propertyName);
328 const bool oldValueExists = modifiedPropertiesIt!=modifiedProperties->constEnd();
330 if(meta->isEnumType()) {
331 if(qstrcmp(propertyName,
"alignment") == 0) {
332 createAlignProperty(meta, w, subwidget);
336 TQStringList keys = TQStringList::fromStrList( meta->enumKeys() );
337 newProp =
new KoProperty::Property(propertyName, createValueList(subwinfo, keys),
340 oldValueExists ? modifiedPropertiesIt.data().toInt() : subwidget->property(propertyName).toInt() ),
343 if (oldValueExists) {
344 newProp->setValue( meta->valueToKey( subwidget->property(propertyName).toInt() ) );
348 newProp =
new KoProperty::Property(propertyName,
350 oldValueExists ? TQVariant(modifiedPropertiesIt.data()) : TQVariant(subwidget->property(propertyName)),
353 if (oldValueExists) {
354 newProp->setValue( subwidget->property(propertyName) );
358 d->set.addProperty(newProp);
359 if(!isPropertyVisible(propertyName, isTopLevel))
360 newProp->setVisible(
false);
362 if(newProp->type() == 0)
363 newProp->setType(KoProperty::Pixmap);
377 updatePropertyValue(tree, propertyName, meta);
380 (*this)[
"name"].setAutoSync(
false);
381 (*this)[
"enabled"].setValue( TQVariant(tree->isEnabled()));
385 d->set.addProperty( newProp =
new KoProperty::Property(
"this:classString", winfo->
name()) );
386 newProp->setVisible(
false);
387 d->set.addProperty( newProp =
new KoProperty::Property(
"this:iconName", winfo->
pixmap()) );
388 newProp->setVisible(
false);
390 d->set.addProperty( newProp =
new KoProperty::Property(
"this:className", w->className()) );
391 newProp->setVisible(
false);
407 createLayoutProperty(tree);
411WidgetPropertySet::updatePropertyValue(
ObjectTreeItem *tree,
const char *property,
const TQMetaProperty *meta)
413 const char *propertyName = meta ? meta->name() : property;
414 if (!d->set.contains(propertyName))
416 KoProperty::Property p( d->set[propertyName] );
419 TQStringVariantMap::ConstIterator it( tree->
modifiedProperties()->find(propertyName) );
422 if(meta && meta->isEnumType()) {
423 p.setValue( meta->valueToKey( it.data().toInt() ),
false );
426 p.setValue(it.data(),
false );
428 p.setValue(p.value(),
true);
434WidgetPropertySet::isPropertyVisible(
const TQCString &property,
bool isTopLevel,
const TQCString &classname)
436 const bool multiple = d->widgets.count() >= 2;
437 if(multiple && classname.isEmpty())
464 TQWidget *w = d->widgets.first();
465 WidgetWithSubpropertiesInterface* subpropIface =
dynamic_cast<WidgetWithSubpropertiesInterface*
>(w);
473 subwidget->className(), subwidget, property, multiple, isTopLevel);
479WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& p)
487 TQCString
property = p.name();
488 if (0==property.find(
"this:"))
491 TQVariant value = p.value();
494 if(property ==
"name") {
495 if(d->widgets.count()!=1)
497 if(!isNameValid(value.toString()))
501 else if(property ==
"paletteBackgroundPixmap") {
502 d->set[
"backgroundOrigin"] =
"WidgetOrigin";
506 }
else if((property ==
"hAlign") || (property ==
"vAlign") || (property ==
"wordbreak")) {
507 saveAlignProperty(property);
510 else if((property ==
"layout") || (property ==
"layoutMargin") || (property ==
"layoutSpacing")) {
511 saveLayoutProperty(property, value);
515 else if(property ==
"enabled") {
516 saveEnabledProperty(value.toBool());
524 const bool alterLastCommand = d->lastCommand && d->lastCommand->property() == property;
526 if(d->widgets.count() == 1)
530 d->lastCommand->setValue(value);
534 d->lastCommand =
new PropertyCommand(
this, d->widgets.first()->name(),
535 d->widgets.first()->property(property), value, property);
541 if (tree && p.isModified())
545 if(property ==
"name")
546 emit widgetNameChanged(d->widgets.first()->name(), p.value().toCString());
547 d->widgets.first()->setProperty(property, value);
548 emitWidgetPropertyChanged(d->widgets.first(), property, value);
553 d->lastCommand->setValue(value);
557 TQMap<TQCString, TQVariant> list;
559 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets)
560 list.insert((*it)->name(), (*it)->property(property));
562 d->lastCommand =
new PropertyCommand(
this, list, value, property);
568 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) {
569 if (!alterLastCommand) {
572 if(tree && p.isModified())
575 (*it)->setProperty(property, value);
576 emitWidgetPropertyChanged((*it), property, value);
581void WidgetPropertySet::emitWidgetPropertyChanged(TQWidget *w,
const TQCString& property,
const TQVariant& value)
583 emit widgetPropertyChanged(w, property, value);
588 tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
589 setSelectedWidget(w,
false,
true);
590 tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
596WidgetPropertySet::createPropertyCommandsInDesignMode(TQWidget* widget,
597 const TQMap<TQCString, TQVariant> &propValues,
CommandGroup *group,
bool addToActiveForm,
598 bool execFlagForSubCommands)
600 if (!widget || propValues.isEmpty())
606 d->slotPropertyChanged_addCommandEnabled =
false;
607 TQMap<TQCString, TQVariant>::ConstIterator endIt = propValues.constEnd();
609 for(TQMap<TQCString, TQVariant>::ConstIterator it = propValues.constBegin(); it != endIt; ++it)
611 if (!d->set.contains(it.key())) {
612 kdWarning() <<
"WidgetPropertySet::createPropertyCommandsInDesignMode(): \"" <<it.key()<<
"\" property not found"<<endl;
615 PropertyCommand *subCommand =
new PropertyCommand(
this, widget->name(),
616 widget->property(it.key()), it.data(), it.key());
617 group->
addCommand( subCommand, execFlagForSubCommands);
618 if (widgetIsSelected) {
619 d->set[it.key()].setValue(it.data());
622 WidgetWithSubpropertiesInterface* subpropIface =
dynamic_cast<WidgetWithSubpropertiesInterface*
>(widget);
623 TQWidget *subwidget = (subpropIface && subpropIface->
subwidget()) ? subpropIface->
subwidget() : widget;
624 if (-1 != subwidget->metaObject()->findProperty(it.key(),
true) && subwidget->property(it.key())!=it.data()) {
628 subwidget->setProperty(it.key(), it.data());
629 emit widgetPropertyChanged(widget, it.key(), it.data());
636 d->slotPropertyChanged_addCommandEnabled =
true;
642WidgetPropertySet::saveEnabledProperty(
bool value)
645 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) {
648 if(tree->isEnabled() == value)
651 TQPalette p( (*it)->palette() );
652 if (!d->origActiveColors)
653 d->origActiveColors =
new TQColorGroup( p.active() );
655 if (d->origActiveColors)
656 p.setActive( *d->origActiveColors );
659 TQColorGroup cg = p.disabled();
661 cg.setColor(TQColorGroup::Base, cg.color(TQColorGroup::Background));
664 (*it)->setPalette(p);
666 tree->setEnabled(value);
667 emit widgetPropertyChanged((*it),
"enabled", TQVariant(value));
672WidgetPropertySet::isNameValid(
const TQString &name)
675 TQWidget *w = d->widgets.first();
679 i18n(
"Could not rename widget \"%1\" to \"%2\" because "
680 "\"%3\" is not a valid name (identifier) for a widget.\n")
681 .arg(w->name()).arg(name).arg(name));
682 d->slotPropertyChangedEnabled =
false;
683 d->set[
"name"].resetValue();
684 d->slotPropertyChangedEnabled =
true;
690 i18n(
"Could not rename widget \"%1\" to \"%2\" "
691 "because a widget with the name \"%3\" already exists.\n")
692 .arg(w->name()).arg(name).arg(name));
693 d->slotPropertyChangedEnabled =
false;
694 d->set[
"name"].resetValue();
695 d->slotPropertyChangedEnabled =
true;
703WidgetPropertySet::slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property)
707 if(d->widgets.count() < 2)
712 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) {
715 (*it)->setProperty(property.name(), tree->
modifiedProperties()->find(property.name()).data());
720WidgetPropertySet::slotWidgetDestroyed()
724 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) {
725 if (
dynamic_cast<const TQWidget*
>(sender()) == *it) {
733WidgetPropertySet::eventFilter(TQObject *o, TQEvent *ev)
735 if(d->widgets.count() > 0 && o == d->widgets.first() && d->widgets.count() < 2)
737 if((ev->type() == TQEvent::Resize) || (ev->type() == TQEvent::Move)) {
738 if(!d->set.contains(
"geometry"))
740 if(d->set[
"geometry"].value() == o->property(
"geometry"))
743 d->set[
"geometry"] =
static_cast<TQWidget*
>(o)->geometry();
746 else if(d->widgets.count() > 1 && ev->type() == TQEvent::Move)
751 if(d->lastGeoCommand)
752 d->lastGeoCommand->setPos(
static_cast<TQMoveEvent*
>(ev)->pos());
755 foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets)
756 list.append((*it)->name());
758 d->lastGeoCommand =
new GeometryPropertyCommand(
this, list,
static_cast<TQMoveEvent*
>(ev)->oldPos());
770WidgetPropertySet::createAlignProperty(
const TQMetaProperty *meta, TQWidget *widget, TQWidget *subwidget)
778 const int alignment = subwidget->property(
"alignment").toInt();
779 const TQStringList keys( TQStringList::fromStrList( meta->valueToKeys(alignment) ) );
781 TQStrList *enumKeys =
new TQStrList(meta->enumKeys());
782 const TQStringList possibleValues( TQStringList::fromStrList(*enumKeys) );
788 if(possibleValues.find(
"AlignHCenter")!=possibleValues.constEnd()) {
790 if(keys.find(
"AlignHCenter")!=keys.constEnd() || keys.find(
"AlignCenter")!=keys.constEnd())
791 value =
"AlignHCenter";
792 else if(keys.find(
"AlignRight")!=keys.constEnd())
793 value =
"AlignRight";
794 else if(keys.find(
"AlignLeft")!=keys.constEnd())
796 else if(keys.find(
"AlignJustify")!=keys.constEnd())
797 value =
"AlignJustify";
801 list <<
"AlignAuto" <<
"AlignLeft" <<
"AlignRight" <<
"AlignHCenter" <<
"AlignJustify";
802 KoProperty::Property *p =
new KoProperty::Property(
"hAlign", createValueList(0, list), value,
803 i18n(
"Translators: please keep this string short (less than 20 chars)",
"Hor. Alignment"),
804 i18n(
"Horizontal Alignment"));
805 d->set.addProperty(p);
806 if(!isPropertyVisible(p->name(), isTopLevel)) {
807 p->setVisible(
false);
809 updatePropertyValue(tree,
"hAlign");
813 if(possibleValues.find(
"AlignTop")!=possibleValues.constEnd())
816 if(keys.find(
"AlignTop")!=keys.constEnd())
818 else if(keys.find(
"AlignBottom")!=keys.constEnd())
819 value =
"AlignBottom";
821 value =
"AlignVCenter";
823 list <<
"AlignTop" <<
"AlignVCenter" <<
"AlignBottom";
824 KoProperty::Property *p =
new KoProperty::Property(
"vAlign", createValueList(0, list), value,
825 i18n(
"Translators: please keep this string short (less than 20 chars)",
"Ver. Alignment"),
826 i18n(
"Vertical Alignment"));
827 d->set.addProperty(p);
828 if(!isPropertyVisible(p->name(), isTopLevel)) {
829 p->setVisible(
false);
831 updatePropertyValue(tree,
"vAlign");
834 if(possibleValues.find(
"WordBreak")!=possibleValues.constEnd()
839 KoProperty::Property *p =
new KoProperty::Property(
"wordbreak",
840 TQVariant(alignment & TQt::WordBreak), i18n(
"Word Break"), i18n(
"Word Break") );
841 d->set.addProperty(p);
842 updatePropertyValue(tree,
"wordbreak");
844 subwidget->className(), subwidget, p->name(),
false, isTopLevel))
846 p->setVisible(
false);
852WidgetPropertySet::saveAlignProperty(
const TQString &property)
858 if( d->set.contains(
"hAlign") )
859 list.append( d->set[
"hAlign"].value().toCString() );
860 if( d->set.contains(
"vAlign") )
861 list.append( d->set[
"vAlign"].value().toCString() );
862 if( d->set.contains(
"wordbreak") && d->set[
"wordbreak"].value().toBool() )
863 list.append(
"WordBreak");
865 WidgetWithSubpropertiesInterface* subpropIface =
dynamic_cast<WidgetWithSubpropertiesInterface*
>(
866 (TQWidget*)d->widgets.first() );
867 TQWidget *subwidget = (subpropIface && subpropIface->
subwidget()) ? subpropIface->
subwidget() : (TQWidget*)d->widgets.first();
868 int count = subwidget->metaObject()->findProperty(
"alignment",
true);
869 const TQMetaProperty *meta = subwidget->metaObject()->property(count,
true);
870 subwidget->setProperty(
"alignment", meta->keysToValue(list));
873 d->widgets.first()->name() );
874 if(tree && d->set[property.latin1()].isModified())
880 if(d->lastCommand && d->lastCommand->property() ==
"alignment")
881 d->lastCommand->setValue(meta->keysToValue(list));
883 d->lastCommand =
new PropertyCommand(
this, d->widgets.first()->name(),
884 subwidget->property(
"alignment"), meta->keysToValue(list),
"alignment");
894 Container *container = item->
container();
899 TQCString className = container->
widget()->className();
900 if((className ==
"HBox") || (className ==
"VBox") || (className ==
"Grid"))
906 list <<
"NoLayout" <<
"HBox" <<
"VBox" <<
"Grid" <<
"HFlow" <<
"VFlow";
908 KoProperty::Property *p =
new KoProperty::Property(
"layout", createValueList(0, list), value,
909 i18n(
"Container's Layout"), i18n(
"Container's Layout"));
911 d->set.addProperty(p);
913 updatePropertyValue(item,
"layout");
915 p =
new KoProperty::Property(
"layoutMargin", container->
layoutMargin(), i18n(
"Layout Margin"), i18n(
"Layout Margin"));
916 d->set.addProperty(p);
917 updatePropertyValue(item,
"layoutMargin");
918 if(container->
layoutType() == Container::NoLayout)
919 p->setVisible(
false);
921 p =
new KoProperty::Property(
"layoutSpacing", container->
layoutSpacing(),
922 i18n(
"Layout Spacing"), i18n(
"Layout Spacing"));
923 d->set.addProperty(p);
924 updatePropertyValue(item,
"layoutSpacing");
925 if(container->
layoutType() == Container::NoLayout)
926 p->setVisible(
false);
931WidgetPropertySet::saveLayoutProperty(
const TQString &prop,
const TQVariant &value)
933 Container *container=0;
941 if(prop ==
"layout") {
944 if(d->lastCommand && d->lastCommand->property() ==
"layout" && !d->isUndoing)
945 d->lastCommand->setValue(value);
946 else if(!d->isUndoing) {
947 d->lastCommand =
new LayoutPropertyCommand(
this, d->widgets.first()->name(),
948 d->set[
"layout"].oldValue(), value);
953 bool show = (type != Container::NoLayout);
954 if(show != d->set[
"layoutMargin"].isVisible()) {
955 d->set[
"layoutMargin"].setVisible(show);
956 d->set[
"layoutSpacing"].setVisible(show);
962 if(prop ==
"layoutMargin" && container->
layout()) {
964 container->
layout()->setMargin(value.toInt());
966 else if(prop ==
"layoutSpacing" && container->
layout()) {
968 container->
layout()->setSpacing(value.toInt());
972 if(tree && d->set[ prop.latin1() ].isModified())
978 if(d->lastCommand && (TQString(d->lastCommand->property()) == prop))
979 d->lastCommand->setValue(value);
981 d->lastCommand =
new PropertyCommand(
this, d->widgets.first()->name(),
982 d->set[ prop.latin1() ].oldValue(), value, prop.latin1());
992WidgetPropertySet::initPropertiesDescription()
996 d->propCaption[
"name"] = i18n(
"Name");
997 d->propCaption[
"caption"] = i18n(
"Caption");
998 d->propCaption[
"text"] = i18n(
"Text");
999 d->propCaption[
"paletteBackgroundPixmap"] = i18n(
"Background Pixmap");
1000 d->propCaption[
"enabled"] = i18n(
"Enabled");
1001 d->propCaption[
"geometry"] = i18n(
"Geometry");
1002 d->propCaption[
"sizePolicy"] = i18n(
"Size Policy");
1003 d->propCaption[
"minimumSize"] = i18n(
"Minimum Size");
1004 d->propCaption[
"maximumSize"] = i18n(
"Maximum Size");
1005 d->propCaption[
"font"] = i18n(
"Font");
1006 d->propCaption[
"cursor"] = i18n(
"Cursor");
1007 d->propCaption[
"paletteForegroundColor"] = i18n(
"Foreground Color");
1008 d->propCaption[
"paletteBackgroundColor"] = i18n(
"Background Color");
1009 d->propCaption[
"focusPolicy"] = i18n(
"Focus Policy");
1010 d->propCaption[
"margin"] = i18n(
"Margin");
1011 d->propCaption[
"readOnly"] = i18n(
"Read Only");
1013 d->propCaption[
"frame"] = i18n(
"Frame");
1014 d->propCaption[
"lineWidth"] = i18n(
"Frame Width");
1015 d->propCaption[
"midLineWidth"] = i18n(
"Mid Frame Width");
1016 d->propCaption[
"frameShape"] = i18n(
"Frame Shape");
1017 d->propCaption[
"frameShadow"] = i18n(
"Frame Shadow");
1019 d->propCaption[
"vScrollBarMode"] = i18n(
"Vertical ScrollBar");
1020 d->propCaption[
"hScrollBarMode"] = i18n(
"Horizontal ScrollBar");
1022 d->propValCaption[
"NoBackground"] = i18n(
"No Background");
1023 d->propValCaption[
"PaletteForeground"] = i18n(
"Palette Foreground");
1024 d->propValCaption[
"AutoText"] = i18n(
"Auto (HINT: for AutoText)",
"Auto");
1026 d->propValCaption[
"AlignAuto"] = i18n(
"Auto (HINT: for Align)",
"Auto");
1027 d->propValCaption[
"AlignLeft"] = i18n(
"Left (HINT: for Align)",
"Left");
1028 d->propValCaption[
"AlignRight"] = i18n(
"Right (HINT: for Align)",
"Right");
1029 d->propValCaption[
"AlignHCenter"] = i18n(
"Center (HINT: for Align)",
"Center");
1030 d->propValCaption[
"AlignJustify"] = i18n(
"Justify (HINT: for Align)",
"Justify");
1031 d->propValCaption[
"AlignVCenter"] = i18n(
"Center (HINT: for Align)",
"Center");
1032 d->propValCaption[
"AlignTop"] = i18n(
"Top (HINT: for Align)",
"Top");
1033 d->propValCaption[
"AlignBottom"] = i18n(
"Bottom (HINT: for Align)",
"Bottom");
1035 d->propValCaption[
"NoFrame"] = i18n(
"No Frame (HINT: for Frame Shape)",
"No Frame");
1036 d->propValCaption[
"Box"] = i18n(
"Box (HINT: for Frame Shape)",
"Box");
1037 d->propValCaption[
"Panel"] = i18n(
"Panel (HINT: for Frame Shape)",
"Panel");
1038 d->propValCaption[
"WinPanel"] = i18n(
"Windows Panel (HINT: for Frame Shape)",
"Windows Panel");
1039 d->propValCaption[
"HLine"] = i18n(
"Horiz. Line (HINT: for Frame Shape)",
"Horiz. Line");
1040 d->propValCaption[
"VLine"] = i18n(
"Vertical Line (HINT: for Frame Shape)",
"Vertical Line");
1041 d->propValCaption[
"StyledPanel"] = i18n(
"Styled (HINT: for Frame Shape)",
"Styled");
1042 d->propValCaption[
"PopupPanel"] = i18n(
"Popup (HINT: for Frame Shape)",
"Popup");
1043 d->propValCaption[
"MenuBarPanel"] = i18n(
"Menu Bar (HINT: for Frame Shape)",
"Menu Bar");
1044 d->propValCaption[
"ToolBarPanel"] = i18n(
"Toolbar (HINT: for Frame Shape)",
"Toolbar");
1045 d->propValCaption[
"LineEditPanel"] = i18n(
"Text Box (HINT: for Frame Shape)",
"Text Box");
1046 d->propValCaption[
"TabWidgetPanel"] = i18n(
"Tab Widget (HINT: for Frame Shape)",
"Tab Widget");
1047 d->propValCaption[
"GroupBoxPanel"] = i18n(
"Group Box (HINT: for Frame Shape)",
"Group Box");
1049 d->propValCaption[
"Plain"] = i18n(
"Plain (HINT: for Frame Shadow)",
"Plain");
1050 d->propValCaption[
"Raised"] = i18n(
"Raised (HINT: for Frame Shadow)",
"Raised");
1051 d->propValCaption[
"Sunken"] = i18n(
"Sunken (HINT: for Frame Shadow)",
"Sunken");
1052 d->propValCaption[
"MShadow"] = i18n(
"for Frame Shadow",
"Internal");
1054 d->propValCaption[
"NoFocus"] = i18n(
"No Focus (HINT: for Focus)",
"No Focus");
1055 d->propValCaption[
"TabFocus"] = i18n(
"Tab (HINT: for Focus)",
"Tab");
1056 d->propValCaption[
"ClickFocus"] = i18n(
"Click (HINT: for Focus)",
"Click");
1057 d->propValCaption[
"StrongFocus"] = i18n(
"Tab/Click (HINT: for Focus)",
"Tab/Click");
1058 d->propValCaption[
"WheelFocus"] = i18n(
"Tab/Click/MouseWheel (HINT: for Focus)",
"Tab/Click/MouseWheel");
1060 d->propValCaption[
"Auto"] = i18n(
"Auto");
1061 d->propValCaption[
"AlwaysOff"] = i18n(
"Always Off");
1062 d->propValCaption[
"AlwaysOn"] = i18n(
"Always On");
1065 d->propValCaption[
"Horizontal"] = i18n(
"Horizontal");
1066 d->propValCaption[
"Vertical"] = i18n(
"Vertical");
1070WidgetPropertySet::propertyCaption(
const TQCString &name)
1072 return d->propCaption[name];
1076WidgetPropertySet::valueCaption(
const TQCString &name)
1078 return d->propValCaption[name];
1081KoProperty::Property::ListData*
1082WidgetPropertySet::createValueList(
WidgetInfo *winfo,
const TQStringList &list)
1086 TQStringList::ConstIterator endIt = list.end();
1087 for(TQStringList::ConstIterator it = list.begin(); it != endIt; ++it) {
1088 TQString n( d->propValCaption[ (*it).latin1() ] );
1093 names.append( *it );
1103 return new KoProperty::Property::ListData(list, names);
1107WidgetPropertySet::addPropertyCaption(
const TQCString &property,
const TQString &caption)
1109 if(!d->propCaption.contains(property))
1110 d->propCaption[property] = caption;
1114WidgetPropertySet::addValueCaption(
const TQCString &value,
const TQString &caption)
1116 if(!d->propValCaption.contains(value))
1117 d->propValCaption[value] = caption;
1120#include "widgetpropertyset.moc"
KEXIUTILS_EXPORT bool isIdentifier(const TQString &s)