Browse Source

improved uiml documentation and added more supported uiml element attributes

Kolja Strohm 8 months ago
parent
commit
c137e4843d
10 changed files with 633 additions and 283 deletions
  1. 22 22
      DX12PixelShader.h
  2. 17 17
      DX12VertexShader.h
  3. 38 2
      Fenster.cpp
  4. 9 1
      Fenster.h
  5. 1 1
      Framework Linux.vcxproj
  6. 3 3
      Framework Linux.vcxproj.filters
  7. 287 148
      UIMLView.cpp
  8. 218 51
      UIMLView.h
  9. 23 23
      UIPixelShader.h
  10. 15 15
      UIVertexShader.h

+ 22 - 22
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67, 186, 195, 
-    212, 229, 146, 222, 174, 164, 
-    234,  67,  33,  48, 200,  17, 
-     92, 137,   1,   0,   0,   0, 
+     68,  88,  66,  67, 107, 167, 
+    128, 193, 201,  13, 208, 118, 
+    217,  33,  32, 185,  38,  26, 
+    130, 194,   1,   0,   0,   0, 
     184,  91,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      36,   2,   0,   0, 188,   2, 
@@ -763,11 +763,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1,  21,  78, 209, 100, 
-      1,   0,   0,   0,  78,  96, 
-     67,  15, 180, 144,  32,  73, 
-    148,   1, 227,  20, 191, 252, 
-    237,  74,   0,   0,   0,   0, 
+     49,   1,  45, 245, 215, 100, 
+      1,   0,   0,   0, 253,  41, 
+    155, 200, 124,  60, 160,  67, 
+    171, 215, 192, 199, 174, 199, 
+    135, 103,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -938,10 +938,10 @@ const BYTE DX12PixelShaderBytes[] =
       3,   0, 242,  56,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0, 148, 153, 
-      2,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0,  14, 184, 
-      3,   0, 193,  33,   3,   0, 
+    236, 179,   1,   0, 215, 127, 
+      0,   0, 125,  10,   2,   0, 
+    125, 181,   2,   0, 205, 178, 
+      1,   0, 193,  33,   3,   0, 
      65, 185,   2,   0, 140, 239, 
       1,   0, 246,  49,   0,   0, 
     213, 255,   0,   0,  46, 248, 
@@ -1788,7 +1788,7 @@ const BYTE DX12PixelShaderBytes[] =
     117, 114, 101,  50,  68,  32, 
     115, 104,  97, 100,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-    142, 187,  83,  62, 106, 201, 
+    214,  34,  12,  94,  97, 205, 
     217,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2348,14 +2348,14 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2, 176, 160,   0,   0, 
+      3,   2,  96,  89,   0,   0, 
     242, 241,  10,   0,  24,  21, 
       8,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
       9,  16,   0,   0,   1,   0, 
       0,   2,  14,   0,  23,  21, 
       0,   0,   0,   0,  10,   2, 
-    176, 160,   0,   0, 242, 241, 
+     96,  89,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -3408,11 +3408,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1,  21,  78, 
-    209, 100,   1,   0,   0,   0, 
-     78,  96,  67,  15, 180, 144, 
-     32,  73, 148,   1, 227,  20, 
-    191, 252, 237,  74, 128,   0, 
+    148,  46,  49,   1,  45, 245, 
+    215, 100,   1,   0,   0,   0, 
+    253,  41, 155, 200, 124,  60, 
+    160,  67, 171, 215, 192, 199, 
+    174, 199, 135, 103, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -3512,7 +3512,7 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   2,   0,   9,   0, 
     220,   4,   0,   0,   0,   0, 
       0,   0, 156,   1,   0,   0, 
-      1,   0,  34,   0,   0,   0, 
+      1,   0, 250, 150,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 109,  97, 
     105, 110,   0, 110, 111, 110, 

+ 17 - 17
DX12VertexShader.h

@@ -131,10 +131,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67, 174,  18, 
-    157, 197, 145,  76, 124, 166, 
-    235, 218, 176, 230,  22, 187, 
-    249, 152,   1,   0,   0,   0, 
+     68,  88,  66,  67,  82, 198, 
+    123, 136, 210, 186,  67, 232, 
+    123, 138, 238, 214, 195, 135, 
+    249, 213,   1,   0,   0,   0, 
     144,  78,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   2,   0,   0,  52,   3, 
@@ -923,11 +923,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1,  21,  78, 
-    209, 100,   1,   0,   0,   0, 
-     70,  22, 116, 117,  78, 193, 
-    253,  73, 139,  54,  44,  19, 
-    233,  57, 122, 118,   0,   0, 
+    148,  46,  49,   1,  45, 245, 
+    215, 100,   1,   0,   0,   0, 
+    222, 106,  44,  43, 110, 235, 
+    107,  73, 185,  36,  69, 234, 
+     90,  40, 183, 209,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1103,7 +1103,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0, 103, 159,   1,   0, 
     179, 120,   1,   0, 238,  97, 
       2,   0,  90,  28,   0,   0, 
-     66, 104,   0,   0,  53, 174, 
+     99,  68,   3,   0,  53, 174, 
       3,   0, 206,  21,   0,   0, 
     193, 205,   3,   0, 207, 193, 
       1,   0,  62,   3,   3,   0, 
@@ -1607,7 +1607,7 @@ const BYTE DX12VertexShaderBytes[] =
      97, 109, 101, 114,  97,  13, 
      10, 115, 116, 114,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-    182, 179, 106,  62, 106, 201, 
+    161,  50,  38,  94,  97, 205, 
     217,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2125,7 +2125,7 @@ const BYTE DX12VertexShaderBytes[] =
      24,  21,  12,  16,   0,   0, 
       1,   0,   1,   0,  14,   0, 
      23,  21,  13,  16,   0,   0, 
-     36,   2, 240, 202,   0,   0, 
+     36,   2,  80, 114,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      14,  16,   0,   0,   1,   0, 
       0,   2,  18,   0,  22,  21, 
@@ -3057,10 +3057,10 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-     21,  78, 209, 100,   1,   0, 
-      0,   0,  70,  22, 116, 117, 
-     78, 193, 253,  73, 139,  54, 
-     44,  19, 233,  57, 122, 118, 
+     45, 245, 215, 100,   1,   0, 
+      0,   0, 222, 106,  44,  43, 
+    110, 235, 107,  73, 185,  36, 
+     69, 234,  90,  40, 183, 209, 
     129,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 
@@ -3160,7 +3160,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   2,   0, 
       9,   0, 156,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0, 187, 202, 
+      0,   0,   1,   0,  33, 114, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
     109,  97, 105, 110,   0, 110, 

+ 38 - 2
Fenster.cpp

@@ -1778,6 +1778,22 @@ void Fenster::setVSBScroll(int scroll)
     rend = 1;
 }
 
+void Framework::Fenster::updateHScroll()
+{
+    if (hScroll)
+    {
+        hScroll->update(getNeededChildWidth(), getInnenBreite());
+    }
+}
+
+void Framework::Fenster::updateVScroll()
+{
+    if (vScroll)
+    {
+        vScroll->update(getNeededChildHeight(), getInnenHeight());
+    }
+}
+
 // -- Members --
 void Fenster::addMember(Zeichnung* obj) // fügt einen Member hinzu
 {
@@ -1990,8 +2006,8 @@ void Fenster::render(Bild& zRObj) // zeichent nach zRObj
         }
         else
         {
-            zRObj.addScrollOffset(hSc ? hScroll->getScroll() : 0,
-                vSc ? vScroll->getScroll() : 0);
+            zRObj.addScrollOffset(
+                hSc ? hScroll->getScroll() : 0, vSc ? vScroll->getScroll() : 0);
             for (Zeichnung* i : *members)
                 i->render(zRObj);
         }
@@ -2326,6 +2342,26 @@ const RCArray<Zeichnung>& Fenster::getMembers() const // gibt die Members zur
     return *members;
 }
 
+int Framework::Fenster::getNeededChildWidth() const
+{
+    int max = 0;
+    for (Zeichnung* z : *members)
+    {
+        if (z->getX() + z->getBreite() > max) max = z->getX() + z->getBreite();
+    }
+    return max;
+}
+
+int Framework::Fenster::getNeededChildHeight() const
+{
+    int max = 0;
+    for (Zeichnung* z : *members)
+    {
+        if (z->getY() + z->getHeight() > max) max = z->getY() + z->getHeight();
+    }
+    return max;
+}
+
 // -- Kopie --
 Zeichnung* Fenster::dublizieren() const // Erzeugt eine Kopie des Fensters
 {

+ 9 - 1
Fenster.h

@@ -592,6 +592,10 @@ namespace Framework
         //! \param scroll Die Anzahl der Pixel, die der Inhalt nach oben
         //! verschoben werden soll
         DLLEXPORT void setVSBScroll(int scroll);
+        //! Updates the horizontal scrollbar so that the max scroll size is set to the width of the content
+        DLLEXPORT void updateHScroll();
+        //! Updates the vertical scrollbar so that the max scroll size is set to the height of the content
+        DLLEXPORT void updateVScroll();
         //! Fügt dem Fenster eine Zeichnung hinzu
         //! \param obj Die Zeichnung
         DLLEXPORT virtual void addMember(Zeichnung* obj);
@@ -735,7 +739,11 @@ namespace Framework
         //! Counter zurück
         DLLEXPORT HScrollBar* zHScrollBar() const;
         //! Gibt eine Liste mit Zeichnungen zurück, die im Fenster sind
-        DLLEXPORT const RCArray<Zeichnung> &getMembers() const;
+        DLLEXPORT const RCArray<Zeichnung>& getMembers() const;
+        //! Gibt die von den kindern benötigte Breite des Fensters zurück
+        DLLEXPORT int getNeededChildWidth() const;
+        //! Gibt die von den kindern benötigte Höhe des Fensters zurück
+        DLLEXPORT int getNeededChildHeight() const;
         //! Erzeugt eine Kopie des Fensters, die ohne Auswirkungen auf das
         //! Original verändert werden kann
         DLLEXPORT Zeichnung* dublizieren() const override;

+ 1 - 1
Framework Linux.vcxproj

@@ -150,7 +150,7 @@
     <ClCompile Include="Punkt.cpp" />
     <ClCompile Include="Rahmen.cpp" />
     <ClCompile Include="Random.cpp" />
-    <ClCompile Include="RCPointer.h" />
+    <ClInclude Include="RCPointer.h" />
     <ClCompile Include="ReferenceCounter.cpp" />
     <ClCompile Include="Schrift.cpp" />
     <ClCompile Include="Scroll.cpp" />

+ 3 - 3
Framework Linux.vcxproj.filters

@@ -295,11 +295,11 @@
     <ClInclude Include="Base64.h">
       <Filter>Framework</Filter>
     </ClInclude>
+    <ClInclude Include="RCPointer.h">
+      <Filter>Framework\Data</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="RCPointer.h">
-      <Filter>Framework\Data</Filter>
-    </ClCompile>
     <ClCompile Include="Bild.cpp">
       <Filter>Framework\Grafik\2D</Filter>
     </ClCompile>

+ 287 - 148
UIMLView.cpp

@@ -29,14 +29,16 @@ void UIMLElement::layout(XML::Element& element,
 {
     int width = z.getBreite();
     int height = z.getHeight();
+    if (element.hasAttribute("style"))
+    {
+        z.setStyle((__int64)element.getAttributeValue("style"));
+    }
     if (element.hasAttribute("width"))
     {
         Text w = element.getAttributeValue("width");
         if (!w.istGleich("auto"))
         {
-            width = (int)w;
-            if (w.getText()[w.getLength() - 1] == '%')
-                width = (int)((pWidth / 100.0) * width);
+            width = calculateSize(w, pWidth);
         }
     }
     if (element.hasAttribute("height"))
@@ -44,9 +46,7 @@ void UIMLElement::layout(XML::Element& element,
         Text h = element.getAttributeValue("height");
         if (!h.istGleich("auto"))
         {
-            height = (int)h;
-            if (h.getText()[h.getLength() - 1] == '%')
-                height = (int)((pHeight / 100.0) * height);
+            height = calculateSize(h, pHeight);
         }
     }
     z.setSize(width, height);
@@ -75,10 +75,7 @@ void UIMLElement::layout(XML::Element& element,
         if (element.hasAttribute("margin-left"))
         {
             Text mt = element.getAttributeValue("margin-left");
-            int m = (int)mt;
-            if (mt.getText()[mt.getLength() - 1] == '%')
-                m = (int)((pWidth / 100.0) * m);
-            x += m;
+            x += calculateSize(mt, pWidth);
         }
         z.setX(x);
     }
@@ -107,10 +104,7 @@ void UIMLElement::layout(XML::Element& element,
         if (element.hasAttribute("margin-right"))
         {
             Text mt = element.getAttributeValue("margin-right");
-            int m = (int)mt;
-            if (mt.getText()[mt.getLength() - 1] == '%')
-                m = (int)((pWidth / 100.0) * m);
-            x -= m;
+            x -= calculateSize(mt, pWidth);
         }
         z.setX(x);
     }
@@ -139,10 +133,7 @@ void UIMLElement::layout(XML::Element& element,
         if (element.hasAttribute("margin-top"))
         {
             Text mt = element.getAttributeValue("margin-top");
-            int m = (int)mt;
-            if (mt.getText()[mt.getLength() - 1] == '%')
-                m = (int)((pHeight / 100.0) * m);
-            y += m;
+            y += calculateSize(mt, pHeight);
         }
         z.setY(y);
     }
@@ -171,10 +162,7 @@ void UIMLElement::layout(XML::Element& element,
         if (element.hasAttribute("margin-bottom"))
         {
             Text mt = element.getAttributeValue("margin-bottom");
-            int m = (int)mt;
-            if (mt.getText()[mt.getLength() - 1] == '%')
-                m = (int)((pHeight / 100.0) * m);
-            y -= m;
+            y -= calculateSize(mt, pHeight);
         }
         z.setY(y);
     }
@@ -183,16 +171,12 @@ void UIMLElement::layout(XML::Element& element,
     if (element.hasAttribute("x"))
     {
         Text xt = element.getAttributeValue("x");
-        x = (int)xt;
-        if (xt.getText()[xt.getLength() - 1] == '%')
-            x = (int)((pWidth / 100.0) * x);
+        x = calculateSize(xt, pWidth);
     }
     if (element.hasAttribute("y"))
     {
         Text yt = element.getAttributeValue("y");
-        y = (int)yt;
-        if (yt.getText()[yt.getLength() - 1] == '%')
-            y = (int)((pHeight / 100.0) * y);
+        y = calculateSize(yt, pHeight);
     }
     z.setPosition(x, y);
     pWidth = z.getInnenBreite();
@@ -213,6 +197,90 @@ void UIMLElement::layout(XML::Element& element,
     }
 }
 
+int Framework::UIMLElement::calculateSize(Text attributeValue, int parentSize)
+{
+    attributeValue.removeWhitespaceAfter(0);
+    attributeValue.removeWhitespaceBefore(attributeValue.getLength());
+    if (attributeValue.hat('('))
+    {
+        int start = -1;
+        int len = attributeValue.getLength();
+        for (int i = 0; i < len; i++)
+        {
+            if (attributeValue.getText()[i] == '(') start = i;
+            if (attributeValue.getText()[i] == ')')
+            {
+                if (start < 0) return 0;
+                Text* part = attributeValue.getTeilText(start + 1, i);
+                int value = calculateSize(*part, parentSize);
+                part->release();
+                attributeValue.remove(start, i + 1);
+                attributeValue.insert(start, Text(value));
+                return calculateSize(attributeValue, parentSize);
+            }
+        }
+        return 0;
+    }
+    else if (attributeValue.hat('*') || attributeValue.hat('/'))
+    {
+        int posD = attributeValue.positionVon('/');
+        int posM = attributeValue.positionVon('*');
+        if ((posD >= 0 && posD < posM) || posM < 0)
+        {
+            Text* firstPart = attributeValue.getTeilText(0, posD);
+            Text* secondPart = attributeValue.getTeilText(posD + 1);
+            int first = calculateSize(*firstPart, parentSize);
+            int second = calculateSize(*secondPart, parentSize);
+            firstPart->release();
+            secondPart->release();
+            return first / second;
+        }
+        else
+        {
+            Text* firstPart = attributeValue.getTeilText(0, posM);
+            Text* secondPart = attributeValue.getTeilText(posM + 1);
+            int first = calculateSize(*firstPart, parentSize);
+            int second = calculateSize(*secondPart, parentSize);
+            firstPart->release();
+            secondPart->release();
+            return first * second;
+        }
+    }
+    else if (attributeValue.hat('+') || attributeValue.hat('-'))
+    {
+        int posP = attributeValue.positionVon('+');
+        int posN = attributeValue.positionVon('-');
+        if ((posP >= 0 && posP < posN) || posN < 0)
+        {
+            Text* firstPart = attributeValue.getTeilText(0, posP);
+            Text* secondPart = attributeValue.getTeilText(posP + 1);
+            int first = calculateSize(*firstPart, parentSize);
+            int second = calculateSize(*secondPart, parentSize);
+            firstPart->release();
+            secondPart->release();
+            return first + second;
+        }
+        else
+        {
+            Text* firstPart = attributeValue.getTeilText(0, posN);
+            Text* secondPart = attributeValue.getTeilText(posN + 1);
+            int first = calculateSize(*firstPart, parentSize);
+            int second = calculateSize(*secondPart, parentSize);
+            firstPart->release();
+            secondPart->release();
+            return first - second;
+        }
+    }
+    else if (attributeValue.hatAt(attributeValue.getLength() - 1, "%"))
+    {
+        return (int)((int)attributeValue * (parentSize / 100.0));
+    }
+    else
+    {
+        return (int)attributeValue;
+    }
+}
+
 UIMLContainer::UIMLContainer()
     : UIMLElement()
 {}
@@ -242,16 +310,7 @@ bool Framework::UIMLTextField::updateElement(
 {
     TextFeld* t = dynamic_cast<TextFeld*>(&z);
     if (!t) return false;
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        t->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         TextFeld* tmp = generalFactory.getFactory().createTextFeld(
             generalFactory.getFactory().initParam);
@@ -268,20 +327,12 @@ void UIMLTextField::layout(XML::Element& element,
     int pHeight,
     UIMLContainer& generalLayouter)
 {
-    if (element.hasAttribute("text-align-horizontal"))
-        z.setStyle(TextFeld::Style::HCenter,
-            element.getAttributeValue("text-align-horizontal")
-                .istGleich("center"));
-    if (element.hasAttribute("text-align-vertical"))
-        z.setStyle(TextFeld::Style::VCenter,
-            element.getAttributeValue("text-align-vertical")
-                .istGleich("center"));
+    TextFeld* tf = dynamic_cast<TextFeld*>(&z);
     if (element.hasAttribute("font-size"))
-        ((TextFeld*)&z)
-            ->setSchriftSize(
-                (unsigned char)(int)element.getAttributeValue("font-size"));
-    if (element.hasAttribute("disabled"))
-        z.removeStyle(TextFeld::Style::Editierbar);
+    {
+        tf->setSchriftSize(
+            (unsigned char)(int)element.getAttributeValue("font-size"));
+    }
     ((TextFeld*)&z)->setText(element.getText());
     if (element.hasAttribute("width"))
     {
@@ -299,7 +350,35 @@ void UIMLTextField::layout(XML::Element& element,
             z.setHeight(((TextFeld*)&z)->getNeededHeight());
         }
     }
+    if (element.hasAttribute("text-color"))
+    {
+        tf->setSchriftFarbe((int)element.getAttributeValue("text-color"));
+    }
     UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
+    if (element.hasAttribute("text-align-horizontal"))
+        z.setStyle(TextFeld::Style::HCenter,
+            element.getAttributeValue("text-align-horizontal")
+                .istGleich("center"));
+    if (element.hasAttribute("text-align-vertical"))
+        z.setStyle(TextFeld::Style::VCenter,
+            element.getAttributeValue("text-align-vertical")
+                .istGleich("center"));
+    if (element.hasAttribute("disabled"))
+        z.removeStyle(TextFeld::Style::Editierbar);
+    if (element.getAttributeValue("vScroll").istGleich("auto"))
+    {
+        tf->setStyle(TextFeld::Style::VScroll,
+            tf->getNeededHeight() > tf->getInnenHeight());
+        tf->setVertikalKlickScroll(tf->getSchriftSize());
+        tf->updateVScroll();
+    }
+    if (element.getAttributeValue("hScroll").istGleich("auto"))
+    {
+        tf->setStyle(TextFeld::Style::HScroll,
+            tf->getNeededWidth() > tf->getInnenBreite());
+        tf->setHorizontalKlickScroll(tf->getSchriftSize());
+        tf->updateHScroll();
+    }
 }
 
 UIMLButton::UIMLButton()
@@ -325,16 +404,7 @@ bool Framework::UIMLButton::updateElement(
 {
     Knopf* k = dynamic_cast<Knopf*>(&z);
     if (!k) return false;
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        k->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         Knopf* tmp = generalFactory.getFactory().createKnopf(
             generalFactory.getFactory().initParam);
@@ -381,16 +451,7 @@ bool Framework::UIMLCheck::updateElement(
 {
     KontrollKnopf* k = dynamic_cast<KontrollKnopf*>(&z);
     if (!k) return false;
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        k->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         KontrollKnopf* tmp = generalFactory.getFactory().createKontrollKnopf(
             generalFactory.getFactory().initParam);
@@ -440,16 +501,7 @@ bool Framework::UIMLText::updateElement(
 {
     TextFeld* t = dynamic_cast<TextFeld*>(&z);
     if (!t) return false;
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        t->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         TextFeld* tmp = generalFactory.getFactory().createTextFeld(
             generalFactory.getFactory().initParam);
@@ -466,27 +518,19 @@ void UIMLText::layout(XML::Element& element,
     int pHeight,
     UIMLContainer& generalLayouter)
 {
-    if (element.hasAttribute("text-align-horizontal"))
-        z.setStyle(TextFeld::Style::HCenter,
-            element.getAttributeValue("text-align-horizontal")
-                .istGleich("center"));
-    if (element.hasAttribute("text-align-vertical"))
-        z.setStyle(TextFeld::Style::VCenter,
-            element.getAttributeValue("text-align-vertical")
-                .istGleich("center"));
+    TextFeld* tf = dynamic_cast<TextFeld*>(&z);
     if (element.hasAttribute("font-size"))
-        ((TextFeld*)&z)
-            ->setSchriftSize(
-                (unsigned char)(int)element.getAttributeValue("font-size"));
-    if (element.hasAttribute("disabled"))
-        z.removeStyle(TextFeld::Style::Editierbar);
-    ((TextFeld*)&z)->setText(element.getText());
+    {
+        tf->setSchriftSize(
+            (unsigned char)(int)element.getAttributeValue("font-size"));
+    }
+    tf->setText(element.getText());
     if (element.hasAttribute("width"))
     {
         Text w = element.getAttributeValue("width");
         if (w.istGleich("auto"))
         {
-            z.setWidth(((TextFeld*)&z)->getNeededWidth());
+            z.setWidth(tf->getNeededWidth());
         }
     }
     if (element.hasAttribute("height"))
@@ -494,10 +538,38 @@ void UIMLText::layout(XML::Element& element,
         Text h = element.getAttributeValue("height");
         if (h.istGleich("auto"))
         {
-            z.setHeight(((TextFeld*)&z)->getNeededHeight());
+            z.setHeight(tf->getNeededHeight());
         }
     }
+    if (element.hasAttribute("text-color"))
+    {
+        tf->setSchriftFarbe((int)element.getAttributeValue("text-color"));
+    }
     UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
+    if (element.hasAttribute("text-align-horizontal"))
+        z.setStyle(TextFeld::Style::HCenter,
+            element.getAttributeValue("text-align-horizontal")
+                .istGleich("center"));
+    if (element.hasAttribute("text-align-vertical"))
+        z.setStyle(TextFeld::Style::VCenter,
+            element.getAttributeValue("text-align-vertical")
+                .istGleich("center"));
+    if (element.hasAttribute("disabled"))
+        z.removeStyle(TextFeld::Style::Editierbar);
+    if (element.getAttributeValue("vScroll").istGleich("auto"))
+    {
+        tf->setStyle(TextFeld::Style::VScroll,
+            tf->getNeededHeight() > tf->getInnenHeight());
+        tf->setVertikalKlickScroll(tf->getSchriftSize());
+        tf->updateVScroll();
+    }
+    if (element.getAttributeValue("hScroll").istGleich("auto"))
+    {
+        tf->setStyle(TextFeld::Style::HScroll,
+            tf->getNeededWidth() > tf->getInnenBreite());
+        tf->setHorizontalKlickScroll(tf->getSchriftSize());
+        tf->updateHScroll();
+    }
 }
 
 UIMLTextArea::UIMLTextArea()
@@ -523,16 +595,7 @@ bool Framework::UIMLTextArea::updateElement(
 {
     TextFeld* t = dynamic_cast<TextFeld*>(&z);
     if (!t) return false;
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        t->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         TextFeld* tmp = generalFactory.getFactory().createTextFeld(
             generalFactory.getFactory().initParam);
@@ -549,24 +612,16 @@ void UIMLTextArea::layout(XML::Element& element,
     int pHeight,
     UIMLContainer& generalLayouter)
 {
-    if (element.hasAttribute("text-align-horizontal"))
-        z.setStyle(TextFeld::Style::HCenter,
-            element.getAttributeValue("text-align-horizontal")
-                .istGleich("center"));
-    if (element.hasAttribute("text-align-vertical"))
-        z.setStyle(TextFeld::Style::VCenter,
-            element.getAttributeValue("text-align-vertical")
-                .istGleich("center"));
+    TextFeld* tf = dynamic_cast<TextFeld*>(&z);
     if (element.hasAttribute("font-size"))
-        ((TextFeld*)&z)
-            ->setSchriftSize(
-                (unsigned char)(int)element.getAttributeValue("font-size"));
+    {
+        tf->setSchriftSize(
+            (unsigned char)(int)element.getAttributeValue("font-size"));
+    }
     if (element.hasAttribute("disabled"))
         z.removeStyle(TextFeld::Style::Editierbar);
-    ((TextFeld*)&z)->setText(element.getText());
-    ((TextFeld*)&z)
-        ->zTextRenderer()
-        ->textFormatieren(((TextFeld*)&z)->zText(), z.getInnenBreite());
+    tf->setText(element.getText());
+    tf->zTextRenderer()->textFormatieren(tf->zText(), z.getInnenBreite());
     if (element.hasAttribute("width"))
     {
         Text w = element.getAttributeValue("width");
@@ -583,7 +638,34 @@ void UIMLTextArea::layout(XML::Element& element,
             z.setHeight(((TextFeld*)&z)->getNeededHeight());
         }
     }
+    if (element.hasAttribute("text-color"))
+    {
+        tf->setSchriftFarbe((int)element.getAttributeValue("text-color"));
+    }
     UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
+    if (element.hasAttribute("text-align-horizontal"))
+        z.setStyle(TextFeld::Style::HCenter,
+            element.getAttributeValue("text-align-horizontal")
+                .istGleich("center"));
+    if (element.hasAttribute("text-align-vertical"))
+        z.setStyle(TextFeld::Style::VCenter,
+            element.getAttributeValue("text-align-vertical")
+                .istGleich("center"));
+    if (element.hasAttribute("font-size"))
+        if (element.getAttributeValue("vScroll").istGleich("auto"))
+        {
+            tf->setStyle(TextFeld::Style::VScroll,
+                tf->getNeededHeight() > tf->getInnenHeight());
+            tf->setVertikalKlickScroll(tf->getSchriftSize());
+            tf->updateVScroll();
+        }
+    if (element.getAttributeValue("hScroll").istGleich("auto"))
+    {
+        tf->setStyle(TextFeld::Style::HScroll,
+            tf->getNeededWidth() > tf->getInnenBreite());
+        tf->setHorizontalKlickScroll(tf->getSchriftSize());
+        tf->updateHScroll();
+    }
 }
 
 UIMLTable::UIMLTable()
@@ -670,16 +752,7 @@ DLLEXPORT bool Framework::UIMLTable::updateElement(
         t->removeSpalte(i);
         i--;
     }
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        t->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         ObjTabelle* tmp = generalFactory.getFactory().createObjTabelle(
             generalFactory.getFactory().initParam);
@@ -770,16 +843,7 @@ bool Framework::UIMLFrame::updateElement(
         }
         if (z) f->setMemberIndex(z, index++);
     }
-    if (element.hasAttribute("style"))
-    {
-        Text style = element.getAttributeValue("style");
-        if (!style.hatAt(0, "0x"))
-        {
-            style.insert(0, "0x");
-        }
-        f->setStyle((int)style);
-    }
-    else
+    if (!element.hasAttribute("style"))
     {
         Fenster* tmp = generalFactory.getFactory().createFenster(
             generalFactory.getFactory().initParam);
@@ -795,14 +859,89 @@ void UIMLFrame::layout(XML::Element& element,
     int pHeight,
     UIMLContainer& generalLayouter)
 {
+    Fenster* f = dynamic_cast<Fenster*>(&z);
     if (element.hasAttribute("title"))
-        ((Fenster*)&z)->setTitel(element.getAttributeValue("title"));
+        f->setTitel(element.getAttributeValue("title"));
     if (element.hasAttribute("title-height"))
-        ((Fenster*)&z)
-            ->zTTextFeld()
-            ->setSize(((Fenster*)&z)->zTTextFeld()->getBreite(),
-                (int)element.getAttributeValue("title-height"));
-    UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
+    {
+        f->zTTextFeld()->setSize(f->zTTextFeld()->getBreite(),
+            (int)element.getAttributeValue("title-height"));
+    }
+    if (element.hasAttribute("title-font-size"))
+    {
+        f->zTTextFeld()->setSchriftSize(
+            (unsigned char)(int)element.getAttributeValue("title-font-size"));
+    }
+    if (element.hasAttribute("title-text-color"))
+    {
+        f->zTTextFeld()->setSchriftFarbe(
+            (int)element.getAttributeValue("title-text-color"));
+    }
+    if (element.hasAttribute("display"))
+    {
+        UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter); // calculate all sizes
+        if (element.getAttributeValue("display").istGleich("column"))
+        {
+            int gap = calculateSize(element.getAttributeValue("gap"), pHeight);
+            int y = 0;
+            for (Zeichnung* z : f->getMembers())
+            {
+                Text id = generalLayouter.getZeichnungId(*z);
+                auto child = element.selectChildsByAttribute("id", id);
+
+                if (child.exists())
+                {
+                    if (!child.whereAttributeExists("align-left").exists()
+                        && !child.whereAttributeExists("align-right").exists()
+                        && !child.whereAttributeExists("align-top").exists()
+                        && !child.whereAttributeExists("align-bottom").exists())
+                    {
+                        z->setY(y);
+                        y += z->getHeight() + gap;
+                    }
+                }
+            }
+        }
+        else if (element.getAttributeValue("display").istGleich("row"))
+        {
+            int gap = calculateSize(element.getAttributeValue("gap"), pWidth);
+            int x = 0;
+            for (Zeichnung* z : f->getMembers())
+            {
+                Text id = generalLayouter.getZeichnungId(*z);
+                auto child = element.selectChildsByAttribute("id", id);
+
+                if (child.exists())
+                {
+                    if (!child.whereAttributeExists("align-left").exists()
+                        && !child.whereAttributeExists("align-right").exists()
+                        && !child.whereAttributeExists("align-top").exists()
+                        && !child.whereAttributeExists("align-bottom").exists())
+                    {
+                        z->setX(x);
+                        x += z->getBreite() + gap;
+                    }
+                }
+            }
+        }
+    }
+    UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter); // calculate all remaining positions
+    if (element.hasAttribute("font-size"))
+        if (element.getAttributeValue("vScroll").istGleich("auto"))
+        {
+            f->setStyle(
+                Fenster::Style::VScroll,
+                f->getNeededChildHeight() > f->getInnenHeight());
+            f->setVSBScroll(10);
+            f->updateVScroll();
+        }
+    if (element.getAttributeValue("hScroll").istGleich("auto"))
+    {
+        f->setStyle(Fenster::Style::HScroll,
+            f->getNeededChildWidth() > f->getInnenBreite());
+        f->setHSBScroll(10);
+        f->updateHScroll();
+    }
 }
 
 // Erstellt eine UIML View

+ 218 - 51
UIMLView.h

@@ -18,6 +18,100 @@ namespace Framework
         class Element;
     }
 
+    /**
+      creates a Zeichnung that views an element of the uiml
+
+      tag: defined by subclasses;
+
+      basic attributes:
+        - (__int64) style: sets the style. Default: TextField::Style::TextField
+          + 0x...: will be interpreted as hex
+          # ...: will be interpreted as normal __int64
+        - (string) text-align-horizontal:
+          + center: adds the style TextFeld::Style::HCenter
+        - (string) text-align-vertical:
+          + center: adds the style TextFeld::Style::VCenter
+        - (int) font-size: sets the font size
+        - (int) text-color: sets the text color format: 0xAARRGGBB
+        - disabled: removes the style TextFeld::Style::Editierbar
+        - (string) width: sets the with
+          + (int)%: specifies the width in % of the parent element
+          + (int): specifies the width in pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+          + auto: attribute will be ignored here and may be handled by the
+            subclasses
+        - (string) height: sets the with
+          + (int)%: specifies the width in % of the parent element
+          + (int): specifies the width in pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+          + auto: attribute will be ignored here and may be handled by the
+            subclasses
+        - (string) align-left: sets the x coordinate of the view. The value of
+          margin-left will be added
+          + start: 0
+          + end: parentWidth
+          + center: parentWidth / 2 - width / 2
+          + id of other element: other element x + other element width
+        - (string) margin-left: only available if align-left is specified.
+          + (int)%: specifies the distance to its left aligned coordinate in
+            percentage of parentWidth
+          + (int): specifies the distance to its left aligned coordinate in
+            pixel
+          + (expression): calculates the width from an expression that contains
+        - (string) align-right: sets the x coordinate of the view. The value of
+          margin-right will be subtracted. Will be ignored when align-left is
+          present.
+          + start: -width
+          + end: parentWidth - width
+          + center: parentWidth / 2 - width / 2
+          + id of other element: other element x - width
+        - (string) margin-right: only available if align-right is specified.
+          + (int)%: specifies the distance to its right aligned coordinate in
+            percentage of parentWidth
+          + (int): specifies the distance to its right aligned coordinate in
+            pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+        - (string) align-top: sets the y coordinate of the view. The value of
+          margin-top will be added
+          + start: 0
+          + end: parentHeight
+          + center: parentHeight / 2 - height / 2
+          + id of other element: other element y + other element height
+        - (string) margin-top: only available if align-top is specified.
+          + (int)%: specifies the distance to its top aligned coordinate in
+            percentage of parentHeight
+          + (int): specifies the distance to its top aligned coordinate in pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+        - (string) align-bottom: sets the y coordinate of the view. The value of
+          margin-bottom will be subtracted. Will be ignored when align-top is
+          present.
+          + start: -height
+          + end: parentHeight - height
+          + center: parentHeight / 2 - height / 2
+          + id of other element: other element y - height
+        - (string) margin-bottom: only available if align-bottom is specified.
+          + (int)%: specifies the distance to its bottom aligned coordinate in
+            percentage of parentHeight
+          + (int): specifies the distance to its bottom aligned coordinate in
+            pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+        - (string) x: sets the x coordinate of the view. overwrites align-left
+          and align-right
+          + (int)%: specifies the x coordinate in percentage of parentWidth
+          + (int): specifies the x coordinate in pixel
+          + (expression): calculates the width from an expression that contains
+        - (string) y: sets the y coordinate of the view. overwrites align-top
+          and align-bottom
+          + (int)%: specifies the y coordinate in percentage of parentHeight
+          + (int): specifies the y coordinate in pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+    */
     class UIMLElement : public virtual ReferenceCounter
     {
     public:
@@ -42,6 +136,15 @@ namespace Framework
             int pWidth,
             int pHeight,
             UIMLContainer& generalLayouter);
+        /// <summary>
+        /// calculates the size based on a given attribute value. Allowed values
+        /// are expression with +, -, * or / operators and percentages of
+        /// parentSize. uses 0 for each invalid part of the expression
+        /// </summary>
+        /// <param name="attributeValue">the expression that should be
+        /// evaluated</param> <param name="parentSize">the size of the parent in
+        /// pixel</param> <returns>the resulting size in pixel</returns>
+        DLLEXPORT int calculateSize(Text attributeValue, int parentSize);
     };
 
     class UIMLContainer : public UIMLElement
@@ -57,6 +160,31 @@ namespace Framework
         virtual const UIInit& getFactory() = 0;
     };
 
+    /**
+      creates a TextFeld instance with style TextField::Style::TextField
+
+      tag: &lt;textfield&gt;
+
+      additional attributes to UIMLElement:
+        - (__int64) style: sets the style. Default: TextField::Style::TextField
+        - (string) text-align-horizontal:
+          + center: adds the style TextFeld::Style::HCenter
+        - (string) text-align-vertical:
+          + center: adds the style TextFeld::Style::VCenter
+        - (int) font-size: sets the font size
+        - (int) text-color: sets the text color. format: 0xAARRGGBB
+        - disabled: removes the style TextFeld::Style::Editierbar
+        - (string) width: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) height: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) vScroll: adds a vertical scroll bar
+          + auto: the max vertical scroll size is set to the needed text height
+            and the click scroll per pixel will be set to font size
+        - (int) hScroll: adds a hotizontal scroll bar
+          + auto: the max horizontal scroll size is set to the needed text width
+            and the click scroll per pixel will be set to font size
+    */
     class UIMLTextField : public UIMLElement
     {
     public:
@@ -108,6 +236,31 @@ namespace Framework
             UIMLContainer& generalLayouter) override;
     };
 
+    /**
+      creates a TextFeld instance with style TextField::Style::Text
+
+      tag: &lt;text&gt;
+
+      additional attributes to UIMLElement:
+        - (__int64) style: sets the style. Default: TextField::Style::Text
+        - (string) text-align-horizontal:
+          + center: adds the style TextFeld::Style::HCenter
+        - (string) text-align-vertical:
+          + center: adds the style TextFeld::Style::VCenter
+        - (int) font-size: sets the font size
+        - (int) text-color: sets the text color. format: 0xAARRGGBB
+        - disabled: removes the style TextFeld::Style::Editierbar
+        - (string) width: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) height: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) vScroll: adds a vertical scroll bar
+          + auto: the max vertical scroll size is set to the needed text height
+            and the click scroll per pixel will be set to font size
+        - (int) hScroll: adds a hotizontal scroll bar
+          + auto: the max horizontal scroll size is set to the needed text width
+            and the click scroll per pixel will be set to font size
+    */
     class UIMLText : public UIMLElement
     {
     public:
@@ -125,6 +278,31 @@ namespace Framework
             UIMLContainer& generalLayouter) override;
     };
 
+    /**
+      creates a TextFeld instance with style TextField::Style::TextGebiet
+
+      tag: &lt;textarea&gt;
+
+      additional attributes to UIMLElement:
+        - (__int64) style: sets the style. Default: TextField::Style::TextGebiet
+        - (string) text-align-horizontal:
+          + center: adds the style TextFeld::Style::HCenter
+        - (string) text-align-vertical:
+          + center: adds the style TextFeld::Style::VCenter
+        - (int) font-size: sets the font size
+        - (int) text-color: sets the text color. format: 0xAARRGGBB
+        - disabled: removes the style TextFeld::Style::Editierbar
+        - (string) width: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) height: sets the with
+          + auto: setzt the width to the calculated needed width
+        - (string) vScroll: adds a vertical scroll bar
+          + auto: the max vertical scroll size is set to the needed text height
+            and the click scroll per pixel will be set to font size
+        - (int) hScroll: adds a hotizontal scroll bar
+          + auto: the max horizontal scroll size is set to the needed text width
+            and the click scroll per pixel will be set to font size
+    */
     class UIMLTextArea : public UIMLElement
     {
     public:
@@ -159,6 +337,33 @@ namespace Framework
             UIMLContainer& generalLayouter) override;
     };
 
+    /**
+      creates a Fenster instance
+
+      tag: &lt;frame&gt;
+
+      additional attributes to UIMLElement:
+        - (string) title: the title of the window
+        - (int) title-height: sets the height of the title
+        - (int) title-font-size: sets the font size of the title
+        - (int) title-text-color: sets the color of the title. format:
+          0xAARRGGBB
+        - (string) display: specifies the position of child elements
+          + column: sets the position of child elements vertically below each
+            other. any align attribute will overwrite this behaviour.
+          + row: sets the position of the child elements horizontally beneath
+            each other. any align attribute will overwrite this behaviour.
+        - (int) gap: the space between each child element. Only valid if display
+          is specified.
+          + (int)%: specifies the y coordinate in percentage of parentHeight
+          + (int): specifies the y coordinate in pixel
+          + (expression): calculates the width from an expression that contains
+            values concatenated by the operators +, -, / or *
+        - (string) vScroll: adds a vertical scroll bar
+          + auto: the max vertical scroll size is set to the needed child elements height
+        - (int) hScroll: adds a hotizontal scroll bar
+          + auto: the max horizontal scroll size is set to the needed child elements width
+    */
     class UIMLFrame : public UIMLElement
     {
     public:
@@ -177,62 +382,24 @@ namespace Framework
     };
 
     /**
-      KSG UIML Standart
-      possible XML elements:
-        - uimlview (the root element of uiml),
-        - class (only as direct child of uimlview),
-        - textfield,
-        - button,
-        - check, (KontrollKnopf)
-        - text,
-        - textarea,
-        - table (allowed child elements: tr),
-        - tr (allowed child elements: textfield, button, table, text, textarea,
-      frame),
-        - frame (allowed child elements: textfield, button, table, text,
-      textarea, frame).
-
-      possible global XML attributes:
-        - id (string should be unique),
-        - x (integer, optional % char at end),
-        - y (integer, optional % char at end),
-        - width (integer, optional % char at end) or auto keyword,
-        - height (integer, optional % char at end) or auto keyword,
-        - margin (integer, optional % char at end),
-        - margin-left (integer, optional % char at end),
-        - margin-top (integer, optional % char at end),
-        - margin-right (integer, optional % char at end),
-        - margin-bottom (integer, optional % char at end),
-        - align-left (string (id values of other elements or keywords: start,
-      end, center)),
-        - align-top (string (id values of other elements or keywords: start,
-      end, center)),
-        - align-bottom ((string (id values of other elements or keywords: start,
-      end, center)),
-        - align-right (string (id values of other elements or keywords: start,
-      end, center)),
-        - tooltip (string),
-        - style (hex __int64),
-        - class (string (id of class element))
-
-        attribute die sich gegenseitig ausschließen:
-        - align-left / align-right
-        - align-top / align-bottom
-
-      spezific attributes:
-         - font-size (textfield, text, textarea, button)
-         - text-align (textfield, text, textarea)
-         - text-align-horizontal (textfield, text, textarea)
-         - text-align-vertical (textfield, text, textarea)
+      Converts uiml views to Zeichnung implementations and renders them.
+      The attribute id of each element has to be unique or absent.
+      All implementations of UIMLElement in the framework are supported by
+      default. Custom elements can be added by calling addKnownElement with a
+      custom UIMLElement implementation. Look at the documentation of specific
+      UIMLElement implementations to view all supported attributes.
 
       example:
         \code
         <view>
           <textfield id="element_at_top_left" align-left="start",
-      align-top="start", margin-left="5", margin-top="5" width="90%"
-      height="30"/> <table id="element_below_textfield" align-left="start",
-      aliign-top="element_at_top_left", margin-left="5", margin-top="5"
-      width="90%" height="300"> <tr> <button id="a_button_in_a_table"/>
+              align-top="start", margin-left="5", margin-top="5" width="90%"
+              height="30"/>
+          <table id="element_below_textfield" align-left="start",
+              aliign-top="element_at_top_left", margin-left="5", margin-top="5"
+              width="90%" height="300">
+            <tr>
+              <button id="a_button_in_a_table"/>
               <textfield id="a_textfield_in_a_table"/>
             </tr>
           </table>

+ 23 - 23
UIPixelShader.h

@@ -352,10 +352,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67,  42, 176, 
-    242, 159, 197, 217,  18, 230, 
-     41,   3,  68,  41, 118, 195, 
-     10, 110,   1,   0,   0,   0, 
+     68,  88,  66,  67, 164, 180, 
+     32, 182, 208,  34,  51,  57, 
+    193,   6, 190,  81, 108, 136, 
+    106, 100,   1,   0,   0,   0, 
      12, 134,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     140,   6,   0,   0,  28,   7, 
@@ -1805,11 +1805,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1,  21,  78, 209, 100, 
-      1,   0,   0,   0, 177, 167, 
-     49, 139, 114,   1, 195,  77, 
-    144,   2, 243, 212, 101,  38, 
-    130, 182,   0,   0,   0,   0, 
+     49,   1,  46, 245, 215, 100, 
+      1,   0,   0,   0,  34,  58, 
+     36, 131,  29,  49,  81,  78, 
+    139,  11, 142, 139,  27, 193, 
+     68, 210,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1980,10 +1980,10 @@ const BYTE UIPixelShader[] =
       3,   0, 242,  56,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0, 148, 153, 
-      2,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0,  14, 184, 
-      3,   0, 193,  33,   3,   0, 
+    236, 179,   1,   0, 215, 127, 
+      0,   0, 125,  10,   2,   0, 
+    125, 181,   2,   0, 205, 178, 
+      1,   0, 193,  33,   3,   0, 
      65, 185,   2,   0,   9, 241, 
       2,   0, 146, 230,   3,   0, 
     125, 218,   1,   0, 118,  19, 
@@ -3000,8 +3000,8 @@ const BYTE UIPixelShader[] =
      84, 101, 120, 116, 117, 114, 
     101,  50,  68,  32, 115, 104, 
      97, 100,  27, 226,  48,   1, 
-    128,   0,   0,   0, 246,  32, 
-    125,  62, 106, 201, 217,   1, 
+    128,   0,   0,   0, 163, 123, 
+     55,  94,  97, 205, 217,   1, 
       1,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4243,14 +4243,14 @@ const BYTE UIPixelShader[] =
       6,  16,   0,   0,  23,   0, 
       1,   0,   5,  16,   0,   0, 
      14,   0,  23,  21,   0,  16, 
-      0,   0,   3,   2, 176, 160, 
+      0,   0,   3,   2,  96,  89, 
       0,   0, 242, 241,  10,   0, 
      24,  21,   8,  16,   0,   0, 
       1,   0,   1,   0,  10,   0, 
      24,  21,   9,  16,   0,   0, 
       1,   0,   0,   2,  14,   0, 
      23,  21,   0,   0,   0,   0, 
-     10,   2, 176, 160,   0,   0, 
+     10,   2,  96,  89,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      11,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
@@ -5474,11 +5474,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1,  21,  78, 
-    209, 100,   1,   0,   0,   0, 
-    177, 167,  49, 139, 114,   1, 
-    195,  77, 144,   2, 243, 212, 
-    101,  38, 130, 182, 128,   0, 
+    148,  46,  49,   1,  46, 245, 
+    215, 100,   1,   0,   0,   0, 
+     34,  58,  36, 131,  29,  49, 
+     81,  78, 139,  11, 142, 139, 
+     27, 193,  68, 210, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -5578,7 +5578,7 @@ const BYTE UIPixelShader[] =
       0,   0,   2,   0,   9,   0, 
     204,   8,   0,   0,   0,   0, 
       0,   0, 164,  14,   0,   0, 
-      1,   0, 198,  79,   0,   0, 
+      1,   0, 204,  52,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,  84, 101, 
     120, 116, 117, 114, 101,  80, 

+ 15 - 15
UIVertexShader.h

@@ -121,10 +121,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67, 134, 100, 
-     11, 134, 106, 140, 123, 142, 
-     45, 234, 237,  92,  46,  20, 
-    203, 191,   1,   0,   0,   0, 
+     68,  88,  66,  67, 209,  39, 
+    116, 215,  20,  97, 179,  98, 
+     87,  70,  84,  52, 195, 111, 
+    212,  87,   1,   0,   0,   0, 
     204,  77,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      20,   2,   0,   0, 204,   2, 
@@ -881,10 +881,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-     21,  78, 209, 100,   1,   0, 
-      0,   0, 103, 209,  30,  34, 
-     39, 126,  42,  79, 132,  66, 
-    155, 189, 210, 200,   3, 102, 
+     46, 245, 215, 100,   1,   0, 
+      0,   0,  41, 217, 161, 203, 
+    186, 104, 182,  78, 133,  81, 
+     26, 221,   8, 166, 186, 211, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1564,8 +1564,8 @@ const BYTE UIVertexShader[] =
      13,  10,  47,  47,  32,  84, 
      89,  80,  69,  68,  69,  70, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,  26, 247, 152,  62, 
-    106, 201, 217,   1,   1,   0, 
+      0,   0,  46, 113,  81,  94, 
+     97, 205, 217,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2929,10 +2929,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-     21,  78, 209, 100,   1,   0, 
-      0,   0, 103, 209,  30,  34, 
-     39, 126,  42,  79, 132,  66, 
-    155, 189, 210, 200,   3, 102, 
+     46, 245, 215, 100,   1,   0, 
+      0,   0,  41, 217, 161, 203, 
+    186, 104, 182,  78, 133,  81, 
+     26, 221,   8, 166, 186, 211, 
     129,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 
@@ -3032,7 +3032,7 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   2,   0, 
       9,   0, 104,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0, 109, 162, 
+      0,   0,   1,   0, 129,  80, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
      84, 101, 120, 116, 117, 114,