[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-29 23:09:08
Message-ID: 20050129230908.B839B1CFE6 () office ! kde ! org
[Download RAW message or body]

CVS commit by segfault: 

Added a new replacement for QLabels in Form Designer.
This special label is capable of placing a drop shadow below the text.
This shadow can be toggled on or off.
Together with the new background gradients very nice effects are possible.
CCMAIL: dkite@shaw.ca
FEATURE


  A            plugins/forms/kexilabel.cpp   1.1 [LGPL (v2+)]
  A            plugins/forms/kexilabel.h   1.1 [LGPL (v2+)]
  M +1 -1      data/kexiformpartinstui.rc   1.13
  M +1 -1      plugins/forms/Makefile.am   1.18
  M +20 -1     plugins/forms/kexidbfactory.cpp   1.17


--- koffice/kexi/data/kexiformpartinstui.rc  #1.12:1.13
@@ -38,5 +38,5 @@
    <Separator/>
    <Action name="library_widget_KexiSubForm"/>
-   <Action name="library_widget_QLabel"/>
+   <Action name="library_widget_KexiLabel"/>
    <Action name="library_widget_MyPicLabel"/>
    <Action name="library_widget_KexiDBLineEdit"/>

--- koffice/kexi/plugins/forms/Makefile.am  #1.17:1.18
@@ -15,5 +15,5 @@
 
 kexidbwidgets_la_LDFLAGS =  $(all_libraries) $(KDE_PLUGIN) -module
-kexidbwidgets_la_SOURCES =  kexidbfactory.cpp
+kexidbwidgets_la_SOURCES =  kexidbfactory.cpp kexilabel.cpp
 kexidbwidgets_la_LIBADD = $(top_builddir)/kexi/formeditor/libkformdesigner.la
 

--- koffice/kexi/plugins/forms/kexidbfactory.cpp  #1.16:1.17
@@ -35,10 +35,11 @@
 #include <kexidb/connection.h>
 #include <kexipart.h>
+#include <widgetlibrary.h>
 
 #include "kexidbform.h"
 #include "kexiformview.h"
+#include "kexilabel.h"
 
 #include "kexidbfactory.h"
-#include "formmanager.h"
 
 KexiSubForm::KexiSubForm(KFormDesigner::FormManager *manager, QWidget *parent, const char *name)
@@ -153,4 +154,15 @@ KexiDBFactory::KexiDBFactory(QObject *pa
         m_classes.append(wLineEdit);
 
+        /* @todo allow to inherit from stdwidgets' KLineEdit */
+        KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this);
+        wLabel->setPixmap("label");
+        wLabel->setClassName("KexiLabel");
+        wLabel->addAlternateClassName("QLabel", true/*override*/);
+        wLabel->setIncludeFileName("qlabel.h");
+        wLabel->setName(i18n("Text Label"));
+        wLabel->setNamePrefix(i18n("Widget name (see above)", "Label"));
+        wLabel->setDescription(i18n("A widget to display text"));
+        m_classes.append(wLabel);
+        
         m_propDesc["dataSource"] = i18n("Data source");
         m_propDesc["formName"] = i18n("Form name");
@@ -173,4 +185,5 @@ KexiDBFactory::create(const QCString &c,
 
         QWidget *w=0;
+        QString text = container->form()->manager()->lib()->textForWidgetName(n, c);
 
         if(c == "KexiSubForm")
@@ -183,4 +196,8 @@ KexiDBFactory::create(const QCString &c,
                 w->setCursor(QCursor(Qt::ArrowCursor));
         }
+        else if(c == "KexiLabel")
+        {
+                w = new KexiLabel(text, p, n);
+        }
 
         return w;
@@ -217,4 +234,6 @@ KexiDBFactory::clearWidgetContent(const 
         if(classname == "KexiDBLineEdit")
                 static_cast<KLineEdit*>(w)->clear();
+        if(classname == "KexiLabel")
+                static_cast<QLabel*>(w)->clear();
 }
 


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

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