[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi
From:       Christian Nitschkowski <segfault_ii () web ! de>
Date:       2005-01-31 18:48:19
Message-ID: 20050131184819.502431D215 () office ! kde ! org
[Download RAW message or body]

CVS commit by segfault: 

Implemented inline-editing of KexiLabel.
Added a default implementation of changeText in WidgetFactory.


  M +4 -2      formeditor/widgetfactory.cpp   1.50
  M +6 -3      formeditor/widgetfactory.h   1.43
  M +13 -8     plugins/forms/kexidbfactory.cpp   1.24


--- koffice/kexi/formeditor/widgetfactory.cpp  #1.49:1.50
@@ -395,6 +395,8 @@ WidgetFactory::clearWidgetContent(const 
 
 void
-WidgetFactory::changeText(const QString&)
-{}
+WidgetFactory::changeText(const QString& text)
+{
+        changeProperty( "text", text, m_container );
+}
 
 bool

--- koffice/kexi/formeditor/widgetfactory.h  #1.42:1.43
@@ -303,6 +303,9 @@ class KFORMEDITOR_EXPORT WidgetFactory :
 
         protected slots:
-                /*! You have to implement this function for editing inside the Form \
                to work. This slot is
-                called when the line edit text changes, and you have to make it \
really change the good +                /*!
+                Default implementation will change property "text".
+                You have to reimplement this function for editing inside the Form to \
work if your widget's +                property you want to change isn't named \
"text". +                This slot is called when the line edit text changes, and you \
                have to make it really change the good
                 property of the widget using changeProperty() (text, or title, \
                etc.).
                  */

--- koffice/kexi/plugins/forms/kexidbfactory.cpp  #1.23:1.24
@@ -234,15 +234,20 @@ KexiDBFactory::startEditing(const QStrin
                 createEditor(lineedit->text(), lineedit, container, \
lineedit->geometry(), lineedit->alignment(), true);  }
-        else if(classname == "KexiLabel")
-        {
+        if ( classname == "KexiLabel" ) {
                 KexiLabel *label = static_cast<KexiLabel*>(w);
-/*              if(label->textFormat() == RichText)
-                {
                         m_widget = w;
-                        // TODO - try to avoid reimplementing \
                StdWidgetFactory::editText
-                        // talk to jstaniek about this
-                        //editText();
+                if(label->textFormat() == RichText)
+                {
+                        QString text = label->text();
+                        if ( editRichText( label, text ) )
+                        {
+                                changeProperty( "textFormat", "RichText", container \
); +                                changeProperty( "text", text, container );
                 }
-                else*/
+
+                        if ( classname == "KexiLabel" )
+                                w->resize(w->sizeHint());
+                }
+                else
                         createEditor(label->text(), label, container, \
label->geometry(), label->alignment());  return;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic