Browse Source

publisch private projects

kolja 5 years ago
parent
commit
66c80a3b05
2 changed files with 19 additions and 6 deletions
  1. 15 4
      UIMLView.cpp
  2. 4 2
      UIMLView.h

+ 15 - 4
UIMLView.cpp

@@ -57,7 +57,10 @@ void UIMLView::parseTable( Iterator<XML::Element*> childs, ObjTabelle *table )
         if( i->hasAttribute( "id" ) )
             id = i->getAttributeValue( "id" );
         else
+        {
             id = Text( "_" ) += nextId++;
+            i->setAttribute( "id", id );
+        }
         if( i->getName().istGleich( "tr" ) )
         {
             table->addZeile( id );
@@ -69,7 +72,7 @@ void UIMLView::parseTable( Iterator<XML::Element*> childs, ObjTabelle *table )
                 if( table->getSpaltenAnzahl() < c )
                     table->addSpalte( Text( c - 1 ) );
                 if( z )
-                    table->setZeichnungZ( c - 1, line, z->getThis() );
+                    table->setZeichnungZ( (char*)Text( c - 1 ), (char*)line, z->getThis() );
                 c++;
             }
         }
@@ -190,6 +193,8 @@ Zeichnung *UIMLView::parseElement( XML::Element *e )
         {
             Fenster *f = init.createFenster( init.initParam );
             parseFrame( e->getChilds(), f );
+            if( e->hasAttribute( "title" ) )
+                f->setTitel( e->getAttributeValue( "title" ) );
             z = f;
         }
         // add general attributes
@@ -197,6 +202,10 @@ Zeichnung *UIMLView::parseElement( XML::Element *e )
             z->setToolTipText( e->getAttributeValue( "tooltip" ), init.initParam.bildschirm );
         if( z && e->hasAttribute( "style" ) )
             z->setStyle( (__int64)e->getAttributeValue( "style" ) );
+        if( z && e->hasAttribute( "hidden" ) )
+            z->removeStyle( Zeichnung::Style::Sichtbar );
+        if( z && e->hasAttribute( "disabled" ) )
+            z->removeStyle( Zeichnung::Style::Erlaubt );
         if( z )
             members->set( id, z );
     }
@@ -418,16 +427,17 @@ void UIMLView::layout()
 
 // fügt ein element hinzu
 //  uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt
-void UIMLView::addMember( Text uiml )
+Text UIMLView::addMember( Text uiml )
 {
     XML::Element *e = new XML::Element( uiml );
     if( parseElement( e ) )
         dom->addChild( e );
+    return e->getAttributeValue( "id" );
 }
 
 // fügt ein element zu einem Elternelement hinzu (funktioniert momentan nur mit frame Objekten)
 //  uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt
-void UIMLView::addMember( Text uiml, Text parentId )
+Text UIMLView::addMember( Text uiml, Text parentId )
 {
     XML::Element *e = new XML::Element( uiml );
     XML::Editor ed = dom->selectChildren();
@@ -444,12 +454,13 @@ void UIMLView::addMember( Text uiml, Text parentId )
                     ( (Fenster*)members->z( parentId ) )->addMember( z->getThis() );
                     ed2.getIterator()->addChild( e );
                 }
-                return;
+                return e->getAttributeValue( "id" );
             }
         }
         ed = ed.selectChildren();
     }
     e->release();
+    return "";
 }
 
 // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.

+ 4 - 2
UIMLView.h

@@ -106,10 +106,12 @@ namespace Framework
         __declspec( dllexport ) void layout();
         // fügt ein element hinzu
         //  uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt
-        __declspec( dllexport ) void addMember( Text uiml );
+        //  return: id des neuen Elements
+        __declspec( dllexport ) Text addMember( Text uiml );
         // fügt ein element zu einem Elternelement hinzu (funktioniert momentan nur mit frame Objekten)
         //  uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt
-        __declspec( dllexport ) void addMember( Text uiml, Text parentId );
+        //  return: id des neuen Elements
+        __declspec( dllexport ) Text addMember( Text uiml, Text parentId );
         // Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
         //  id: die id der Zeichnung
         __declspec( dllexport ) Zeichnung *zZeichnung( Text id );