[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed May 12 01:28:13 CEST 2004


CVS commit by arwalker: 

Added ability to edit label properties


  A            kstviewlabeldialog.ui   1.1
  M +2 -0      Makefile.am   1.103
  M +16 -1     kstviewlabel.cpp   1.13
  M +7 -1      kstviewlabel.h   1.10


--- kdeextragear-2/kst/kst/kstviewlabel.cpp  #1.12:1.13
@@ -21,7 +21,8 @@
 #include <klocale.h>
 #include <kpopupmenu.h>
+#include "kstviewlabeldialog_i.h"
 #include "kstviewlabel.h"
-
 #include <qptrstack.h>
+#include <qmessagebox.h>
 
 KstViewLabel::KstViewLabel(const QString& txt, KstVLJustifyType justify,
@@ -38,4 +39,5 @@ KstViewLabel::KstViewLabel(const QString
   _standardActions |= Delete | Edit;
   _chunk = 0L;
+  _editDialog = NULL;
   setBackgroundColor("white"); // FIXME
   reparse();
@@ -44,4 +46,8 @@ KstViewLabel::KstViewLabel(const QString
 
 KstViewLabel::~KstViewLabel() {
+  if( _editDialog ) {
+    _editDialog->close();
+    delete _editDialog;
+  }
 }
 
@@ -560,4 +566,13 @@ void KstViewLabel::adjustSizeForText() {
 
 
+void KstViewLabel::edit() {
+  if( _editDialog == NULL ) {
+    _editDialog = new KstViewLabelDialogI( );
+  }
+  if( _editDialog ) {
+    _editDialog->showI(this);
+  }
+}
+
 bool KstViewLabel::layoutPopupMenu(KPopupMenu *menu, const QPoint& pos, KstViewObjectPtr topLevelParent) {
   KstViewObject::layoutPopupMenu(menu, pos, topLevelParent);

--- kdeextragear-2/kst/kst/kstviewlabel.h  #1.9:1.10
@@ -24,4 +24,6 @@
 #include "kstscalar.h"
 
+class KstViewLabelDialogI;
+
 typedef Q_UINT16 KstVLJustifyType;
 #define KST_JUSTIFY_H(x)     (x & 0x00000003L)
@@ -37,4 +39,6 @@ typedef Q_UINT16 KstVLJustifyType;
 #define KST_JUSTIFY_V_CENTER  3
 
+#define SET_KST_JUSTIFY(h,v) ( ( h & 0x00000003L ) | ( ( v & 0x00000003L ) << 2 ) )
+
 struct LabelChunk;
 
@@ -72,4 +76,5 @@ class KstViewLabel : public KstBorderedV
   public slots:
     void adjustSizeForText();
+    void edit();
 
   protected:
@@ -98,4 +103,5 @@ class KstViewLabel : public KstBorderedV
     KstBackBuffer _backBuffer;
     LabelChunk *_chunk;
+    KstViewLabelDialogI *_editDialog;
 };
 

--- kdeextragear-2/kst/kst/Makefile.am  #1.102:1.103
@@ -97,4 +97,5 @@
         kstdebugdialog_i.cpp \
         kstlabeldialog_i.cpp \
+        kstviewlabeldialog_i.cpp \
         kstpsdcurve.cpp \
         kstfitcurve.cpp \
@@ -136,4 +137,5 @@
         vectorsavedialog.ui \
         kstlabeldialog.ui \
+        kstviewlabeldialog.ui \
         kstsettingsdlg.ui \
         kstscalar.cpp \





More information about the Kst mailing list