Browse Source

add registerZeichnung to UIMLContainer interface

Kolja Strohm 9 months ago
parent
commit
acfca10e7a
2 changed files with 15 additions and 0 deletions
  1. 13 0
      UIMLView.cpp
  2. 2 0
      UIMLView.h

+ 13 - 0
UIMLView.cpp

@@ -1066,6 +1066,19 @@ void UIMLView::layout(XML::Element& element,
     }
 }
 
+DLLEXPORT bool Framework::UIMLView::registerZeichnung(
+    const char* id, Zeichnung* z)
+{
+    Zeichnung* existing = members->z(id, textLength(id));
+    if (existing)
+    {
+        z->release();
+        return 0;
+    }
+    members->set(id, textLength(id), z);
+    return 1;
+}
+
 const UIInit& UIMLView::getFactory()
 {
     return init;

+ 2 - 0
UIMLView.h

@@ -45,6 +45,7 @@ namespace Framework
         DLLEXPORT virtual ~UIMLContainer();
         virtual Zeichnung* zZeichnungById(const char* id) = 0;
         virtual Zeichnung* getZeichnungById(const char* id) = 0;
+        virtual bool registerZeichnung(const char* id, Zeichnung* z) = 0;
         virtual const UIInit& getFactory() = 0;
     };
 
@@ -301,6 +302,7 @@ namespace Framework
             int pWidth,
             int pHeight,
             UIMLContainer& generalLayouter) override;
+        DLLEXPORT bool registerZeichnung(const char* id, Zeichnung* z) override;
         DLLEXPORT const UIInit& getFactory() override;
         //! calculates the needed size for all content elements to be visible
         DLLEXPORT Punkt calculateContentSize();