Browse Source

add setEintragPos methods to list views

Kolja Strohm 8 months ago
parent
commit
0f3d239c97
2 changed files with 26 additions and 0 deletions
  1. 18 0
      Liste.cpp
  2. 8 0
      Liste.h

+ 18 - 0
Liste.cpp

@@ -292,6 +292,19 @@ void AuswahlListe::tauschEintragPos(
     }
 }
 
+void Framework::AuswahlListe::setEintragPos(int vpos, int npos) {
+    if (tfListe)
+    {
+        tfListe->setPosition(vpos, npos);
+        if (styles) styles->setPosition(vpos, npos);
+        if (ahFarbeListe) ahFarbeListe->setPosition(vpos, npos);
+        if (ahBildListe) ahBildListe->setPosition(vpos, npos);
+        if (aBufferListe) aBufferListe->setPosition(vpos, npos);
+        if (aRahmenListe) aRahmenListe->setPosition(vpos, npos);
+        rend = 1;
+    }
+}
+
 void AuswahlListe::removeEintrag(int pos) // löscht den Eintrag pos
 {
     tfListe->remove(pos);
@@ -1093,6 +1106,11 @@ void ZListe::tauschEintragPos(int vPos, int nPos)
     list.tausch(vPos, nPos);
 }
 
+void Framework::ZListe::setEintragPos(int vpos, int npos)
+{
+    list.setPosition(vpos, npos);
+}
+
 //! Löscht einen Eintrag
 //! pos: Der Index des Eintrags
 void ZListe::removeEintrag(int pos)

+ 8 - 0
Liste.h

@@ -129,6 +129,10 @@ namespace Framework
         //! \param vpos Der Index des ersten Eintrags
         //! \param npos Der Index des zweiten Eintrags
         DLLEXPORT void tauschEintragPos(int vpos, int npos);
+        //! setzt die Position eines Eintags
+        //! \param vpos Der Index des Eintrags
+        //! \param npos Der Index den der Eintrag haben soll
+        DLLEXPORT void setEintragPos(int vpos, int npos);
         //! Löscht einen Eintrag
         //! pos: Der Index des Eintrags
         DLLEXPORT void removeEintrag(int pos);
@@ -369,6 +373,10 @@ namespace Framework
         //! \param vpos Der Index des ersten Eintrags
         //! \param npos Der Index des zweiten Eintrags
         DLLEXPORT void tauschEintragPos(int vpos, int npos);
+        //! setzt die Position eines Eintags
+        //! \param vpos Der Index des Eintrags
+        //! \param npos Der Index den der Eintrag haben soll
+        DLLEXPORT void setEintragPos(int vpos, int npos);
         //! Löscht einen Eintrag
         //! pos: Der Index des Eintrags
         DLLEXPORT void removeEintrag(int pos);