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

List:       kde-commits
Subject:    koffice/kivio/kiviopart/kiviosdk
From:       Peter Simonsson <psn () linux ! se>
Date:       2004-01-01 1:00:06
Message-ID: 20040101010006.ED35A93EA () office ! kde ! org
[Download RAW message or body]

CVS commit by psn: 

Support for accessing the individual textareas in grouped stencils


  M +39 -1     kivio_group_stencil.cpp   1.17
  M +11 -1     kivio_group_stencil.h   1.9


--- koffice/kivio/kiviopart/kiviosdk/kivio_group_stencil.cpp  #1.16:1.17
@@ -1,5 +1,6 @@
 /*
  * Kivio - Visual Modelling and Flowcharting
- * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
+ * Copyright (C) 2000-2004 theKompany.com & Dave Marotti
+ *                         Peter Simonsson
  *
  * This program is free software; you can redistribute it and/or
@@ -594,2 +595,39 @@ int KivioGroupStencil::resizeHandlePosit
     return KIVIO_RESIZE_HANDLE_POSITION_ALL;
 }
+
+QString KivioGroupStencil::getTextBoxName(const KoPoint& p)
+{
+  KivioStencil *pStencil = m_pGroupList->first();
+  QString name;
+  int id = 0;
+  
+  while(pStencil)
+  {
+    name = pStencil->getTextBoxName(p);
+    
+    if(!name.isEmpty()) {
+      return QString::number(id) + "-" + name;
+    }
+    
+    pStencil = m_pGroupList->next();
+    id++;
+  }
+  
+  return QString::null;
+}
+
+void KivioGroupStencil::setText(const QString& text, const QString& name)
+{
+  int id = name.section("-", 0, 0).toInt();
+  QString n = name.section("-", 1);
+  
+  m_pGroupList->at(id)->setText(text, n);
+}
+
+QString KivioGroupStencil::text(const QString& name)
+{
+  int id = name.section("-", 0, 0).toInt();
+  QString n = name.section("-", 1);
+  
+  return m_pGroupList->at(id)->text(n);
+}

--- koffice/kivio/kiviopart/kiviosdk/kivio_group_stencil.h  #1.8:1.9
@@ -1,5 +1,6 @@
 /*
  * Kivio - Visual Modelling and Flowcharting
- * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
+ * Copyright (C) 2000-2004 theKompany.com & Dave Marotti
+ *                         Peter Simonsson
  *
  * This program is free software; you can redistribute it and/or
@@ -112,4 +113,13 @@ public:
 
     virtual int resizeHandlePositions();
+
+    /**
+      Returns the name of the text box that is at @param p.
+      If there exist no text box at @param p then it returns QString::null.
+    */
+    virtual QString getTextBoxName(const KoPoint& p);
+
+    virtual void setText(const QString& text, const QString& name);
+    virtual QString text(const QString& name);
 };
 


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

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