Browse Source

made most char * arguments const

Kolja Strohm 1 year ago
parent
commit
6ab0110f6c
31 changed files with 8463 additions and 8460 deletions
  1. 6 6
      Array.h
  2. 2626 2626
      Bild.cpp
  3. 1 1
      Bild.h
  4. 63 63
      DLLRegister.cpp
  5. 20 20
      DLLRegister.h
  6. 1 1
      DX12GraphicsApi.cpp
  7. 109 109
      DX12PixelShader.h
  8. 108 108
      DX12VertexShader.h
  9. 2 2
      Datei.cpp
  10. 1634 1634
      Diagramm.cpp
  11. 547 547
      Diagramm.h
  12. 160 156
      Ebene3D.h
  13. 10 10
      Errors.cpp
  14. 1 1
      Framework Linux.vcxproj
  15. 1 1
      Global.cpp
  16. 5 5
      HashMap.h
  17. 1 1
      InMemoryBuffer.cpp
  18. 8 10
      JSON.cpp
  19. 797 797
      Liste.cpp
  20. 248 248
      Liste.h
  21. 328 328
      M2Datei.cpp
  22. 1 1
      Model3D.cpp
  23. 1 0
      ObjFile.cpp
  24. 1 1
      Reader.cpp
  25. 15 15
      Text.cpp
  26. 16 16
      Text.h
  27. 1452 1452
      TextFeld.cpp
  28. 11 11
      UIMLView.cpp
  29. 111 111
      UIPixelShader.h
  30. 107 107
      UIVertexShader.h
  31. 72 72
      Zeit.cpp

+ 6 - 6
Array.h

@@ -42,7 +42,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return var;
 		}
@@ -141,7 +141,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return Iterator(current->next, onRemove);
 		}
@@ -159,7 +159,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return current->var;
 		}
@@ -193,7 +193,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return current->var;
 		}
@@ -206,7 +206,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return current->var;
 		}
@@ -224,7 +224,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 		}
 

+ 2626 - 2626
Bild.cpp

@@ -31,2748 +31,2748 @@ using namespace Framework;
 
 // Inhalt der Bild Klasse aus Bild.h
 // Konstruktor 
-Bild::Bild( bool options )
-    : ReferenceCounter(),
-    fc( 0 ),
-    delFc( 1 ),
-    size( 0, 0 ),
-    drawOff( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
-    dPosA( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
-    dSizeA( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
-    doa( 0 ),
-    alpha( options ? new unsigned char[ 1000 ] : new unsigned char[ 1 ] ),
-    alphaAnzahl( 0 ),
-    rend( 0 ),
-    alpha3D( 0 )
-{
-    alpha[ 0 ] = 0;
+Bild::Bild(bool options)
+	: ReferenceCounter(),
+	fc(0),
+	delFc(1),
+	size(0, 0),
+	drawOff(options ? new Punkt[2000] : new Punkt[1]),
+	dPosA(options ? new Punkt[2000] : new Punkt[1]),
+	dSizeA(options ? new Punkt[2000] : new Punkt[1]),
+	doa(0),
+	alpha(options ? new unsigned char[1000] : new unsigned char[1]),
+	alphaAnzahl(0),
+	rend(0),
+	alpha3D(0)
+{
+	alpha[0] = 0;
 }
 
 // Destruktor 
 Bild::~Bild()
 {
-    if( delFc )
-    {
-        delete[] fc;
-        fc = 0;
-    }
-    delete[] dPosA;
-    delete[] dSizeA;
-    delete[] alpha;
-    delete[] drawOff;
+	if (delFc)
+	{
+		delete[] fc;
+		fc = 0;
+	}
+	delete[] dPosA;
+	delete[] dSizeA;
+	delete[] alpha;
+	delete[] drawOff;
 }
 
 // privat
-inline void Bild::alphaPixelP( int x, int y, int f )
-{
-    alphaPixelP( fc[ x + y * size.x ], f );
-}
-
-inline void Bild::alphaPixelP3D( int x, int y, int f )
-{
-    alphaPixelP3D( fc[ x + y * size.x ], f );
-}
-
-inline void Bild::alphaPixelAssozP( int& fc, int f )
-{
-    unsigned char* fc1 = (unsigned char*)&fc;
-    unsigned char* fc2 = (unsigned char*)&f;
-    unsigned char na = (unsigned char)~fc2[ 3 ];
-    unsigned char a = (unsigned char)(fc2[ 3 ] + ((na * fc1[ 3 ]) >> 8));
-    if( a == 0 )
-        return;
-    fc1[ 2 ] = (unsigned char)((fc2[ 2 ] * fc2[ 3 ] + ((fc1[ 2 ] * na * fc1[ 3 ]) >> 8)) / a);
-    fc1[ 1 ] = (unsigned char)((fc2[ 1 ] * fc2[ 3 ] + ((fc1[ 1 ] * na * fc1[ 3 ]) >> 8)) / a);
-    fc1[ 0 ] = (unsigned char)((fc2[ 0 ] * fc2[ 3 ] + ((fc1[ 0 ] * na * fc1[ 3 ]) >> 8)) / a);
-    fc1[ 3 ] = a;
-}
-
-inline void Bild::alphaPixelP3D( int& fc, int colorb )
-{
-    //alphaPixelAssozP( fc, colorb );
-    //return;
-    int alpha = ((colorb >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
-           ((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
-           ((fc & 0xFF000000))) * (fc != 0) | (fc == 0) * colorb;
-    //unsigned char *fc1 = (unsigned char*)&fc;
-    //unsigned char *fc2 = (unsigned char*)&colorb;
-    //unsigned char na = 255-fc2[ 3 ];
-    //fc1[ 3 ] = fc2[ 3 ];
-    //fc1[ 2 ] = (unsigned char)( ( fc2[ 2 ] * fc2[ 3 ] + fc1[ 2 ] * na ) / 255 );
-    //fc1[ 1 ] = (unsigned char)( ( fc2[ 1 ] * fc2[ 3 ] + fc1[ 1 ] * na ) / 255 );
-    //fc1[ 0 ] = (unsigned char)( ( fc2[ 0 ] * fc2[ 3 ] + fc1[ 0 ] * na ) / 255 );
-}
-
-inline void Bild::alphaPixelP( int& fc, int colorb )
-{
-    //alphaPixelAssozP( fc, colorb );
-    //return;
-    int alpha = ((colorb >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
-           ((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
-           ((fc & 0xFF000000)));
-    //unsigned char *fc1 = (unsigned char*)&fc;
-    //unsigned char *fc2 = (unsigned char*)&colorb;
-    //unsigned char na = 255-fc2[ 3 ];
-    //fc1[ 3 ] = fc2[ 3 ];
-    //fc1[ 2 ] = (unsigned char)( ( fc2[ 2 ] * fc2[ 3 ] + fc1[ 2 ] * na ) / 255 );
-    //fc1[ 1 ] = (unsigned char)( ( fc2[ 1 ] * fc2[ 3 ] + fc1[ 1 ] * na ) / 255 );
-    //fc1[ 0 ] = (unsigned char)( ( fc2[ 0 ] * fc2[ 3 ] + fc1[ 0 ] * na ) / 255 );
-}
-
-char Bild::getOutCode( Punkt p ) const
-{
-    char ret = 0;
-    if( p.x < dPosA[ doa ].x )
-        ret = 1;
-    if( p.x >= dSizeA[ doa ].x )
-        ret = 2;
-    if( p.y < dPosA[ doa ].y )
-        ret |= 4;
-    if( p.y >= dSizeA[ doa ].y )
-        ret |= 8;
-    return ret;
-}
-
-void Bild::drawFlatDreieck( int y1, int y2, float m1, float b1, float m2, float b2, int farbe )
-{
-    const int yStart = max( y1, dPosA[ doa ].y );
-    const int yEnd = min( y2, dSizeA[ doa ].y );
-    for( int y = yStart; y < yEnd; y++ )
-    {
-        const int xStart = max( (int)(m1 * (float)y + b1 + 0.5f), dPosA[ doa ].x );
-        const int xEnd = min( (int)(m2 * (float)y + b2 + 0.5f), dSizeA[ doa ].x );
-        for( int x = xStart; x < xEnd; x++ )
-            fc[ x + y * size.x ] = farbe;
-    }
-}
-
-void Bild::drawFlatDreieckTextur( int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
-                                  double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur )
-{
-    const double yStart = max( y1, dPosA[ doa ].y );
-    const double yEnd = min( y2, dSizeA[ doa ].y );
-    double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
-    for( double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o )
-    {
-        const double xStart = m1 * y + b1;
-        const double xEnd = m2 * y + b2;
-        drawLinieHTextur( Vec2< double >( xStart, y ), xEnd - xStart, Vec2< double >( tx_1, ty_1 ), Vec2< double >( tx_2, ty_2 ), txf, tyf, textur );
-    }
-}
-
-void Bild::drawFlatDreieckAlpha( int y1, int y2, float m1, float b1, float m2, float b2, int farbe )
-{
-    const int yStart = max( (int)(y1 + 0.5), dPosA[ doa ].y );
-    const int yEnd = min( (int)(y2 + 0.5), dSizeA[ doa ].y );
-    if( alpha3D )
-    {
-        for( int y = yStart; y < yEnd; y++ )
-        {
-            const int xStart = max( (int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[ doa ].x );
-            const int xEnd = min( (int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[ doa ].x );
-            for( int x = xStart; x < xEnd; x++ )
-                alphaPixelP3D( fc[ x + y * size.x ], farbe );
-        }
-    }
-    else
-    {
-        for( int y = yStart; y < yEnd; y++ )
-        {
-            const int xStart = max( (int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[ doa ].x );
-            const int xEnd = min( (int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[ doa ].x );
-            for( int x = xStart; x < xEnd; x++ )
-                alphaPixelP( fc[ x + y * size.x ], farbe );
-        }
-    }
-}
-
-void Bild::drawFlatDreieckTexturAlpha( int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
-                                       double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur )
-{
-    const double yStart = max( y1, dPosA[ doa ].y );
-    const double yEnd = min( y2, dSizeA[ doa ].y );
-    double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
-    for( double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o )
-    {
-        const double xStart = m1 * y + b1;
-        const double xEnd = m2 * y + b2;
-        drawLinieHTexturAlpha( Vec2< double >( xStart, y ), xEnd - xStart, Vec2< double >( tx_1, ty_1 ), Vec2< double >( tx_2, ty_2 ), txf, tyf, textur );
-    }
-}
-
-void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur ) // zeichnet eine horizontale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawLinieHTexturAlpha( p, len, ta, tb, txo, tyo, textur );
-        return;
-    }
-    if( len < 0 )
-    {
-        p.x += len;
-        len = -len;
-        ta.Swap( tb );
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    if( p.y < dpy || p.y >= dgy )
-        return;
-    double off = 0;
-    if( p.x < dpx )
-    {
-        off = dpx - p.x;
-        len -= dpx - p.x;
-        if( len <= 0 )
-            return;
-        p.x = dpx;
-    }
-    if( p.x + len >= dgx )
-    {
-        len -= p.x - dgx + len;
-        if( len <= 0 )
-            return;
-    }
-    int br = size.x;
-    int* fc = this->fc + (int)(p.x + (int)p.y * br);
-    double x = ta.x + txo * off, y = ta.y + tyo * off;
-    int* buffer = textur.getBuffer();
-    int txtBr = textur.getBreite();
-    for( int i = 0; i < len; ++i, ++fc )
-    {
-        *fc = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
-        x += txo, y += tyo;
-    }
-    rend = 1;
-}
-
-void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur ) // zeichnet eine horizontale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( len < 0 )
-    {
-        p.x += len;
-        len = -len;
-        ta.Swap( tb );
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    if( p.y < dpy || p.y >= dgy )
-        return;
-    double off = 0;
-    if( p.x < dpx )
-    {
-        off = dpx - p.x;
-        len -= dpx - p.x;
-        if( len <= 0 )
-            return;
-        p.x = dpx;
-    }
-    if( p.x + len >= dgx )
-    {
-        len -= p.x - dgx + len;
-        if( len <= 0 )
-            return;
-    }
-    int br = size.x;
-    int* fc = this->fc + (int)(p.x + (int)p.y * br);
-    double x = ta.x + txo * off, y = ta.y + tyo * off;
-    int* buffer = textur.getBuffer();
-    int txtBr = textur.getBreite();
-    int f;
-    if( alpha3D )
-    {
-        for( int i = 0; i < len; ++i, ++fc )
-        {
-            f = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
-            if( alpha[ alphaAnzahl ] )
-            {
-                unsigned char* cf = (unsigned char*)&f;
-                cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-            }
-            alphaPixelP3D( *fc, f );
-            x += txo, y += tyo;
-        }
-    }
-    else
-    {
-        for( int i = 0; i < len; ++i, ++fc )
-        {
-            f = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
-            if( alpha[ alphaAnzahl ] )
-            {
-                unsigned char* cf = (unsigned char*)&f;
-                cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-            }
-            alphaPixelP( *fc, f );
-            x += txo, y += tyo;
-        }
-    }
-    rend = 1;
+inline void Bild::alphaPixelP(int x, int y, int f)
+{
+	alphaPixelP(fc[x + y * size.x], f);
+}
+
+inline void Bild::alphaPixelP3D(int x, int y, int f)
+{
+	alphaPixelP3D(fc[x + y * size.x], f);
+}
+
+inline void Bild::alphaPixelAssozP(int& fc, int f)
+{
+	unsigned char* fc1 = (unsigned char*)&fc;
+	unsigned char* fc2 = (unsigned char*)&f;
+	unsigned char na = (unsigned char)~fc2[3];
+	unsigned char a = (unsigned char)(fc2[3] + ((na * fc1[3]) >> 8));
+	if (a == 0)
+		return;
+	fc1[2] = (unsigned char)((fc2[2] * fc2[3] + ((fc1[2] * na * fc1[3]) >> 8)) / a);
+	fc1[1] = (unsigned char)((fc2[1] * fc2[3] + ((fc1[1] * na * fc1[3]) >> 8)) / a);
+	fc1[0] = (unsigned char)((fc2[0] * fc2[3] + ((fc1[0] * na * fc1[3]) >> 8)) / a);
+	fc1[3] = a;
+}
+
+inline void Bild::alphaPixelP3D(int& fc, int colorb)
+{
+	//alphaPixelAssozP( fc, colorb );
+	//return;
+	int alpha = ((colorb >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
+		((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
+		((fc & 0xFF000000))) * (fc != 0) | (fc == 0) * colorb;
+	//unsigned char *fc1 = (unsigned char*)&fc;
+	//unsigned char *fc2 = (unsigned char*)&colorb;
+	//unsigned char na = 255-fc2[ 3 ];
+	//fc1[ 3 ] = fc2[ 3 ];
+	//fc1[ 2 ] = (unsigned char)( ( fc2[ 2 ] * fc2[ 3 ] + fc1[ 2 ] * na ) / 255 );
+	//fc1[ 1 ] = (unsigned char)( ( fc2[ 1 ] * fc2[ 3 ] + fc1[ 1 ] * na ) / 255 );
+	//fc1[ 0 ] = (unsigned char)( ( fc2[ 0 ] * fc2[ 3 ] + fc1[ 0 ] * na ) / 255 );
+}
+
+inline void Bild::alphaPixelP(int& fc, int colorb)
+{
+	//alphaPixelAssozP( fc, colorb );
+	//return;
+	int alpha = ((colorb >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
+		((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
+		((fc & 0xFF000000)));
+	//unsigned char *fc1 = (unsigned char*)&fc;
+	//unsigned char *fc2 = (unsigned char*)&colorb;
+	//unsigned char na = 255-fc2[ 3 ];
+	//fc1[ 3 ] = fc2[ 3 ];
+	//fc1[ 2 ] = (unsigned char)( ( fc2[ 2 ] * fc2[ 3 ] + fc1[ 2 ] * na ) / 255 );
+	//fc1[ 1 ] = (unsigned char)( ( fc2[ 1 ] * fc2[ 3 ] + fc1[ 1 ] * na ) / 255 );
+	//fc1[ 0 ] = (unsigned char)( ( fc2[ 0 ] * fc2[ 3 ] + fc1[ 0 ] * na ) / 255 );
+}
+
+char Bild::getOutCode(Punkt p) const
+{
+	char ret = 0;
+	if (p.x < dPosA[doa].x)
+		ret = 1;
+	if (p.x >= dSizeA[doa].x)
+		ret = 2;
+	if (p.y < dPosA[doa].y)
+		ret |= 4;
+	if (p.y >= dSizeA[doa].y)
+		ret |= 8;
+	return ret;
+}
+
+void Bild::drawFlatDreieck(int y1, int y2, float m1, float b1, float m2, float b2, int farbe)
+{
+	const int yStart = max(y1, dPosA[doa].y);
+	const int yEnd = min(y2, dSizeA[doa].y);
+	for (int y = yStart; y < yEnd; y++)
+	{
+		const int xStart = max((int)(m1 * (float)y + b1 + 0.5f), dPosA[doa].x);
+		const int xEnd = min((int)(m2 * (float)y + b2 + 0.5f), dSizeA[doa].x);
+		for (int x = xStart; x < xEnd; x++)
+			fc[x + y * size.x] = farbe;
+	}
+}
+
+void Bild::drawFlatDreieckTextur(int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
+	double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur)
+{
+	const double yStart = max(y1, dPosA[doa].y);
+	const double yEnd = min(y2, dSizeA[doa].y);
+	double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
+	for (double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o)
+	{
+		const double xStart = m1 * y + b1;
+		const double xEnd = m2 * y + b2;
+		drawLinieHTextur(Vec2< double >(xStart, y), xEnd - xStart, Vec2< double >(tx_1, ty_1), Vec2< double >(tx_2, ty_2), txf, tyf, textur);
+	}
+}
+
+void Bild::drawFlatDreieckAlpha(int y1, int y2, float m1, float b1, float m2, float b2, int farbe)
+{
+	const int yStart = max((int)(y1 + 0.5), dPosA[doa].y);
+	const int yEnd = min((int)(y2 + 0.5), dSizeA[doa].y);
+	if (alpha3D)
+	{
+		for (int y = yStart; y < yEnd; y++)
+		{
+			const int xStart = max((int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[doa].x);
+			const int xEnd = min((int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[doa].x);
+			for (int x = xStart; x < xEnd; x++)
+				alphaPixelP3D(fc[x + y * size.x], farbe);
+		}
+	}
+	else
+	{
+		for (int y = yStart; y < yEnd; y++)
+		{
+			const int xStart = max((int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[doa].x);
+			const int xEnd = min((int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[doa].x);
+			for (int x = xStart; x < xEnd; x++)
+				alphaPixelP(fc[x + y * size.x], farbe);
+		}
+	}
+}
+
+void Bild::drawFlatDreieckTexturAlpha(int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
+	double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur)
+{
+	const double yStart = max(y1, dPosA[doa].y);
+	const double yEnd = min(y2, dSizeA[doa].y);
+	double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
+	for (double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o)
+	{
+		const double xStart = m1 * y + b1;
+		const double xEnd = m2 * y + b2;
+		drawLinieHTexturAlpha(Vec2< double >(xStart, y), xEnd - xStart, Vec2< double >(tx_1, ty_1), Vec2< double >(tx_2, ty_2), txf, tyf, textur);
+	}
+}
+
+void Bild::drawLinieHTextur(Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur) // zeichnet eine horizontale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawLinieHTexturAlpha(p, len, ta, tb, txo, tyo, textur);
+		return;
+	}
+	if (len < 0)
+	{
+		p.x += len;
+		len = -len;
+		ta.Swap(tb);
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	if (p.y < dpy || p.y >= dgy)
+		return;
+	double off = 0;
+	if (p.x < dpx)
+	{
+		off = dpx - p.x;
+		len -= dpx - p.x;
+		if (len <= 0)
+			return;
+		p.x = dpx;
+	}
+	if (p.x + len >= dgx)
+	{
+		len -= p.x - dgx + len;
+		if (len <= 0)
+			return;
+	}
+	int br = size.x;
+	int* fc = this->fc + (int)(p.x + (int)p.y * br);
+	double x = ta.x + txo * off, y = ta.y + tyo * off;
+	int* buffer = textur.getBuffer();
+	int txtBr = textur.getBreite();
+	for (int i = 0; i < len; ++i, ++fc)
+	{
+		*fc = buffer[(int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr)];
+		x += txo, y += tyo;
+	}
+	rend = 1;
+}
+
+void Bild::drawLinieHTexturAlpha(Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur) // zeichnet eine horizontale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (len < 0)
+	{
+		p.x += len;
+		len = -len;
+		ta.Swap(tb);
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	if (p.y < dpy || p.y >= dgy)
+		return;
+	double off = 0;
+	if (p.x < dpx)
+	{
+		off = dpx - p.x;
+		len -= dpx - p.x;
+		if (len <= 0)
+			return;
+		p.x = dpx;
+	}
+	if (p.x + len >= dgx)
+	{
+		len -= p.x - dgx + len;
+		if (len <= 0)
+			return;
+	}
+	int br = size.x;
+	int* fc = this->fc + (int)(p.x + (int)p.y * br);
+	double x = ta.x + txo * off, y = ta.y + tyo * off;
+	int* buffer = textur.getBuffer();
+	int txtBr = textur.getBreite();
+	int f;
+	if (alpha3D)
+	{
+		for (int i = 0; i < len; ++i, ++fc)
+		{
+			f = buffer[(int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr)];
+			if (alpha[alphaAnzahl])
+			{
+				unsigned char* cf = (unsigned char*)&f;
+				cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+			}
+			alphaPixelP3D(*fc, f);
+			x += txo, y += tyo;
+		}
+	}
+	else
+	{
+		for (int i = 0; i < len; ++i, ++fc)
+		{
+			f = buffer[(int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr)];
+			if (alpha[alphaAnzahl])
+			{
+				unsigned char* cf = (unsigned char*)&f;
+				cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+			}
+			alphaPixelP(*fc, f);
+			x += txo, y += tyo;
+		}
+	}
+	rend = 1;
 }
 
 // nicht constant
 
 // Prüft ob ein Rechteck vollständig oder teilweise in der Zeichen Fläche liegt.
 //  return 0, falls das Rechteck nicht in der Zeichenfläche liegt, 1 sonst
-bool Bild::isAreaDrawable( int x, int y, int b, int h )
+bool Bild::isAreaDrawable(int x, int y, int b, int h)
 {
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + b < dpx || y + h < dpy || x > dgx || y > dgy )
-        return 0;
-    return 1;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + b < dpx || y + h < dpy || x > dgx || y > dgy)
+		return 0;
+	return 1;
 }
 
 // Wird dieser Flag gesetzt, so wird beim Alpha Blending wenn die vorheriege Farbe 0 ist nur die neue mit ihrem Alpha Wert kopiert.
 // Das ist sinnvoll für die Verwendung im 3DBildschirm, wo das Gezeichnette Bild später mittels Alpha Blending angezeigt wird
-void Bild::setAlpha3D( bool erlaubt )
+void Bild::setAlpha3D(bool erlaubt)
 {
-    alpha3D = erlaubt;
+	alpha3D = erlaubt;
 }
 
-void Bild::setAlpha( unsigned char alpha ) // setzt die Transparenz der nachfolgenden Zeichnunge
+void Bild::setAlpha(unsigned char alpha) // setzt die Transparenz der nachfolgenden Zeichnunge
 {
-    int last = this->alpha[ alphaAnzahl ];
-    ++alphaAnzahl;
-    assert( alphaAnzahl < 1000 );
-    this->alpha[ alphaAnzahl ] = (unsigned char)((255 - alpha) > last ? (255 - alpha) : last);
+	int last = this->alpha[alphaAnzahl];
+	++alphaAnzahl;
+	assert(alphaAnzahl < 1000);
+	this->alpha[alphaAnzahl] = (unsigned char)((255 - alpha) > last ? (255 - alpha) : last);
 }
 
 void Bild::releaseAlpha() // Löscht alpha
 {
-    --alphaAnzahl;
-}
-
-void Bild::setPixelBuffer( int* buffer, bool deleteBuffer, int breite, int height ) // setzt den Zeiger auf die Pixel des Bildes
-{
-    if( delFc )
-        delete[]fc;
-    fc = buffer;
-    delFc = deleteBuffer;
-    size.x = breite;
-    size.y = height;
-    drawOff[ 0 ].x = 0;
-    drawOff[ 0 ].y = 0;
-    dPosA[ 0 ].x = 0;
-    dPosA[ 0 ].y = 0;
-    dSizeA[ 0 ] = size;
-    alphaAnzahl = 0;
-    alpha[ 0 ] = 0;
-    doa = 0;
-    rend = 1;
-}
-
-void Bild::neuBild( int breite, int height, int fillColor )
-{
-    if( fc && delFc )
-        delete[] fc;
-    size.x = breite;
-    size.y = height;
-    fc = new int[ size.x * size.y ];
-    setFarbe( fillColor );
-    drawOff[ 0 ].x = 0;
-    drawOff[ 0 ].y = 0;
-    dPosA[ 0 ].x = 0;
-    dPosA[ 0 ].y = 0;
-    dSizeA[ 0 ] = size;
-    alphaAnzahl = 0;
-    alpha[ 0 ] = 0;
-    doa = 0;
-    rend = 1;
-}
-
-void Bild::setFarbe( int f )
-{
-    if( (f & 0xFF) == ((f >> 8) & 0xFF) && (f & 0xFF) == ((f >> 16) & 0xFF) && (f & 0xFF) == ((f >> 24) & 0xFF) )
-        memset( fc, f, size.x * size.y * 4 );
-    else
-    {
-        for( int* i = fc, *end = i + size.x * size.y; i < end; i++ )
-            *i = f;
-    }
-    rend = 1;
-}
-
-void Bild::fillRegion( int x, int y, int b, int h, int ff )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaRegion( x, y, b, h, ff );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + b < dpx || y + h < dpy || x > dgx || y > dgy )
-        return;
-    if( x < dpx )
-    {
-        b -= dpx - x;
-        x = dpx;
-    }
-    if( y < dpy )
-    {
-        h -= dpy - y;
-        y = dpy;
-    }
-    b = (x + b) >= dgx ? (dgx - x) : b;
-    h = (y + h) >= dgy ? (dgy - y) : h;
-    int* pixel = fc + y * size.x + x;
-    int* rowEnd = pixel + b;
-    for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
-    {
-        for( ; pixel < rowEnd; ++pixel )
-            *pixel = ff;
-    }
-    rend = 1;
-}
-
-void Bild::alphaRegion( int x, int y, int b, int h, int ff )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + b < dpx || y + h < dpy || x > dgx || y > dgy )
-        return;
-    if( x < dpx )
-    {
-        b -= dpx - x;
-        x = dpx;
-    }
-    if( y < dpy )
-    {
-        h -= dpy - y;
-        y = dpy;
-    }
-    b = (x + b) >= dgx ? (dgx - x) : b;
-    h = (y + h) >= dgy ? (dgy - y) : h;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&ff;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    int* pixel = fc + y * size.x + x;
-    int* rowEnd = pixel + b;
-    int alpha = ((ff >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    int i1 = (alpha * (ff & 0xFF00FF)) >> 8;
-    int i2 = (alpha * (ff & 0x00FF00)) >> 8;
-    if( alpha3D )
-    {
-        for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
-        {
-            for( ; pixel < rowEnd; ++pixel )
-            {
-                *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                           ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                           ((*pixel & 0xFF000000))) * (*pixel != 0) | (*pixel == 0) * ff;
-            }
-        }
-    }
-    else
-    {
-        for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
-        {
-            for( ; pixel < rowEnd; ++pixel )
-            {
-                *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                           ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                           ((*pixel & 0xFF000000)));
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::alphaPixel2D( int i, int f )
-{
-    if( !alpha[ alphaAnzahl ] )
-        alphaPixelP( fc[ i ], f );
-    else
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        alphaPixelP( fc[ i ], f );
-        rend = 1;
-    }
-}
-
-void Bild::alphaPixel3D( int i, int f )
-{
-    if( !alpha[ alphaAnzahl ] )
-        alphaPixelP3D( fc[ i ], f );
-    else
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        alphaPixelP3D( fc[ i ], f );
-        rend = 1;
-    }
-}
-
-void Bild::alphaPixel2D( int x, int y, int f )
-{
-    if( !alpha[ alphaAnzahl ] )
-        alphaPixelP( fc[ x + y * size.x ], f );
-    if( alpha[ alphaAnzahl ] < 0xFF )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        alphaPixelP( fc[ x + y * size.x ], f );
-        rend = 1;
-    }
-}
-
-void Bild::alphaPixel3D( int x, int y, int f )
-{
-    if( !alpha[ alphaAnzahl ] )
-        alphaPixelP3D( fc[ x + y * size.x ], f );
-    if( alpha[ alphaAnzahl ] < 0xFF )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        alphaPixelP3D( fc[ x + y * size.x ], f );
-        rend = 1;
-    }
-}
-
-void Bild::alphaPixelDP2D( int x, int y, int f )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    if( x < dpx || y < dpy || x > dgx || y > dgy )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    alphaPixelP( fc[ x + y * size.x ], f );
-    rend = 1;
-}
-
-void Bild::alphaPixelDP3D( int x, int y, int f )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    if( x < dpx || y < dpy || x > dgx || y > dgy )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    alphaPixelP3D( fc[ x + y * size.x ], f );
-    rend = 1;
-}
-
-void Bild::alphaPixelDP2D( int i, int f )
-{
-    int x = i % size.x;
-    int y = i / size.x;
-    alphaPixelDP2D( x, y, f );
-    rend = 1;
-}
-
-void Bild::alphaPixelDP3D( int i, int f )
-{
-    int x = i % size.x;
-    int y = i / size.x;
-    alphaPixelDP3D( x, y, f );
-    rend = 1;
-}
-
-void Bild::setPixelDP( int x, int y, int f )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        if( alpha3D )
-            alphaPixelDP3D( x, y, f );
-        else
-            alphaPixelDP2D( x, y, f );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    if( x < dpx || y < dpy || x > dgx || y > dgy )
-        return;
-    fc[ x + y * size.x ] = f;
-    rend = 1;
-}
-
-void Bild::setPixelDP( int i, int f )
-{
-    int x = i % size.x;
-    int y = i / size.x;
-    setPixelDP( x, y, f );
-    rend = 1;
-}
-
-void Bild::drawLinieH( int x, int y, int len, int f ) // zeichnet eine horizontale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawLinieHAlpha( x, y, len, f );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( y < dpy || y >= dgy )
-        return;
-    if( x < dpx )
-    {
-        len -= dpx - x;
-        if( len <= 0 )
-            return;
-        x = dpx;
-    }
-    if( x + len >= dgx )
-    {
-        len -= x - dgx + len;
-        if( len <= 0 )
-            return;
-    }
-    int br = size.x;
-    int* fc = this->fc + x + y * br;
-    int pval = len < 0 ? -1 : 1;
-    len = len > 0 ? len : -len;
-    for( int i = 0; i < len; ++i, fc += pval )
-        *fc = f;
-    rend = 1;
-}
-
-void Bild::drawLinieV( int x, int y, int len, int f ) // zeichnet eine vertikale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawLinieVAlpha( x, y, len, f );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x < dpx || x >= dgx )
-        return;
-    if( y < dpy )
-    {
-        len -= dpy - y;
-        if( len <= 0 )
-            return;
-        y = dpy;
-    }
-    if( y + len >= dgy )
-    {
-        len -= y - dgy + len;
-        if( len < 0 )
-            return;
-    }
-    int br = size.x;
-    int* fc = this->fc + x + y * br;
-    int pval = len < 0 ? -br : br;
-    len = len > 0 ? len : -len;
-    for( int i = 0; i < len; ++i, fc += pval )
-        *fc = f;
-    rend = 1;
-}
-
-void Bild::drawLinieHAlpha( int x, int y, int len, int f ) // zeichnet eine horizontale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( y < dpy || y >= dgy )
-        return;
-    if( x < dpx )
-    {
-        len -= dpx - x;
-        if( len <= 0 )
-            return;
-        x = dpx;
-    }
-    if( x + len >= dgx )
-    {
-        len -= x - dgx + len;
-        if( len <= 0 )
-            return;
-    }
-    int br = size.x;
-    int pval = len < 0 ? -1 : 1;
-    len = len > 0 ? len : -len;
-    int end = 0;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    int alpha = ((f >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    int i1 = (alpha * (f & 0xFF00FF)) >> 8;
-    int i2 = (alpha * (f & 0x00FF00)) >> 8;
-    for( int i = x + y * br; end < len; ++end, i += pval )
-    {
-        fc[ i ] = (((((na * (fc[ i ] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                    ((((na * (fc[ i ] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                    ((fc[ i ] & 0xFF000000))) * (fc[ i ] != 0 || !alpha3D) | (fc[ i ] == 0 && alpha3D) * f;
-    }
-    rend = 1;
-}
-
-void Bild::drawLinieVAlpha( int x, int y, int len, int f ) // zeichnet eine vertikale Linie
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x < dpx || x >= dgx )
-        return;
-    if( y < dpy )
-    {
-        len -= dpy - y;
-        if( len <= 0 )
-            return;
-        y = dpy;
-    }
-    if( y + len >= dgy )
-    {
-        len -= y - dgy + len;
-        if( len < 0 )
-            return;
-    }
-    int br = size.x;
-    int pval = len < 0 ? -br : br;
-    len = len > 0 ? len : -len;
-    int end = 0;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&f;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    int alpha = ((f >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    int i1 = (alpha * (f & 0xFF00FF)) >> 8;
-    int i2 = (alpha * (f & 0x00FF00)) >> 8;
-    for( int i = x + y * br; end < len; ++end, i += pval )
-    {
-        fc[ i ] = (((((na * (fc[ i ] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                    ((((na * (fc[ i ] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                    (fc[ i ] & 0xFF000000)) * (fc[ i ] != 0 || !alpha3D) | (fc[ i ] == 0 && alpha3D) * f;
-    }
-    rend = 1;
-}
-
-void Bild::drawLinieBordered( Punkt a, Punkt b, int bc, int fc )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawLinieBorderedAlpha( a, b, bc, fc );
-        return;
-    }
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    char outCode1 = getOutCode( a );
-    char outCode2 = getOutCode( b );
-    bool ok = 0;
-    while( 1 )
-    {
-        int xMax = dSizeA[ doa ].x - 1;
-        int yMax = dSizeA[ doa ].y - 1;
-        if( !(outCode1 | outCode2) )
-        {
-            ok = 1;
-            break;
-        }
-        else if( outCode1 & outCode2 )
-            break;
-        else
-        {
-            int x = 0, y = 0;
-            char outCodeOut = outCode1 ? outCode1 : outCode2;
-            if( outCodeOut & 8 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
-                y = yMax;
-            }
-            else if( outCodeOut & 4 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
-                y = dPosA[ doa ].y;
-            }
-            else if( outCodeOut & 2 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
-                x = xMax;
-            }
-            else if( outCodeOut & 1 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
-                x = dPosA[ doa ].x;
-            }
-            if( outCodeOut == outCode1 )
-            {
-                a.x = x;
-                a.y = y;
-                outCode1 = getOutCode( a );
-            }
-            else
-            {
-                b.x = x;
-                b.y = y;
-                outCode2 = getOutCode( b );
-            }
-        }
-    }
-    if( ok )
-    {
-        int xlen = b.x - a.x, axlen = abs( xlen );
-        int ylen = b.y - a.y, aylen = abs( ylen );
-        double xf = (double)xlen / (aylen ? aylen : 1);
-        double yf = (double)ylen / (axlen ? axlen : 1);
-        if( axlen > aylen )
-            xf = xf < 0 ? -1 : 1;
-        else
-            yf = yf < 0 ? -1 : 1;
-        double x = (double)a.x, y = (double)a.y;
-        int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
-        int count = 0;
-        int maxPixel = size.x * size.y;
-        while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
-        {
-            ++count;
-            this->fc[ (int)((int)(x + 0.5) + (int)(y + 0.5) * size.x) ] = fc;
-            if( (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel &&
-                this->fc[ (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) ] != fc )
-                this->fc[ (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) ] = bc;
-            if( (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel &&
-                this->fc[ (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) ] != fc )
-                this->fc[ (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) ] = bc;
-            if( (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel &&
-                this->fc[ (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) ] != fc )
-                this->fc[ (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) ] = bc;
-            if( (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel &&
-                this->fc[ (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) ] != fc )
-                this->fc[ (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) ] = bc;
-            x += xf, y += yf;
-        }
-        rend = 1;
-    }
-}
-
-void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    char outCode1 = getOutCode( a );
-    char outCode2 = getOutCode( b );
-    bool ok = 0;
-    while( 1 )
-    {
-        int xMax = dSizeA[ doa ].x - 1;
-        int yMax = dSizeA[ doa ].y - 1;
-        if( !(outCode1 | outCode2) )
-        {
-            ok = 1;
-            break;
-        }
-        else if( outCode1 & outCode2 )
-            break;
-        else
-        {
-            int x = 0, y = 0;
-            char outCodeOut = outCode1 ? outCode1 : outCode2;
-            if( outCodeOut & 8 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
-                y = yMax;
-            }
-            else if( outCodeOut & 4 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
-                y = dPosA[ doa ].y;
-            }
-            else if( outCodeOut & 2 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
-                x = xMax;
-            }
-            else if( outCodeOut & 1 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
-                x = dPosA[ doa ].x;
-            }
-            if( outCodeOut == outCode1 )
-            {
-                a.x = x;
-                a.y = y;
-                outCode1 = getOutCode( a );
-            }
-            else
-            {
-                b.x = x;
-                b.y = y;
-                outCode2 = getOutCode( b );
-            }
-        }
-    }
-    if( ok )
-    {
-        int xlen = b.x - a.x, axlen = abs( xlen );
-        int ylen = b.y - a.y, aylen = abs( ylen );
-        double xf = (double)xlen / (aylen ? aylen : 1);
-        double yf = (double)ylen / (axlen ? axlen : 1);
-        if( axlen > aylen )
-            xf = xf < 0 ? -1 : 1;
-        else
-            yf = yf < 0 ? -1 : 1;
-        double x = (double)a.x, y = (double)a.y;
-        if( alpha[ alphaAnzahl ] )
-        {
-            unsigned char* cf = (unsigned char*)&fc;
-            cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        }
-        int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
-        int alpha = ((fc >> 24) & 0xFF);
-        int alpha2 = ((bc >> 24) & 0xFF);
-        int na = (0x100 - alpha);
-        int na2 = (0x100 - alpha2);
-        int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
-        int i2 = (alpha * (fc & 0x00FF00)) >> 8;
-        int j1 = (alpha2 * (bc & 0xFF00FF)) >> 8;
-        int j2 = (alpha2 * (bc & 0x00FF00)) >> 8;
-        int count = 0;
-        int maxPixel = size.x * size.y;
-        while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
-        {
-            ++count;
-            if( (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel )
-            {
-                int& pixel = this->fc[ (int)(x - 0.5) + (int)(y + 0.5) * size.x ];
-                pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
-                          ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
-                          (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
-            }
-            if( (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel )
-            {
-                int& pixel = this->fc[ (int)(x + 1.5) + (int)(y + 0.5) * size.x ];
-                pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
-                          ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
-                          (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
-            }
-            if( (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel )
-            {
-                int& pixel = this->fc[ (int)(x + 0.5) + (int)(y - 0.5) * size.x ];
-                pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
-                          ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
-                          (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
-            }
-            if( (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel )
-            {
-                int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 1.5) * size.x ];
-                pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
-                          ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
-                          (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
-            }
-            x += xf, y += yf;
-        }
-        count = 0;
-        while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
-        {
-            ++count;
-            int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 0.5) * size.x ];
-            pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                      ((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                      (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
-            x += xf, y += yf;
-        }
-        rend = 1;
-    }
-}
-
-void Bild::drawLinie( Punkt a, Punkt b, int fc ) // zeichnet eine Linie von Punkt( x1, y1 ) nach Punke( x2, y2 )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawLinieAlpha( a, b, fc );
-        return;
-    }
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    char outCode1 = getOutCode( a );
-    char outCode2 = getOutCode( b );
-    bool ok = 0;
-    while( 1 )
-    {
-        int xMax = dSizeA[ doa ].x - 1;
-        int yMax = dSizeA[ doa ].y - 1;
-        if( !(outCode1 | outCode2) )
-        {
-            ok = 1;
-            break;
-        }
-        else if( outCode1 & outCode2 )
-            break;
-        else
-        {
-            int x = 0, y = 0;
-            char outCodeOut = outCode1 ? outCode1 : outCode2;
-            if( outCodeOut & 8 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
-                y = yMax;
-            }
-            else if( outCodeOut & 4 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
-                y = dPosA[ doa ].y;
-            }
-            else if( outCodeOut & 2 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
-                x = xMax;
-            }
-            else if( outCodeOut & 1 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
-                x = dPosA[ doa ].x;
-            }
-            if( outCodeOut == outCode1 )
-            {
-                a.x = x;
-                a.y = y;
-                outCode1 = getOutCode( a );
-            }
-            else
-            {
-                b.x = x;
-                b.y = y;
-                outCode2 = getOutCode( b );
-            }
-        }
-    }
-    if( ok )
-    {
-        int xlen = b.x - a.x, axlen = abs( xlen );
-        int ylen = b.y - a.y, aylen = abs( ylen );
-        double xf = (double)xlen / (aylen ? aylen : 1);
-        double yf = (double)ylen / (axlen ? axlen : 1);
-        if( axlen > aylen )
-            xf = xf < 0 ? -1 : 1;
-        else
-            yf = yf < 0 ? -1 : 1;
-        double x = (double)a.x, y = (double)a.y;
-        int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
-        int count = 0;
-        while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
-        {
-            ++count;
-            this->fc[ (int)((int)(x + 0.5) + (int)(y + 0.5) * size.x) ] = fc;
-            x += xf, y += yf;
-        }
-        rend = 1;
-    }
-}
-
-void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    char outCode1 = getOutCode( a );
-    char outCode2 = getOutCode( b );
-    bool ok = 0;
-    while( 1 )
-    {
-        int xMax = dSizeA[ doa ].x - 1;
-        int yMax = dSizeA[ doa ].y - 1;
-        if( !(outCode1 | outCode2) )
-        {
-            ok = 1;
-            break;
-        }
-        else if( outCode1 & outCode2 )
-            break;
-        else
-        {
-            int x = 0, y = 0;
-            char outCodeOut = outCode1 ? outCode1 : outCode2;
-            if( outCodeOut & 8 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
-                y = yMax;
-            }
-            else if( outCodeOut & 4 )
-            {
-                x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
-                y = dPosA[ doa ].y;
-            }
-            else if( outCodeOut & 2 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
-                x = xMax;
-            }
-            else if( outCodeOut & 1 )
-            {
-                y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
-                x = dPosA[ doa ].x;
-            }
-            if( outCodeOut == outCode1 )
-            {
-                a.x = x;
-                a.y = y;
-                outCode1 = getOutCode( a );
-            }
-            else
-            {
-                b.x = x;
-                b.y = y;
-                outCode2 = getOutCode( b );
-            }
-        }
-    }
-    if( ok )
-    {
-        int xlen = b.x - a.x, axlen = abs( xlen );
-        int ylen = b.y - a.y, aylen = abs( ylen );
-        double xf = (double)xlen / (aylen ? aylen : 1);
-        double yf = (double)ylen / (axlen ? axlen : 1);
-        if( axlen > aylen )
-            xf = xf < 0 ? -1 : 1;
-        else
-            yf = yf < 0 ? -1 : 1;
-        double x = (double)a.x, y = (double)a.y;
-        if( alpha[ alphaAnzahl ] )
-        {
-            unsigned char* cf = (unsigned char*)&fc;
-            cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-        }
-        int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
-        int count = 0;
-        int alpha = ((fc >> 24) & 0xFF);
-        int na = (0x100 - alpha);
-        int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
-        int i2 = (alpha * (fc & 0x00FF00)) >> 8;
-        while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
-        {
-            ++count;
-            int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 0.5) * size.x ];
-            pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                      ((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                      (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
-            x += xf, y += yf;
-        }
-        rend = 1;
-    }
-}
-
-void Bild::fillCircle( int xOff, int yOff, int r, int fc ) // zeichnet einen Kreis um Punkt( xOff, yOff ) mit radius r
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    for( int i = r; i > 0; i-- )
-        drawKreis( xOff, yOff, i, fc );
-}
-
-void Bild::drawKreis( int xOff, int yOff, int r, int fc ) // zeichnet einen Kreis um Punkt( xOff, yOff ) mit radius r
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawKreisAlpha( xOff, yOff, r, fc );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    xOff += drawOff[ doa ].x;
-    yOff += drawOff[ doa ].y;
-    if( xOff + r < dpx || xOff - r >= dgx || yOff + r < dpy || yOff - r >= dgy )
-        return;
-    for( int a = 0; a < r; ++a )
-    {
-        int b = (int)(sqrt( (float)(long)(r * r - a * a) ) + 0.5);
-        if( xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy )
-            this->fc[ xOff + a + (yOff + b) * size.x ] = fc;
-        if( xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy )
-            this->fc[ xOff - a + (yOff + b) * size.x ] = fc;
-        if( xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy )
-            this->fc[ xOff + a + (yOff - b) * size.x ] = fc;
-        if( xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy )
-            this->fc[ xOff - a + (yOff - b) * size.x ] = fc;
-        if( xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy )
-            this->fc[ xOff + b + (yOff + a) * size.x ] = fc;
-        if( xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy )
-            this->fc[ xOff - b + (yOff + a) * size.x ] = fc;
-        if( xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy )
-            this->fc[ xOff + b + (yOff - a) * size.x ] = fc;
-        if( xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy )
-            this->fc[ xOff - b + (yOff - a) * size.x ] = fc;
-    }
-    rend = 1;
-}
-
-void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    xOff += drawOff[ doa ].x;
-    yOff += drawOff[ doa ].y;
-    if( xOff + r < dpx || xOff - r >= dgx || yOff + r < dpy || yOff - r >= dgy )
-        return;
-    if( alpha[ alphaAnzahl ] < 0xFF )
-    {
-        unsigned char* cf = (unsigned char*)&fc;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    int alpha = ((fc >> 24) & 0xFF);
-    int na = (0x100 - alpha);
-    int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
-    int i2 = (alpha * (fc & 0x00FF00)) >> 8;
-    for( int a = 0; a < r; ++a )
-    {
-        int b = (int)(sqrt( (float)(long)(r * r - a * a) ) + 0.5);
-        int* pixel = 0;
-        if( xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy )
-        {
-            pixel = &this->fc[ xOff + a + (yOff + b) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy )
-        {
-            pixel = &this->fc[ xOff - a + (yOff + b) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy )
-        {
-            pixel = &this->fc[ xOff + a + (yOff - b) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy )
-        {
-            pixel = &this->fc[ xOff - a + (yOff - b) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy )
-        {
-            pixel = &this->fc[ xOff + b + (yOff + a) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy )
-        {
-            pixel = &this->fc[ xOff - b + (yOff + a) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy )
-        {
-            pixel = &this->fc[ xOff + b + (yOff - a) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-        if( xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy )
-        {
-            pixel = &this->fc[ xOff - b + (yOff - a) * size.x ];
-            *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
-                       ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
-                       (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawBild( int x, int y, int br, int hi, Bild& zBild ) // zeichet zBild
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaBild( x, y, br, hi, zBild );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getBreite() );
-    hi = minInt( hi, zBild.getHeight() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int xx, ygr, ygr2;
-    for( int yy = yst2; yy < dgy; ++yy )
-    {
-        ygr = yy * size.x;
-        ygr2 = (yy - yst2 + yst) * bb;
-        for( xx = xst2; xx < dgx; ++xx )
-            fc[ xx + ygr ] = ff[ (xx - xst2 + xst) + ygr2 ];
-    }
-    rend = 1;
-}
-
-void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getBreite() );
-    hi = minInt( hi, zBild.getHeight() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    if( !alpha[ alphaAnzahl ] )
-    {
-        int xx, ygr, ygr2;
-        for( int yy = yst2; yy < dgy; ++yy )
-        {
-            ygr = yy * size.x;
-            ygr2 = (yy - yst2 + yst) * bb;
-            for( xx = xst2; xx < dgx; ++xx )
-                alphaPixelAssozP( fc[ xx + ygr ], ff[ (xx - xst2 + xst) + ygr2 ] );
-        }
-    }
-    else
-    {
-        int xx, ygr, ygr2;
-        for( int yy = yst2; yy < dgy; ++yy )
-        {
-            ygr = yy * size.x;
-            ygr2 = (yy - yst2 + yst) * bb;
-            for( xx = xst2; xx < dgx; ++xx )
-            {
-                int fc = ff[ (xx - xst2 + xst) + ygr2 ];
-                unsigned char* cf = (unsigned char*)&fc;
-                cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                alphaPixelAssozP( this->fc[ xx + ygr ], fc );
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::alphaBild( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getBreite() );
-    hi = minInt( hi, zBild.getHeight() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    if( !alpha[ alphaAnzahl ] )
-    {
-        int xx, ygr, ygr2;
-        if( alpha3D )
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ygr2 = (yy - yst2 + yst) * bb;
-                int fci = xst2 + ygr;
-                int ffi = xst + ygr2;
-                for( xx = xst2; xx < dgx; ++xx, ++fci, ++ffi )
-                    alphaPixelP3D( fc[ fci ], ff[ ffi ] );
-            }
-        }
-        else
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ygr2 = (yy - yst2 + yst) * bb;
-                int fci = xst2 + ygr;
-                int ffi = xst + ygr2;
-                for( xx = xst2; xx < dgx; ++xx, ++fci, ++ffi )
-                    alphaPixelP( fc[ fci ], ff[ ffi ] );
-            }
-        }
-    }
-    else
-    {
-        int xx, ygr, ygr2;
-        if( alpha3D )
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ygr2 = (yy - yst2 + yst) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                {
-                    int fc = ff[ (xx - xst2 + xst) + ygr2 ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP( this->fc[ xx + ygr ], fc );
-                }
-            }
-        }
-        else
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ygr2 = (yy - yst2 + yst) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                {
-                    int fc = ff[ (xx - xst2 + xst) + ygr2 ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP3D( this->fc[ xx + ygr ], fc );
-                }
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawBild90( int x, int y, int br, int hi, Bild& zBild ) // Zeichnet ein um 90 Grad nach rchts gedrehtes Bild
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaBild90( x, y, br, hi, zBild );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + hi < dpx || y + br < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getHeight() );
-    hi = minInt( hi, zBild.getBreite() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int yy, xbb;
-    for( int xx = xst2; xx < dgx; ++xx )
-    {
-        xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
-        for( yy = yst2; yy < dgy; ++yy )
-            fc[ xx + yy * size.x ] = ff[ (yy - yst2 + yst) + xbb ];
-    }
-    rend = 1;
-}
-
-void Bild::alphaBild90( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + hi < dpx || y + br < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getHeight() );
-    hi = minInt( hi, zBild.getBreite() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    if( !alpha[ alphaAnzahl ] )
-    {
-        int yy, xbb;
-        if( alpha3D )
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                    alphaPixelP3D( xx, yy, ff[ (yy - yst2 + yst) + xbb ] );
-            }
-        }
-        else
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                    alphaPixelP( xx, yy, ff[ (yy - yst2 + yst) + xbb ] );
-            }
-        }
-    }
-    else
-    {
-        int yy, xbb;
-        if( alpha3D )
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                {
-                    int fc = ff[ (yy - yst2 + yst) + xbb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP3D( xx, yy, fc );
-                }
-            }
-        }
-        else
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                {
-                    int fc = ff[ (yy - yst2 + yst) + xbb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP( xx, yy, fc );
-                }
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawBild180( int x, int y, int br, int hi, Bild& zBild ) // Zeichnet ein um 180 Grad nach rchts gedrehtes Bild
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaBild180( x, y, br, hi, zBild );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getBreite() );
-    hi = minInt( hi, zBild.getHeight() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int xx, ygr, ybb;
-    for( int yy = yst2; yy < dgy; ++yy )
-    {
-        ygr = yy * size.x;
-        ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
-        for( xx = xst2; xx < dgx; ++xx )
-            fc[ xx + ygr ] = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
-    }
-    rend = 1;
-}
-
-void Bild::alphaBild180( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getHeight() );
-    hi = minInt( hi, zBild.getBreite() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    if( !alpha[ alphaAnzahl ] )
-    {
-        int xx, ygr, ybb;
-        if( alpha3D )
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                    alphaPixelP3D( fc[ xx + ygr ], ff[ (bb - (xx - xst2 + xst + 1)) + ybb ] );
-            }
-        }
-        else
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                    alphaPixelP( fc[ xx + ygr ], ff[ (bb - (xx - xst2 + xst + 1)) + ybb ] );
-            }
-        }
-    }
-    else
-    {
-        int xx, ygr, ybb;
-        if( alpha3D )
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                {
-                    int fc = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP3D( this->fc[ xx + ygr ], fc );
-                }
-            }
-        }
-        else
-        {
-            for( int yy = yst2; yy < dgy; ++yy )
-            {
-                ygr = yy * size.x;
-                ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
-                for( xx = xst2; xx < dgx; ++xx )
-                {
-                    int fc = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP( this->fc[ xx + ygr ], fc );
-                }
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawBild270( int x, int y, int br, int hi, Bild& zBild ) // Zeichnet ein um 270 Grad nach rchts gedrehtes Bild
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaBild270( x, y, br, hi, zBild );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + hi < dpx || y + br < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getHeight() );
-    hi = minInt( hi, zBild.getBreite() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int yy, xbb;
-    for( int xx = xst2; xx < dgx; ++xx )
-    {
-        xbb = (xx - xst2 + xst) * bb;
-        for( yy = yst2; yy < dgy; ++yy )
-            fc[ xx + yy * size.x ] = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
-    }
-    rend = 1;
-}
-
-void Bild::alphaBild270( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + hi < dpx || y + br < dpy || x > dgx || y > dgy )
-        return;
-    br = minInt( br, zBild.getHeight() );
-    hi = minInt( hi, zBild.getBreite() );
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    if( !alpha[ alphaAnzahl ] )
-    {
-        int yy, xbb;
-        if( alpha3D )
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (xx - xst2 + xst) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                    alphaPixelP3D( xx, yy, ff[ (bb - (yy - yst2 + yst + 1)) + xbb ] );
-            }
-        }
-        else
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (xx - xst2 + xst) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                    alphaPixelP( xx, yy, ff[ (bb - (yy - yst2 + yst + 1)) + xbb ] );
-            }
-        }
-    }
-    else
-    {
-        int yy, xbb;
-        if( alpha3D )
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (xx - xst2 + xst) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                {
-                    int fc = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP3D( xx, yy, fc );
-                }
-            }
-        }
-        else
-        {
-            for( int xx = xst2; xx < dgx; ++xx )
-            {
-                xbb = (xx - xst2 + xst) * bb;
-                for( yy = yst2; yy < dgy; ++yy )
-                {
-                    int fc = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
-                    unsigned char* cf = (unsigned char*)&fc;
-                    cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                    alphaPixelP( xx, yy, fc );
-                }
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawBildSkall( int x, int y, int br, int hi, Bild& zBild ) // zeichet zBild Skalliert
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        alphaBildSkall( x, y, br, hi, zBild );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    double xo = zBild.getBreite() / (double)br;
-    double yo = zBild.getHeight() / (double)hi;
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int xx, ygr, ygr2;
-    double xb = 0, yb = yst * yo;
-    for( int yy = yst2; yy < dgy; ++yy, yb += yo )
-    {
-        ygr = yy * size.x;
-        ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
-        for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
-            fc[ xx + ygr ] = ff[ (int)xb + ygr2 ];
-    }
-    rend = 1;
-}
-
-void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild& zBild )
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    x += drawOff[ doa ].x;
-    y += drawOff[ doa ].y;
-    if( x + br < dpx || y + hi < dpy || x > dgx || y > dgy )
-        return;
-    double xo = zBild.getBreite() / (double)br;
-    double yo = zBild.getHeight() / (double)hi;
-    int xst = maxInt( dpx - x, 0 );
-    int yst = maxInt( dpy - y, 0 );
-    int xst2 = maxInt( x, dpx );
-    int yst2 = maxInt( y, dpy );
-    dgx = minInt( x + br, dgx );
-    dgy = minInt( y + hi, dgy );
-    int bb = zBild.getBreite();
-    int* ff = zBild.getBuffer();
-    int xx, ygr, ygr2;
-    double xb = 0;
-    if( alpha3D )
-    {
-        for( int yy = yst2; yy < dgy; ++yy )
-        {
-            ygr = yy * size.x;
-            ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
-            for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
-            {
-                int f = ff[ (int)xb + ygr2 ];
-                unsigned char* cf = (unsigned char*)&f;
-                cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                alphaPixelP3D( fc[ xx + ygr ], f );
-            }
-        }
-    }
-    else
-    {
-        for( int yy = yst2; yy < dgy; ++yy )
-        {
-            ygr = yy * size.x;
-            ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
-            for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
-            {
-                int f = ff[ (int)xb + ygr2 ];
-                unsigned char* cf = (unsigned char*)&f;
-                cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-                alphaPixelP( fc[ xx + ygr ], f );
-            }
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe ) // füllt eine Dreieck aus
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawDreieckAlpha( a, b, c, farbe );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    c += drawOff[ doa ];
-    if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
-        (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
-        return;
-    if( b.y < a.y )
-        a.Swap( b );
-    if( c.y < b.y )
-        b.Swap( c );
-    if( b.y < a.y )
-        a.Swap( b );
-    if( a.y == b.y )
-    {
-        if( b.x < a.x )
-            a.Swap( b );
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
-        float b2 = (float)a.x - m2 * (float)a.y;
-        float b3 = (float)b.x - m3 * (float)b.y;
-        drawFlatDreieck( b.y, c.y, m2, b2, m3, b3, farbe );
-    }
-    else if( b.y == c.y )
-    {
-        if( c.x < b.x )
-            b.Swap( c );
-        const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        float b1 = (float)a.x - m1 * (float)a.y;
-        float b2 = (float)a.x - m2 * (float)a.y;
-        drawFlatDreieck( a.y, b.y, m1, b1, m2, b2, farbe );
-    }
-    else
-    {
-        const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
-        float b1 = (float)a.x - m1 * (float)a.y;
-        float b2 = (float)a.x - m2 * (float)a.y;
-        float b3 = (float)b.x - m3 * (float)b.y;
-        const float qx = m2 * (float)b.y + b2;
-        if( qx < (float)b.x )
-        {
-            drawFlatDreieck( a.y, b.y, m2, b2, m1, b1, farbe );
-            drawFlatDreieck( b.y, c.y, m2, b2, m3, b3, farbe );
-        }
-        else
-        {
-            drawFlatDreieck( a.y, b.y, m1, b1, m2, b2, farbe );
-            drawFlatDreieck( b.y, c.y, m3, b3, m2, b2, farbe );
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur ) // füllt eine Dreieck aus
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        drawDreieckTexturAlpha( a, b, c, ta, tb, tc, textur );
-        return;
-    }
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    c += drawOff[ doa ];
-    if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
-        (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
-        return;
-    if( b.y < a.y )
-    {
-        a.Swap( b );
-        ta.Swap( tb );
-    }
-    if( c.y < b.y )
-    {
-        b.Swap( c );
-        tb.Swap( tc );
-    }
-    if( b.y < a.y )
-    {
-        a.Swap( b );
-        ta.Swap( tb );
-    }
-    const double m1 = (double)(a.x - b.x) / (a.y - b.y);
-    const double m2 = (double)(a.x - c.x) / (a.y - c.y);
-    const double m3 = (double)(b.x - c.x) / (b.y - c.y);
-    double b1 = a.x - m1 * a.y;
-    double b2 = a.x - m2 * a.y;
-    double b3 = b.x - m3 * b.y;
-    const double qx = m2 * b.y + b2;
-    if( qx < b.x )
-    {
-        double tx1o, ty1o, tx2o, ty2o;
-        if( c.y - a.y )
-        {
-            tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
-            ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        if( b.y - a.y )
-        {
-            tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
-            ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        Vec2< double > q( ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y) );
-        double txf, tyf;
-        if( b.x - qx )
-        {
-            txf = (tb.x - q.x) / (b.x - qx);
-            tyf = (tb.y - q.y) / (b.x - qx);
-        }
-        else
-        {
-            txf = 0;
-            tyf = 0;
-        }
-        drawFlatDreieckTextur( a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-        if( c.y - b.y )
-        {
-            tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
-            ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        drawFlatDreieckTextur( b.y, c.y, m2, b2, m3, b3, q.x, q.y, tb.x, tb.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-    }
-    else
-    {
-        double tx1o, ty1o, tx2o, ty2o;
-        if( b.y - a.y )
-        {
-            tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
-            ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        if( c.y - a.y )
-        {
-            tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
-            ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        Vec2< double > q( ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y) );
-        double txf, tyf;
-        if( qx - b.x )
-        {
-            txf = (q.x - tb.x) / (qx - b.x);
-            tyf = (q.y - tb.y) / (qx - b.x);
-        }
-        else
-        {
-            txf = 0;
-            tyf = 0;
-        }
-        drawFlatDreieckTextur( a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-        if( c.y - b.y )
-        {
-            tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
-            ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        drawFlatDreieckTextur( b.y, c.y, m3, b3, m2, b2, tb.x, tb.y, q.x, q.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-    }
-    rend = 1;
-}
-
-void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe ) // füllt eine Dreieck aus
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    c += drawOff[ doa ];
-    if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
-        (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
-        return;
-    if( alpha[ alphaAnzahl ] )
-    {
-        unsigned char* cf = (unsigned char*)&farbe;
-        cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
-    }
-    if( b.y < a.y )
-        a.Swap( b );
-    if( c.y < b.y )
-        b.Swap( c );
-    if( b.y < a.y )
-        a.Swap( b );
-    if( a.y == b.y )
-    {
-        if( b.x < a.x )
-            a.Swap( b );
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
-        float b2 = (float)a.x - m2 * (float)a.y;
-        float b3 = (float)b.x - m3 * (float)b.y;
-        drawFlatDreieckAlpha( b.y, c.y, m2, b2, m3, b3, farbe );
-    }
-    else if( b.y == c.y )
-    {
-        if( c.x < b.x )
-            b.Swap( c );
-        const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        float b1 = (float)a.x - m1 * (float)a.y;
-        float b2 = (float)a.x - m2 * (float)a.y;
-        drawFlatDreieckAlpha( a.y, b.y, m1, b1, m2, b2, farbe );
-    }
-    else
-    {
-        const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
-        const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
-        const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
-        float b1 = (float)a.x - m1 * (float)a.y;
-        float b2 = (float)a.x - m2 * (float)a.y;
-        float b3 = (float)b.x - m3 * (float)b.y;
-        const float qx = m2 * (float)b.y + b2;
-        if( qx < (float)b.x )
-        {
-            drawFlatDreieckAlpha( a.y, b.y, m2, b2, m1, b1, farbe );
-            drawFlatDreieckAlpha( b.y, c.y, m2, b2, m3, b3, farbe );
-        }
-        else
-        {
-            drawFlatDreieckAlpha( a.y, b.y, m1, b1, m2, b2, farbe );
-            drawFlatDreieckAlpha( b.y, c.y, m3, b3, m2, b2, farbe );
-        }
-    }
-    rend = 1;
-}
-
-void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur ) // füllt eine Dreieck aus
-{
-    if( alpha[ alphaAnzahl ] == 0xFF )
-        return;
-    int dpx = dPosA[ doa ].x;
-    int dpy = dPosA[ doa ].y;
-    int dgx = dSizeA[ doa ].x;
-    int dgy = dSizeA[ doa ].y;
-    a += drawOff[ doa ];
-    b += drawOff[ doa ];
-    c += drawOff[ doa ];
-    if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
-        (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
-        return;
-    if( b.y < a.y )
-    {
-        a.Swap( b );
-        ta.Swap( tb );
-    }
-    if( c.y < b.y )
-    {
-        b.Swap( c );
-        tb.Swap( tc );
-    }
-    if( b.y < a.y )
-    {
-        a.Swap( b );
-        ta.Swap( tb );
-    }
-    const double m1 = (double)(a.x - b.x) / (a.y - b.y);
-    const double m2 = (double)(a.x - c.x) / (a.y - c.y);
-    const double m3 = (double)(b.x - c.x) / (b.y - c.y);
-    double b1 = a.x - m1 * a.y;
-    double b2 = a.x - m2 * a.y;
-    double b3 = b.x - m3 * b.y;
-    const double qx = m2 * b.y + b2;
-    if( qx < b.x )
-    {
-        double tx1o, ty1o, tx2o, ty2o;
-        if( c.y - a.y )
-        {
-            tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
-            ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        if( b.y - a.y )
-        {
-            tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
-            ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        Vec2< double > q( ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y) );
-        double txf, tyf;
-        if( b.x - qx )
-        {
-            txf = (tb.x - q.x) / (b.x - qx);
-            tyf = (tb.y - q.y) / (b.x - qx);
-        }
-        else
-        {
-            txf = 0;
-            tyf = 0;
-        }
-        drawFlatDreieckTexturAlpha( a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-        if( c.y - b.y )
-        {
-            tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
-            ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        drawFlatDreieckTexturAlpha( b.y, c.y, m2, b2, m3, b3, q.x, q.y, tb.x, tb.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-    }
-    else
-    {
-        double tx1o, ty1o, tx2o, ty2o;
-        if( b.y - a.y )
-        {
-            tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
-            ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        if( c.y - a.y )
-        {
-            tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
-            ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
-        }
-        else
-        {
-            tx2o = 0;
-            ty2o = 0;
-        }
-        Vec2< double > q( ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y) );
-        double txf, tyf;
-        if( qx - b.x )
-        {
-            txf = (q.x - tb.x) / (qx - b.x);
-            tyf = (q.y - tb.y) / (qx - b.x);
-        }
-        else
-        {
-            txf = 0;
-            tyf = 0;
-        }
-        drawFlatDreieckTexturAlpha( a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-        if( c.y - b.y )
-        {
-            tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
-            ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
-        }
-        else
-        {
-            tx1o = 0;
-            ty1o = 0;
-        }
-        drawFlatDreieckTexturAlpha( b.y, c.y, m3, b3, m2, b2, tb.x, tb.y, q.x, q.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
-    }
-    rend = 1;
-}
-
-void Bild::replaceColorWithAlpha( int color )
-{
-    int r = (color & 0xFF0000) >> 16;
-    int g = (color & 0xFF00) >> 8;
-    int b = color & 0xFF;
-    int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
-    int xx = dPosA[ doa ].x, yy = dPosA[ doa ].y;
-    int bb = dSizeA[ doa ].x, hh = dSizeA[ doa ].y;
-    for( int y = dy + yy; y < hh; y++ )
-    {
-        int ygr = y * size.x;
-        for( int x = dx + xx; x < bb; x++ )
-        {
-            unsigned char* cf = (unsigned char*)&(fc[ x + ygr ]);
-            int abstand = (int)sqrt( (float)((r - cf[ 2 ]) * (r - cf[ 2 ]) + (g - cf[ 1 ]) * (g - cf[ 1 ]) + (b - cf[ 0 ]) * (b - cf[ 0 ])) );
-            if( abstand > 255 )
-                abstand = 255;
-            cf[ 3 ] = (unsigned char)(abstand);
-        }
-    }
-}
-
-bool Bild::setDrawOptions( const Punkt& pos, const Punkt& gr ) // setzt die Drawoptionen
-{
-    int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
-    int xx = dPosA[ doa ].x, yy = dPosA[ doa ].y;
-    int bb = dSizeA[ doa ].x, hh = dSizeA[ doa ].y;
-    if( dx + pos.x + gr.x < 0 || dy + pos.y + gr.y < 0 || dx + pos.x >= size.x || dy + pos.y >= size.y )
-        return 0;
-    if( pos.x + gr.x + dx < xx || pos.y + gr.y + dy < yy || dx + pos.x >= bb || dy + pos.y >= hh )
-        return 0;
-    ++doa;
-    assert( doa < 2000 );
-    dPosA[ doa ].x = maxInt( pos.x + dx, xx );
-    dPosA[ doa ].y = maxInt( pos.y + dy, yy );
-    dSizeA[ doa ].x = minInt( pos.x + gr.x + dx, bb );
-    dSizeA[ doa ].y = minInt( pos.y + gr.y + dy, hh );
-    drawOff[ doa ].x = dx + pos.x;
-    drawOff[ doa ].y = dy + pos.y;
-    return 1;
-}
-
-bool Bild::setDrawOptions( int x, int y, int br, int hi )
-{
-    int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
-    int xx = dPosA[ doa ].x, yy = dPosA[ doa ].y;
-    int bb = dSizeA[ doa ].x, hh = dSizeA[ doa ].y;
-    if( dx + x + br < 0 || dy + y + hi < 0 || dx + x >= size.x || dy + y >= size.y )
-        return 0;
-    if( x + br + dx < xx || y + hi + dy < yy || dx + x >= bb || dy + y >= hh )
-        return 0;
-    ++doa;
-    assert( doa < 2000 );
-    dPosA[ doa ].x = maxInt( x + dx, xx );
-    dPosA[ doa ].y = maxInt( y + dy, yy );
-    dSizeA[ doa ].x = minInt( x + br + dx, bb );
-    dSizeA[ doa ].y = minInt( y + hi + dy, hh );
-    drawOff[ doa ].x = dx + x;
-    drawOff[ doa ].y = dy + y;
-    return 1;
-}
-
-bool Bild::setDrawOptionsErzwingen( const Punkt& pos, const Punkt& gr ) // setzt die Drawoptionen
-{
-    int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
-    if( dx + pos.x + gr.x < 0 || dy + pos.y + gr.y < 0 || dx + pos.x >= size.x || dy + pos.y >= size.y )
-        return 0;
-    ++doa;
-    assert( doa < 2000 );
-    dPosA[ doa ].x = maxInt( pos.x + dx, 0 );
-    dPosA[ doa ].y = maxInt( pos.y + dy, 0 );
-    dSizeA[ doa ].x = minInt( pos.x + gr.x + dx, size.x );
-    dSizeA[ doa ].y = minInt( pos.y + gr.y + dy, size.y );
-    drawOff[ doa ].x = dx + pos.x;
-    drawOff[ doa ].y = dy + pos.y;
-    return 1;
-}
-
-bool Bild::setDrawOptionsErzwingen( int x, int y, int br, int hi ) // setzt die Drawoptionen
-{
-    int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
-    if( dx + x + br < 0 || dy + y + hi < 0 || dx + x >= size.x || dy + y >= size.y )
-        return 0;
-    ++doa;
-    assert( doa < 2000 );
-    dPosA[ doa ].x = maxInt( x + dx, 0 );
-    dPosA[ doa ].y = maxInt( y + dy, 0 );
-    dSizeA[ doa ].x = minInt( x + br + dx, size.x );
-    dSizeA[ doa ].y = minInt( y + hi + dy, size.y );
-    drawOff[ doa ].x = dx + x;
-    drawOff[ doa ].y = dy + y;
-    return 1;
+	--alphaAnzahl;
+}
+
+void Bild::setPixelBuffer(int* buffer, bool deleteBuffer, int breite, int height) // setzt den Zeiger auf die Pixel des Bildes
+{
+	if (delFc)
+		delete[]fc;
+	fc = buffer;
+	delFc = deleteBuffer;
+	size.x = breite;
+	size.y = height;
+	drawOff[0].x = 0;
+	drawOff[0].y = 0;
+	dPosA[0].x = 0;
+	dPosA[0].y = 0;
+	dSizeA[0] = size;
+	alphaAnzahl = 0;
+	alpha[0] = 0;
+	doa = 0;
+	rend = 1;
+}
+
+void Bild::neuBild(int breite, int height, int fillColor)
+{
+	if (fc && delFc)
+		delete[] fc;
+	size.x = breite;
+	size.y = height;
+	fc = new int[size.x * size.y];
+	setFarbe(fillColor);
+	drawOff[0].x = 0;
+	drawOff[0].y = 0;
+	dPosA[0].x = 0;
+	dPosA[0].y = 0;
+	dSizeA[0] = size;
+	alphaAnzahl = 0;
+	alpha[0] = 0;
+	doa = 0;
+	rend = 1;
+}
+
+void Bild::setFarbe(int f)
+{
+	if ((f & 0xFF) == ((f >> 8) & 0xFF) && (f & 0xFF) == ((f >> 16) & 0xFF) && (f & 0xFF) == ((f >> 24) & 0xFF))
+		memset(fc, f, size.x * size.y * 4);
+	else
+	{
+		for (int* i = fc, *end = i + size.x * size.y; i < end; i++)
+			*i = f;
+	}
+	rend = 1;
+}
+
+void Bild::fillRegion(int x, int y, int b, int h, int ff)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaRegion(x, y, b, h, ff);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + b < dpx || y + h < dpy || x > dgx || y > dgy)
+		return;
+	if (x < dpx)
+	{
+		b -= dpx - x;
+		x = dpx;
+	}
+	if (y < dpy)
+	{
+		h -= dpy - y;
+		y = dpy;
+	}
+	b = (x + b) >= dgx ? (dgx - x) : b;
+	h = (y + h) >= dgy ? (dgy - y) : h;
+	int* pixel = fc + y * size.x + x;
+	int* rowEnd = pixel + b;
+	for (int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x)
+	{
+		for (; pixel < rowEnd; ++pixel)
+			*pixel = ff;
+	}
+	rend = 1;
+}
+
+void Bild::alphaRegion(int x, int y, int b, int h, int ff)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + b < dpx || y + h < dpy || x > dgx || y > dgy)
+		return;
+	if (x < dpx)
+	{
+		b -= dpx - x;
+		x = dpx;
+	}
+	if (y < dpy)
+	{
+		h -= dpy - y;
+		y = dpy;
+	}
+	b = (x + b) >= dgx ? (dgx - x) : b;
+	h = (y + h) >= dgy ? (dgy - y) : h;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&ff;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	int* pixel = fc + y * size.x + x;
+	int* rowEnd = pixel + b;
+	int alpha = ((ff >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	int i1 = (alpha * (ff & 0xFF00FF)) >> 8;
+	int i2 = (alpha * (ff & 0x00FF00)) >> 8;
+	if (alpha3D)
+	{
+		for (int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x)
+		{
+			for (; pixel < rowEnd; ++pixel)
+			{
+				*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+					((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+					((*pixel & 0xFF000000))) * (*pixel != 0) | (*pixel == 0) * ff;
+			}
+		}
+	}
+	else
+	{
+		for (int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x)
+		{
+			for (; pixel < rowEnd; ++pixel)
+			{
+				*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+					((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+					((*pixel & 0xFF000000)));
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::alphaPixel2D(int i, int f)
+{
+	if (!alpha[alphaAnzahl])
+		alphaPixelP(fc[i], f);
+	else
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		alphaPixelP(fc[i], f);
+		rend = 1;
+	}
+}
+
+void Bild::alphaPixel3D(int i, int f)
+{
+	if (!alpha[alphaAnzahl])
+		alphaPixelP3D(fc[i], f);
+	else
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		alphaPixelP3D(fc[i], f);
+		rend = 1;
+	}
+}
+
+void Bild::alphaPixel2D(int x, int y, int f)
+{
+	if (!alpha[alphaAnzahl])
+		alphaPixelP(fc[x + y * size.x], f);
+	if (alpha[alphaAnzahl] < 0xFF)
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		alphaPixelP(fc[x + y * size.x], f);
+		rend = 1;
+	}
+}
+
+void Bild::alphaPixel3D(int x, int y, int f)
+{
+	if (!alpha[alphaAnzahl])
+		alphaPixelP3D(fc[x + y * size.x], f);
+	if (alpha[alphaAnzahl] < 0xFF)
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		alphaPixelP3D(fc[x + y * size.x], f);
+		rend = 1;
+	}
+}
+
+void Bild::alphaPixelDP2D(int x, int y, int f)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	if (x < dpx || y < dpy || x > dgx || y > dgy)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	alphaPixelP(fc[x + y * size.x], f);
+	rend = 1;
+}
+
+void Bild::alphaPixelDP3D(int x, int y, int f)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	if (x < dpx || y < dpy || x > dgx || y > dgy)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	alphaPixelP3D(fc[x + y * size.x], f);
+	rend = 1;
+}
+
+void Bild::alphaPixelDP2D(int i, int f)
+{
+	int x = i % size.x;
+	int y = i / size.x;
+	alphaPixelDP2D(x, y, f);
+	rend = 1;
+}
+
+void Bild::alphaPixelDP3D(int i, int f)
+{
+	int x = i % size.x;
+	int y = i / size.x;
+	alphaPixelDP3D(x, y, f);
+	rend = 1;
+}
+
+void Bild::setPixelDP(int x, int y, int f)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		if (alpha3D)
+			alphaPixelDP3D(x, y, f);
+		else
+			alphaPixelDP2D(x, y, f);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	if (x < dpx || y < dpy || x > dgx || y > dgy)
+		return;
+	fc[x + y * size.x] = f;
+	rend = 1;
+}
+
+void Bild::setPixelDP(int i, int f)
+{
+	int x = i % size.x;
+	int y = i / size.x;
+	setPixelDP(x, y, f);
+	rend = 1;
+}
+
+void Bild::drawLinieH(int x, int y, int len, int f) // zeichnet eine horizontale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawLinieHAlpha(x, y, len, f);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (y < dpy || y >= dgy)
+		return;
+	if (x < dpx)
+	{
+		len -= dpx - x;
+		if (len <= 0)
+			return;
+		x = dpx;
+	}
+	if (x + len >= dgx)
+	{
+		len -= x - dgx + len;
+		if (len <= 0)
+			return;
+	}
+	int br = size.x;
+	int* fc = this->fc + x + y * br;
+	int pval = len < 0 ? -1 : 1;
+	len = len > 0 ? len : -len;
+	for (int i = 0; i < len; ++i, fc += pval)
+		*fc = f;
+	rend = 1;
+}
+
+void Bild::drawLinieV(int x, int y, int len, int f) // zeichnet eine vertikale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawLinieVAlpha(x, y, len, f);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x < dpx || x >= dgx)
+		return;
+	if (y < dpy)
+	{
+		len -= dpy - y;
+		if (len <= 0)
+			return;
+		y = dpy;
+	}
+	if (y + len >= dgy)
+	{
+		len -= y - dgy + len;
+		if (len < 0)
+			return;
+	}
+	int br = size.x;
+	int* fc = this->fc + x + y * br;
+	int pval = len < 0 ? -br : br;
+	len = len > 0 ? len : -len;
+	for (int i = 0; i < len; ++i, fc += pval)
+		*fc = f;
+	rend = 1;
+}
+
+void Bild::drawLinieHAlpha(int x, int y, int len, int f) // zeichnet eine horizontale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (y < dpy || y >= dgy)
+		return;
+	if (x < dpx)
+	{
+		len -= dpx - x;
+		if (len <= 0)
+			return;
+		x = dpx;
+	}
+	if (x + len >= dgx)
+	{
+		len -= x - dgx + len;
+		if (len <= 0)
+			return;
+	}
+	int br = size.x;
+	int pval = len < 0 ? -1 : 1;
+	len = len > 0 ? len : -len;
+	int end = 0;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	int alpha = ((f >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	int i1 = (alpha * (f & 0xFF00FF)) >> 8;
+	int i2 = (alpha * (f & 0x00FF00)) >> 8;
+	for (int i = x + y * br; end < len; ++end, i += pval)
+	{
+		fc[i] = (((((na * (fc[i] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+			((((na * (fc[i] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+			((fc[i] & 0xFF000000))) * (fc[i] != 0 || !alpha3D) | (fc[i] == 0 && alpha3D) * f;
+	}
+	rend = 1;
+}
+
+void Bild::drawLinieVAlpha(int x, int y, int len, int f) // zeichnet eine vertikale Linie
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x < dpx || x >= dgx)
+		return;
+	if (y < dpy)
+	{
+		len -= dpy - y;
+		if (len <= 0)
+			return;
+		y = dpy;
+	}
+	if (y + len >= dgy)
+	{
+		len -= y - dgy + len;
+		if (len < 0)
+			return;
+	}
+	int br = size.x;
+	int pval = len < 0 ? -br : br;
+	len = len > 0 ? len : -len;
+	int end = 0;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&f;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	int alpha = ((f >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	int i1 = (alpha * (f & 0xFF00FF)) >> 8;
+	int i2 = (alpha * (f & 0x00FF00)) >> 8;
+	for (int i = x + y * br; end < len; ++end, i += pval)
+	{
+		fc[i] = (((((na * (fc[i] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+			((((na * (fc[i] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+			(fc[i] & 0xFF000000)) * (fc[i] != 0 || !alpha3D) | (fc[i] == 0 && alpha3D) * f;
+	}
+	rend = 1;
+}
+
+void Bild::drawLinieBordered(Punkt a, Punkt b, int bc, int fc)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawLinieBorderedAlpha(a, b, bc, fc);
+		return;
+	}
+	a += drawOff[doa];
+	b += drawOff[doa];
+	char outCode1 = getOutCode(a);
+	char outCode2 = getOutCode(b);
+	bool ok = 0;
+	while (1)
+	{
+		int xMax = dSizeA[doa].x - 1;
+		int yMax = dSizeA[doa].y - 1;
+		if (!(outCode1 | outCode2))
+		{
+			ok = 1;
+			break;
+		}
+		else if (outCode1 & outCode2)
+			break;
+		else
+		{
+			int x = 0, y = 0;
+			char outCodeOut = outCode1 ? outCode1 : outCode2;
+			if (outCodeOut & 8)
+			{
+				x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
+				y = yMax;
+			}
+			else if (outCodeOut & 4)
+			{
+				x = (int)(a.x + (b.x - a.x) * (dPosA[doa].y - a.y) / (b.y - a.y) + 0.5);
+				y = dPosA[doa].y;
+			}
+			else if (outCodeOut & 2)
+			{
+				y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
+				x = xMax;
+			}
+			else if (outCodeOut & 1)
+			{
+				y = (int)(a.y + (b.y - a.y) * (dPosA[doa].x - a.x) / (b.x - a.x) + 0.5);
+				x = dPosA[doa].x;
+			}
+			if (outCodeOut == outCode1)
+			{
+				a.x = x;
+				a.y = y;
+				outCode1 = getOutCode(a);
+			}
+			else
+			{
+				b.x = x;
+				b.y = y;
+				outCode2 = getOutCode(b);
+			}
+		}
+	}
+	if (ok)
+	{
+		int xlen = b.x - a.x, axlen = abs(xlen);
+		int ylen = b.y - a.y, aylen = abs(ylen);
+		double xf = (double)xlen / (aylen ? aylen : 1);
+		double yf = (double)ylen / (axlen ? axlen : 1);
+		if (axlen > aylen)
+			xf = xf < 0 ? -1 : 1;
+		else
+			yf = yf < 0 ? -1 : 1;
+		double x = (double)a.x, y = (double)a.y;
+		int maxP = (int)(sqrt((float)(xlen * xlen + ylen * ylen)) + 0.5);
+		int count = 0;
+		int maxPixel = size.x * size.y;
+		while (!((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP)
+		{
+			++count;
+			this->fc[(int)((int)(x + 0.5) + (int)(y + 0.5) * size.x)] = fc;
+			if ((int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel &&
+				this->fc[(int)((int)(x - 0.5) + (int)(y + 0.5) * size.x)] != fc)
+				this->fc[(int)((int)(x - 0.5) + (int)(y + 0.5) * size.x)] = bc;
+			if ((int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel &&
+				this->fc[(int)((int)(x + 1.5) + (int)(y + 0.5) * size.x)] != fc)
+				this->fc[(int)((int)(x + 1.5) + (int)(y + 0.5) * size.x)] = bc;
+			if ((int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel &&
+				this->fc[(int)((int)(x + 0.5) + (int)(y - 0.5) * size.x)] != fc)
+				this->fc[(int)((int)(x + 0.5) + (int)(y - 0.5) * size.x)] = bc;
+			if ((int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel &&
+				this->fc[(int)((int)(x + 0.5) + (int)(y + 1.5) * size.x)] != fc)
+				this->fc[(int)((int)(x + 0.5) + (int)(y + 1.5) * size.x)] = bc;
+			x += xf, y += yf;
+		}
+		rend = 1;
+	}
+}
+
+void Bild::drawLinieBorderedAlpha(Punkt a, Punkt b, int bc, int fc)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	char outCode1 = getOutCode(a);
+	char outCode2 = getOutCode(b);
+	bool ok = 0;
+	while (1)
+	{
+		int xMax = dSizeA[doa].x - 1;
+		int yMax = dSizeA[doa].y - 1;
+		if (!(outCode1 | outCode2))
+		{
+			ok = 1;
+			break;
+		}
+		else if (outCode1 & outCode2)
+			break;
+		else
+		{
+			int x = 0, y = 0;
+			char outCodeOut = outCode1 ? outCode1 : outCode2;
+			if (outCodeOut & 8)
+			{
+				x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
+				y = yMax;
+			}
+			else if (outCodeOut & 4)
+			{
+				x = (int)(a.x + (b.x - a.x) * (dPosA[doa].y - a.y) / (b.y - a.y) + 0.5);
+				y = dPosA[doa].y;
+			}
+			else if (outCodeOut & 2)
+			{
+				y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
+				x = xMax;
+			}
+			else if (outCodeOut & 1)
+			{
+				y = (int)(a.y + (b.y - a.y) * (dPosA[doa].x - a.x) / (b.x - a.x) + 0.5);
+				x = dPosA[doa].x;
+			}
+			if (outCodeOut == outCode1)
+			{
+				a.x = x;
+				a.y = y;
+				outCode1 = getOutCode(a);
+			}
+			else
+			{
+				b.x = x;
+				b.y = y;
+				outCode2 = getOutCode(b);
+			}
+		}
+	}
+	if (ok)
+	{
+		int xlen = b.x - a.x, axlen = abs(xlen);
+		int ylen = b.y - a.y, aylen = abs(ylen);
+		double xf = (double)xlen / (aylen ? aylen : 1);
+		double yf = (double)ylen / (axlen ? axlen : 1);
+		if (axlen > aylen)
+			xf = xf < 0 ? -1 : 1;
+		else
+			yf = yf < 0 ? -1 : 1;
+		double x = (double)a.x, y = (double)a.y;
+		if (alpha[alphaAnzahl])
+		{
+			unsigned char* cf = (unsigned char*)&fc;
+			cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		}
+		int maxP = (int)(sqrt((float)(xlen * xlen + ylen * ylen)) + 0.5);
+		int alpha = ((fc >> 24) & 0xFF);
+		int alpha2 = ((bc >> 24) & 0xFF);
+		int na = (0x100 - alpha);
+		int na2 = (0x100 - alpha2);
+		int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
+		int i2 = (alpha * (fc & 0x00FF00)) >> 8;
+		int j1 = (alpha2 * (bc & 0xFF00FF)) >> 8;
+		int j2 = (alpha2 * (bc & 0x00FF00)) >> 8;
+		int count = 0;
+		int maxPixel = size.x * size.y;
+		while (!((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP)
+		{
+			++count;
+			if ((int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel)
+			{
+				int& pixel = this->fc[(int)(x - 0.5) + (int)(y + 0.5) * size.x];
+				pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
+					((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
+					(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
+			}
+			if ((int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel)
+			{
+				int& pixel = this->fc[(int)(x + 1.5) + (int)(y + 0.5) * size.x];
+				pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
+					((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
+					(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
+			}
+			if ((int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel)
+			{
+				int& pixel = this->fc[(int)(x + 0.5) + (int)(y - 0.5) * size.x];
+				pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
+					((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
+					(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
+			}
+			if ((int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel)
+			{
+				int& pixel = this->fc[(int)(x + 0.5) + (int)(y + 1.5) * size.x];
+				pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
+					((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
+					(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
+			}
+			x += xf, y += yf;
+		}
+		count = 0;
+		while (!((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP)
+		{
+			++count;
+			int& pixel = this->fc[(int)(x + 0.5) + (int)(y + 0.5) * size.x];
+			pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
+			x += xf, y += yf;
+		}
+		rend = 1;
+	}
+}
+
+void Bild::drawLinie(Punkt a, Punkt b, int fc) // zeichnet eine Linie von Punkt( x1, y1 ) nach Punke( x2, y2 )
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawLinieAlpha(a, b, fc);
+		return;
+	}
+	a += drawOff[doa];
+	b += drawOff[doa];
+	char outCode1 = getOutCode(a);
+	char outCode2 = getOutCode(b);
+	bool ok = 0;
+	while (1)
+	{
+		int xMax = dSizeA[doa].x - 1;
+		int yMax = dSizeA[doa].y - 1;
+		if (!(outCode1 | outCode2))
+		{
+			ok = 1;
+			break;
+		}
+		else if (outCode1 & outCode2)
+			break;
+		else
+		{
+			int x = 0, y = 0;
+			char outCodeOut = outCode1 ? outCode1 : outCode2;
+			if (outCodeOut & 8)
+			{
+				x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
+				y = yMax;
+			}
+			else if (outCodeOut & 4)
+			{
+				x = (int)(a.x + (b.x - a.x) * (dPosA[doa].y - a.y) / (b.y - a.y) + 0.5);
+				y = dPosA[doa].y;
+			}
+			else if (outCodeOut & 2)
+			{
+				y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
+				x = xMax;
+			}
+			else if (outCodeOut & 1)
+			{
+				y = (int)(a.y + (b.y - a.y) * (dPosA[doa].x - a.x) / (b.x - a.x) + 0.5);
+				x = dPosA[doa].x;
+			}
+			if (outCodeOut == outCode1)
+			{
+				a.x = x;
+				a.y = y;
+				outCode1 = getOutCode(a);
+			}
+			else
+			{
+				b.x = x;
+				b.y = y;
+				outCode2 = getOutCode(b);
+			}
+		}
+	}
+	if (ok)
+	{
+		int xlen = b.x - a.x, axlen = abs(xlen);
+		int ylen = b.y - a.y, aylen = abs(ylen);
+		double xf = (double)xlen / (aylen ? aylen : 1);
+		double yf = (double)ylen / (axlen ? axlen : 1);
+		if (axlen > aylen)
+			xf = xf < 0 ? -1 : 1;
+		else
+			yf = yf < 0 ? -1 : 1;
+		double x = (double)a.x, y = (double)a.y;
+		int maxP = (int)(sqrt((float)(xlen * xlen + ylen * ylen)) + 0.5);
+		int count = 0;
+		while (!((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP)
+		{
+			++count;
+			this->fc[(int)((int)(x + 0.5) + (int)(y + 0.5) * size.x)] = fc;
+			x += xf, y += yf;
+		}
+		rend = 1;
+	}
+}
+
+void Bild::drawLinieAlpha(Punkt a, Punkt b, int fc)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	char outCode1 = getOutCode(a);
+	char outCode2 = getOutCode(b);
+	bool ok = 0;
+	while (1)
+	{
+		int xMax = dSizeA[doa].x - 1;
+		int yMax = dSizeA[doa].y - 1;
+		if (!(outCode1 | outCode2))
+		{
+			ok = 1;
+			break;
+		}
+		else if (outCode1 & outCode2)
+			break;
+		else
+		{
+			int x = 0, y = 0;
+			char outCodeOut = outCode1 ? outCode1 : outCode2;
+			if (outCodeOut & 8)
+			{
+				x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
+				y = yMax;
+			}
+			else if (outCodeOut & 4)
+			{
+				x = (int)(a.x + (b.x - a.x) * (dPosA[doa].y - a.y) / (b.y - a.y) + 0.5);
+				y = dPosA[doa].y;
+			}
+			else if (outCodeOut & 2)
+			{
+				y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
+				x = xMax;
+			}
+			else if (outCodeOut & 1)
+			{
+				y = (int)(a.y + (b.y - a.y) * (dPosA[doa].x - a.x) / (b.x - a.x) + 0.5);
+				x = dPosA[doa].x;
+			}
+			if (outCodeOut == outCode1)
+			{
+				a.x = x;
+				a.y = y;
+				outCode1 = getOutCode(a);
+			}
+			else
+			{
+				b.x = x;
+				b.y = y;
+				outCode2 = getOutCode(b);
+			}
+		}
+	}
+	if (ok)
+	{
+		int xlen = b.x - a.x, axlen = abs(xlen);
+		int ylen = b.y - a.y, aylen = abs(ylen);
+		double xf = (double)xlen / (aylen ? aylen : 1);
+		double yf = (double)ylen / (axlen ? axlen : 1);
+		if (axlen > aylen)
+			xf = xf < 0 ? -1 : 1;
+		else
+			yf = yf < 0 ? -1 : 1;
+		double x = (double)a.x, y = (double)a.y;
+		if (alpha[alphaAnzahl])
+		{
+			unsigned char* cf = (unsigned char*)&fc;
+			cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+		}
+		int maxP = (int)(sqrt((float)(xlen * xlen + ylen * ylen)) + 0.5);
+		int count = 0;
+		int alpha = ((fc >> 24) & 0xFF);
+		int na = (0x100 - alpha);
+		int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
+		int i2 = (alpha * (fc & 0x00FF00)) >> 8;
+		while (!((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP)
+		{
+			++count;
+			int& pixel = this->fc[(int)(x + 0.5) + (int)(y + 0.5) * size.x];
+			pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
+			x += xf, y += yf;
+		}
+		rend = 1;
+	}
+}
+
+void Bild::fillCircle(int xOff, int yOff, int r, int fc) // zeichnet einen Kreis um Punkt( xOff, yOff ) mit radius r
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	for (int i = r; i > 0; i--)
+		drawKreis(xOff, yOff, i, fc);
+}
+
+void Bild::drawKreis(int xOff, int yOff, int r, int fc) // zeichnet einen Kreis um Punkt( xOff, yOff ) mit radius r
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawKreisAlpha(xOff, yOff, r, fc);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	xOff += drawOff[doa].x;
+	yOff += drawOff[doa].y;
+	if (xOff + r < dpx || xOff - r >= dgx || yOff + r < dpy || yOff - r >= dgy)
+		return;
+	for (int a = 0; a < r; ++a)
+	{
+		int b = (int)(sqrt((float)(long)(r * r - a * a)) + 0.5);
+		if (xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy)
+			this->fc[xOff + a + (yOff + b) * size.x] = fc;
+		if (xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy)
+			this->fc[xOff - a + (yOff + b) * size.x] = fc;
+		if (xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy)
+			this->fc[xOff + a + (yOff - b) * size.x] = fc;
+		if (xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy)
+			this->fc[xOff - a + (yOff - b) * size.x] = fc;
+		if (xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy)
+			this->fc[xOff + b + (yOff + a) * size.x] = fc;
+		if (xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy)
+			this->fc[xOff - b + (yOff + a) * size.x] = fc;
+		if (xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy)
+			this->fc[xOff + b + (yOff - a) * size.x] = fc;
+		if (xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy)
+			this->fc[xOff - b + (yOff - a) * size.x] = fc;
+	}
+	rend = 1;
+}
+
+void Bild::drawKreisAlpha(int xOff, int yOff, int r, int fc)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	xOff += drawOff[doa].x;
+	yOff += drawOff[doa].y;
+	if (xOff + r < dpx || xOff - r >= dgx || yOff + r < dpy || yOff - r >= dgy)
+		return;
+	if (alpha[alphaAnzahl] < 0xFF)
+	{
+		unsigned char* cf = (unsigned char*)&fc;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	int alpha = ((fc >> 24) & 0xFF);
+	int na = (0x100 - alpha);
+	int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
+	int i2 = (alpha * (fc & 0x00FF00)) >> 8;
+	for (int a = 0; a < r; ++a)
+	{
+		int b = (int)(sqrt((float)(long)(r * r - a * a)) + 0.5);
+		int* pixel = 0;
+		if (xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy)
+		{
+			pixel = &this->fc[xOff + a + (yOff + b) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy)
+		{
+			pixel = &this->fc[xOff - a + (yOff + b) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy)
+		{
+			pixel = &this->fc[xOff + a + (yOff - b) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy)
+		{
+			pixel = &this->fc[xOff - a + (yOff - b) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy)
+		{
+			pixel = &this->fc[xOff + b + (yOff + a) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy)
+		{
+			pixel = &this->fc[xOff - b + (yOff + a) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy)
+		{
+			pixel = &this->fc[xOff + b + (yOff - a) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+		if (xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy)
+		{
+			pixel = &this->fc[xOff - b + (yOff - a) * size.x];
+			*pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
+				((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
+				(*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawBild(int x, int y, int br, int hi, Bild& zBild) // zeichet zBild
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaBild(x, y, br, hi, zBild);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getBreite());
+	hi = minInt(hi, zBild.getHeight());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int xx, ygr, ygr2;
+	for (int yy = yst2; yy < dgy; ++yy)
+	{
+		ygr = yy * size.x;
+		ygr2 = (yy - yst2 + yst) * bb;
+		for (xx = xst2; xx < dgx; ++xx)
+			fc[xx + ygr] = ff[(xx - xst2 + xst) + ygr2];
+	}
+	rend = 1;
+}
+
+void Bild::alphaBildAssoz(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getBreite());
+	hi = minInt(hi, zBild.getHeight());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	if (!alpha[alphaAnzahl])
+	{
+		int xx, ygr, ygr2;
+		for (int yy = yst2; yy < dgy; ++yy)
+		{
+			ygr = yy * size.x;
+			ygr2 = (yy - yst2 + yst) * bb;
+			for (xx = xst2; xx < dgx; ++xx)
+				alphaPixelAssozP(fc[xx + ygr], ff[(xx - xst2 + xst) + ygr2]);
+		}
+	}
+	else
+	{
+		int xx, ygr, ygr2;
+		for (int yy = yst2; yy < dgy; ++yy)
+		{
+			ygr = yy * size.x;
+			ygr2 = (yy - yst2 + yst) * bb;
+			for (xx = xst2; xx < dgx; ++xx)
+			{
+				int fc = ff[(xx - xst2 + xst) + ygr2];
+				unsigned char* cf = (unsigned char*)&fc;
+				cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+				alphaPixelAssozP(this->fc[xx + ygr], fc);
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::alphaBild(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getBreite());
+	hi = minInt(hi, zBild.getHeight());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	if (!alpha[alphaAnzahl])
+	{
+		int xx, ygr, ygr2;
+		if (alpha3D)
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ygr2 = (yy - yst2 + yst) * bb;
+				int fci = xst2 + ygr;
+				int ffi = xst + ygr2;
+				for (xx = xst2; xx < dgx; ++xx, ++fci, ++ffi)
+					alphaPixelP3D(fc[fci], ff[ffi]);
+			}
+		}
+		else
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ygr2 = (yy - yst2 + yst) * bb;
+				int fci = xst2 + ygr;
+				int ffi = xst + ygr2;
+				for (xx = xst2; xx < dgx; ++xx, ++fci, ++ffi)
+					alphaPixelP(fc[fci], ff[ffi]);
+			}
+		}
+	}
+	else
+	{
+		int xx, ygr, ygr2;
+		if (alpha3D)
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ygr2 = (yy - yst2 + yst) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+				{
+					int fc = ff[(xx - xst2 + xst) + ygr2];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP(this->fc[xx + ygr], fc);
+				}
+			}
+		}
+		else
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ygr2 = (yy - yst2 + yst) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+				{
+					int fc = ff[(xx - xst2 + xst) + ygr2];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP3D(this->fc[xx + ygr], fc);
+				}
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawBild90(int x, int y, int br, int hi, Bild& zBild) // Zeichnet ein um 90 Grad nach rchts gedrehtes Bild
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaBild90(x, y, br, hi, zBild);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + hi < dpx || y + br < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getHeight());
+	hi = minInt(hi, zBild.getBreite());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int yy, xbb;
+	for (int xx = xst2; xx < dgx; ++xx)
+	{
+		xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
+		for (yy = yst2; yy < dgy; ++yy)
+			fc[xx + yy * size.x] = ff[(yy - yst2 + yst) + xbb];
+	}
+	rend = 1;
+}
+
+void Bild::alphaBild90(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + hi < dpx || y + br < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getHeight());
+	hi = minInt(hi, zBild.getBreite());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	if (!alpha[alphaAnzahl])
+	{
+		int yy, xbb;
+		if (alpha3D)
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+					alphaPixelP3D(xx, yy, ff[(yy - yst2 + yst) + xbb]);
+			}
+		}
+		else
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+					alphaPixelP(xx, yy, ff[(yy - yst2 + yst) + xbb]);
+			}
+		}
+	}
+	else
+	{
+		int yy, xbb;
+		if (alpha3D)
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+				{
+					int fc = ff[(yy - yst2 + yst) + xbb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP3D(xx, yy, fc);
+				}
+			}
+		}
+		else
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+				{
+					int fc = ff[(yy - yst2 + yst) + xbb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP(xx, yy, fc);
+				}
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawBild180(int x, int y, int br, int hi, Bild& zBild) // Zeichnet ein um 180 Grad nach rchts gedrehtes Bild
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaBild180(x, y, br, hi, zBild);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getBreite());
+	hi = minInt(hi, zBild.getHeight());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int xx, ygr, ybb;
+	for (int yy = yst2; yy < dgy; ++yy)
+	{
+		ygr = yy * size.x;
+		ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
+		for (xx = xst2; xx < dgx; ++xx)
+			fc[xx + ygr] = ff[(bb - (xx - xst2 + xst + 1)) + ybb];
+	}
+	rend = 1;
+}
+
+void Bild::alphaBild180(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getHeight());
+	hi = minInt(hi, zBild.getBreite());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	if (!alpha[alphaAnzahl])
+	{
+		int xx, ygr, ybb;
+		if (alpha3D)
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+					alphaPixelP3D(fc[xx + ygr], ff[(bb - (xx - xst2 + xst + 1)) + ybb]);
+			}
+		}
+		else
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+					alphaPixelP(fc[xx + ygr], ff[(bb - (xx - xst2 + xst + 1)) + ybb]);
+			}
+		}
+	}
+	else
+	{
+		int xx, ygr, ybb;
+		if (alpha3D)
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+				{
+					int fc = ff[(bb - (xx - xst2 + xst + 1)) + ybb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP3D(this->fc[xx + ygr], fc);
+				}
+			}
+		}
+		else
+		{
+			for (int yy = yst2; yy < dgy; ++yy)
+			{
+				ygr = yy * size.x;
+				ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
+				for (xx = xst2; xx < dgx; ++xx)
+				{
+					int fc = ff[(bb - (xx - xst2 + xst + 1)) + ybb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP(this->fc[xx + ygr], fc);
+				}
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawBild270(int x, int y, int br, int hi, Bild& zBild) // Zeichnet ein um 270 Grad nach rchts gedrehtes Bild
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaBild270(x, y, br, hi, zBild);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + hi < dpx || y + br < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getHeight());
+	hi = minInt(hi, zBild.getBreite());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int yy, xbb;
+	for (int xx = xst2; xx < dgx; ++xx)
+	{
+		xbb = (xx - xst2 + xst) * bb;
+		for (yy = yst2; yy < dgy; ++yy)
+			fc[xx + yy * size.x] = ff[(bb - (yy - yst2 + yst + 1)) + xbb];
+	}
+	rend = 1;
+}
+
+void Bild::alphaBild270(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + hi < dpx || y + br < dpy || x > dgx || y > dgy)
+		return;
+	br = minInt(br, zBild.getHeight());
+	hi = minInt(hi, zBild.getBreite());
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	if (!alpha[alphaAnzahl])
+	{
+		int yy, xbb;
+		if (alpha3D)
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (xx - xst2 + xst) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+					alphaPixelP3D(xx, yy, ff[(bb - (yy - yst2 + yst + 1)) + xbb]);
+			}
+		}
+		else
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (xx - xst2 + xst) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+					alphaPixelP(xx, yy, ff[(bb - (yy - yst2 + yst + 1)) + xbb]);
+			}
+		}
+	}
+	else
+	{
+		int yy, xbb;
+		if (alpha3D)
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (xx - xst2 + xst) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+				{
+					int fc = ff[(bb - (yy - yst2 + yst + 1)) + xbb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP3D(xx, yy, fc);
+				}
+			}
+		}
+		else
+		{
+			for (int xx = xst2; xx < dgx; ++xx)
+			{
+				xbb = (xx - xst2 + xst) * bb;
+				for (yy = yst2; yy < dgy; ++yy)
+				{
+					int fc = ff[(bb - (yy - yst2 + yst + 1)) + xbb];
+					unsigned char* cf = (unsigned char*)&fc;
+					cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+					alphaPixelP(xx, yy, fc);
+				}
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawBildSkall(int x, int y, int br, int hi, Bild& zBild) // zeichet zBild Skalliert
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		alphaBildSkall(x, y, br, hi, zBild);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	double xo = zBild.getBreite() / (double)br;
+	double yo = zBild.getHeight() / (double)hi;
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int xx, ygr, ygr2;
+	double xb = 0, yb = yst * yo;
+	for (int yy = yst2; yy < dgy; ++yy, yb += yo)
+	{
+		ygr = yy * size.x;
+		ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
+		for (xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo)
+			fc[xx + ygr] = ff[(int)xb + ygr2];
+	}
+	rend = 1;
+}
+
+void Bild::alphaBildSkall(int x, int y, int br, int hi, Bild& zBild)
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	x += drawOff[doa].x;
+	y += drawOff[doa].y;
+	if (x + br < dpx || y + hi < dpy || x > dgx || y > dgy)
+		return;
+	double xo = zBild.getBreite() / (double)br;
+	double yo = zBild.getHeight() / (double)hi;
+	int xst = maxInt(dpx - x, 0);
+	int yst = maxInt(dpy - y, 0);
+	int xst2 = maxInt(x, dpx);
+	int yst2 = maxInt(y, dpy);
+	dgx = minInt(x + br, dgx);
+	dgy = minInt(y + hi, dgy);
+	int bb = zBild.getBreite();
+	int* ff = zBild.getBuffer();
+	int xx, ygr, ygr2;
+	double xb = 0;
+	if (alpha3D)
+	{
+		for (int yy = yst2; yy < dgy; ++yy)
+		{
+			ygr = yy * size.x;
+			ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
+			for (xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo)
+			{
+				int f = ff[(int)xb + ygr2];
+				unsigned char* cf = (unsigned char*)&f;
+				cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+				alphaPixelP3D(fc[xx + ygr], f);
+			}
+		}
+	}
+	else
+	{
+		for (int yy = yst2; yy < dgy; ++yy)
+		{
+			ygr = yy * size.x;
+			ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
+			for (xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo)
+			{
+				int f = ff[(int)xb + ygr2];
+				unsigned char* cf = (unsigned char*)&f;
+				cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+				alphaPixelP(fc[xx + ygr], f);
+			}
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawDreieck(Punkt a, Punkt b, Punkt c, int farbe) // füllt eine Dreieck aus
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawDreieckAlpha(a, b, c, farbe);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	c += drawOff[doa];
+	if ((a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
+		(a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy))
+		return;
+	if (b.y < a.y)
+		a.Swap(b);
+	if (c.y < b.y)
+		b.Swap(c);
+	if (b.y < a.y)
+		a.Swap(b);
+	if (a.y == b.y)
+	{
+		if (b.x < a.x)
+			a.Swap(b);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
+		float b2 = (float)a.x - m2 * (float)a.y;
+		float b3 = (float)b.x - m3 * (float)b.y;
+		drawFlatDreieck(b.y, c.y, m2, b2, m3, b3, farbe);
+	}
+	else if (b.y == c.y)
+	{
+		if (c.x < b.x)
+			b.Swap(c);
+		const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		float b1 = (float)a.x - m1 * (float)a.y;
+		float b2 = (float)a.x - m2 * (float)a.y;
+		drawFlatDreieck(a.y, b.y, m1, b1, m2, b2, farbe);
+	}
+	else
+	{
+		const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
+		float b1 = (float)a.x - m1 * (float)a.y;
+		float b2 = (float)a.x - m2 * (float)a.y;
+		float b3 = (float)b.x - m3 * (float)b.y;
+		const float qx = m2 * (float)b.y + b2;
+		if (qx < (float)b.x)
+		{
+			drawFlatDreieck(a.y, b.y, m2, b2, m1, b1, farbe);
+			drawFlatDreieck(b.y, c.y, m2, b2, m3, b3, farbe);
+		}
+		else
+		{
+			drawFlatDreieck(a.y, b.y, m1, b1, m2, b2, farbe);
+			drawFlatDreieck(b.y, c.y, m3, b3, m2, b2, farbe);
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawDreieckTextur(Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur) // füllt eine Dreieck aus
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		drawDreieckTexturAlpha(a, b, c, ta, tb, tc, textur);
+		return;
+	}
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	c += drawOff[doa];
+	if ((a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
+		(a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy))
+		return;
+	if (b.y < a.y)
+	{
+		a.Swap(b);
+		ta.Swap(tb);
+	}
+	if (c.y < b.y)
+	{
+		b.Swap(c);
+		tb.Swap(tc);
+	}
+	if (b.y < a.y)
+	{
+		a.Swap(b);
+		ta.Swap(tb);
+	}
+	const double m1 = (double)(a.x - b.x) / (a.y - b.y);
+	const double m2 = (double)(a.x - c.x) / (a.y - c.y);
+	const double m3 = (double)(b.x - c.x) / (b.y - c.y);
+	double b1 = a.x - m1 * a.y;
+	double b2 = a.x - m2 * a.y;
+	double b3 = b.x - m3 * b.y;
+	const double qx = m2 * b.y + b2;
+	if (qx < b.x)
+	{
+		double tx1o, ty1o, tx2o, ty2o;
+		if (c.y - a.y)
+		{
+			tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
+			ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		if (b.y - a.y)
+		{
+			tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
+			ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		Vec2< double > q(ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y));
+		double txf, tyf;
+		if (b.x - qx)
+		{
+			txf = (tb.x - q.x) / (b.x - qx);
+			tyf = (tb.y - q.y) / (b.x - qx);
+		}
+		else
+		{
+			txf = 0;
+			tyf = 0;
+		}
+		drawFlatDreieckTextur(a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+		if (c.y - b.y)
+		{
+			tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
+			ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		drawFlatDreieckTextur(b.y, c.y, m2, b2, m3, b3, q.x, q.y, tb.x, tb.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+	}
+	else
+	{
+		double tx1o, ty1o, tx2o, ty2o;
+		if (b.y - a.y)
+		{
+			tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
+			ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		if (c.y - a.y)
+		{
+			tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
+			ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		Vec2< double > q(ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y));
+		double txf, tyf;
+		if (qx - b.x)
+		{
+			txf = (q.x - tb.x) / (qx - b.x);
+			tyf = (q.y - tb.y) / (qx - b.x);
+		}
+		else
+		{
+			txf = 0;
+			tyf = 0;
+		}
+		drawFlatDreieckTextur(a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+		if (c.y - b.y)
+		{
+			tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
+			ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		drawFlatDreieckTextur(b.y, c.y, m3, b3, m2, b2, tb.x, tb.y, q.x, q.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+	}
+	rend = 1;
+}
+
+void Bild::drawDreieckAlpha(Punkt a, Punkt b, Punkt c, int farbe) // füllt eine Dreieck aus
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	c += drawOff[doa];
+	if ((a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
+		(a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy))
+		return;
+	if (alpha[alphaAnzahl])
+	{
+		unsigned char* cf = (unsigned char*)&farbe;
+		cf[3] = (unsigned char)((cf[3] > alpha[alphaAnzahl]) * (cf[3] - alpha[alphaAnzahl]));
+	}
+	if (b.y < a.y)
+		a.Swap(b);
+	if (c.y < b.y)
+		b.Swap(c);
+	if (b.y < a.y)
+		a.Swap(b);
+	if (a.y == b.y)
+	{
+		if (b.x < a.x)
+			a.Swap(b);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
+		float b2 = (float)a.x - m2 * (float)a.y;
+		float b3 = (float)b.x - m3 * (float)b.y;
+		drawFlatDreieckAlpha(b.y, c.y, m2, b2, m3, b3, farbe);
+	}
+	else if (b.y == c.y)
+	{
+		if (c.x < b.x)
+			b.Swap(c);
+		const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		float b1 = (float)a.x - m1 * (float)a.y;
+		float b2 = (float)a.x - m2 * (float)a.y;
+		drawFlatDreieckAlpha(a.y, b.y, m1, b1, m2, b2, farbe);
+	}
+	else
+	{
+		const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
+		const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
+		const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
+		float b1 = (float)a.x - m1 * (float)a.y;
+		float b2 = (float)a.x - m2 * (float)a.y;
+		float b3 = (float)b.x - m3 * (float)b.y;
+		const float qx = m2 * (float)b.y + b2;
+		if (qx < (float)b.x)
+		{
+			drawFlatDreieckAlpha(a.y, b.y, m2, b2, m1, b1, farbe);
+			drawFlatDreieckAlpha(b.y, c.y, m2, b2, m3, b3, farbe);
+		}
+		else
+		{
+			drawFlatDreieckAlpha(a.y, b.y, m1, b1, m2, b2, farbe);
+			drawFlatDreieckAlpha(b.y, c.y, m3, b3, m2, b2, farbe);
+		}
+	}
+	rend = 1;
+}
+
+void Bild::drawDreieckTexturAlpha(Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur) // füllt eine Dreieck aus
+{
+	if (alpha[alphaAnzahl] == 0xFF)
+		return;
+	int dpx = dPosA[doa].x;
+	int dpy = dPosA[doa].y;
+	int dgx = dSizeA[doa].x;
+	int dgy = dSizeA[doa].y;
+	a += drawOff[doa];
+	b += drawOff[doa];
+	c += drawOff[doa];
+	if ((a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
+		(a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy))
+		return;
+	if (b.y < a.y)
+	{
+		a.Swap(b);
+		ta.Swap(tb);
+	}
+	if (c.y < b.y)
+	{
+		b.Swap(c);
+		tb.Swap(tc);
+	}
+	if (b.y < a.y)
+	{
+		a.Swap(b);
+		ta.Swap(tb);
+	}
+	const double m1 = (double)(a.x - b.x) / (a.y - b.y);
+	const double m2 = (double)(a.x - c.x) / (a.y - c.y);
+	const double m3 = (double)(b.x - c.x) / (b.y - c.y);
+	double b1 = a.x - m1 * a.y;
+	double b2 = a.x - m2 * a.y;
+	double b3 = b.x - m3 * b.y;
+	const double qx = m2 * b.y + b2;
+	if (qx < b.x)
+	{
+		double tx1o, ty1o, tx2o, ty2o;
+		if (c.y - a.y)
+		{
+			tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
+			ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		if (b.y - a.y)
+		{
+			tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
+			ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		Vec2< double > q(ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y));
+		double txf, tyf;
+		if (b.x - qx)
+		{
+			txf = (tb.x - q.x) / (b.x - qx);
+			tyf = (tb.y - q.y) / (b.x - qx);
+		}
+		else
+		{
+			txf = 0;
+			tyf = 0;
+		}
+		drawFlatDreieckTexturAlpha(a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+		if (c.y - b.y)
+		{
+			tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
+			ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		drawFlatDreieckTexturAlpha(b.y, c.y, m2, b2, m3, b3, q.x, q.y, tb.x, tb.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+	}
+	else
+	{
+		double tx1o, ty1o, tx2o, ty2o;
+		if (b.y - a.y)
+		{
+			tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
+			ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		if (c.y - a.y)
+		{
+			tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
+			ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
+		}
+		else
+		{
+			tx2o = 0;
+			ty2o = 0;
+		}
+		Vec2< double > q(ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y));
+		double txf, tyf;
+		if (qx - b.x)
+		{
+			txf = (q.x - tb.x) / (qx - b.x);
+			tyf = (q.y - tb.y) / (qx - b.x);
+		}
+		else
+		{
+			txf = 0;
+			tyf = 0;
+		}
+		drawFlatDreieckTexturAlpha(a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+		if (c.y - b.y)
+		{
+			tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
+			ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
+		}
+		else
+		{
+			tx1o = 0;
+			ty1o = 0;
+		}
+		drawFlatDreieckTexturAlpha(b.y, c.y, m3, b3, m2, b2, tb.x, tb.y, q.x, q.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur);
+	}
+	rend = 1;
+}
+
+void Bild::replaceColorWithAlpha(int color)
+{
+	int r = (color & 0xFF0000) >> 16;
+	int g = (color & 0xFF00) >> 8;
+	int b = color & 0xFF;
+	int dx = drawOff[doa].x, dy = drawOff[doa].y;
+	int xx = dPosA[doa].x, yy = dPosA[doa].y;
+	int bb = dSizeA[doa].x, hh = dSizeA[doa].y;
+	for (int y = dy + yy; y < hh; y++)
+	{
+		int ygr = y * size.x;
+		for (int x = dx + xx; x < bb; x++)
+		{
+			unsigned char* cf = (unsigned char*)&(fc[x + ygr]);
+			int abstand = (int)sqrt((float)((r - cf[2]) * (r - cf[2]) + (g - cf[1]) * (g - cf[1]) + (b - cf[0]) * (b - cf[0])));
+			if (abstand > 255)
+				abstand = 255;
+			cf[3] = (unsigned char)(abstand);
+		}
+	}
+}
+
+bool Bild::setDrawOptions(const Punkt& pos, const Punkt& gr) // setzt die Drawoptionen
+{
+	int dx = drawOff[doa].x, dy = drawOff[doa].y;
+	int xx = dPosA[doa].x, yy = dPosA[doa].y;
+	int bb = dSizeA[doa].x, hh = dSizeA[doa].y;
+	if (dx + pos.x + gr.x < 0 || dy + pos.y + gr.y < 0 || dx + pos.x >= size.x || dy + pos.y >= size.y)
+		return 0;
+	if (pos.x + gr.x + dx < xx || pos.y + gr.y + dy < yy || dx + pos.x >= bb || dy + pos.y >= hh)
+		return 0;
+	++doa;
+	assert(doa < 2000);
+	dPosA[doa].x = maxInt(pos.x + dx, xx);
+	dPosA[doa].y = maxInt(pos.y + dy, yy);
+	dSizeA[doa].x = minInt(pos.x + gr.x + dx, bb);
+	dSizeA[doa].y = minInt(pos.y + gr.y + dy, hh);
+	drawOff[doa].x = dx + pos.x;
+	drawOff[doa].y = dy + pos.y;
+	return 1;
+}
+
+bool Bild::setDrawOptions(int x, int y, int br, int hi)
+{
+	int dx = drawOff[doa].x, dy = drawOff[doa].y;
+	int xx = dPosA[doa].x, yy = dPosA[doa].y;
+	int bb = dSizeA[doa].x, hh = dSizeA[doa].y;
+	if (dx + x + br < 0 || dy + y + hi < 0 || dx + x >= size.x || dy + y >= size.y)
+		return 0;
+	if (x + br + dx < xx || y + hi + dy < yy || dx + x >= bb || dy + y >= hh)
+		return 0;
+	++doa;
+	assert(doa < 2000);
+	dPosA[doa].x = maxInt(x + dx, xx);
+	dPosA[doa].y = maxInt(y + dy, yy);
+	dSizeA[doa].x = minInt(x + br + dx, bb);
+	dSizeA[doa].y = minInt(y + hi + dy, hh);
+	drawOff[doa].x = dx + x;
+	drawOff[doa].y = dy + y;
+	return 1;
+}
+
+bool Bild::setDrawOptionsErzwingen(const Punkt& pos, const Punkt& gr) // setzt die Drawoptionen
+{
+	int dx = drawOff[doa].x, dy = drawOff[doa].y;
+	if (dx + pos.x + gr.x < 0 || dy + pos.y + gr.y < 0 || dx + pos.x >= size.x || dy + pos.y >= size.y)
+		return 0;
+	++doa;
+	assert(doa < 2000);
+	dPosA[doa].x = maxInt(pos.x + dx, 0);
+	dPosA[doa].y = maxInt(pos.y + dy, 0);
+	dSizeA[doa].x = minInt(pos.x + gr.x + dx, size.x);
+	dSizeA[doa].y = minInt(pos.y + gr.y + dy, size.y);
+	drawOff[doa].x = dx + pos.x;
+	drawOff[doa].y = dy + pos.y;
+	return 1;
+}
+
+bool Bild::setDrawOptionsErzwingen(int x, int y, int br, int hi) // setzt die Drawoptionen
+{
+	int dx = drawOff[doa].x, dy = drawOff[doa].y;
+	if (dx + x + br < 0 || dy + y + hi < 0 || dx + x >= size.x || dy + y >= size.y)
+		return 0;
+	++doa;
+	assert(doa < 2000);
+	dPosA[doa].x = maxInt(x + dx, 0);
+	dPosA[doa].y = maxInt(y + dy, 0);
+	dSizeA[doa].x = minInt(x + br + dx, size.x);
+	dSizeA[doa].y = minInt(y + hi + dy, size.y);
+	drawOff[doa].x = dx + x;
+	drawOff[doa].y = dy + y;
+	return 1;
 }
 
 void Bild::setDrawOptionsReset()
 {
-    ++doa;
-    dPosA[ doa ].x = 0;
-    dPosA[ doa ].y = 0;
-    dSizeA[ doa ].x = size.x;
-    dSizeA[ doa ].y = size.y;
-    drawOff[ doa ].x = 0;
-    drawOff[ doa ].y = 0;
+	++doa;
+	dPosA[doa].x = 0;
+	dPosA[doa].y = 0;
+	dSizeA[doa].x = size.x;
+	dSizeA[doa].y = size.y;
+	drawOff[doa].x = 0;
+	drawOff[doa].y = 0;
 }
 
-void Bild::addScrollOffset( int xOff, int yOff ) // setzt ScrollOffset
+void Bild::addScrollOffset(int xOff, int yOff) // setzt ScrollOffset
 {
-    drawOff[ doa ].x -= xOff;
-    drawOff[ doa ].y -= yOff;
+	drawOff[doa].x -= xOff;
+	drawOff[doa].y -= yOff;
 }
 
 void Bild::releaseDrawOptions() // setzt die Drawoptionen zurück
 {
-    --doa;
+	--doa;
 }
 
 bool Bild::getRend()
 {
-    bool ret = rend;
-    rend = 0;
-    return ret;
+	bool ret = rend;
+	rend = 0;
+	return ret;
 }
 
 // constant 
 int* Bild::getBuffer()const // gibt buffer zurück
 {
-    return fc;
+	return fc;
 }
 
-int Bild::getPixel( int x, int y ) const
+int Bild::getPixel(int x, int y) const
 {
-    if( x < 0 || y < 0 || x >= size.x || y >= size.y )
-        return 0;
-    return fc[ x + y * size.x ];
+	if (x < 0 || y < 0 || x >= size.x || y >= size.y)
+		return 0;
+	return fc[x + y * size.x];
 }
 
 const Punkt& Bild::getSize() const // gibt die Größe zurück
 {
-    return size;
+	return size;
 }
 
 int Bild::getBreite() const // gibt die Breite zurück
 {
-    return size.x;
+	return size.x;
 }
 
 int Bild::getHeight() const // gibt die Höhe zurück
 {
-    return size.y;
+	return size.y;
 }
 
 unsigned char Bild::getAlpha() const // gibt den Alpha wert zurück
 {
-    return (unsigned char)(255 - alpha[ alphaAnzahl ]);
+	return (unsigned char)(255 - alpha[alphaAnzahl]);
 }
 
 const Punkt& Bild::getDrawPos() const
 {
-    return dPosA[ doa ];
+	return dPosA[doa];
 }
 
 const Punkt& Bild::getDrawGr() const
 {
-    return dSizeA[ doa ];
+	return dSizeA[doa];
 }
 
 const Punkt& Bild::getDrawOff() const
 {
-    return drawOff[ doa ];
+	return drawOff[doa];
 }
 
 bool Bild::hasAlpha3D()
 {
-    return alpha3D;
+	return alpha3D;
 }
 
 
 // Inhalt der BildZ Klasse aus Bild.h
 // Konstruktor 
 BildZ::BildZ()
-    : ZeichnungHintergrund(),
-    bild( 0 )
+	: ZeichnungHintergrund(),
+	bild(0)
 {
-    style = Style::MELockZeichnung;
-    mak = _ret1ME;
+	style = Style::MELockZeichnung;
+	mak = _ret1ME;
 }
 
 // Destruktor 
 BildZ::~BildZ()
 {
-    if( bild )
-        bild->release();
+	if (bild)
+		bild->release();
 }
 
-void BildZ::doMausEreignis( MausEreignis& me, bool userRet ) // ruft Mak auf
+void BildZ::doMausEreignis(MausEreignis& me, bool userRet) // ruft Mak auf
 {
-    if( userRet )
-    {
-        int rbr = 0;
-        if( hatStyle( Style::Rahmen ) && rahmen )
-            rbr = rahmen->getRBreite();
-        bool vs = hatStyle( Style::VScroll ) && vertikalScrollBar;
-        bool hs = hatStyle( Style::HScroll ) && horizontalScrollBar;
-        if( vs )
-        {
-            if( hs )
-                horizontalScrollBar->doMausMessage( rbr, gr.y - rbr - 15, gr.x - rbr * 2 - 15, 15, me );
-            vertikalScrollBar->doMausMessage( gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me );
-        }
-        else if( hs )
-            horizontalScrollBar->doMausMessage( rbr, gr.y - rbr - 15, gr.x - rbr * 2, 15, me );
-    }
-    me.verarbeitet = userRet;
+	if (userRet)
+	{
+		int rbr = 0;
+		if (hatStyle(Style::Rahmen) && rahmen)
+			rbr = rahmen->getRBreite();
+		bool vs = hatStyle(Style::VScroll) && vertikalScrollBar;
+		bool hs = hatStyle(Style::HScroll) && horizontalScrollBar;
+		if (vs)
+		{
+			if (hs)
+				horizontalScrollBar->doMausMessage(rbr, gr.y - rbr - 15, gr.x - rbr * 2 - 15, 15, me);
+			vertikalScrollBar->doMausMessage(gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me);
+		}
+		else if (hs)
+			horizontalScrollBar->doMausMessage(rbr, gr.y - rbr - 15, gr.x - rbr * 2, 15, me);
+	}
+	me.verarbeitet = userRet;
 }
 
 // nicht constant 
-void BildZ::setBildZ( Bild* b ) // setzt das Bild
-{
-    if( bild )
-        bild->release();
-    bild = b;
-    if( !vertikalScrollBar )
-        vertikalScrollBar = new VScrollBar();
-    if( !horizontalScrollBar )
-        horizontalScrollBar = new HScrollBar();
-    if( b )
-    {
-        horizontalScrollBar->getScrollData()->max = b->getBreite();
-        vertikalScrollBar->getScrollData()->max = b->getHeight();
-    }
-    rend = 1;
-}
-
-void BildZ::setBild( Bild* b )
-{
-    if( !bild )
-        bild = new Bild();
-    bild->neuBild( b->getBreite(), b->getHeight(), 0 );
-    bild->drawBild( 0, 0, b->getBreite(), b->getHeight(), *b );
-    if( !vertikalScrollBar )
-        vertikalScrollBar = new VScrollBar();
-    if( !horizontalScrollBar )
-        horizontalScrollBar = new HScrollBar();
-    horizontalScrollBar->getScrollData()->max = b->getBreite();
-    vertikalScrollBar->getScrollData()->max = b->getHeight();
-    b->release();
-    rend = 1;
-}
-
-bool BildZ::tick( double tickVal ) // tick
-{
-    return ZeichnungHintergrund::tick( tickVal );
-}
-
-void BildZ::render( Bild& zRObj ) // zeichnet nach zRObj
-{
-    if( hatStyle( Style::Sichtbar ) )
-    {
-        ZeichnungHintergrund::render( zRObj );
-        lockZeichnung();
-        if( !zRObj.setDrawOptions( innenPosition, innenSize ) )
-        {
-            unlockZeichnung();
-            return;
-        }
-        if( bild )
-        {
-            int x = 0;
-            int y = 0;
-            int br = innenSize.x;
-            int hi = innenSize.y;
-            if( !(vertikalScrollBar && hatStyle( Style::VScroll )) && !(horizontalScrollBar && hatStyle( Style::HScroll )) )
-            {
-                if( hatStyle( Style::Alpha ) )
-                {
-                    if( hatStyle( Style::Skalliert ) )
-                        zRObj.alphaBildSkall( x, y, br, hi, *bild );
-                    else
-                        zRObj.alphaBild( x, y, br, hi, *bild );
-                }
-                else
-                {
-                    if( hatStyle( Style::Skalliert ) )
-                        zRObj.drawBildSkall( x, y, br, hi, *bild );
-                    else
-                        zRObj.drawBild( x, y, br, hi, *bild );
-                }
-            }
-            else
-            {
-                if( !zRObj.setDrawOptions( x, y, br, hi ) )
-                {
-                    zRObj.releaseDrawOptions();
-                    unlockZeichnung();
-                    return;
-                }
-                if( hatStyle( Style::Alpha ) )
-                    zRObj.alphaBild( -horizontalScrollBar->getScroll(), -vertikalScrollBar->getScroll(), bild->getBreite(), bild->getHeight(), *bild );
-                else
-                    zRObj.drawBild( -horizontalScrollBar->getScroll(), -vertikalScrollBar->getScroll(), bild->getBreite(), bild->getHeight(), *bild );
-                zRObj.releaseDrawOptions();
-            }
-        }
-        zRObj.releaseDrawOptions();
-        unlockZeichnung();
-    }
+void BildZ::setBildZ(Bild* b) // setzt das Bild
+{
+	if (bild)
+		bild->release();
+	bild = b;
+	if (!vertikalScrollBar)
+		vertikalScrollBar = new VScrollBar();
+	if (!horizontalScrollBar)
+		horizontalScrollBar = new HScrollBar();
+	if (b)
+	{
+		horizontalScrollBar->getScrollData()->max = b->getBreite();
+		vertikalScrollBar->getScrollData()->max = b->getHeight();
+	}
+	rend = 1;
+}
+
+void BildZ::setBild(Bild* b)
+{
+	if (!bild)
+		bild = new Bild();
+	bild->neuBild(b->getBreite(), b->getHeight(), 0);
+	bild->drawBild(0, 0, b->getBreite(), b->getHeight(), *b);
+	if (!vertikalScrollBar)
+		vertikalScrollBar = new VScrollBar();
+	if (!horizontalScrollBar)
+		horizontalScrollBar = new HScrollBar();
+	horizontalScrollBar->getScrollData()->max = b->getBreite();
+	vertikalScrollBar->getScrollData()->max = b->getHeight();
+	b->release();
+	rend = 1;
+}
+
+bool BildZ::tick(double tickVal) // tick
+{
+	return ZeichnungHintergrund::tick(tickVal);
+}
+
+void BildZ::render(Bild& zRObj) // zeichnet nach zRObj
+{
+	if (hatStyle(Style::Sichtbar))
+	{
+		ZeichnungHintergrund::render(zRObj);
+		lockZeichnung();
+		if (!zRObj.setDrawOptions(innenPosition, innenSize))
+		{
+			unlockZeichnung();
+			return;
+		}
+		if (bild)
+		{
+			int x = 0;
+			int y = 0;
+			int br = innenSize.x;
+			int hi = innenSize.y;
+			if (!(vertikalScrollBar && hatStyle(Style::VScroll)) && !(horizontalScrollBar && hatStyle(Style::HScroll)))
+			{
+				if (hatStyle(Style::Alpha))
+				{
+					if (hatStyle(Style::Skalliert))
+						zRObj.alphaBildSkall(x, y, br, hi, *bild);
+					else
+						zRObj.alphaBild(x, y, br, hi, *bild);
+				}
+				else
+				{
+					if (hatStyle(Style::Skalliert))
+						zRObj.drawBildSkall(x, y, br, hi, *bild);
+					else
+						zRObj.drawBild(x, y, br, hi, *bild);
+				}
+			}
+			else
+			{
+				if (!zRObj.setDrawOptions(x, y, br, hi))
+				{
+					zRObj.releaseDrawOptions();
+					unlockZeichnung();
+					return;
+				}
+				if (hatStyle(Style::Alpha))
+					zRObj.alphaBild(-horizontalScrollBar->getScroll(), -vertikalScrollBar->getScroll(), bild->getBreite(), bild->getHeight(), *bild);
+				else
+					zRObj.drawBild(-horizontalScrollBar->getScroll(), -vertikalScrollBar->getScroll(), bild->getBreite(), bild->getHeight(), *bild);
+				zRObj.releaseDrawOptions();
+			}
+		}
+		zRObj.releaseDrawOptions();
+		unlockZeichnung();
+	}
 }
 
 // constant 
 Bild* BildZ::getBild() const // gibt das Bild zurück
 {
-    if( bild )
-        return dynamic_cast<Bild*>(bild->getThis());
-    return 0;
+	if (bild)
+		return dynamic_cast<Bild*>(bild->getThis());
+	return 0;
 }
 
 Bild* BildZ::zBild() const
 {
-    return bild;
+	return bild;
 }
 
 Zeichnung* BildZ::dublizieren() const // erstellt eine Kopie des Zeichnungs
 {
-    BildZ* obj = new BildZ();
-    obj->setPosition( pos );
-    obj->setSize( gr );
-    obj->setMausEreignisParameter( makParam );
-    obj->setTastaturEreignisParameter( takParam );
-    obj->setMausEreignis( mak );
-    obj->setTastaturEreignis( tak );
-    if( toolTip )
-        obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
-    obj->setStyle( style );
-    obj->setHintergrundFarbe( hintergrundFarbe );
-    if( hintergrundFeld )
-        obj->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
-    if( rahmen )
-        obj->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
-    if( hintergrundBild )
-        obj->setHintergrundBild( dynamic_cast<Bild*>(hintergrundBild->getThis()) );
-    if( bild )
-        obj->setBild( dynamic_cast<Bild*>(bild->getThis()) );
-    obj->setStyle( style );
-    return obj;
+	BildZ* obj = new BildZ();
+	obj->setPosition(pos);
+	obj->setSize(gr);
+	obj->setMausEreignisParameter(makParam);
+	obj->setTastaturEreignisParameter(takParam);
+	obj->setMausEreignis(mak);
+	obj->setTastaturEreignis(tak);
+	if (toolTip)
+		obj->setToolTipZ((ToolTip*)toolTip->dublizieren());
+	obj->setStyle(style);
+	obj->setHintergrundFarbe(hintergrundFarbe);
+	if (hintergrundFeld)
+		obj->setAlphaFeldZ((AlphaFeld*)hintergrundFeld->dublizieren());
+	if (rahmen)
+		obj->setRahmenZ((Rahmen*)rahmen->dublizieren());
+	if (hintergrundBild)
+		obj->setHintergrundBild(dynamic_cast<Bild*>(hintergrundBild->getThis()));
+	if (bild)
+		obj->setBild(dynamic_cast<Bild*>(bild->getThis()));
+	obj->setStyle(style);
+	return obj;
 }
 
 #ifdef WIN32
-Bild* Framework::ladeBild( char* pfad, Text* zError )
-{
-    Text p = pfad;
-    Text* txt = p.getTeilText( p.positionVon( '.', p.anzahlVon( '.' ) - 1 ) );
-    if( !(txt->istGleich( ".bmp" ) || txt->istGleich( ".jpg" ) || txt->istGleich( ".gif" ) || txt->istGleich( ".png" )) )
-    {
-        zError->setText( "Die Angegebene Datei ist keine gueltige Bilddatei!" );
-        txt->release();
-        return 0;
-    }
-    txt->release();
-    wchar_t* name = new wchar_t[ p.getLength() + 1 ];
-    for( int i = 0; i < p.getLength(); i++ )
-        name[ i ] = (wchar_t)p.getText()[ i ];
-    name[ p.getLength() ] = '\0';
-
-    Gdiplus::Bitmap bitmap( name );
-    Gdiplus::Color pix;
-    delete[]name;
-
-    Bild* ret = new Bild();
-    ret->neuBild( bitmap.GetWidth(), bitmap.GetHeight(), 0 );
-    int* buff = ret->getBuffer();
-    for( unsigned int i = 0; i < bitmap.GetWidth() * bitmap.GetHeight(); i++ )
-    {
-        bitmap.GetPixel( i % bitmap.GetWidth(), i / bitmap.GetWidth(), &pix );
-        buff[ i ] = pix.GetValue();
-    }
-    return ret;
+Bild* Framework::ladeBild(const char* pfad, Text* zError)
+{
+	Text p = pfad;
+	Text* txt = p.getTeilText(p.positionVon('.', p.anzahlVon('.') - 1));
+	if (!(txt->istGleich(".bmp") || txt->istGleich(".jpg") || txt->istGleich(".gif") || txt->istGleich(".png")))
+	{
+		zError->setText("Die Angegebene Datei ist keine gueltige Bilddatei!");
+		txt->release();
+		return 0;
+	}
+	txt->release();
+	wchar_t* name = new wchar_t[p.getLength() + 1];
+	for (int i = 0; i < p.getLength(); i++)
+		name[i] = (wchar_t)p.getText()[i];
+	name[p.getLength()] = '\0';
+
+	Gdiplus::Bitmap bitmap(name);
+	Gdiplus::Color pix;
+	delete[]name;
+
+	Bild* ret = new Bild();
+	ret->neuBild(bitmap.GetWidth(), bitmap.GetHeight(), 0);
+	int* buff = ret->getBuffer();
+	for (unsigned int i = 0; i < bitmap.GetWidth() * bitmap.GetHeight(); i++)
+	{
+		bitmap.GetPixel(i % bitmap.GetWidth(), i / bitmap.GetWidth(), &pix);
+		buff[i] = pix.GetValue();
+	}
+	return ret;
 }
 
 #endif

+ 1 - 1
Bild.h

@@ -416,7 +416,7 @@ namespace Framework
 	//! \param pfad Der Pfad zur Bilddatei
 	//! \param zError Ein Zeiger auf ein Text Objekt, in dem ein möglicher Fehler zurückgegeben wird
 	//! \return Das geladene Bild
-	DLLEXPORT Bild* ladeBild(char* pfad, Text* zError);
+	DLLEXPORT Bild* ladeBild(const char* pfad, Text* zError);
 #endif
 }
 #endif

+ 63 - 63
DLLRegister.cpp

@@ -5,84 +5,84 @@ using namespace Framework;
 // Inhalt der DLLDateien Klasse aus DLLDateien.h
 // Konstruktor
 DLLRegister::DLLRegister()
-    : ReferenceCounter()
+	: ReferenceCounter()
 {
-    dlls = new Array< DLLDatei * >();
+	dlls = new Array< DLLDatei* >();
 }
 
 // Destruktor
 DLLRegister::~DLLRegister()
 {
-    cs.lock();
-    int anz = dlls->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        DLLDatei *tmp = dlls->get( i );
-        if( tmp )
-        {
-            tmp->name->release();
+	cs.lock();
+	int anz = dlls->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		DLLDatei* tmp = dlls->get(i);
+		if (tmp)
+		{
+			tmp->name->release();
 #ifndef _DEBUG
-            FreeLibrary( tmp->handle );
+			FreeLibrary(tmp->handle);
 #endif
-        }
-        delete tmp;
-    }
-    dlls->release();
-    cs.unlock();
+		}
+		delete tmp;
+	}
+	dlls->release();
+	cs.unlock();
 }
 
 // nicht constant
-HINSTANCE DLLRegister::ladeDLL( char *name, char *pfad )
+HINSTANCE DLLRegister::ladeDLL(const char* name, const char* pfad)
 {
-    cs.lock();
-    int anz = dlls->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        DLLDatei *tmp = dlls->get( i );
-        if( tmp &&tmp->name->istGleich( name ) )
-        {
-            tmp->ref++;
-            cs.unlock();
-            return tmp->handle;
-        }
-    }
-    HINSTANCE h = LoadLibrary( pfad );
-    if( !h )
-    {
-        cs.unlock();
-        return 0;
-    }
-    DLLDatei *dll = new DLLDatei();
-    dll->name = new Text( name );
-    dll->handle = h;
-    dll->ref = 1;
-    dlls->add( dll );
-    cs.unlock();
-    return h;
+	cs.lock();
+	int anz = dlls->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		DLLDatei* tmp = dlls->get(i);
+		if (tmp && tmp->name->istGleich(name))
+		{
+			tmp->ref++;
+			cs.unlock();
+			return tmp->handle;
+		}
+	}
+	HINSTANCE h = LoadLibrary(pfad);
+	if (!h)
+	{
+		cs.unlock();
+		return 0;
+	}
+	DLLDatei* dll = new DLLDatei();
+	dll->name = new Text(name);
+	dll->handle = h;
+	dll->ref = 1;
+	dlls->add(dll);
+	cs.unlock();
+	return h;
 }
 
-void DLLRegister::releaseDLL( char *name )
+void DLLRegister::releaseDLL(const char* name)
 {
-    cs.lock();
-    int anz = dlls->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        DLLDatei *tmp = dlls->get( i );
-        if( tmp &&tmp->name->istGleich( name ) )
-        {
-            tmp->ref--;
-            if( !tmp->ref )
-            {
-                tmp->name->release();
+	cs.lock();
+	int anz = dlls->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		DLLDatei* tmp = dlls->get(i);
+		if (tmp && tmp->name->istGleich(name))
+		{
+			tmp->ref--;
+			if (!tmp->ref)
+			{
+				tmp->name->release();
 #ifndef _DEBUG
-                FreeLibrary( tmp->handle );
+				FreeLibrary(tmp->handle);
 #endif
-                delete tmp;
-                dlls->remove( i );
-            }
-            cs.unlock();
-            return;
-        }
-    }
-    cs.unlock();
+				delete tmp;
+				dlls->remove(i);
+			}
+			cs.unlock();
+			return;
+		}
+	}
+	cs.unlock();
 }

+ 20 - 20
DLLRegister.h

@@ -6,26 +6,26 @@
 
 namespace Framework
 {
-    struct DLLDatei
-    {
-        Text *name;
-        HINSTANCE handle;
-        int ref;
-    };
+	struct DLLDatei
+	{
+		Text* name;
+		HINSTANCE handle;
+		int ref;
+	};
 
-    class DLLRegister : public virtual ReferenceCounter
-    {
-    private:
-        Array< DLLDatei * > *dlls;
-        Critical cs;
+	class DLLRegister : public virtual ReferenceCounter
+	{
+	private:
+		Array< DLLDatei* >* dlls;
+		Critical cs;
 
-    public:
-        //! Konstruktor
-        __declspec(dllexport) DLLRegister();
-        //! Destruktor
-        DLLEXPORT ~DLLRegister();
-        //! nicht constant       
-        DLLEXPORT HINSTANCE ladeDLL( char *name, char *pfad );
-        DLLEXPORT void releaseDLL( char *name );
-    };
+	public:
+		//! Konstruktor
+		__declspec(dllexport) DLLRegister();
+		//! Destruktor
+		DLLEXPORT ~DLLRegister();
+		//! nicht constant       
+		DLLEXPORT HINSTANCE ladeDLL(const char* name, const char* pfad);
+		DLLEXPORT void releaseDLL(const char* name);
+	};
 }

+ 1 - 1
DX12GraphicsApi.cpp

@@ -164,8 +164,8 @@ void DirectX12::initialize(WFenster* fenster, Vec2<int> backBufferSize, bool ful
 	PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE d3d12svrsf = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)GetProcAddress(d3d12DLL, "D3D12SerializeVersionedRootSignature");
 	PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d12srsf = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)GetProcAddress(d3d12DLL, "D3D12SerializeRootSignature");
 	bool debugDXGI = 0;
-	IDXGIInfoQueue* dxgiInfoQueue;
 #ifdef _DEBUG
+	IDXGIInfoQueue* dxgiInfoQueue;
 	if (debugDX)
 	{
 		D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress(d3d12DLL, "D3D12GetDebugInterface");

+ 109 - 109
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67, 225,  75, 
-    166,  23, 193, 147, 228, 146, 
-     54, 211, 219, 115,  52, 194, 
-    243, 246,   1,   0,   0,   0, 
+     68,  88,  66,  67,  48,  75, 
+    224, 254, 173, 127, 201,  68, 
+     97, 127,  71,  45, 185, 233, 
+    103,  92,   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, 247,  68, 143,  98, 
-      1,   0,   0,   0,  46, 129, 
-    147, 118,  13,  48,  79,  72, 
-    151,  14,  94, 220, 155, 116, 
-     35,  50,   0,   0,   0,   0, 
+     49,   1, 103,   3, 161,  98, 
+      1,   0,   0,   0,  62,  66, 
+    198,  70,  86,  86,  71,  69, 
+    160,  94, 121, 137,  32, 170, 
+     84,  95,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -938,14 +938,14 @@ 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, 115, 135, 
-      3,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0, 253, 203, 
-      2,   0, 193,  33,   3,   0, 
+    236, 179,   1,   0, 151, 219, 
+      1,   0, 125,  10,   2,   0, 
+    125, 181,   2,   0, 221, 119, 
+      0,   0, 193,  33,   3,   0, 
      65, 185,   2,   0, 140, 239, 
       1,   0, 246,  49,   0,   0, 
-    213, 255,   0,   0,  46, 248, 
-      2,   0, 202, 179,   0,   0, 
+    213, 255,   0,   0, 115, 108, 
+      0,   0, 202, 179,   0,   0, 
       0,  16,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -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, 
-     40,  71,  44,   2, 225, 112, 
+     23,   5,  71, 131, 116, 123, 
     216,   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, 121,   0,   0, 
+      3,   2, 240,   2,   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, 121,   0,   0, 242, 241, 
+    240,   2,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -2382,7 +2382,7 @@ const BYTE DX12PixelShaderBytes[] =
      24,  21,  15,  16,   0,   0, 
       1,   0,   1,   0,  14,   0, 
      23,  21,  16,  16,   0,   0, 
-     36,   2,   0, 128,   0,   0, 
+     36,   2,   0,   0,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      11, 202,  49,   1,  56,   0, 
       0,   0,   0,  16,   0,   0, 
@@ -3408,49 +3408,66 @@ 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, 247,  68, 
-    143,  98,   1,   0,   0,   0, 
-     46, 129, 147, 118,  13,  48, 
-     79,  72, 151,  14,  94, 220, 
-    155, 116,  35,  50, 128,   0, 
-      0,   0,  47,  76, 105, 110, 
-    107,  73, 110, 102, 111,   0, 
-     47, 110,  97, 109, 101, 115, 
-      0,  47, 115, 114,  99,  47, 
-    104, 101,  97, 100, 101, 114, 
-     98, 108, 111,  99, 107,   0, 
-     47, 115, 114,  99,  47, 102, 
-    105, 108, 101, 115,  47,  99, 
-     58,  92, 117, 115, 101, 114, 
-    115,  92, 107, 111, 108, 106, 
-     97,  92, 100, 101, 115, 107, 
-    116, 111, 112,  92, 107, 111, 
-    108, 106,  97,  45, 115, 116, 
-    114, 111, 104, 109,  45, 103, 
-     97, 109, 101, 115,  92,  97, 
-    108, 108, 103, 101, 109, 101, 
-    105, 110,  92, 102, 114,  97, 
-    109, 101, 119, 111, 114, 107, 
-     92, 100, 120,  49,  50, 112, 
-    105, 120, 101, 108, 115, 104, 
-     97, 100, 101, 114,  46, 104, 
-    108, 115, 108,   0,   4,   0, 
-      0,   0,   6,   0,   0,   0, 
-      1,   0,   0,   0,  27,   0, 
+    255, 255, 255, 255, 119,   9, 
+     49,   1,   1,   0,   0,   0, 
+     13,   0,   0, 142,  14,   0, 
+     63,  92,  15,   0,   0,   0, 
+     76,   0,   0,   0,  32,   0, 
+      0,   0,  44,   0,   0,   0, 
+     96,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-     34,   0,   0,   0,   8,   0, 
-      0,   0,  17,   0,   0,   0, 
-      7,   0,   0,   0,  10,   0, 
-      0,   0,   6,   0,   0,   0, 
-      0,   0,   0,   0,   5,   0, 
+     22,   0,   0,   0,  25,   0, 
       0,   0,   0,   0,   0,   0, 
-    220,  81,  51,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   0,   0,   0,  28,   2, 
+      0,   0,  32,   0,   0,  96, 
+      0,   0,  84,  95,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      2,   0,   9,   0, 220,   4, 
       0,   0,   0,   0,   0,   0, 
+    156,   1,   0,   0,   1,   0, 
+      0,   0, 224, 232,  54,   3, 
       0,   0,   0,   0,   0,   0, 
+      0,   0, 109,  97, 105, 110, 
+      0, 110, 111, 110, 101,   0, 
+      0,   0,  45, 186,  46, 241, 
+      1,   0,   0,   0,   0,   0, 
+      0,   0,  28,   2,   0,   0, 
+     32,   0,   0,  96,   0,   0, 
+     84,  95,   0,   0,   0,   0, 
+      0,   0,   0,   0,   2,   0, 
+      2,   0,   7,   0,   0,   0, 
+      0,   0,   1,   0, 255, 255, 
+    255, 255,   0,   0,   0,   0, 
+     28,   2,   0,   0,   8,   2, 
       0,   0,   0,   0,   0,   0, 
+    255, 255, 255, 255,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+      1,   0,   1,   0,   0,   0, 
+      1,   0,   0,   0,   0,   0, 
+     67,  58,  92,  85, 115, 101, 
+    114, 115,  92, 107, 111, 108, 
+    106,  97,  92,  68, 101, 115, 
+    107, 116, 111, 112,  92,  75, 
+    111, 108, 106,  97,  45,  83, 
+    116, 114, 111, 104, 109,  45, 
+     71,  97, 109, 101, 115,  92, 
+     65, 108, 108, 103, 101, 109, 
+    101, 105, 110,  92,  70, 114, 
+     97, 109, 101, 119, 111, 114, 
+    107,  92,  68,  88,  49,  50, 
+     80, 105, 120, 101, 108,  83, 
+    104,  97, 100, 101, 114,  46, 
+    104, 108, 115, 108,   0,   0, 
+    254, 239, 254, 239,   1,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   1,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0, 255, 255, 255, 255, 255, 
+    255, 255, 255, 255, 255,  12, 
+      0, 255, 255, 255, 255, 255, 
+    255, 255, 255, 255, 255,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3476,7 +3493,43 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0, 148,  46,  49,   1, 
+    103,   3, 161,  98,   1,   0, 
+      0,   0,  62,  66, 198,  70, 
+     86,  86,  71,  69, 160,  94, 
+    121, 137,  32, 170,  84,  95, 
+    128,   0,   0,   0,  47,  76, 
+    105, 110, 107,  73, 110, 102, 
+    111,   0,  47, 110,  97, 109, 
+    101, 115,   0,  47, 115, 114, 
+     99,  47, 104, 101,  97, 100, 
+    101, 114,  98, 108, 111,  99, 
+    107,   0,  47, 115, 114,  99, 
+     47, 102, 105, 108, 101, 115, 
+     47,  99,  58,  92, 117, 115, 
+    101, 114, 115,  92, 107, 111, 
+    108, 106,  97,  92, 100, 101, 
+    115, 107, 116, 111, 112,  92, 
+    107, 111, 108, 106,  97,  45, 
+    115, 116, 114, 111, 104, 109, 
+     45, 103,  97, 109, 101, 115, 
+     92,  97, 108, 108, 103, 101, 
+    109, 101, 105, 110,  92, 102, 
+    114,  97, 109, 101, 119, 111, 
+    114, 107,  92, 100, 120,  49, 
+     50, 112, 105, 120, 101, 108, 
+    115, 104,  97, 100, 101, 114, 
+     46, 104, 108, 115, 108,   0, 
+      4,   0,   0,   0,   6,   0, 
+      0,   0,   1,   0,   0,   0, 
+     27,   0,   0,   0,   0,   0, 
+      0,   0,  34,   0,   0,   0, 
+      8,   0,   0,   0,  17,   0, 
+      0,   0,   7,   0,   0,   0, 
+     10,   0,   0,   0,   6,   0, 
       0,   0,   0,   0,   0,   0, 
+      5,   0,   0,   0,   0,   0, 
+      0,   0, 220,  81,  51,   1, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3493,67 +3546,14 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-    119,   9,  49,   1,   1,   0, 
-      0,   0,  13,   0,   0, 142, 
-     14,   0,  63,  92,  15,   0, 
-      0,   0,  76,   0,   0,   0, 
-     32,   0,   0,   0,  44,   0, 
-      0,   0,  96,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,  22,   0,   0,   0, 
-     25,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
-     28,   2,   0,   0,  32,   0, 
-      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   9,   0, 
-    220,   4,   0,   0,   0,   0, 
-      0,   0, 156,   1,   0,   0, 
-      1,   0, 234,  26,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  97, 
-    105, 110,   0, 110, 111, 110, 
-    101,   0,   0,   0,  45, 186, 
-     46, 241,   1,   0,   0,   0, 
-      0,   0,   0,   0,  28,   2, 
-      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      2,   0,   2,   0,   7,   0, 
-      0,   0,   0,   0,   1,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,  28,   2,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   1,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,  67,  58,  92,  85, 
-    115, 101, 114, 115,  92, 107, 
-    111, 108, 106,  97,  92,  68, 
-    101, 115, 107, 116, 111, 112, 
-     92,  75, 111, 108, 106,  97, 
-     45,  83, 116, 114, 111, 104, 
-    109,  45,  71,  97, 109, 101, 
-    115,  92,  65, 108, 108, 103, 
-    101, 109, 101, 105, 110,  92, 
-     70, 114,  97, 109, 101, 119, 
-    111, 114, 107,  92,  68,  88, 
-     49,  50,  80, 105, 120, 101, 
-    108,  83, 104,  97, 100, 101, 
-    114,  46, 104, 108, 115, 108, 
-      0,   0, 254, 239, 254, 239, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   0,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,  12,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3590,9 +3590,9 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,  40,   0,   0,   0, 
      68,   2,   0,   0,  44,   0, 
       0,   0, 136,   0,   0,   0, 
-      3,   0,   0,   0,  36,   0, 
+      3,   0,   0,   0,  37,   0, 
       0,   0,  23,   0,   0,   0, 
-     22,   0,   0,   0,  37,   0, 
+     22,   0,   0,   0,  36,   0, 
       0,   0,  24,   0,   0,   0, 
      16,   0,   0,   0,   6,   0, 
       0,   0,  25,   0,   0,   0, 

+ 108 - 108
DX12VertexShader.h

@@ -131,10 +131,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67,  89, 149, 
-    195,  24, 149,  28,  51, 159, 
-     13,  45, 152, 157, 191,  79, 
-    104,  54,   1,   0,   0,   0, 
+     68,  88,  66,  67, 136, 189, 
+    241,  51,  13, 158, 242, 132, 
+     26, 211, 159,   0, 224, 137, 
+     67,   3,   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, 247,  68, 
-    143,  98,   1,   0,   0,   0, 
-    207,  28,  70, 239, 143,  70, 
-     25,  71, 152,  27,  36,  51, 
-    131, 169, 202, 217,   0,   0, 
+    148,  46,  49,   1, 104,   3, 
+    161,  98,   1,   0,   0,   0, 
+    158, 160,  68,  15,  70, 106, 
+     79,  71, 165, 169,  85, 150, 
+    236,  11,  71,  40,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1103,11 +1103,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0, 103, 159,   1,   0, 
     179, 120,   1,   0, 238,  97, 
       2,   0,  90,  28,   0,   0, 
-    234, 180,   2,   0,  53, 174, 
+     22, 120,   2,   0,  53, 174, 
       3,   0, 206,  21,   0,   0, 
     193, 205,   3,   0, 207, 193, 
       1,   0,  62,   3,   3,   0, 
-    223,  60,   0,   0, 118, 199, 
+    134, 200,   2,   0, 118, 199, 
       0,   0,   0,  16,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   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, 
-    122,  54,  95,   2, 225, 112, 
+     36, 150, 151, 131, 116, 123, 
     216,   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,  48,  86,   0,   0, 
+     36,   2, 176,  80,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      14,  16,   0,   0,   1,   0, 
       0,   2,  18,   0,  22,  21, 
@@ -2146,7 +2146,7 @@ const BYTE DX12VertexShaderBytes[] =
      18,  16,   0,   0,   1,   0, 
       1,   0,  14,   0,  23,  21, 
      19,  16,   0,   0,  36,   2, 
-      0, 128,   0,   0, 242, 241, 
+      0,   0,   0,   0, 242, 241, 
      10,   0,  24,  21,  20,  16, 
       0,   0,   1,   0,   0,   2, 
       0,   0,   0,   0,   0,   0, 
@@ -3056,52 +3056,67 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0, 148,  46,  49,   1, 
-    247,  68, 143,  98,   1,   0, 
-      0,   0, 207,  28,  70, 239, 
-    143,  70,  25,  71, 152,  27, 
-     36,  51, 131, 169, 202, 217, 
-    129,   0,   0,   0,  47,  76, 
-    105, 110, 107,  73, 110, 102, 
-    111,   0,  47, 110,  97, 109, 
-    101, 115,   0,  47, 115, 114, 
-     99,  47, 104, 101,  97, 100, 
-    101, 114,  98, 108, 111,  99, 
-    107,   0,  47, 115, 114,  99, 
-     47, 102, 105, 108, 101, 115, 
-     47,  99,  58,  92, 117, 115, 
-    101, 114, 115,  92, 107, 111, 
-    108, 106,  97,  92, 100, 101, 
-    115, 107, 116, 111, 112,  92, 
-    107, 111, 108, 106,  97,  45, 
-    115, 116, 114, 111, 104, 109, 
-     45, 103,  97, 109, 101, 115, 
-     92,  97, 108, 108, 103, 101, 
-    109, 101, 105, 110,  92, 102, 
-    114,  97, 109, 101, 119, 111, 
-    114, 107,  92, 100, 120,  49, 
-     50, 118, 101, 114, 116, 101, 
-    120, 115, 104,  97, 100, 101, 
-    114,  46, 104, 108, 115, 108, 
-      0,   4,   0,   0,   0,   6, 
-      0,   0,   0,   1,   0,   0, 
-      0,  58,   0,   0,   0,   0, 
-      0,   0,   0,  17,   0,   0, 
-      0,   7,   0,   0,   0,  10, 
-      0,   0,   0,   6,   0,   0, 
-      0,   0,   0,   0,   0,   5, 
-      0,   0,   0,  34,   0,   0, 
-      0,   8,   0,   0,   0,   0, 
-      0,   0,   0, 220,  81,  51, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+    119,   9,  49,   1,   1,   0, 
+      0,   0,  13,   0,   0, 142, 
+     14,   0,  63,  92,  15,   0, 
+      0,   0,  76,   0,   0,   0, 
+     32,   0,   0,   0,  44,   0, 
+      0,   0,  96,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,  22,   0,   0,   0, 
+     25,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
+     24,   4,   0,   0,  32,   0, 
+      0,  96,   0,   0,  71,  40, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   2,   0,   9,   0, 
+    156,   5,   0,   0,   0,   0, 
+      0,   0, 236,   2,   0,   0, 
+      1,   0,   0,   0, 136, 233, 
+     27,   3,   0,   0,   0,   0, 
+      0,   0,   0,   0, 109,  97, 
+    105, 110,   0, 110, 111, 110, 
+    101,   0,   0,   0,  45, 186, 
+     46, 241,   1,   0,   0,   0, 
+      0,   0,   0,   0,  24,   4, 
+      0,   0,  32,   0,   0,  96, 
+      0,   0,  71,  40,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      2,   0,   2,   0,   7,   0, 
+      0,   0,   0,   0,   1,   0, 
+    255, 255, 255, 255,   0,   0, 
+      0,   0,  24,   4,   0,   0, 
+      8,   2,   0,   0,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+      0,   0,   0,   0, 255, 255, 
+    255, 255,   1,   0,   1,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   0,  67,  58,  92,  85, 
+    115, 101, 114, 115,  92, 107, 
+    111, 108, 106,  97,  92,  68, 
+    101, 115, 107, 116, 111, 112, 
+     92,  75, 111, 108, 106,  97, 
+     45,  83, 116, 114, 111, 104, 
+    109,  45,  71,  97, 109, 101, 
+    115,  92,  65, 108, 108, 103, 
+    101, 109, 101, 105, 110,  92, 
+     70, 114,  97, 109, 101, 119, 
+    111, 114, 107,  92,  68,  88, 
+     49,  50,  86, 101, 114, 116, 
+    101, 120,  83, 104,  97, 100, 
+    101, 114,  46, 104, 108, 115, 
+    108,   0, 254, 239, 254, 239, 
+      1,   0,   0,   0,   1,   0, 
+      0,   0,   0,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0, 255, 255, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255,  12,   0, 255, 255, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3126,7 +3141,44 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0, 148,  46, 
+     49,   1, 104,   3, 161,  98, 
+      1,   0,   0,   0, 158, 160, 
+     68,  15,  70, 106,  79,  71, 
+    165, 169,  85, 150, 236,  11, 
+     71,  40, 129,   0,   0,   0, 
+     47,  76, 105, 110, 107,  73, 
+    110, 102, 111,   0,  47, 110, 
+     97, 109, 101, 115,   0,  47, 
+    115, 114,  99,  47, 104, 101, 
+     97, 100, 101, 114,  98, 108, 
+    111,  99, 107,   0,  47, 115, 
+    114,  99,  47, 102, 105, 108, 
+    101, 115,  47,  99,  58,  92, 
+    117, 115, 101, 114, 115,  92, 
+    107, 111, 108, 106,  97,  92, 
+    100, 101, 115, 107, 116, 111, 
+    112,  92, 107, 111, 108, 106, 
+     97,  45, 115, 116, 114, 111, 
+    104, 109,  45, 103,  97, 109, 
+    101, 115,  92,  97, 108, 108, 
+    103, 101, 109, 101, 105, 110, 
+     92, 102, 114,  97, 109, 101, 
+    119, 111, 114, 107,  92, 100, 
+    120,  49,  50, 118, 101, 114, 
+    116, 101, 120, 115, 104,  97, 
+    100, 101, 114,  46, 104, 108, 
+    115, 108,   0,   4,   0,   0, 
+      0,   6,   0,   0,   0,   1, 
+      0,   0,   0,  58,   0,   0, 
+      0,   0,   0,   0,   0,  17, 
+      0,   0,   0,   7,   0,   0, 
+      0,  10,   0,   0,   0,   6, 
       0,   0,   0,   0,   0,   0, 
+      0,   5,   0,   0,   0,  34, 
+      0,   0,   0,   8,   0,   0, 
+      0,   0,   0,   0,   0, 220, 
+     81,  51,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3141,67 +3193,15 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255, 119,   9,  49,   1, 
-      1,   0,   0,   0,  13,   0, 
-      0, 142,  14,   0,  63,  92, 
-     15,   0,   0,   0,  76,   0, 
-      0,   0,  32,   0,   0,   0, 
-     44,   0,   0,   0,  96,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  22,   0, 
-      0,   0,  25,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,  24,   4,   0,   0, 
-     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      9,   0, 156,   5,   0,   0, 
-      0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0,  22,  86, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    109,  97, 105, 110,   0, 110, 
-    111, 110, 101,   0,   0,   0, 
-     45, 186,  46, 241,   1,   0, 
       0,   0,   0,   0,   0,   0, 
-     24,   4,   0,   0,  32,   0, 
-      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   2,   0, 
-      7,   0,   0,   0,   0,   0, 
-      1,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0,  24,   4, 
-      0,   0,   8,   2,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   1,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,  67,  58, 
-     92,  85, 115, 101, 114, 115, 
-     92, 107, 111, 108, 106,  97, 
-     92,  68, 101, 115, 107, 116, 
-    111, 112,  92,  75, 111, 108, 
-    106,  97,  45,  83, 116, 114, 
-    111, 104, 109,  45,  71,  97, 
-    109, 101, 115,  92,  65, 108, 
-    108, 103, 101, 109, 101, 105, 
-    110,  92,  70, 114,  97, 109, 
-    101, 119, 111, 114, 107,  92, 
-     68,  88,  49,  50,  86, 101, 
-    114, 116, 101, 120,  83, 104, 
-     97, 100, 101, 114,  46, 104, 
-    108, 115, 108,   0, 254, 239, 
-    254, 239,   1,   0,   0,   0, 
-      1,   0,   0,   0,   0,   1, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255, 255, 255,  12,   0, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255, 255, 255,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3239,9 +3239,9 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,  56,   2,   0,   0, 
      44,   0,   0,   0,  92,   0, 
       0,   0,   3,   0,   0,   0, 
-     30,   0,   0,   0,  20,   0, 
+     31,   0,   0,   0,  20,   0, 
       0,   0,  19,   0,   0,   0, 
-     31,   0,   0,   0,  21,   0, 
+     30,   0,   0,   0,  21,   0, 
       0,   0,  12,   0,   0,   0, 
       6,   0,   0,   0,  22,   0, 
       0,   0,  23,   0,   0,   0, 

+ 2 - 2
Datei.cpp

@@ -238,7 +238,7 @@ Text* Datei::leseZeile() // lie
 			key->decodieren(n);
 		}
 		if (c)
-			ret->append((const char*)&c, 1);
+			ret->append(&c, 1);
 	}
 	tmpSBPos = 7;
 	tmpSBPos = -1;
@@ -667,7 +667,7 @@ bool Framework::DateiPfadErstellen(const char* pfad) // Erstellt eine Datei in d
 		t->release();
 		if (pf.positionVon("\\", i) == pf.getLength() - 1)
 			erst = 0;
-}
+	}
 #else
 	pf.ersetzen("\\", "/"); // Pfadangaben korrigieren
 	for (int i = 0; i < pf.anzahlVon("/"); ++i) // Jeden ordner erstellen wenn er nicht existiert

+ 1634 - 1634
Diagramm.cpp

@@ -14,1893 +14,1893 @@ using namespace Framework;
 // Inhalt der SLDiag Klasse aus Diagramm.h
 // Konstruktor 
 SLDiag::SLDiag()
-    : ZeichnungHintergrund(),
-    gF( 0xFF000000 ),
-    lFarbe( new Array< int >() ),
-    lName( new RCArray< Text >() ),
-    ph( new RCArray< Array< int > >() ),
-    pb( new RCArray< Array< int > >() ),
-    lastValue( new Array< int >() ),
-    textRd( 0 ),
-    gitterGr( 0, 0 ),
-    lines( 0 )
+	: ZeichnungHintergrund(),
+	gF(0xFF000000),
+	lFarbe(new Array< int >()),
+	lName(new RCArray< Text >()),
+	ph(new RCArray< Array< int > >()),
+	pb(new RCArray< Array< int > >()),
+	lastValue(new Array< int >()),
+	textRd(0),
+	gitterGr(0, 0),
+	lines(0)
 {
-    style = 0;
+	style = 0;
 }
 
 // Destruktor 
 SLDiag::~SLDiag()
 {
-    lFarbe->release();
-    lName->release();
-    ph->release();
-    pb->release();
-    lastValue->release();
-    if( textRd )
-        textRd->release();
+	lFarbe->release();
+	lName->release();
+	ph->release();
+	pb->release();
+	lastValue->release();
+	if (textRd)
+		textRd->release();
 }
 
 // nicht constant 
-void SLDiag::setTextRendererZ( TextRenderer *textRd )
+void SLDiag::setTextRendererZ(TextRenderer* textRd)
 {
-    if( this->textRd )
-        this->textRd->release();
-    this->textRd = textRd;
+	if (this->textRd)
+		this->textRd->release();
+	this->textRd = textRd;
 }
 
-void SLDiag::setSchriftZ( Schrift *schrift ) // setzt die Schrift
+void SLDiag::setSchriftZ(Schrift* schrift) // setzt die Schrift
 {
-    if( !this->textRd )
-        textRd = new TextRenderer( schrift );
-    else
-        textRd->setSchriftZ( schrift );
-    rend = 1;
+	if (!this->textRd)
+		textRd = new TextRenderer(schrift);
+	else
+		textRd->setSchriftZ(schrift);
+	rend = 1;
 }
-
-void SLDiag::setGSize( Punkt &gr ) // setzt die Größe des Gitters
-{
-    gitterGr = gr;
-    rend = 1;
-}
-
-void SLDiag::setGFarbe( int f ) // setzt die Gitter Farbe
-{
-    gF = f;
-    rend = 1;
-}
-
-void SLDiag::addLinie( const char *name ) // fügt eine Linie hinzu
-{
-    addLinie( new Text( name ) );
-    rend = 1;
-}
-
-void SLDiag::addLinie( Text *txt )
-{
-    lFarbe->add( 0xFFFFFFFF, lines );
-    lName->add( txt, lines );
-    ph->add( new Array< int >(), lines );
-    pb->add( new Array< int >(), lines );
-    int rbr = rahmen && hatStyle( Style::Rahmen ) ? rahmen->getRBreite() : 0;
-    pb->z( lines )->set( gr.x - rbr * 2, 0 );
-    ++lines;
-    rend = 1;
-}
-
-void SLDiag::setLFarbe( int lNum, int f ) // setzt die Linienfarbe
-{
-    lFarbe->set( f, lNum );
-    rend = 1;
-}
-
-void SLDiag::addPunkt( int lNum, int x, int h ) // fügt einen Punkt hinzu
-{
-    Array< int > *ph_tmp = ph->z( lNum );
-    Array< int > *pb_tmp = pb->z( lNum );
-    if( ph_tmp && pb_tmp )
-    {
-        int i = pb_tmp->get( 0 );
-        i -= x;
-        if( i >= 0 )
-            pb_tmp->set( i, 0 );
-        while( i < 0 )
-        {
-            ph_tmp->remove( 0 );
-            pb_tmp->remove( 0 );
-            if( !pb_tmp->getEintragAnzahl() || !ph_tmp->getEintragAnzahl() )
-                break;
-            int ii = -i;
-            i = pb_tmp->get( 0 );
-            i -= ii;
-            pb_tmp->set( i, 0 );
-        }
-        pb_tmp->add( x );
-        ph_tmp->add( h );
-        lastValue->set( h, lNum );
-    }
-    rend = 1;
-}
-
-void SLDiag::removeLinie( int lNum ) // entfernt eine Linie
-{
-    lFarbe->remove( lNum );
-    lName->remove( lNum );
-    ph->remove( lNum );
-    pb->remove( lNum );
-    --lines;
-    rend = 1;
-}
-
-void SLDiag::render( Bild &zRObj ) // zeichnet nach zRObj
-{
-    if( hatStyle( Style::Sichtbar ) )
-    {
-        lockZeichnung();
-        removeStyle( Style::VScroll | Style::HScroll );
-        ZeichnungHintergrund::render( zRObj );
-        if( !zRObj.setDrawOptions( innenPosition, innenSize ) )
-        {
-            unlockZeichnung();
-            return;
-        }
-        int hv = getHighestValue();
-        hv = hv ? hv : 1;
-        double yFaktor = innenSize.y / hv;
-        if( hatStyle( Style::Gitter ) )
-        {
-            double ghi = gitterGr.y * yFaktor;
-            int yo = innenSize.y - 1;
-            int bo = innenSize.x, ho = innenSize.y;
-            int maxBr = (int)( (double)innenSize.x / gitterGr.x + 0.5 );
-            int maxHi = ghi ? (int)( innenSize.y / ghi + 0.5 ) : 0;
-            if( hatStyle( Style::HAlpha ) )
-            {
-                for( int i = 0; i < maxBr; ++i )
-                    zRObj.drawLinieVAlpha( gitterGr.x * i, 0, ho, gF );
-                for( int i = 0; i < maxHi; ++i )
-                    zRObj.drawLinieHAlpha( 0, (int)( yo - ghi * i + 0.5 ), bo, gF );
-            }
-            else
-            {
-                for( int i = 0; i < maxBr; ++i )
-                    zRObj.drawLinieV( gitterGr.x * i, 0, ho, gF );
-                for( int i = 0; i < maxHi; ++i )
-                    zRObj.drawLinieH( 0, (int)( yo - ghi * i + 0.5 ), bo, gF );
-            }
-        }
-        for( int i = 0; i < lines; ++i )
-        {
-            int f_tmp = lFarbe->hat( i ) ? lFarbe->get( i ) : 0;
-            Text *n_tmp = lName->z( i );
-            Array< int > *ph_tmp = ph->z( i );
-            Array< int > *pb_tmp = pb->z( i );
-            if( hatStyle( Style::LinienName ) && textRd && n_tmp )
-            {
-                textRd->setSchriftSize( 12 );
-                Text rtxt = n_tmp->getText();
-                rtxt += ": ";
-                rtxt += lastValue->get( i );
-                textRd->renderText( 5, 5 + 15 * i, rtxt, zRObj, f_tmp );
-            }
-            if( ph_tmp && pb_tmp )
-            {
-                int lastX = 0;
-                int lastY = innenSize.y - 1;
-                int ph_anz = ph_tmp->getEintragAnzahl();
-                int pb_anz = pb_tmp->getEintragAnzahl();
-                for( int ii = 0; ii < ph_anz && ii < pb_anz; ++ii )
-                {
-                    if( !ph_tmp || !pb_tmp )
-                        break;
-                    int xpos = lastX + pb_tmp->get( ii );
-                    int ypos = innenSize.y - (int)( ph_tmp->get( ii ) * yFaktor + 0.5 ) - 1;
-                    if( ypos == -1 )
-                        ++ypos;
-                    if( ypos < 0 || xpos < 0 )
-                        break;
-                    if( hatStyle( Style::HAlpha ) )
-                        zRObj.drawLinieAlpha( Punkt( lastX, lastY ), Punkt( xpos, ypos ), f_tmp );
-                    else
-                        zRObj.drawLinie( Punkt( lastX, lastY ), Punkt( xpos, ypos ), f_tmp );
-                    lastX = xpos;
-                    lastY = ypos;
-                }
-            }
-        }
-        zRObj.releaseDrawOptions();
-        unlockZeichnung();
-    }
+
+void SLDiag::setGSize(Punkt& gr) // setzt die Größe des Gitters
+{
+	gitterGr = gr;
+	rend = 1;
+}
+
+void SLDiag::setGFarbe(int f) // setzt die Gitter Farbe
+{
+	gF = f;
+	rend = 1;
+}
+
+void SLDiag::addLinie(const char* name) // fügt eine Linie hinzu
+{
+	addLinie(new Text(name));
+	rend = 1;
+}
+
+void SLDiag::addLinie(Text* txt)
+{
+	lFarbe->add(0xFFFFFFFF, lines);
+	lName->add(txt, lines);
+	ph->add(new Array< int >(), lines);
+	pb->add(new Array< int >(), lines);
+	int rbr = rahmen && hatStyle(Style::Rahmen) ? rahmen->getRBreite() : 0;
+	pb->z(lines)->set(gr.x - rbr * 2, 0);
+	++lines;
+	rend = 1;
+}
+
+void SLDiag::setLFarbe(int lNum, int f) // setzt die Linienfarbe
+{
+	lFarbe->set(f, lNum);
+	rend = 1;
+}
+
+void SLDiag::addPunkt(int lNum, int x, int h) // fügt einen Punkt hinzu
+{
+	Array< int >* ph_tmp = ph->z(lNum);
+	Array< int >* pb_tmp = pb->z(lNum);
+	if (ph_tmp && pb_tmp)
+	{
+		int i = pb_tmp->get(0);
+		i -= x;
+		if (i >= 0)
+			pb_tmp->set(i, 0);
+		while (i < 0)
+		{
+			ph_tmp->remove(0);
+			pb_tmp->remove(0);
+			if (!pb_tmp->getEintragAnzahl() || !ph_tmp->getEintragAnzahl())
+				break;
+			int ii = -i;
+			i = pb_tmp->get(0);
+			i -= ii;
+			pb_tmp->set(i, 0);
+		}
+		pb_tmp->add(x);
+		ph_tmp->add(h);
+		lastValue->set(h, lNum);
+	}
+	rend = 1;
+}
+
+void SLDiag::removeLinie(int lNum) // entfernt eine Linie
+{
+	lFarbe->remove(lNum);
+	lName->remove(lNum);
+	ph->remove(lNum);
+	pb->remove(lNum);
+	--lines;
+	rend = 1;
+}
+
+void SLDiag::render(Bild& zRObj) // zeichnet nach zRObj
+{
+	if (hatStyle(Style::Sichtbar))
+	{
+		lockZeichnung();
+		removeStyle(Style::VScroll | Style::HScroll);
+		ZeichnungHintergrund::render(zRObj);
+		if (!zRObj.setDrawOptions(innenPosition, innenSize))
+		{
+			unlockZeichnung();
+			return;
+		}
+		int hv = getHighestValue();
+		hv = hv ? hv : 1;
+		double yFaktor = innenSize.y / hv;
+		if (hatStyle(Style::Gitter))
+		{
+			double ghi = gitterGr.y * yFaktor;
+			int yo = innenSize.y - 1;
+			int bo = innenSize.x, ho = innenSize.y;
+			int maxBr = (int)((double)innenSize.x / gitterGr.x + 0.5);
+			int maxHi = ghi ? (int)(innenSize.y / ghi + 0.5) : 0;
+			if (hatStyle(Style::HAlpha))
+			{
+				for (int i = 0; i < maxBr; ++i)
+					zRObj.drawLinieVAlpha(gitterGr.x * i, 0, ho, gF);
+				for (int i = 0; i < maxHi; ++i)
+					zRObj.drawLinieHAlpha(0, (int)(yo - ghi * i + 0.5), bo, gF);
+			}
+			else
+			{
+				for (int i = 0; i < maxBr; ++i)
+					zRObj.drawLinieV(gitterGr.x * i, 0, ho, gF);
+				for (int i = 0; i < maxHi; ++i)
+					zRObj.drawLinieH(0, (int)(yo - ghi * i + 0.5), bo, gF);
+			}
+		}
+		for (int i = 0; i < lines; ++i)
+		{
+			int f_tmp = lFarbe->hat(i) ? lFarbe->get(i) : 0;
+			Text* n_tmp = lName->z(i);
+			Array< int >* ph_tmp = ph->z(i);
+			Array< int >* pb_tmp = pb->z(i);
+			if (hatStyle(Style::LinienName) && textRd && n_tmp)
+			{
+				textRd->setSchriftSize(12);
+				Text rtxt = n_tmp->getText();
+				rtxt += ": ";
+				rtxt += lastValue->get(i);
+				textRd->renderText(5, 5 + 15 * i, rtxt, zRObj, f_tmp);
+			}
+			if (ph_tmp && pb_tmp)
+			{
+				int lastX = 0;
+				int lastY = innenSize.y - 1;
+				int ph_anz = ph_tmp->getEintragAnzahl();
+				int pb_anz = pb_tmp->getEintragAnzahl();
+				for (int ii = 0; ii < ph_anz && ii < pb_anz; ++ii)
+				{
+					if (!ph_tmp || !pb_tmp)
+						break;
+					int xpos = lastX + pb_tmp->get(ii);
+					int ypos = innenSize.y - (int)(ph_tmp->get(ii) * yFaktor + 0.5) - 1;
+					if (ypos == -1)
+						++ypos;
+					if (ypos < 0 || xpos < 0)
+						break;
+					if (hatStyle(Style::HAlpha))
+						zRObj.drawLinieAlpha(Punkt(lastX, lastY), Punkt(xpos, ypos), f_tmp);
+					else
+						zRObj.drawLinie(Punkt(lastX, lastY), Punkt(xpos, ypos), f_tmp);
+					lastX = xpos;
+					lastY = ypos;
+				}
+			}
+		}
+		zRObj.releaseDrawOptions();
+		unlockZeichnung();
+	}
 }
 
 // constant
-Schrift *SLDiag::getSchrift() const // gibt die Schrift zurück
+Schrift* SLDiag::getSchrift() const // gibt die Schrift zurück
 {
-    if( textRd )
-        return textRd->getSchrift();
-    return 0;
+	if (textRd)
+		return textRd->getSchrift();
+	return 0;
 }
 
-Schrift *SLDiag::zSchrift() const
+Schrift* SLDiag::zSchrift() const
 {
-    return textRd ? textRd->zSchrift() : 0;
+	return textRd ? textRd->zSchrift() : 0;
 }
 
-const Punkt &SLDiag::getGSize() const // gibt die Gitter Größe zurück
+const Punkt& SLDiag::getGSize() const // gibt die Gitter Größe zurück
 {
-    return gitterGr;
+	return gitterGr;
 }
 
 int SLDiag::getGFarbe() const // gibt die Gitter Farbe zurück
 {
-    return gF;
+	return gF;
 }
 
-int SLDiag::getLinienNummer( const char *name ) const // gibt die Linien Nummer zurück
+int SLDiag::getLinienNummer(const char* name) const // gibt die Linien Nummer zurück
 {
-    for( int i = 0; i < lines; ++i )
-    {
-        if( lName->z( i )->istGleich( name ) )
-            return i;
-    }
-    return -1;
+	for (int i = 0; i < lines; ++i)
+	{
+		if (lName->z(i)->istGleich(name))
+			return i;
+	}
+	return -1;
 }
 
-int SLDiag::getLinienNummer( Text *name ) const
+int SLDiag::getLinienNummer(Text* name) const
 {
-    for( int i = 0; i < lines; ++i )
-    {
-        if( lName->z( i )->istGleich( name->getText() ) )
-        {
-            name->release();
-            return i;
-        }
-    }
-    name->release();
-    return -1;
+	for (int i = 0; i < lines; ++i)
+	{
+		if (lName->z(i)->istGleich(name->getText()))
+		{
+			name->release();
+			return i;
+		}
+	}
+	name->release();
+	return -1;
 }
 
-Text *SLDiag::getLinienName( int lNum ) const // gibt den Linien Namen zurück
+Text* SLDiag::getLinienName(int lNum) const // gibt den Linien Namen zurück
 {
-    return lName->get( lNum );
+	return lName->get(lNum);
 }
 
-Text *SLDiag::zLinienNamen( int lNum ) const
+Text* SLDiag::zLinienNamen(int lNum) const
 {
-    return lName->z( lNum );
+	return lName->z(lNum);
 }
 
 int SLDiag::getHighestValue() const // gibt den Höchsten Wert zurück
 {
-    int ret = 0;
-    for( int i = 0; i < lines; ++i )
-    {
-        int tmp = getHighestValue( i );
-        ret = ret >= tmp ? ret : tmp;
-    }
-    return ret;
+	int ret = 0;
+	for (int i = 0; i < lines; ++i)
+	{
+		int tmp = getHighestValue(i);
+		ret = ret >= tmp ? ret : tmp;
+	}
+	return ret;
 }
 
-int SLDiag::getHighestValue( int lNum ) const
+int SLDiag::getHighestValue(int lNum) const
 {
-    int ret = 0;
-    Array< int > *tmp = ph->z( lNum );
-    int anz = tmp->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-        ret = ret >= tmp->get( i ) ? ret : tmp->get( i );
-    return ret;
+	int ret = 0;
+	Array< int >* tmp = ph->z(lNum);
+	int anz = tmp->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+		ret = ret >= tmp->get(i) ? ret : tmp->get(i);
+	return ret;
 }
 
-int SLDiag::getMedian( int lNum ) const // gibt den durchschnittswert zurück
+int SLDiag::getMedian(int lNum) const // gibt den durchschnittswert zurück
 {
-    int count;
-    int all = 0;
-    Array< int > *tmp = ph->z( lNum );
-    int anz = tmp->getEintragAnzahl();
-    for( count = 1; count <= anz; ++count )
-        all += tmp->get( count - 1 );
-    return (int)( (double)all / count + 0.5 );
+	int count;
+	int all = 0;
+	Array< int >* tmp = ph->z(lNum);
+	int anz = tmp->getEintragAnzahl();
+	for (count = 1; count <= anz; ++count)
+		all += tmp->get(count - 1);
+	return (int)((double)all / count + 0.5);
 }
 
 int SLDiag::getLAnzahl() const // gibt die Linien Anzahl zurück
 {
-    return lines;
+	return lines;
 }
 
-int SLDiag::getLastValue( int lNum ) const // gibt den letzten Wert zurück
+int SLDiag::getLastValue(int lNum) const // gibt den letzten Wert zurück
 {
-    return lastValue->get( lNum );
+	return lastValue->get(lNum);
 }
 
 
 // Inhalt der DiagWert Struktur aus Diagramm.h
 // Konstruktor
 DiagWert::DiagWert()
-    : ReferenceCounter(),
-    style( 0 ),
-    farbe( 0xFFFFFFFF ),
-    hintergrund( 0 ),
-    name( new Text() ),
-    punkte( new Array< DiagPunkt * > )
+	: ReferenceCounter(),
+	style(0),
+	farbe(0xFFFFFFFF),
+	hintergrund(0),
+	name(new Text()),
+	punkte(new Array< DiagPunkt* >)
 {}
 
 // Destruktor
 DiagWert::~DiagWert()
 {
-    name->release();
-    int anz = punkte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( punkte->hat( i ) )
-            delete punkte->get( i );
-    }
-    punkte->release();
+	name->release();
+	int anz = punkte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (punkte->hat(i))
+			delete punkte->get(i);
+	}
+	punkte->release();
 }
 
 
 // Inhalt der DiagDaten Struktur aus Diagramm.h
 // Konstruktor
 DiagDaten::DiagDaten()
-    : ReferenceCounter(),
-    style( 0 ),
-    rasterDicke( 0 ),
-    rasterBreite( 0 ),
-    rasterHeight( 0 ),
-    rasterFarbe( 0 ),
-    hIntervallFarbe( 0xFFFFFFFF ),
-    vIntervallFarbe( 0xFFFFFFFF ),
-    hIntervallName( new Text() ),
-    vIntervallName( new Text() ),
-    hIntervallTexte( new RCArray< Text > ),
-    vIntervallTexte( new RCArray< Text > ),
-    hIntervallWerte( new Array< double > ),
-    vIntervallWerte( new Array< double > ),
-    hIntervallBreite( 0 ),
-    vIntervallHeight( 0 ),
-    werte( new RCArray< DiagWert >() )
+	: ReferenceCounter(),
+	style(0),
+	rasterDicke(0),
+	rasterBreite(0),
+	rasterHeight(0),
+	rasterFarbe(0),
+	hIntervallFarbe(0xFFFFFFFF),
+	vIntervallFarbe(0xFFFFFFFF),
+	hIntervallName(new Text()),
+	vIntervallName(new Text()),
+	hIntervallTexte(new RCArray< Text >),
+	vIntervallTexte(new RCArray< Text >),
+	hIntervallWerte(new Array< double >),
+	vIntervallWerte(new Array< double >),
+	hIntervallBreite(0),
+	vIntervallHeight(0),
+	werte(new RCArray< DiagWert >())
 {}
 
 // Destruktor
 DiagDaten::~DiagDaten()
 {
-    hIntervallName->release();
-    vIntervallName->release();
-    hIntervallWerte->release();
-    vIntervallWerte->release();
-    hIntervallTexte->release();
-    vIntervallTexte->release();
-    werte->release();
+	hIntervallName->release();
+	vIntervallName->release();
+	hIntervallWerte->release();
+	vIntervallWerte->release();
+	hIntervallTexte->release();
+	vIntervallTexte->release();
+	werte->release();
 }
 
 
 // Inhalt der BaseDiag Klasse aus Diagramm.h
 // Konstruktor
-BaseDiag::BaseDiag( Critical *lock )
-    : daten( new DiagDaten() ),
-    changed( 0 ),
-    lock( lock )
+BaseDiag::BaseDiag(Critical* lock)
+	: daten(new DiagDaten()),
+	changed(0),
+	lock(lock)
 {}
 
 // Destruktor
 BaseDiag::~BaseDiag()
 {
-    if( daten )
-        daten->release();
+	if (daten)
+		daten->release();
 }
 
 // nicht constant
-void BaseDiag::setDiagDatenZ( DiagDaten *dd ) // Setzt einen Zeiger auf die Daten des Diagramms
-{
-    lock->lock();
-    if( daten )
-        daten->release();
-    daten = dd;
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::setDiagDaten( DiagDaten *dd ) // Kopiert die Daten eines Diagramms
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    daten->style = dd->style;
-    daten->rasterBreite = dd->rasterBreite;
-    daten->rasterHeight = dd->rasterHeight;
-    daten->rasterFarbe = dd->rasterFarbe;
-    daten->hIntervallFarbe = dd->hIntervallFarbe;
-    daten->vIntervallFarbe = dd->vIntervallFarbe;
-    daten->hIntervallName->setText( *dd->hIntervallName );
-    daten->vIntervallName->setText( *dd->vIntervallName );
-    int anz = dd->hIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( dd->hIntervallWerte->hat( i ) )
-            daten->hIntervallWerte->set( dd->hIntervallWerte->get( i ), i );
-    }
-    anz = dd->vIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( dd->vIntervallWerte->hat( i ) )
-            daten->vIntervallWerte->set( dd->vIntervallWerte->get( i ), i );
-    }
-    daten->hIntervallBreite = dd->hIntervallBreite;
-    daten->vIntervallHeight = dd->vIntervallHeight;
-    anz = dd->werte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        DiagWert *tmp = dd->werte->z( i );
-        if( tmp )
-        {
-            DiagWert *w = new DiagWert();
-            w->style = tmp->style;
-            w->farbe = tmp->farbe;
-            w->hintergrund = tmp->hintergrund;
-            w->name->setText( tmp->name->getText() );
-            int anz = tmp->punkte->getEintragAnzahl();
-            for( int j = 0; j < anz; ++j )
-            {
-                if( tmp->punkte->hat( j ) )
-                {
-                    DiagPunkt *p = new DiagPunkt();
-                    p->hIntervall = tmp->punkte->get( j )->hIntervall;
-                    p->vIntervall = tmp->punkte->get( j )->vIntervall;
-                    w->punkte->set( p, j );
-                }
-            }
-            daten->werte->set( w, i );
-        }
-    }
-    dd->release();
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::setRasterDicke( int d ) // Rasterdicke setzen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->rasterDicke != d )
-        changed = 1;
-    daten->rasterDicke = d;
-    lock->unlock();
-}
-
-void BaseDiag::setRasterBreite( int br ) // Rasterbreite setzen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->rasterBreite != br )
-        changed = 1;
-    daten->rasterBreite = br;
-    lock->unlock();
-}
-
-void BaseDiag::setRasterHeight( int hi ) // Rasterhöhe setzen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->rasterHeight != hi )
-        changed = 1;
-    daten->rasterHeight = hi;
-    lock->unlock();
-}
-
-void BaseDiag::setRasterFarbe( int f ) // Rasterfarbe setzen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->rasterFarbe != f )
-        changed = 1;
-    daten->rasterFarbe = f;
-    lock->unlock();
-}
-
-void BaseDiag::setHIntervallBreite( double br ) // Intervall Breite
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    daten->hIntervallBreite = br;
-    lock->unlock();
-}
-
-void BaseDiag::setVIntervallHeight( double hi ) // Intervall Höhe
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    daten->vIntervallHeight = hi;
-    lock->unlock();
-}
-
-void BaseDiag::setHIntervallFarbe( int f ) // Farbe des Horizontalen Intervalls
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->hIntervallFarbe != f )
-        changed = 1;
-    daten->hIntervallFarbe = f;
-    lock->unlock();
-}
-
-void BaseDiag::setVIntervallFarbe( int f ) // Farbe des Vertikalen Intervalls
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->vIntervallFarbe != f )
-        changed = 1;
-    daten->vIntervallFarbe = f;
-    lock->unlock();
+void BaseDiag::setDiagDatenZ(DiagDaten* dd) // Setzt einen Zeiger auf die Daten des Diagramms
+{
+	lock->lock();
+	if (daten)
+		daten->release();
+	daten = dd;
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::setDiagDaten(DiagDaten* dd) // Kopiert die Daten eines Diagramms
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	daten->style = dd->style;
+	daten->rasterBreite = dd->rasterBreite;
+	daten->rasterHeight = dd->rasterHeight;
+	daten->rasterFarbe = dd->rasterFarbe;
+	daten->hIntervallFarbe = dd->hIntervallFarbe;
+	daten->vIntervallFarbe = dd->vIntervallFarbe;
+	daten->hIntervallName->setText(*dd->hIntervallName);
+	daten->vIntervallName->setText(*dd->vIntervallName);
+	int anz = dd->hIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (dd->hIntervallWerte->hat(i))
+			daten->hIntervallWerte->set(dd->hIntervallWerte->get(i), i);
+	}
+	anz = dd->vIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (dd->vIntervallWerte->hat(i))
+			daten->vIntervallWerte->set(dd->vIntervallWerte->get(i), i);
+	}
+	daten->hIntervallBreite = dd->hIntervallBreite;
+	daten->vIntervallHeight = dd->vIntervallHeight;
+	anz = dd->werte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		DiagWert* tmp = dd->werte->z(i);
+		if (tmp)
+		{
+			DiagWert* w = new DiagWert();
+			w->style = tmp->style;
+			w->farbe = tmp->farbe;
+			w->hintergrund = tmp->hintergrund;
+			w->name->setText(tmp->name->getText());
+			int anz = tmp->punkte->getEintragAnzahl();
+			for (int j = 0; j < anz; ++j)
+			{
+				if (tmp->punkte->hat(j))
+				{
+					DiagPunkt* p = new DiagPunkt();
+					p->hIntervall = tmp->punkte->get(j)->hIntervall;
+					p->vIntervall = tmp->punkte->get(j)->vIntervall;
+					w->punkte->set(p, j);
+				}
+			}
+			daten->werte->set(w, i);
+		}
+	}
+	dd->release();
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::setRasterDicke(int d) // Rasterdicke setzen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->rasterDicke != d)
+		changed = 1;
+	daten->rasterDicke = d;
+	lock->unlock();
+}
+
+void BaseDiag::setRasterBreite(int br) // Rasterbreite setzen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->rasterBreite != br)
+		changed = 1;
+	daten->rasterBreite = br;
+	lock->unlock();
+}
+
+void BaseDiag::setRasterHeight(int hi) // Rasterhöhe setzen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->rasterHeight != hi)
+		changed = 1;
+	daten->rasterHeight = hi;
+	lock->unlock();
+}
+
+void BaseDiag::setRasterFarbe(int f) // Rasterfarbe setzen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->rasterFarbe != f)
+		changed = 1;
+	daten->rasterFarbe = f;
+	lock->unlock();
+}
+
+void BaseDiag::setHIntervallBreite(double br) // Intervall Breite
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	daten->hIntervallBreite = br;
+	lock->unlock();
+}
+
+void BaseDiag::setVIntervallHeight(double hi) // Intervall Höhe
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	daten->vIntervallHeight = hi;
+	lock->unlock();
+}
+
+void BaseDiag::setHIntervallFarbe(int f) // Farbe des Horizontalen Intervalls
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->hIntervallFarbe != f)
+		changed = 1;
+	daten->hIntervallFarbe = f;
+	lock->unlock();
+}
+
+void BaseDiag::setVIntervallFarbe(int f) // Farbe des Vertikalen Intervalls
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->vIntervallFarbe != f)
+		changed = 1;
+	daten->vIntervallFarbe = f;
+	lock->unlock();
 }
 
-void BaseDiag::setHIntervallName( char *name ) // Setzt den Namen des Horizontalen Intervalls
+void BaseDiag::setHIntervallName(const char* name) // Setzt den Namen des Horizontalen Intervalls
 {
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->hIntervallName )
-        daten->hIntervallName = new Text();
-    if( !daten->hIntervallName->istGleich( name ) )
-        changed = 1;
-    daten->hIntervallName->setText( name );
-    lock->unlock();
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->hIntervallName)
+		daten->hIntervallName = new Text();
+	if (!daten->hIntervallName->istGleich(name))
+		changed = 1;
+	daten->hIntervallName->setText(name);
+	lock->unlock();
 }
 
-void BaseDiag::setHIntervallName( Text *name )
+void BaseDiag::setHIntervallName(Text* name)
 {
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->hIntervallName )
-        daten->hIntervallName = new Text();
-    if( !daten->hIntervallName->istGleich( *name ) )
-        changed = 1;
-    daten->hIntervallName->setText( name );
-    lock->unlock();
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->hIntervallName)
+		daten->hIntervallName = new Text();
+	if (!daten->hIntervallName->istGleich(*name))
+		changed = 1;
+	daten->hIntervallName->setText(name);
+	lock->unlock();
 }
 
-void BaseDiag::setVIntervallName( char *name ) // Setzt den Namen des Vertikalen Intervalls
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->vIntervallName )
-        daten->vIntervallName = new Text();
-    if( !daten->vIntervallName->istGleich( name ) )
-        changed = 1;
-    daten->vIntervallName->setText( name );
-    lock->unlock();
-}
-
-void BaseDiag::setVIntervallName( Text *name )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->vIntervallName )
-        daten->vIntervallName = new Text();
-    if( !daten->vIntervallName->istGleich( *name ) )
-        changed = 1;
-    daten->vIntervallName->setText( name );
-    lock->unlock();
-}
-
-void BaseDiag::addHIntervallText( double hIntervall, char *text ) // Text eines Horizontalen Intervalls hinzufügen
-{
-    setHIntervallText( hIntervall, text );
-}
-
-void BaseDiag::addHIntervallText( double hIntervall, Text *text )
+void BaseDiag::setVIntervallName(const char* name) // Setzt den Namen des Vertikalen Intervalls
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->vIntervallName)
+		daten->vIntervallName = new Text();
+	if (!daten->vIntervallName->istGleich(name))
+		changed = 1;
+	daten->vIntervallName->setText(name);
+	lock->unlock();
+}
+
+void BaseDiag::setVIntervallName(Text* name)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->vIntervallName)
+		daten->vIntervallName = new Text();
+	if (!daten->vIntervallName->istGleich(*name))
+		changed = 1;
+	daten->vIntervallName->setText(name);
+	lock->unlock();
+}
+
+void BaseDiag::addHIntervallText(double hIntervall, const char* text) // Text eines Horizontalen Intervalls hinzufügen
+{
+	setHIntervallText(hIntervall, text);
+}
+
+void BaseDiag::addHIntervallText(double hIntervall, Text* text)
 {
-    setHIntervallText( hIntervall, *text );
-    text->release();
-}
-
-void BaseDiag::setHIntervallTextZ( double hIntervall, Text *text ) // Setzt den Text eines Horizontalen Intervalls
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->hIntervallWerte )
-        daten->hIntervallWerte = new Array< double >();
-    if( !daten->hIntervallTexte )
-        daten->hIntervallTexte = new RCArray< Text >();
-    int anz = daten->hIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->hIntervallWerte->hat( i ) && daten->hIntervallWerte->get( i ) == hIntervall )
-        {
-            daten->hIntervallTexte->set( text, i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    daten->hIntervallWerte->set( hIntervall, anz );
-    daten->hIntervallTexte->set( text, anz );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::setHIntervallText( double hIntervall, Text *text )
-{
-    setHIntervallText( hIntervall, *text );
-    text->release();
-}
-
-void BaseDiag::setHIntervallText( double hIntervall, char *text )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->hIntervallWerte )
-        daten->hIntervallWerte = new Array< double >();
-    if( !daten->hIntervallTexte )
-        daten->hIntervallTexte = new RCArray< Text >();
-    int anz = daten->hIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->hIntervallWerte->hat( i ) && daten->hIntervallWerte->get( i ) == hIntervall )
-        {
-            if( !daten->hIntervallTexte->z( i ) )
-                daten->hIntervallTexte->set( new Text( text ), i );
-            else
-                daten->hIntervallTexte->z( i )->setText( text );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    daten->hIntervallWerte->set( hIntervall, anz );
-    daten->hIntervallTexte->set( new Text( text ), anz );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::removeHIntervallText( double hIntervall ) // Text eines Horizontalen Intervalls entfernen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->hIntervallWerte )
-        daten->hIntervallWerte = new Array< double >();
-    if( !daten->hIntervallTexte )
-        daten->hIntervallTexte = new RCArray< Text >();
-    int anz = daten->hIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->hIntervallWerte->hat( i ) && daten->hIntervallWerte->get( i ) == hIntervall )
-        {
-            daten->hIntervallTexte->remove( i );
-            daten->hIntervallWerte->remove( i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    lock->unlock();
-}
-
-void BaseDiag::addVIntervallText( double vIntervall, char *text ) // Text eines Vertikalen Intervalls hinzufügen
-{
-    setVIntervallText( vIntervall, text );
-}
-
-void BaseDiag::addVIntervallText( double vIntervall, Text *text )
-{
-    setVIntervallText( vIntervall, *text );
-    text->release();
-}
-
-void BaseDiag::setVIntervallTextZ( double vIntervall, Text *text ) // Setzt den Text eines Vertikalen Intervalls
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->vIntervallWerte )
-        daten->vIntervallWerte = new Array< double >();
-    if( !daten->vIntervallTexte )
-        daten->vIntervallTexte = new RCArray< Text >();
-    int anz = daten->vIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->vIntervallWerte->hat( i ) && daten->vIntervallWerte->get( i ) == vIntervall )
-        {
-            daten->vIntervallTexte->set( text, i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    daten->vIntervallWerte->set( vIntervall, anz );
-    daten->vIntervallTexte->set( text, anz );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::setVIntervallText( double vIntervall, Text *text )
-{
-    setVIntervallText( vIntervall, *text );
-    text->release();
-}
-
-void BaseDiag::setVIntervallText( double vIntervall, char *text )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->vIntervallWerte )
-        daten->vIntervallWerte = new Array< double >();
-    if( !daten->vIntervallTexte )
-        daten->vIntervallTexte = new RCArray< Text >();
-    int anz = daten->vIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->vIntervallWerte->hat( i ) && daten->vIntervallWerte->get( i ) == vIntervall )
-        {
-            if( !daten->vIntervallTexte->z( i ) )
-                daten->vIntervallTexte->set( new Text( text ), i );
-            else
-                daten->vIntervallTexte->z( i )->setText( text );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    daten->vIntervallWerte->set( vIntervall, anz );
-    daten->vIntervallTexte->set( new Text( text ), anz );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::removeVIntervallText( double vIntervall ) // Text eines Vertikalen Intervalls entfernen
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->vIntervallWerte )
-        daten->vIntervallWerte = new Array< double >();
-    if( !daten->vIntervallTexte )
-        daten->vIntervallTexte = new RCArray< Text >();
-    int anz = daten->vIntervallWerte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->vIntervallWerte->hat( i ) && daten->vIntervallWerte->get( i ) == vIntervall )
-        {
-            daten->vIntervallTexte->remove( i );
-            daten->vIntervallWerte->remove( i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    lock->unlock();
-}
-
-void BaseDiag::addWertZ( DiagWert *w ) // Fügt einen Wert hinzu
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    daten->werte->add( w );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addWert( DiagWert *w )
-{
-    lock->lock();
-    DiagWert *tmp = new DiagWert();
-    tmp->style = w->style;
-    tmp->farbe = w->farbe;
-    tmp->hintergrund = w->hintergrund;
-    tmp->name->setText( *w->name );
-    int anz = w->punkte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( w->punkte->hat( i ) )
-        {
-            DiagPunkt *p = new DiagPunkt();
-            p->hIntervall = w->punkte->get( i )->hIntervall;
-            p->vIntervall = w->punkte->get( i )->vIntervall;
-            tmp->punkte->set( p, i );
-        }
-    }
-    w->release();
-    addWertZ( tmp );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addWert( const char *name )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    DiagWert *w = new DiagWert();
-    w->name->setText( name );
-    daten->werte->add( w );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addWert( Text *txt )
-{
-    addWert( *txt );
-    txt->release();
-}
-
-void BaseDiag::setWertFarbe( int wNum, int f ) // setzt die Farbe eines Wertes
-{
-    if( wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    daten->werte->z( wNum )->farbe = f;
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addPunktZ( int wNum, DiagPunkt *p ) // fügt einem Wert einen Punkt hinzu
-{
-    if( wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    while( !daten->werte->hat( wNum ) )
-        daten->werte->add( new DiagWert() );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    daten->werte->z( wNum )->punkte->add( p );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addPunkt( int wNum, DiagPunkt *p )
-{
-    if( wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    while( !daten->werte->hat( wNum ) )
-        daten->werte->add( new DiagWert() );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    DiagPunkt *tmp = new DiagPunkt();
-    tmp->hIntervall = p->hIntervall;
-    tmp->vIntervall = p->vIntervall;
-    daten->werte->z( wNum )->punkte->add( tmp );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::addPunkt( int wNum, double hI, double vI )
-{
-    if( wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    DiagPunkt *tmp = new DiagPunkt();
-    tmp->hIntervall = hI;
-    tmp->vIntervall = vI;
-    daten->werte->z( wNum )->punkte->add( tmp );
-    lock->unlock();
-    changed = 1;
+	setHIntervallText(hIntervall, *text);
+	text->release();
+}
+
+void BaseDiag::setHIntervallTextZ(double hIntervall, Text* text) // Setzt den Text eines Horizontalen Intervalls
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->hIntervallWerte)
+		daten->hIntervallWerte = new Array< double >();
+	if (!daten->hIntervallTexte)
+		daten->hIntervallTexte = new RCArray< Text >();
+	int anz = daten->hIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->hIntervallWerte->hat(i) && daten->hIntervallWerte->get(i) == hIntervall)
+		{
+			daten->hIntervallTexte->set(text, i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	daten->hIntervallWerte->set(hIntervall, anz);
+	daten->hIntervallTexte->set(text, anz);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::setHIntervallText(double hIntervall, Text* text)
+{
+	setHIntervallText(hIntervall, *text);
+	text->release();
+}
+
+void BaseDiag::setHIntervallText(double hIntervall, const  char* text)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->hIntervallWerte)
+		daten->hIntervallWerte = new Array< double >();
+	if (!daten->hIntervallTexte)
+		daten->hIntervallTexte = new RCArray< Text >();
+	int anz = daten->hIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->hIntervallWerte->hat(i) && daten->hIntervallWerte->get(i) == hIntervall)
+		{
+			if (!daten->hIntervallTexte->z(i))
+				daten->hIntervallTexte->set(new Text(text), i);
+			else
+				daten->hIntervallTexte->z(i)->setText(text);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	daten->hIntervallWerte->set(hIntervall, anz);
+	daten->hIntervallTexte->set(new Text(text), anz);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::removeHIntervallText(double hIntervall) // Text eines Horizontalen Intervalls entfernen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->hIntervallWerte)
+		daten->hIntervallWerte = new Array< double >();
+	if (!daten->hIntervallTexte)
+		daten->hIntervallTexte = new RCArray< Text >();
+	int anz = daten->hIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->hIntervallWerte->hat(i) && daten->hIntervallWerte->get(i) == hIntervall)
+		{
+			daten->hIntervallTexte->remove(i);
+			daten->hIntervallWerte->remove(i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	lock->unlock();
+}
+
+void BaseDiag::addVIntervallText(double vIntervall, const char* text) // Text eines Vertikalen Intervalls hinzufügen
+{
+	setVIntervallText(vIntervall, text);
+}
+
+void BaseDiag::addVIntervallText(double vIntervall, Text* text)
+{
+	setVIntervallText(vIntervall, *text);
+	text->release();
+}
+
+void BaseDiag::setVIntervallTextZ(double vIntervall, Text* text) // Setzt den Text eines Vertikalen Intervalls
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->vIntervallWerte)
+		daten->vIntervallWerte = new Array< double >();
+	if (!daten->vIntervallTexte)
+		daten->vIntervallTexte = new RCArray< Text >();
+	int anz = daten->vIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->vIntervallWerte->hat(i) && daten->vIntervallWerte->get(i) == vIntervall)
+		{
+			daten->vIntervallTexte->set(text, i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	daten->vIntervallWerte->set(vIntervall, anz);
+	daten->vIntervallTexte->set(text, anz);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::setVIntervallText(double vIntervall, Text* text)
+{
+	setVIntervallText(vIntervall, *text);
+	text->release();
+}
+
+void BaseDiag::setVIntervallText(double vIntervall, const char* text)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->vIntervallWerte)
+		daten->vIntervallWerte = new Array< double >();
+	if (!daten->vIntervallTexte)
+		daten->vIntervallTexte = new RCArray< Text >();
+	int anz = daten->vIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->vIntervallWerte->hat(i) && daten->vIntervallWerte->get(i) == vIntervall)
+		{
+			if (!daten->vIntervallTexte->z(i))
+				daten->vIntervallTexte->set(new Text(text), i);
+			else
+				daten->vIntervallTexte->z(i)->setText(text);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	daten->vIntervallWerte->set(vIntervall, anz);
+	daten->vIntervallTexte->set(new Text(text), anz);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::removeVIntervallText(double vIntervall) // Text eines Vertikalen Intervalls entfernen
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->vIntervallWerte)
+		daten->vIntervallWerte = new Array< double >();
+	if (!daten->vIntervallTexte)
+		daten->vIntervallTexte = new RCArray< Text >();
+	int anz = daten->vIntervallWerte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->vIntervallWerte->hat(i) && daten->vIntervallWerte->get(i) == vIntervall)
+		{
+			daten->vIntervallTexte->remove(i);
+			daten->vIntervallWerte->remove(i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	lock->unlock();
+}
+
+void BaseDiag::addWertZ(DiagWert* w) // Fügt einen Wert hinzu
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	daten->werte->add(w);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addWert(DiagWert* w)
+{
+	lock->lock();
+	DiagWert* tmp = new DiagWert();
+	tmp->style = w->style;
+	tmp->farbe = w->farbe;
+	tmp->hintergrund = w->hintergrund;
+	tmp->name->setText(*w->name);
+	int anz = w->punkte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (w->punkte->hat(i))
+		{
+			DiagPunkt* p = new DiagPunkt();
+			p->hIntervall = w->punkte->get(i)->hIntervall;
+			p->vIntervall = w->punkte->get(i)->vIntervall;
+			tmp->punkte->set(p, i);
+		}
+	}
+	w->release();
+	addWertZ(tmp);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addWert(const char* name)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	DiagWert* w = new DiagWert();
+	w->name->setText(name);
+	daten->werte->add(w);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addWert(Text* txt)
+{
+	addWert(*txt);
+	txt->release();
+}
+
+void BaseDiag::setWertFarbe(int wNum, int f) // setzt die Farbe eines Wertes
+{
+	if (wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	daten->werte->z(wNum)->farbe = f;
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addPunktZ(int wNum, DiagPunkt* p) // fügt einem Wert einen Punkt hinzu
+{
+	if (wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	while (!daten->werte->hat(wNum))
+		daten->werte->add(new DiagWert());
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	daten->werte->z(wNum)->punkte->add(p);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addPunkt(int wNum, DiagPunkt* p)
+{
+	if (wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	while (!daten->werte->hat(wNum))
+		daten->werte->add(new DiagWert());
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	DiagPunkt* tmp = new DiagPunkt();
+	tmp->hIntervall = p->hIntervall;
+	tmp->vIntervall = p->vIntervall;
+	daten->werte->z(wNum)->punkte->add(tmp);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::addPunkt(int wNum, double hI, double vI)
+{
+	if (wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	DiagPunkt* tmp = new DiagPunkt();
+	tmp->hIntervall = hI;
+	tmp->vIntervall = vI;
+	daten->werte->z(wNum)->punkte->add(tmp);
+	lock->unlock();
+	changed = 1;
 }
 
 // Ändert einen vorhandenen Punkt eines Wertes
-void BaseDiag::setPunktZ( int wNum, double hI, DiagPunkt *p )
+void BaseDiag::setPunktZ(int wNum, double hI, DiagPunkt* p)
 {
-    setPunktZ( wNum, getDiagPunktPos( wNum, hI ), p );
+	setPunktZ(wNum, getDiagPunktPos(wNum, hI), p);
 }
 
-void BaseDiag::setPunkt( int wNum, double hI, DiagPunkt *p )
+void BaseDiag::setPunkt(int wNum, double hI, DiagPunkt* p)
 {
-    setPunkt( wNum, getDiagPunktPos( wNum, hI ), p->hIntervall, p->vIntervall );
+	setPunkt(wNum, getDiagPunktPos(wNum, hI), p->hIntervall, p->vIntervall);
 }
 
-void BaseDiag::setPunkt( int wNum, double hI, double h, double v )
+void BaseDiag::setPunkt(int wNum, double hI, double h, double v)
 {
-    setPunkt( wNum, getDiagPunktPos( wNum, hI ), h, v );
+	setPunkt(wNum, getDiagPunktPos(wNum, hI), h, v);
 }
 
-void BaseDiag::setPunktZ( int wNum, int pNum, DiagPunkt *p )
+void BaseDiag::setPunktZ(int wNum, int pNum, DiagPunkt* p)
 {
-    if( pNum < 0 || wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    if( daten->werte->z( wNum )->punkte->hat( pNum ) )
-        delete daten->werte->z( wNum )->punkte->get( pNum );
-    daten->werte->z( wNum )->punkte->set( p, pNum );
-    lock->unlock();
-    changed = 1;
+	if (pNum < 0 || wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	if (daten->werte->z(wNum)->punkte->hat(pNum))
+		delete daten->werte->z(wNum)->punkte->get(pNum);
+	daten->werte->z(wNum)->punkte->set(p, pNum);
+	lock->unlock();
+	changed = 1;
 }
 
-void BaseDiag::setPunkt( int wNum, int pNum, DiagPunkt *p )
+void BaseDiag::setPunkt(int wNum, int pNum, DiagPunkt* p)
 {
-    if( pNum < 0 || wNum < 0 )
-        return;
-    setPunkt( wNum, pNum, p->hIntervall, p->vIntervall );
+	if (pNum < 0 || wNum < 0)
+		return;
+	setPunkt(wNum, pNum, p->hIntervall, p->vIntervall);
 }
 
-void BaseDiag::setPunkt( int wNum, int pNum, double h, double v )
+void BaseDiag::setPunkt(int wNum, int pNum, double h, double v)
 {
-    if( pNum < 0 || wNum < 0 )
-        return;
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    if( !daten->werte->z( wNum )->punkte->hat( pNum ) )
-        daten->werte->z( wNum )->punkte->set( new DiagPunkt(), pNum );
-    daten->werte->z( wNum )->punkte->get( pNum )->hIntervall = h;
-    daten->werte->z( wNum )->punkte->get( pNum )->vIntervall = v;
-    lock->unlock();
-    changed = 1;
+	if (pNum < 0 || wNum < 0)
+		return;
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	if (!daten->werte->z(wNum)->punkte->hat(pNum))
+		daten->werte->z(wNum)->punkte->set(new DiagPunkt(), pNum);
+	daten->werte->z(wNum)->punkte->get(pNum)->hIntervall = h;
+	daten->werte->z(wNum)->punkte->get(pNum)->vIntervall = v;
+	lock->unlock();
+	changed = 1;
 }
 
 // Löscht einen vorhandenen Punkt
-void BaseDiag::removePunkt( int wNum, double hI )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    int anz = daten->werte->z( wNum )->punkte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->werte->z( wNum )->punkte->hat( i ) && daten->werte->z( wNum )->punkte->get( i )->hIntervall == hI )
-        {
-            delete daten->werte->z( wNum )->punkte->get( i );
-            daten->werte->z( wNum )->punkte->remove( i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    lock->unlock();
-}
-
-void BaseDiag::removePunkt( int wNum, int pNum )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( !daten->werte->z( wNum )->punkte )
-        daten->werte->z( wNum )->punkte = new Array< DiagPunkt * >();
-    if( daten->werte->z( wNum )->punkte->hat( pNum ) )
-    {
-        delete daten->werte->z( wNum )->punkte->get( pNum );
-        daten->werte->z( wNum )->punkte->remove( pNum );
-        changed = 1;
-    }
-    lock->unlock();
-}
-
-void BaseDiag::removeWert( int wNum ) // entfernt einen Wert
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    daten->werte->remove( wNum );
-    lock->unlock();
-    changed = 1;
-}
-
-void BaseDiag::removeWert( char *name )
-{
-    lock->lock();
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte )
-        daten->werte = new RCArray< DiagWert >();
-    int anz = daten->werte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        DiagWert *tmp = daten->werte->z( i );
-        if( tmp && tmp->name && tmp->name->istGleich( name ) )
-        {
-            daten->werte->remove( i );
-            lock->unlock();
-            changed = 1;
-            return;
-        }
-    }
-    lock->unlock();
-}
-
-void BaseDiag::removeWert( Text *name )
-{
-    removeWert( name->getText() );
-    name->release();
-}
-
-void BaseDiag::addDatenStyle( int style ) // Setzt den Style der Daten
-{
-    if( !daten )
-        daten = new DiagDaten();
-    if( ( daten->style | style ) != daten->style )
-        changed = 1;
-    daten->style |= style;
-}
-
-void BaseDiag::setDatenStyle( int style )
-{
-    if( !daten )
-        daten = new DiagDaten();
-    if( daten->style != style )
-        changed = 1;
-    daten->style = style;
-}
-
-void BaseDiag::setDatenStyle( int style, bool addRemove )
-{
-    if( addRemove )
-        addDatenStyle( style );
-    else
-        removeDatenStyle( style );
-}
-
-void BaseDiag::removeDatenStyle( int style )
-{
-    if( !daten )
-        daten = new DiagDaten();
-    if( ( daten->style & ~style ) != daten->style )
-        changed = 1;
-    daten->style &= ~style;
+void BaseDiag::removePunkt(int wNum, double hI)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	int anz = daten->werte->z(wNum)->punkte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->werte->z(wNum)->punkte->hat(i) && daten->werte->z(wNum)->punkte->get(i)->hIntervall == hI)
+		{
+			delete daten->werte->z(wNum)->punkte->get(i);
+			daten->werte->z(wNum)->punkte->remove(i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	lock->unlock();
+}
+
+void BaseDiag::removePunkt(int wNum, int pNum)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (!daten->werte->z(wNum)->punkte)
+		daten->werte->z(wNum)->punkte = new Array< DiagPunkt* >();
+	if (daten->werte->z(wNum)->punkte->hat(pNum))
+	{
+		delete daten->werte->z(wNum)->punkte->get(pNum);
+		daten->werte->z(wNum)->punkte->remove(pNum);
+		changed = 1;
+	}
+	lock->unlock();
+}
+
+void BaseDiag::removeWert(int wNum) // entfernt einen Wert
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	daten->werte->remove(wNum);
+	lock->unlock();
+	changed = 1;
+}
+
+void BaseDiag::removeWert(const char* name)
+{
+	lock->lock();
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte)
+		daten->werte = new RCArray< DiagWert >();
+	int anz = daten->werte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		DiagWert* tmp = daten->werte->z(i);
+		if (tmp && tmp->name && tmp->name->istGleich(name))
+		{
+			daten->werte->remove(i);
+			lock->unlock();
+			changed = 1;
+			return;
+		}
+	}
+	lock->unlock();
+}
+
+void BaseDiag::removeWert(Text* name)
+{
+	removeWert(name->getText());
+	name->release();
+}
+
+void BaseDiag::addDatenStyle(int style) // Setzt den Style der Daten
+{
+	if (!daten)
+		daten = new DiagDaten();
+	if ((daten->style | style) != daten->style)
+		changed = 1;
+	daten->style |= style;
+}
+
+void BaseDiag::setDatenStyle(int style)
+{
+	if (!daten)
+		daten = new DiagDaten();
+	if (daten->style != style)
+		changed = 1;
+	daten->style = style;
+}
+
+void BaseDiag::setDatenStyle(int style, bool addRemove)
+{
+	if (addRemove)
+		addDatenStyle(style);
+	else
+		removeDatenStyle(style);
+}
+
+void BaseDiag::removeDatenStyle(int style)
+{
+	if (!daten)
+		daten = new DiagDaten();
+	if ((daten->style & ~style) != daten->style)
+		changed = 1;
+	daten->style &= ~style;
 }
 
-void BaseDiag::addWertStyle( int wNum, int style ) // Setzt den Style eines Wertes
+void BaseDiag::addWertStyle(int wNum, int style) // Setzt den Style eines Wertes
 {
-    if( wNum < 0 )
-        return;
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( ( daten->werte->z( wNum )->style | style ) != daten->werte->z( wNum )->style )
-        changed = 1;
-    daten->werte->z( wNum )->style |= style;
+	if (wNum < 0)
+		return;
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if ((daten->werte->z(wNum)->style | style) != daten->werte->z(wNum)->style)
+		changed = 1;
+	daten->werte->z(wNum)->style |= style;
 }
 
-void BaseDiag::setWertStyle( int wNum, int style )
+void BaseDiag::setWertStyle(int wNum, int style)
 {
-    if( wNum < 0 )
-        return;
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( daten->werte->z( wNum )->style != style )
-        changed = 1;
-    daten->werte->z( wNum )->style = style;
+	if (wNum < 0)
+		return;
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if (daten->werte->z(wNum)->style != style)
+		changed = 1;
+	daten->werte->z(wNum)->style = style;
 }
 
-void BaseDiag::setWertStyle( int wNum, int style, bool addRemove )
+void BaseDiag::setWertStyle(int wNum, int style, bool addRemove)
 {
-    if( wNum < 0 )
-        return;
-    if( addRemove )
-        addWertStyle( wNum, style );
-    else
-        removeWertStyle( wNum, style );
+	if (wNum < 0)
+		return;
+	if (addRemove)
+		addWertStyle(wNum, style);
+	else
+		removeWertStyle(wNum, style);
 }
 
-void BaseDiag::removeWertStyle( int wNum, int style )
+void BaseDiag::removeWertStyle(int wNum, int style)
 {
-    if( wNum < 0 )
-        return;
-    if( !daten )
-        daten = new DiagDaten();
-    if( !daten->werte->z( wNum ) )
-        daten->werte->set( new DiagWert(), wNum );
-    if( ( daten->werte->z( wNum )->style & ~style ) != daten->werte->z( wNum )->style )
-        changed = 1;
-    daten->werte->z( wNum )->style &= ~style;
+	if (wNum < 0)
+		return;
+	if (!daten)
+		daten = new DiagDaten();
+	if (!daten->werte->z(wNum))
+		daten->werte->set(new DiagWert(), wNum);
+	if ((daten->werte->z(wNum)->style & ~style) != daten->werte->z(wNum)->style)
+		changed = 1;
+	daten->werte->z(wNum)->style &= ~style;
 }
 
 // constant
-DiagDaten *BaseDiag::getDiagDaten() const // Gibt die Daten des Diagramms zurück
+DiagDaten* BaseDiag::getDiagDaten() const // Gibt die Daten des Diagramms zurück
 {
-    return daten ? dynamic_cast<DiagDaten *>( daten->getThis() ) : 0;
+	return daten ? dynamic_cast<DiagDaten*>(daten->getThis()) : 0;
 }
 
-DiagDaten *BaseDiag::zDiagDaten() const
+DiagDaten* BaseDiag::zDiagDaten() const
 {
-    return daten;
+	return daten;
 }
 
-DiagWert *BaseDiag::getDiagWert( int wNum ) const // Gibt die Daten eines Wertes zurück
+DiagWert* BaseDiag::getDiagWert(int wNum) const // Gibt die Daten eines Wertes zurück
 {
-    return ( daten && daten->werte ) ? daten->werte->get( wNum ) : 0;
+	return (daten && daten->werte) ? daten->werte->get(wNum) : 0;
 }
 
-DiagWert *BaseDiag::zDiagWert( int wNum ) const
+DiagWert* BaseDiag::zDiagWert(int wNum) const
 {
-    return ( daten && daten->werte ) ? daten->werte->z( wNum ) : 0;
+	return (daten && daten->werte) ? daten->werte->z(wNum) : 0;
 }
 
-DiagWert *BaseDiag::getDiagWert( char *name ) const
+DiagWert* BaseDiag::getDiagWert(const char* name) const
 {
-    return getDiagWert( getDiagWertPos( name ) );
+	return getDiagWert(getDiagWertPos(name));
 }
 
-DiagWert *BaseDiag::zDiagWert( char *name ) const
+DiagWert* BaseDiag::zDiagWert(const char* name) const
 {
-    return zDiagWert( getDiagWertPos( name ) );
+	return zDiagWert(getDiagWertPos(name));
 }
 
-int BaseDiag::getDiagWertPos( char *name ) const // Gibt die Position eines Wertes zurück
+int BaseDiag::getDiagWertPos(const char* name) const // Gibt die Position eines Wertes zurück
 {
-    if( !daten || !daten->werte )
-        return -1;
-    int anz = daten->werte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->werte->z( i ) && daten->werte->z( i )->name && daten->werte->z( i )->name->istGleich( name ) )
-            return i;
-    }
-    return -1;
+	if (!daten || !daten->werte)
+		return -1;
+	int anz = daten->werte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->werte->z(i) && daten->werte->z(i)->name && daten->werte->z(i)->name->istGleich(name))
+			return i;
+	}
+	return -1;
 }
 
-int BaseDiag::getDiagPunktPos( int wNum, double hI ) const // Gibt die Position eines Punktes von einem Wert zurück
+int BaseDiag::getDiagPunktPos(int wNum, double hI) const // Gibt die Position eines Punktes von einem Wert zurück
 {
-    if( !daten || !daten->werte || !daten->werte->z( wNum ) || !daten->werte->z( wNum )->punkte )
-        return -1;
-    int anz = daten->werte->z( wNum )->punkte->getEintragAnzahl();
-    for( int i = 0; i < anz; ++i )
-    {
-        if( daten->werte->z( wNum )->punkte->hat( i ) && daten->werte->z( wNum )->punkte->get( i )->hIntervall == hI )
-            return i;
-    }
-    return -1;
+	if (!daten || !daten->werte || !daten->werte->z(wNum) || !daten->werte->z(wNum)->punkte)
+		return -1;
+	int anz = daten->werte->z(wNum)->punkte->getEintragAnzahl();
+	for (int i = 0; i < anz; ++i)
+	{
+		if (daten->werte->z(wNum)->punkte->hat(i) && daten->werte->z(wNum)->punkte->get(i)->hIntervall == hI)
+			return i;
+	}
+	return -1;
 }
 
-int BaseDiag::getDiagPunktPos( char *wName, double hI ) const
+int BaseDiag::getDiagPunktPos(char* wName, double hI) const
 {
-    return getDiagPunktPos( getDiagWertPos( wName ), hI );
+	return getDiagPunktPos(getDiagWertPos(wName), hI);
 }
 
-bool BaseDiag::hatDatenStyle( int style ) const // Prüft den Style der Daten
+bool BaseDiag::hatDatenStyle(int style) const // Prüft den Style der Daten
 {
-    if( !daten )
-        return 0;
-    return ( daten->style | style ) == daten->style;
+	if (!daten)
+		return 0;
+	return (daten->style | style) == daten->style;
 }
 
-bool BaseDiag::hatDatenStyleNicht( int style ) const
+bool BaseDiag::hatDatenStyleNicht(int style) const
 {
-    if( !daten )
-        return 1;
-    return ( daten->style | style ) != daten->style;
+	if (!daten)
+		return 1;
+	return (daten->style | style) != daten->style;
 }
 
-bool BaseDiag::hatWertStyle( int wNum, int style ) const // Prüft den Style eines Wertes
+bool BaseDiag::hatWertStyle(int wNum, int style) const // Prüft den Style eines Wertes
 {
-    if( !daten || !daten->werte || !daten->werte->z( wNum ) )
-        return 0;
-    return ( daten->werte->z( wNum )->style | style ) == daten->werte->z( wNum )->style;
+	if (!daten || !daten->werte || !daten->werte->z(wNum))
+		return 0;
+	return (daten->werte->z(wNum)->style | style) == daten->werte->z(wNum)->style;
 }
 
-bool BaseDiag::hatWertStyleNicht( int wNum, int style ) const
+bool BaseDiag::hatWertStyleNicht(int wNum, int style) const
 {
-    if( !daten || !daten->werte || !daten->werte->z( wNum ) )
-        return 1;
-    return ( daten->werte->z( wNum )->style | style ) != daten->werte->z( wNum )->style;
+	if (!daten || !daten->werte || !daten->werte->z(wNum))
+		return 1;
+	return (daten->werte->z(wNum)->style | style) != daten->werte->z(wNum)->style;
 }
 
 // Inhalt der LDiag Klasse aus Diagramm.h
 // Konstruktor
 LDiag::LDiag()
-    : ZeichnungHintergrund(),
-    BaseDiag( &cs ),
-    textRd( 0 ),
-    dRam( new LRahmen() ),
-    dBgF( 0 ),
-    dBgB( 0 ),
-    dAf( new AlphaFeld() ),
-    vIntervallRB( new Bild() ),
-    hIntervallRB( new Bild() ),
-    schriftGr( 12 )
-{
-    style = Style::MELockZeichnung;
-    vertikalScrollBar = new VScrollBar();
-    horizontalScrollBar = new HScrollBar();
+	: ZeichnungHintergrund(),
+	BaseDiag(&cs),
+	textRd(0),
+	dRam(new LRahmen()),
+	dBgF(0),
+	dBgB(0),
+	dAf(new AlphaFeld()),
+	vIntervallRB(new Bild()),
+	hIntervallRB(new Bild()),
+	schriftGr(12)
+{
+	style = Style::MELockZeichnung;
+	vertikalScrollBar = new VScrollBar();
+	horizontalScrollBar = new HScrollBar();
 }
 
 // Destruktor
 LDiag::~LDiag()
 {
-    if( textRd )
-        textRd->release();
-    if( dRam )
-        dRam->release();
-    if( dBgB )
-        dBgB->release();
-    if( dAf )
-        dAf->release();
-    if( vIntervallRB )
-        vIntervallRB->release();
-    if( hIntervallRB )
-        hIntervallRB->release();
-}
-
-void LDiag::doMausEreignis( MausEreignis &me, bool userRet )
-{
-    if( hatDatenStyle( DiagDaten::Style::Sichtbar ) && ( hatStyle( Style::HScroll ) || hatStyle( Style::VScroll ) ) && userRet )
-    {
-        int rbr = 0;
-        if( hatStyle( Style::Rahmen ) && rahmen )
-            rbr = rahmen->getRBreite();
-        bool vs = hatStyle( Style::VScroll ) && vertikalScrollBar;
-        bool hs = hatStyle( Style::HScroll ) && horizontalScrollBar;
-        if( vs )
-        {
-            if( hs )
-                horizontalScrollBar->doMausMessage( rbr, gr.y - rbr - 15, gr.x - rbr * 2 - 15, 15, me );
-            vertikalScrollBar->doMausMessage( gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me );
-        }
-        else if( hs )
-            horizontalScrollBar->doMausMessage( rbr, gr.y - rbr - 15, gr.x - rbr * 2, 15, me );
-    }
-    me.verarbeitet = userRet;
+	if (textRd)
+		textRd->release();
+	if (dRam)
+		dRam->release();
+	if (dBgB)
+		dBgB->release();
+	if (dAf)
+		dAf->release();
+	if (vIntervallRB)
+		vIntervallRB->release();
+	if (hIntervallRB)
+		hIntervallRB->release();
+}
+
+void LDiag::doMausEreignis(MausEreignis& me, bool userRet)
+{
+	if (hatDatenStyle(DiagDaten::Style::Sichtbar) && (hatStyle(Style::HScroll) || hatStyle(Style::VScroll)) && userRet)
+	{
+		int rbr = 0;
+		if (hatStyle(Style::Rahmen) && rahmen)
+			rbr = rahmen->getRBreite();
+		bool vs = hatStyle(Style::VScroll) && vertikalScrollBar;
+		bool hs = hatStyle(Style::HScroll) && horizontalScrollBar;
+		if (vs)
+		{
+			if (hs)
+				horizontalScrollBar->doMausMessage(rbr, gr.y - rbr - 15, gr.x - rbr * 2 - 15, 15, me);
+			vertikalScrollBar->doMausMessage(gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me);
+		}
+		else if (hs)
+			horizontalScrollBar->doMausMessage(rbr, gr.y - rbr - 15, gr.x - rbr * 2, 15, me);
+	}
+	me.verarbeitet = userRet;
 }
 
 // nicht constant
-void LDiag::setTextRendererZ( TextRenderer *textRd )
+void LDiag::setTextRendererZ(TextRenderer* textRd)
 {
-    lockZeichnung();
-    if( this->textRd )
-        this->textRd->release();
-    this->textRd = textRd;
-    unlockZeichnung();
+	lockZeichnung();
+	if (this->textRd)
+		this->textRd->release();
+	this->textRd = textRd;
+	unlockZeichnung();
 }
 
-void LDiag::setSchriftZ( Schrift *schrift ) // Setzt die Schrift
+void LDiag::setSchriftZ(Schrift* schrift) // Setzt die Schrift
 {
-    lockZeichnung();
-    if( !this->textRd )
-        textRd = new TextRenderer( schrift );
-    else
-        textRd->setSchriftZ( schrift );
-    rend = 1;
-    unlockZeichnung();
+	lockZeichnung();
+	if (!this->textRd)
+		textRd = new TextRenderer(schrift);
+	else
+		textRd->setSchriftZ(schrift);
+	rend = 1;
+	unlockZeichnung();
 }
 
-void LDiag::setSchriftSize( int gr )
+void LDiag::setSchriftSize(int gr)
 {
-    lockZeichnung();
-    if( schriftGr != gr )
-        rend = 1;
-    schriftGr = gr;
-    unlockZeichnung();
+	lockZeichnung();
+	if (schriftGr != gr)
+		rend = 1;
+	schriftGr = gr;
+	unlockZeichnung();
 }
 
-void LDiag::setDatenRahmenZ( Rahmen *ram ) // Setzt den inneren Rahmen um das eigentliche Diagramm
+void LDiag::setDatenRahmenZ(Rahmen* ram) // Setzt den inneren Rahmen um das eigentliche Diagramm
 {
-    lockZeichnung();
-    if( dRam )
-        dRam->release();
-    dRam = ram;
-    unlockZeichnung();
-    rend = 1;
+	lockZeichnung();
+	if (dRam)
+		dRam->release();
+	dRam = ram;
+	unlockZeichnung();
+	rend = 1;
 }
 
-void LDiag::setDatenRahmen( Rahmen *ram )
+void LDiag::setDatenRahmen(Rahmen* ram)
 {
-    lockZeichnung();
-    if( !dRam )
-        dRam = new LRahmen();
-    dRam->setAlpha( ram->hatAlpha() );
-    dRam->setFarbe( ram->getFarbe() );
-    dRam->setRamenBreite( ram->getRBreite() );
-    unlockZeichnung();
-    ram->release();
-    rend = 1;
+	lockZeichnung();
+	if (!dRam)
+		dRam = new LRahmen();
+	dRam->setAlpha(ram->hatAlpha());
+	dRam->setFarbe(ram->getFarbe());
+	dRam->setRamenBreite(ram->getRBreite());
+	unlockZeichnung();
+	ram->release();
+	rend = 1;
 }
 
-void LDiag::setDatenRahmenBreite( int br )
+void LDiag::setDatenRahmenBreite(int br)
 {
-    lockZeichnung();
-    if( !dRam )
-        dRam = new LRahmen();
-    if( dRam->getRBreite() != br )
-        rend = 1;
-    dRam->setRamenBreite( br );
-    unlockZeichnung();
+	lockZeichnung();
+	if (!dRam)
+		dRam = new LRahmen();
+	if (dRam->getRBreite() != br)
+		rend = 1;
+	dRam->setRamenBreite(br);
+	unlockZeichnung();
 }
 
-void LDiag::setDatenRahmenFarbe( int f )
+void LDiag::setDatenRahmenFarbe(int f)
 {
-    lockZeichnung();
-    if( !dRam )
-        dRam = new LRahmen();
-    dRam->setFarbe( f );
-    unlockZeichnung();
-    rend = 1;
+	lockZeichnung();
+	if (!dRam)
+		dRam = new LRahmen();
+	dRam->setFarbe(f);
+	unlockZeichnung();
+	rend = 1;
 }
 
-void LDiag::setDatenHintergrundFarbe( int f ) // Setzt den Hintergrund des eigentlichen Diagramms
+void LDiag::setDatenHintergrundFarbe(int f) // Setzt den Hintergrund des eigentlichen Diagramms
 {
-    dBgF = f;
-    rend = 1;
-}
-
-void LDiag::setDatenHintergrundBildZ( Bild *b )
-{
-    lockZeichnung();
-    if( dBgB )
-        dBgB->release();
-    dBgB = b;
-    unlockZeichnung();
-    rend = 1;
-}
-
-void LDiag::setDatenHintergrundBild( Bild *b )
-{
-    lockZeichnung();
-    if( !dBgB )
-        dBgB = new Bild();
-    dBgB->neuBild( b->getBreite(), b->getHeight(), 0 );
-    dBgB->drawBild( 0, 0, b->getBreite(), b->getHeight(), *b );
-    unlockZeichnung();
-    b->release();
-    rend = 1;
-}
-
-void LDiag::setDatenAlphaFeldZ( AlphaFeld *af ) // Setzt das AlphaFeld des eigentlichen Diagramms
-{
-    lockZeichnung();
-    if( dAf )
-        dAf->release();
-    dAf = af;
-    unlockZeichnung();
-    rend = 1;
-}
-
-void LDiag::setDatenAlphaFeld( AlphaFeld *af )
-{
-    lockZeichnung();
-    if( !dAf )
-        dAf = new AlphaFeld();
-    dAf->setFarbe( af->getFarbe() );
-    dAf->setStrength( af->getStrength() );
-    unlockZeichnung();
-    af->release();
-    rend = 1;
-}
-
-void LDiag::setDatenAlphaFeldFarbe( int f )
-{
-    lockZeichnung();
-    if( !dAf )
-        dAf = new AlphaFeld();
-    dAf->setFarbe( f );
-    unlockZeichnung();
-    rend = 1;
-}
-
-void LDiag::setDatenAlphaFeldStrength( int st )
-{
-    lockZeichnung();
-    if( !dAf )
-        dAf = new AlphaFeld();
-    if( dAf->getStrength() != st )
-        rend = 1;
-    dAf->setStrength( st );
-    unlockZeichnung();
-}
-
-void LDiag::render( Bild &zRObj )
-{
-    if( !hatDatenStyle( DiagDaten::Style::Sichtbar ) )
-        return;
-    ZeichnungHintergrund::render( zRObj );
-    if( !zRObj.setDrawOptions( innenPosition, innenSize ) )
-        return;
-    lockZeichnung();
-    int dgy = 0;
-    int dgbr = innenSize.x;
-    int dghi = innenSize.y;
-    int vIAnz = 0;
-    int hIAnz = 0;
-    if( daten )
-    { // Auto werte berechnen
-        vIAnz = daten->vIntervallWerte ? daten->vIntervallWerte->getEintragAnzahl() : 0;
-        hIAnz = daten->hIntervallWerte ? daten->hIntervallWerte->getEintragAnzahl() : 0;
-        if( daten->vIntervallWerte && hatDatenStyle( DiagDaten::Style::AutoIntervallHeight ) )
-        {
-            double maxW = 0;
-            for( int i = 0; i < vIAnz; ++i )
-            {
-                if( daten->vIntervallWerte->hat( i ) && daten->vIntervallWerte->get( i ) > maxW )
-                    maxW = daten->vIntervallWerte->get( i );
-            }
-            if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                daten->vIntervallHeight = maxW ? ( vertikalScrollBar->getScroll() / maxW ) : 0;
-            else
-                daten->vIntervallHeight = maxW ? ( vIntervallRB->getBreite() / maxW ) : 0;
-        }
-        if( hatDatenStyle( DiagDaten::Style::AutoRasterHeight ) )
-            daten->rasterHeight = daten->vIntervallHeight;
-        if( daten->hIntervallWerte && hatDatenStyle( DiagDaten::Style::AutoIntervallBreite ) )
-        {
-            double maxW = 0;
-            for( int i = 0; i < hIAnz; ++i )
-            {
-                if( daten->hIntervallWerte->hat( i ) && daten->hIntervallWerte->get( i ) > maxW )
-                    maxW = daten->hIntervallWerte->get( i );
-            }
-            if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                daten->hIntervallBreite = maxW ? ( horizontalScrollBar->getScroll() / maxW ) : 0;
-            else
-                daten->hIntervallBreite = maxW ? ( hIntervallRB->getBreite() / maxW ) : 0;
-        }
-        if( hatDatenStyle( DiagDaten::Style::AutoRasterBreite ) )
-            daten->rasterBreite = daten->hIntervallBreite;
-    }
-    if( hatDatenStyle( DiagDaten::Style::VIntervall ) && textRd && schriftGr && daten )
-    { // Rendern des vertikalen Intervalls
-        int vIRBbr = innenSize.y;
-        if( hatDatenStyle( DiagDaten::Style::HIntervall ) && daten->hIntervallFarbe )
-            vIRBbr -= schriftGr + 2;
-        if( vIRBbr > 0 )
-        {
-            if( vIntervallRB->getBreite() != vIRBbr || vIntervallRB->getHeight() != schriftGr + 2 )
-                vIntervallRB->neuBild( vIRBbr, schriftGr + 2, 0xFF000000 );
-            else
-                vIntervallRB->fillRegion( 0, 0, vIRBbr, schriftGr + 2, 0xFF000000 );
-            textRd->setSchriftSize( schriftGr );
-            if( daten->vIntervallWerte )
-            {
-                int *rf = new int[ vIAnz ];
-                int anz = 0;
-                bool *fertig = new bool[ vIAnz ];
-                ZeroMemory( fertig, vIAnz );
-                for( int i = 0; i < vIAnz; ++i )
-                {
-                    double min = 0;
-                    int mI = -1;
-                    for( int j = 0; j < vIAnz; ++j )
-                    {
-                        if( !fertig[ j ] && daten->vIntervallWerte->hat( j ) && ( daten->vIntervallWerte->get( j ) < min || mI < 0 ) )
-                        {
-                            mI = j;
-                            min = daten->vIntervallWerte->get( j );
-                        }
-                    }
-                    if( mI < 0 )
-                        break;
-                    rf[ anz ] = mI;
-                    ++anz;
-                    fertig[ mI ] = 1;
-                }
-                delete[] fertig;
-                Text txt;
-                int xPos = 0;
-                if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                    xPos -= vertikalScrollBar->getScroll();
-                int rWeite = xPos - 10;
-                for( int i = anz - 1; i >= 0; --i )
-                {
-                    txt = "";
-                    if( hatDatenStyle( DiagDaten::Style::VIntervallTexte ) && daten->vIntervallTexte && daten->vIntervallTexte->z( rf[ i ] ) )
-                        txt = daten->vIntervallTexte->z( rf[ i ] )->getText();
-                    else if( hatDatenStyleNicht( DiagDaten::Style::VIntervallTexte ) || !daten->vIntervallWerte )
-                        txt = daten->vIntervallWerte->get( rf[ i ] );
-                    xPos = (int)( daten->vIntervallWerte->get( rf[ i ] ) * daten->vIntervallHeight );
-                    xPos = ( vertikalScrollBar && hatStyle( Style::VScroll ) ? vertikalScrollBar->getScroll() : vIntervallRB->getBreite() ) - xPos;
-                    if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                        xPos -= vertikalScrollBar->getScroll();
-                    int br = textRd->getTextBreite( txt );
-                    if( xPos + br > vIntervallRB->getBreite() && vIntervallRB->getBreite() - br >= rWeite + 10 )
-                        xPos = vIntervallRB->getBreite() - br;
-                    if( xPos >= rWeite + 10 )
-                    {
-                        textRd->renderText( xPos, 1, txt, *vIntervallRB, daten->vIntervallFarbe );
-                        rWeite = xPos + br + 10;
-                    }
-                }
-                delete[] rf;
-            }
-            if( daten->vIntervallName )
-            {
-                int vinbr = textRd->getTextBreite( daten->vIntervallName->getText() );
-                int vinx = vIntervallRB->getBreite() / 2 - vinbr / 2;
-                vIntervallRB->fillRegion( vinx - 5, 1, vinbr + 10, schriftGr, 0xFF000000 );
-                textRd->renderText( vinx, 1, daten->vIntervallName->getText(), *vIntervallRB, daten->vIntervallFarbe );
-            }
-            if( hatDatenStyle( DiagDaten::Style::HIntervall ) && daten->hIntervallFarbe )
-                zRObj.alphaBild90( innenSize.x - vIntervallRB->getHeight(), schriftGr + 2, vIntervallRB->getBreite(), vIntervallRB->getHeight(), *vIntervallRB );
-            else
-                zRObj.alphaBild90( innenSize.x - vIntervallRB->getHeight(), 0, vIntervallRB->getBreite(), vIntervallRB->getHeight(), *vIntervallRB );
-            dgbr -= vIntervallRB->getHeight();
-        }
-    }
-    if( hatDatenStyle( DiagDaten::Style::HIntervall ) && textRd && schriftGr && daten )
-    { // Rendern des horizontalen Intervalls
-        int hIRBbr = innenSize.x;
-        if( hatDatenStyle( DiagDaten::Style::VIntervall ) && daten->vIntervallFarbe )
-            hIRBbr -= schriftGr + 2;
-        if( hIRBbr > 0 )
-        {
-            if( hIntervallRB->getBreite() != hIRBbr || hIntervallRB->getHeight() != schriftGr + 2 )
-                hIntervallRB->neuBild( hIRBbr, schriftGr + 2, 0xFF000000 );
-            else
-                hIntervallRB->fillRegion( 0, 0, hIRBbr, schriftGr + 2, 0xFF000000 );
-            textRd->setSchriftSize( schriftGr );
-            if( daten->hIntervallWerte )
-            {
-                int *rf = new int[ hIAnz ];
-                int anz = 0;
-                bool *fertig = new bool[ hIAnz ];
-                ZeroMemory( fertig, hIAnz );
-                for( int i = 0; i < hIAnz; ++i )
-                {
-                    double min = 0;
-                    int mI = -1;
-                    for( int j = 0; j < hIAnz; ++j )
-                    {
-                        if( !fertig[ j ] && daten->hIntervallWerte->hat( j ) && ( daten->hIntervallWerte->get( j ) < min || mI < 0 ) )
-                        {
-                            mI = j;
-                            min = daten->hIntervallWerte->get( j );
-                        }
-                    }
-                    if( mI < 0 )
-                        break;
-                    rf[ anz ] = mI;
-                    ++anz;
-                    fertig[ mI ] = 1;
-                }
-                delete[] fertig;
-                Text txt;
-                int xPos = 0;
-                if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                    xPos -= horizontalScrollBar->getScroll();
-                int rWeite = xPos - 10;
-                for( int i = 0; i < anz; ++i )
-                {
-                    txt = "";
-                    if( hatDatenStyle( DiagDaten::Style::HIntervallTexte ) && daten->hIntervallTexte && daten->hIntervallTexte->z( rf[ i ] ) )
-                        txt = daten->hIntervallTexte->z( rf[ i ] )->getText();
-                    else if( hatDatenStyleNicht( DiagDaten::Style::HIntervallTexte ) || !daten->hIntervallWerte )
-                        txt = daten->hIntervallWerte->get( rf[ i ] );
-                    xPos = (int)( daten->hIntervallWerte->get( rf[ i ] ) * daten->hIntervallBreite );
-                    if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                        xPos -= horizontalScrollBar->getScroll();
-                    int br = textRd->getTextBreite( txt );
-                    if( xPos + br > hIntervallRB->getBreite() && hIntervallRB->getBreite() - br >= rWeite + 10 )
-                        xPos = hIntervallRB->getBreite() - br;
-                    if( xPos >= rWeite + 10 )
-                    {
-                        textRd->renderText( xPos, 1, txt, *hIntervallRB, daten->hIntervallFarbe );
-                        rWeite = xPos + br + 10;
-                    }
-                }
-                delete[] rf;
-            }
-            if( daten->hIntervallName )
-            {
-                int hinbr = textRd->getTextBreite( daten->hIntervallName->getText() );
-                int hinx = hIntervallRB->getBreite() / 2 - hinbr / 2;
-                hIntervallRB->fillRegion( hinx - 5, 1, hinbr + 10, schriftGr, 0xFF000000 );
-                textRd->renderText( hinx, 1, daten->hIntervallName->getText(), *hIntervallRB, daten->hIntervallFarbe );
-            }
-            zRObj.alphaBild( 0, 0, hIntervallRB->getBreite(), hIntervallRB->getHeight(), *hIntervallRB );
-            dghi -= hIntervallRB->getHeight();
-            dgy += hIntervallRB->getHeight();
-        }
-    }
-    if( !zRObj.setDrawOptions( 0, dgy, dgbr, dghi ) )
-    {
-        zRObj.releaseDrawOptions();
-        unlockZeichnung();
-        return;
-    }
-    dgy = 0;
-    int dgrbr = 0;
-    if( hatStyle( Style::DatenRahmen ) && dRam )
-    {
-        dRam->setSize( dgbr, dghi );
-        dRam->render( zRObj );
-        dgrbr = dRam->getRBreite();
-    }
-    if( !zRObj.setDrawOptions( dgrbr, dgrbr, dgbr - dgrbr * 2, dghi - dgrbr * 2 ) )
-    {
-        zRObj.releaseDrawOptions();
-        zRObj.releaseDrawOptions();
-        unlockZeichnung();
-        return;
-    }
-    if( hatStyle( Style::DatenHintergrund ) )
-    {
-        if( hatStyle( Style::DatenHAlpha ) )
-            zRObj.alphaRegion( 0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, dBgF );
-        else
-            zRObj.fillRegion( 0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, dBgF );
-        if( hatStyle( Style::DatenHBild ) && dBgB )
-        {
-            if( hatStyle( Style::DatenHAlpha ) )
-                zRObj.alphaBild( 0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, *dBgB );
-            else
-                zRObj.drawBild( 0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, *dBgB );
-        }
-    }
-    if( hatStyle( Style::DatenBuffered ) && dAf )
-    {
-        dAf->setSize( dgbr - dgrbr * 2, dghi - dgrbr * 2 );
-        dAf->render( zRObj );
-    }
-    if( hatDatenStyle( DiagDaten::Style::Raster ) && daten && daten->rasterDicke && daten->rasterBreite && daten->rasterHeight )
-    { // Raster
-        int maxBr = dgbr;
-        if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-            maxBr = horizontalScrollBar->getScroll();
-        int maxHi = dghi;
-        if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-            maxHi = vertikalScrollBar->getScroll();
-        for( double x = horizontalScrollBar && hatStyle( Style::HScroll ) ? -horizontalScrollBar->getScroll() : 0; x < maxBr; x += daten->rasterBreite )
-        {
-            for( int i = 0; i < daten->rasterDicke; ++i )
-            {
-                if( hatDatenStyle( DiagDaten::Style::RasterAlpha ) )
-                    zRObj.drawLinieVAlpha( (int)( x + i ), dgy + dgrbr, dghi - dgrbr * 2, daten->rasterFarbe );
-                else
-                    zRObj.drawLinieV( (int)( x + i ), dgy + dgrbr, dghi - dgrbr * 2, daten->rasterFarbe );
-            }
-        }
-        for( double y = maxHi; y > ( vertikalScrollBar && hatStyle( Style::VScroll ) ? -vertikalScrollBar->getScroll() : 0 ); y -= daten->rasterHeight )
-        {
-            for( int i = 0; i < daten->rasterDicke; ++i )
-            {
-                if( hatDatenStyle( DiagDaten::Style::RasterAlpha ) )
-                    zRObj.drawLinieHAlpha( 0, (int)( y + i ), dgbr - dgrbr * 2, daten->rasterFarbe );
-                else
-                    zRObj.drawLinieH( 0, (int)( y + i ), dgbr - dgrbr * 2, daten->rasterFarbe );
-            }
-        }
-    }
-    if( daten && daten->werte && daten->werte->getEintragAnzahl() && daten->hIntervallBreite && daten->vIntervallHeight )
-    { // Werte
-        int wAnz = daten->werte->getEintragAnzahl();
-        for( int i = 0; i < wAnz; ++i )
-        {
-            DiagWert *wert = daten->werte->z( i );
-            if( wert && hatWertStyle( i, DiagWert::Style::Sichtbar ) && wert->punkte && wert->punkte->getEintragAnzahl() )
-            {
-                int pAnz = wert->punkte->getEintragAnzahl();
-                int *rf = new int[ pAnz ];
-                bool *fertig = new bool[ pAnz ];
-                int anz = 0;
-                ZeroMemory( fertig, pAnz );
-                for( int j = 0; j < pAnz; ++j )
-                {
-                    double min = -1;
-                    int p = -1;
-                    for( int pi = 0; pi < pAnz; ++pi )
-                    {
-                        if( wert->punkte->hat( pi ) && !fertig[ pi ] && ( p < 0 || wert->punkte->get( pi )->hIntervall < min ) )
-                        {
-                            min = wert->punkte->get( pi )->hIntervall;
-                            p = pi;
-                        }
-                    }
-                    if( p < 0 )
-                        break;
-                    rf[ anz ] = p;
-                    fertig[ p ] = 1;
-                    ++anz;
-                }
-                delete[] fertig;
-                int rpx = horizontalScrollBar && hatStyle( Style::HScroll ) ? -horizontalScrollBar->getScroll() : 0;
-                int rpy = vertikalScrollBar && hatStyle( Style::VScroll ) ? -vertikalScrollBar->getScroll() : 0;
-                rpy += dgy;
-                int dgmhi = vertikalScrollBar && hatStyle( Style::VScroll ) ? dgy + vertikalScrollBar->getScrollData()->max + dgrbr : dgy + dghi - dgrbr;
-                if( hatWertStyle( i, DiagWert::Style::Hintergrund ) )
-                {
-                    DiagPunkt *vorher = 0;
-                    DiagPunkt *jetzt = 0;
-                    for( int j = 0; j < anz; ++j )
-                    {
-                        jetzt = wert->punkte->get( rf[ j ] );
-                        if( jetzt && vorher )
-                        {
-                            int ax = (int)( rpx + vorher->hIntervall * daten->hIntervallBreite );
-                            int ay = (int)( dgmhi - vorher->vIntervall * daten->vIntervallHeight );
-                            int bx = (int)( rpx + jetzt->hIntervall * daten->hIntervallBreite );
-                            int by = (int)( dgmhi - jetzt->vIntervall * daten->vIntervallHeight );
-                            if( ax >= bx )
-                            {
-                                vorher = jetzt;
-                                continue;
-                            }
-                            if( !( ax > dgbr - dgrbr || bx < 0 || ( ay > dgy + dghi - dgrbr && by > dgy + dghi - dgrbr ) ) )
-                            {
-                                double yf = (double)( by - ay ) / ( bx - ax );
-                                double y = (double)ay;
-                                ax = ax < 0 ? 0 : ax;
-                                bx = bx > dgbr - dgrbr ? dgbr - dgrbr : bx;
-                                if( hatWertStyle( i, DiagWert::Style::HAlpha ) )
-                                {
-                                    for( int x = ax; x < bx; x++, y += yf )
-                                        zRObj.drawLinieVAlpha( x, (int)( y + 0.5 ), dgmhi - (int)( y + 0.5 ), wert->hintergrund );
-                                }
-                                else
-                                {
-                                    for( int x = ax; x < bx; x++, y += yf )
-                                        zRObj.drawLinieV( x, (int)( y + 0.5 ), dgmhi - (int)( y + 0.5 ), wert->hintergrund );
-                                }
-                                if( hatWertStyle( i, DiagWert::Style::Alpha ) )
-                                    zRObj.drawLinieAlpha( Punkt( ax, ay ), Punkt( bx, by ), wert->farbe );
-                                else
-                                    zRObj.drawLinie( Punkt( ax, ay ), Punkt( bx, by ), wert->farbe );
-                            }
-                        }
-                        vorher = jetzt;
-                    }
-                }
-                else
-                {
-                    DiagPunkt *vorher = 0;
-                    DiagPunkt *jetzt = 0;
-                    for( int j = 0; j < anz; ++j )
-                    {
-                        jetzt = wert->punkte->get( rf[ j ] );
-                        if( jetzt && vorher )
-                        {
-                            if( hatWertStyle( i, DiagWert::Style::Alpha ) )
-                                zRObj.drawLinieAlpha( Punkt( (int)( rpx + vorher->hIntervall * daten->hIntervallBreite ), (int)( dgmhi - vorher->vIntervall * daten->vIntervallHeight ) ),
-                                                      Punkt( (int)( rpx + jetzt->hIntervall * daten->hIntervallBreite ), (int)( dgmhi - jetzt->vIntervall * daten->vIntervallHeight ) ), wert->farbe );
-                            else
-                                zRObj.drawLinie( Punkt( (int)( rpx + vorher->hIntervall * daten->hIntervallBreite ), (int)( dgmhi - vorher->vIntervall * daten->vIntervallHeight ) ),
-                                                 Punkt( (int)( rpx + jetzt->hIntervall * daten->hIntervallBreite ), (int)( dgmhi - jetzt->vIntervall * daten->vIntervallHeight ) ), wert->farbe );
-                        }
-                        vorher = jetzt;
-                    }
-                }
-                delete[] rf;
-            }
-        }
-    }
-    if( daten && daten->werte && daten->werte->getEintragAnzahl() && textRd && schriftGr )
-    {
-        int wAnz = daten->werte->getEintragAnzahl();
-        int rx = 5;
-        int ry = 5;
-        textRd->setSchriftSize( schriftGr );
-        for( int i = 0; i < wAnz; ++i )
-        {
-            DiagWert *w = daten->werte->z( i );
-            if( w && w->name && hatWertStyle( i, DiagWert::Style::Name ) && hatWertStyle( i, DiagWert::Style::Sichtbar ) )
-            {
-                int br = textRd->getTextBreite( w->name->getText() );
-                zRObj.alphaRegion( rx, ry, br, schriftGr, 0xA0000000 );
-                textRd->renderText( rx, ry, w->name->getText(), zRObj, w->farbe );
-                ry += 15;
-            }
-        }
-    }
-    zRObj.releaseDrawOptions();
-    zRObj.releaseDrawOptions();
-    zRObj.releaseDrawOptions();
-    unlockZeichnung();
+	dBgF = f;
+	rend = 1;
+}
+
+void LDiag::setDatenHintergrundBildZ(Bild* b)
+{
+	lockZeichnung();
+	if (dBgB)
+		dBgB->release();
+	dBgB = b;
+	unlockZeichnung();
+	rend = 1;
+}
+
+void LDiag::setDatenHintergrundBild(Bild* b)
+{
+	lockZeichnung();
+	if (!dBgB)
+		dBgB = new Bild();
+	dBgB->neuBild(b->getBreite(), b->getHeight(), 0);
+	dBgB->drawBild(0, 0, b->getBreite(), b->getHeight(), *b);
+	unlockZeichnung();
+	b->release();
+	rend = 1;
+}
+
+void LDiag::setDatenAlphaFeldZ(AlphaFeld* af) // Setzt das AlphaFeld des eigentlichen Diagramms
+{
+	lockZeichnung();
+	if (dAf)
+		dAf->release();
+	dAf = af;
+	unlockZeichnung();
+	rend = 1;
+}
+
+void LDiag::setDatenAlphaFeld(AlphaFeld* af)
+{
+	lockZeichnung();
+	if (!dAf)
+		dAf = new AlphaFeld();
+	dAf->setFarbe(af->getFarbe());
+	dAf->setStrength(af->getStrength());
+	unlockZeichnung();
+	af->release();
+	rend = 1;
+}
+
+void LDiag::setDatenAlphaFeldFarbe(int f)
+{
+	lockZeichnung();
+	if (!dAf)
+		dAf = new AlphaFeld();
+	dAf->setFarbe(f);
+	unlockZeichnung();
+	rend = 1;
+}
+
+void LDiag::setDatenAlphaFeldStrength(int st)
+{
+	lockZeichnung();
+	if (!dAf)
+		dAf = new AlphaFeld();
+	if (dAf->getStrength() != st)
+		rend = 1;
+	dAf->setStrength(st);
+	unlockZeichnung();
+}
+
+void LDiag::render(Bild& zRObj)
+{
+	if (!hatDatenStyle(DiagDaten::Style::Sichtbar))
+		return;
+	ZeichnungHintergrund::render(zRObj);
+	if (!zRObj.setDrawOptions(innenPosition, innenSize))
+		return;
+	lockZeichnung();
+	int dgy = 0;
+	int dgbr = innenSize.x;
+	int dghi = innenSize.y;
+	int vIAnz = 0;
+	int hIAnz = 0;
+	if (daten)
+	{ // Auto werte berechnen
+		vIAnz = daten->vIntervallWerte ? daten->vIntervallWerte->getEintragAnzahl() : 0;
+		hIAnz = daten->hIntervallWerte ? daten->hIntervallWerte->getEintragAnzahl() : 0;
+		if (daten->vIntervallWerte && hatDatenStyle(DiagDaten::Style::AutoIntervallHeight))
+		{
+			double maxW = 0;
+			for (int i = 0; i < vIAnz; ++i)
+			{
+				if (daten->vIntervallWerte->hat(i) && daten->vIntervallWerte->get(i) > maxW)
+					maxW = daten->vIntervallWerte->get(i);
+			}
+			if (vertikalScrollBar && hatStyle(Style::VScroll))
+				daten->vIntervallHeight = maxW ? (vertikalScrollBar->getScroll() / maxW) : 0;
+			else
+				daten->vIntervallHeight = maxW ? (vIntervallRB->getBreite() / maxW) : 0;
+		}
+		if (hatDatenStyle(DiagDaten::Style::AutoRasterHeight))
+			daten->rasterHeight = daten->vIntervallHeight;
+		if (daten->hIntervallWerte && hatDatenStyle(DiagDaten::Style::AutoIntervallBreite))
+		{
+			double maxW = 0;
+			for (int i = 0; i < hIAnz; ++i)
+			{
+				if (daten->hIntervallWerte->hat(i) && daten->hIntervallWerte->get(i) > maxW)
+					maxW = daten->hIntervallWerte->get(i);
+			}
+			if (horizontalScrollBar && hatStyle(Style::HScroll))
+				daten->hIntervallBreite = maxW ? (horizontalScrollBar->getScroll() / maxW) : 0;
+			else
+				daten->hIntervallBreite = maxW ? (hIntervallRB->getBreite() / maxW) : 0;
+		}
+		if (hatDatenStyle(DiagDaten::Style::AutoRasterBreite))
+			daten->rasterBreite = daten->hIntervallBreite;
+	}
+	if (hatDatenStyle(DiagDaten::Style::VIntervall) && textRd && schriftGr && daten)
+	{ // Rendern des vertikalen Intervalls
+		int vIRBbr = innenSize.y;
+		if (hatDatenStyle(DiagDaten::Style::HIntervall) && daten->hIntervallFarbe)
+			vIRBbr -= schriftGr + 2;
+		if (vIRBbr > 0)
+		{
+			if (vIntervallRB->getBreite() != vIRBbr || vIntervallRB->getHeight() != schriftGr + 2)
+				vIntervallRB->neuBild(vIRBbr, schriftGr + 2, 0xFF000000);
+			else
+				vIntervallRB->fillRegion(0, 0, vIRBbr, schriftGr + 2, 0xFF000000);
+			textRd->setSchriftSize(schriftGr);
+			if (daten->vIntervallWerte)
+			{
+				int* rf = new int[vIAnz];
+				int anz = 0;
+				bool* fertig = new bool[vIAnz];
+				ZeroMemory(fertig, vIAnz);
+				for (int i = 0; i < vIAnz; ++i)
+				{
+					double min = 0;
+					int mI = -1;
+					for (int j = 0; j < vIAnz; ++j)
+					{
+						if (!fertig[j] && daten->vIntervallWerte->hat(j) && (daten->vIntervallWerte->get(j) < min || mI < 0))
+						{
+							mI = j;
+							min = daten->vIntervallWerte->get(j);
+						}
+					}
+					if (mI < 0)
+						break;
+					rf[anz] = mI;
+					++anz;
+					fertig[mI] = 1;
+				}
+				delete[] fertig;
+				Text txt;
+				int xPos = 0;
+				if (vertikalScrollBar && hatStyle(Style::VScroll))
+					xPos -= vertikalScrollBar->getScroll();
+				int rWeite = xPos - 10;
+				for (int i = anz - 1; i >= 0; --i)
+				{
+					txt = "";
+					if (hatDatenStyle(DiagDaten::Style::VIntervallTexte) && daten->vIntervallTexte && daten->vIntervallTexte->z(rf[i]))
+						txt = daten->vIntervallTexte->z(rf[i])->getText();
+					else if (hatDatenStyleNicht(DiagDaten::Style::VIntervallTexte) || !daten->vIntervallWerte)
+						txt = daten->vIntervallWerte->get(rf[i]);
+					xPos = (int)(daten->vIntervallWerte->get(rf[i]) * daten->vIntervallHeight);
+					xPos = (vertikalScrollBar && hatStyle(Style::VScroll) ? vertikalScrollBar->getScroll() : vIntervallRB->getBreite()) - xPos;
+					if (vertikalScrollBar && hatStyle(Style::VScroll))
+						xPos -= vertikalScrollBar->getScroll();
+					int br = textRd->getTextBreite(txt);
+					if (xPos + br > vIntervallRB->getBreite() && vIntervallRB->getBreite() - br >= rWeite + 10)
+						xPos = vIntervallRB->getBreite() - br;
+					if (xPos >= rWeite + 10)
+					{
+						textRd->renderText(xPos, 1, txt, *vIntervallRB, daten->vIntervallFarbe);
+						rWeite = xPos + br + 10;
+					}
+				}
+				delete[] rf;
+			}
+			if (daten->vIntervallName)
+			{
+				int vinbr = textRd->getTextBreite(daten->vIntervallName->getText());
+				int vinx = vIntervallRB->getBreite() / 2 - vinbr / 2;
+				vIntervallRB->fillRegion(vinx - 5, 1, vinbr + 10, schriftGr, 0xFF000000);
+				textRd->renderText(vinx, 1, daten->vIntervallName->getText(), *vIntervallRB, daten->vIntervallFarbe);
+			}
+			if (hatDatenStyle(DiagDaten::Style::HIntervall) && daten->hIntervallFarbe)
+				zRObj.alphaBild90(innenSize.x - vIntervallRB->getHeight(), schriftGr + 2, vIntervallRB->getBreite(), vIntervallRB->getHeight(), *vIntervallRB);
+			else
+				zRObj.alphaBild90(innenSize.x - vIntervallRB->getHeight(), 0, vIntervallRB->getBreite(), vIntervallRB->getHeight(), *vIntervallRB);
+			dgbr -= vIntervallRB->getHeight();
+		}
+	}
+	if (hatDatenStyle(DiagDaten::Style::HIntervall) && textRd && schriftGr && daten)
+	{ // Rendern des horizontalen Intervalls
+		int hIRBbr = innenSize.x;
+		if (hatDatenStyle(DiagDaten::Style::VIntervall) && daten->vIntervallFarbe)
+			hIRBbr -= schriftGr + 2;
+		if (hIRBbr > 0)
+		{
+			if (hIntervallRB->getBreite() != hIRBbr || hIntervallRB->getHeight() != schriftGr + 2)
+				hIntervallRB->neuBild(hIRBbr, schriftGr + 2, 0xFF000000);
+			else
+				hIntervallRB->fillRegion(0, 0, hIRBbr, schriftGr + 2, 0xFF000000);
+			textRd->setSchriftSize(schriftGr);
+			if (daten->hIntervallWerte)
+			{
+				int* rf = new int[hIAnz];
+				int anz = 0;
+				bool* fertig = new bool[hIAnz];
+				ZeroMemory(fertig, hIAnz);
+				for (int i = 0; i < hIAnz; ++i)
+				{
+					double min = 0;
+					int mI = -1;
+					for (int j = 0; j < hIAnz; ++j)
+					{
+						if (!fertig[j] && daten->hIntervallWerte->hat(j) && (daten->hIntervallWerte->get(j) < min || mI < 0))
+						{
+							mI = j;
+							min = daten->hIntervallWerte->get(j);
+						}
+					}
+					if (mI < 0)
+						break;
+					rf[anz] = mI;
+					++anz;
+					fertig[mI] = 1;
+				}
+				delete[] fertig;
+				Text txt;
+				int xPos = 0;
+				if (horizontalScrollBar && hatStyle(Style::HScroll))
+					xPos -= horizontalScrollBar->getScroll();
+				int rWeite = xPos - 10;
+				for (int i = 0; i < anz; ++i)
+				{
+					txt = "";
+					if (hatDatenStyle(DiagDaten::Style::HIntervallTexte) && daten->hIntervallTexte && daten->hIntervallTexte->z(rf[i]))
+						txt = daten->hIntervallTexte->z(rf[i])->getText();
+					else if (hatDatenStyleNicht(DiagDaten::Style::HIntervallTexte) || !daten->hIntervallWerte)
+						txt = daten->hIntervallWerte->get(rf[i]);
+					xPos = (int)(daten->hIntervallWerte->get(rf[i]) * daten->hIntervallBreite);
+					if (horizontalScrollBar && hatStyle(Style::HScroll))
+						xPos -= horizontalScrollBar->getScroll();
+					int br = textRd->getTextBreite(txt);
+					if (xPos + br > hIntervallRB->getBreite() && hIntervallRB->getBreite() - br >= rWeite + 10)
+						xPos = hIntervallRB->getBreite() - br;
+					if (xPos >= rWeite + 10)
+					{
+						textRd->renderText(xPos, 1, txt, *hIntervallRB, daten->hIntervallFarbe);
+						rWeite = xPos + br + 10;
+					}
+				}
+				delete[] rf;
+			}
+			if (daten->hIntervallName)
+			{
+				int hinbr = textRd->getTextBreite(daten->hIntervallName->getText());
+				int hinx = hIntervallRB->getBreite() / 2 - hinbr / 2;
+				hIntervallRB->fillRegion(hinx - 5, 1, hinbr + 10, schriftGr, 0xFF000000);
+				textRd->renderText(hinx, 1, daten->hIntervallName->getText(), *hIntervallRB, daten->hIntervallFarbe);
+			}
+			zRObj.alphaBild(0, 0, hIntervallRB->getBreite(), hIntervallRB->getHeight(), *hIntervallRB);
+			dghi -= hIntervallRB->getHeight();
+			dgy += hIntervallRB->getHeight();
+		}
+	}
+	if (!zRObj.setDrawOptions(0, dgy, dgbr, dghi))
+	{
+		zRObj.releaseDrawOptions();
+		unlockZeichnung();
+		return;
+	}
+	dgy = 0;
+	int dgrbr = 0;
+	if (hatStyle(Style::DatenRahmen) && dRam)
+	{
+		dRam->setSize(dgbr, dghi);
+		dRam->render(zRObj);
+		dgrbr = dRam->getRBreite();
+	}
+	if (!zRObj.setDrawOptions(dgrbr, dgrbr, dgbr - dgrbr * 2, dghi - dgrbr * 2))
+	{
+		zRObj.releaseDrawOptions();
+		zRObj.releaseDrawOptions();
+		unlockZeichnung();
+		return;
+	}
+	if (hatStyle(Style::DatenHintergrund))
+	{
+		if (hatStyle(Style::DatenHAlpha))
+			zRObj.alphaRegion(0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, dBgF);
+		else
+			zRObj.fillRegion(0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, dBgF);
+		if (hatStyle(Style::DatenHBild) && dBgB)
+		{
+			if (hatStyle(Style::DatenHAlpha))
+				zRObj.alphaBild(0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, *dBgB);
+			else
+				zRObj.drawBild(0, 0, dgbr - dgrbr * 2, dghi - dgrbr * 2, *dBgB);
+		}
+	}
+	if (hatStyle(Style::DatenBuffered) && dAf)
+	{
+		dAf->setSize(dgbr - dgrbr * 2, dghi - dgrbr * 2);
+		dAf->render(zRObj);
+	}
+	if (hatDatenStyle(DiagDaten::Style::Raster) && daten && daten->rasterDicke && daten->rasterBreite && daten->rasterHeight)
+	{ // Raster
+		int maxBr = dgbr;
+		if (horizontalScrollBar && hatStyle(Style::HScroll))
+			maxBr = horizontalScrollBar->getScroll();
+		int maxHi = dghi;
+		if (vertikalScrollBar && hatStyle(Style::VScroll))
+			maxHi = vertikalScrollBar->getScroll();
+		for (double x = horizontalScrollBar && hatStyle(Style::HScroll) ? -horizontalScrollBar->getScroll() : 0; x < maxBr; x += daten->rasterBreite)
+		{
+			for (int i = 0; i < daten->rasterDicke; ++i)
+			{
+				if (hatDatenStyle(DiagDaten::Style::RasterAlpha))
+					zRObj.drawLinieVAlpha((int)(x + i), dgy + dgrbr, dghi - dgrbr * 2, daten->rasterFarbe);
+				else
+					zRObj.drawLinieV((int)(x + i), dgy + dgrbr, dghi - dgrbr * 2, daten->rasterFarbe);
+			}
+		}
+		for (double y = maxHi; y > (vertikalScrollBar && hatStyle(Style::VScroll) ? -vertikalScrollBar->getScroll() : 0); y -= daten->rasterHeight)
+		{
+			for (int i = 0; i < daten->rasterDicke; ++i)
+			{
+				if (hatDatenStyle(DiagDaten::Style::RasterAlpha))
+					zRObj.drawLinieHAlpha(0, (int)(y + i), dgbr - dgrbr * 2, daten->rasterFarbe);
+				else
+					zRObj.drawLinieH(0, (int)(y + i), dgbr - dgrbr * 2, daten->rasterFarbe);
+			}
+		}
+	}
+	if (daten && daten->werte && daten->werte->getEintragAnzahl() && daten->hIntervallBreite && daten->vIntervallHeight)
+	{ // Werte
+		int wAnz = daten->werte->getEintragAnzahl();
+		for (int i = 0; i < wAnz; ++i)
+		{
+			DiagWert* wert = daten->werte->z(i);
+			if (wert && hatWertStyle(i, DiagWert::Style::Sichtbar) && wert->punkte && wert->punkte->getEintragAnzahl())
+			{
+				int pAnz = wert->punkte->getEintragAnzahl();
+				int* rf = new int[pAnz];
+				bool* fertig = new bool[pAnz];
+				int anz = 0;
+				ZeroMemory(fertig, pAnz);
+				for (int j = 0; j < pAnz; ++j)
+				{
+					double min = -1;
+					int p = -1;
+					for (int pi = 0; pi < pAnz; ++pi)
+					{
+						if (wert->punkte->hat(pi) && !fertig[pi] && (p < 0 || wert->punkte->get(pi)->hIntervall < min))
+						{
+							min = wert->punkte->get(pi)->hIntervall;
+							p = pi;
+						}
+					}
+					if (p < 0)
+						break;
+					rf[anz] = p;
+					fertig[p] = 1;
+					++anz;
+				}
+				delete[] fertig;
+				int rpx = horizontalScrollBar && hatStyle(Style::HScroll) ? -horizontalScrollBar->getScroll() : 0;
+				int rpy = vertikalScrollBar && hatStyle(Style::VScroll) ? -vertikalScrollBar->getScroll() : 0;
+				rpy += dgy;
+				int dgmhi = vertikalScrollBar && hatStyle(Style::VScroll) ? dgy + vertikalScrollBar->getScrollData()->max + dgrbr : dgy + dghi - dgrbr;
+				if (hatWertStyle(i, DiagWert::Style::Hintergrund))
+				{
+					DiagPunkt* vorher = 0;
+					DiagPunkt* jetzt = 0;
+					for (int j = 0; j < anz; ++j)
+					{
+						jetzt = wert->punkte->get(rf[j]);
+						if (jetzt && vorher)
+						{
+							int ax = (int)(rpx + vorher->hIntervall * daten->hIntervallBreite);
+							int ay = (int)(dgmhi - vorher->vIntervall * daten->vIntervallHeight);
+							int bx = (int)(rpx + jetzt->hIntervall * daten->hIntervallBreite);
+							int by = (int)(dgmhi - jetzt->vIntervall * daten->vIntervallHeight);
+							if (ax >= bx)
+							{
+								vorher = jetzt;
+								continue;
+							}
+							if (!(ax > dgbr - dgrbr || bx < 0 || (ay > dgy + dghi - dgrbr && by > dgy + dghi - dgrbr)))
+							{
+								double yf = (double)(by - ay) / (bx - ax);
+								double y = (double)ay;
+								ax = ax < 0 ? 0 : ax;
+								bx = bx > dgbr - dgrbr ? dgbr - dgrbr : bx;
+								if (hatWertStyle(i, DiagWert::Style::HAlpha))
+								{
+									for (int x = ax; x < bx; x++, y += yf)
+										zRObj.drawLinieVAlpha(x, (int)(y + 0.5), dgmhi - (int)(y + 0.5), wert->hintergrund);
+								}
+								else
+								{
+									for (int x = ax; x < bx; x++, y += yf)
+										zRObj.drawLinieV(x, (int)(y + 0.5), dgmhi - (int)(y + 0.5), wert->hintergrund);
+								}
+								if (hatWertStyle(i, DiagWert::Style::Alpha))
+									zRObj.drawLinieAlpha(Punkt(ax, ay), Punkt(bx, by), wert->farbe);
+								else
+									zRObj.drawLinie(Punkt(ax, ay), Punkt(bx, by), wert->farbe);
+							}
+						}
+						vorher = jetzt;
+					}
+				}
+				else
+				{
+					DiagPunkt* vorher = 0;
+					DiagPunkt* jetzt = 0;
+					for (int j = 0; j < anz; ++j)
+					{
+						jetzt = wert->punkte->get(rf[j]);
+						if (jetzt && vorher)
+						{
+							if (hatWertStyle(i, DiagWert::Style::Alpha))
+								zRObj.drawLinieAlpha(Punkt((int)(rpx + vorher->hIntervall * daten->hIntervallBreite), (int)(dgmhi - vorher->vIntervall * daten->vIntervallHeight)),
+									Punkt((int)(rpx + jetzt->hIntervall * daten->hIntervallBreite), (int)(dgmhi - jetzt->vIntervall * daten->vIntervallHeight)), wert->farbe);
+							else
+								zRObj.drawLinie(Punkt((int)(rpx + vorher->hIntervall * daten->hIntervallBreite), (int)(dgmhi - vorher->vIntervall * daten->vIntervallHeight)),
+									Punkt((int)(rpx + jetzt->hIntervall * daten->hIntervallBreite), (int)(dgmhi - jetzt->vIntervall * daten->vIntervallHeight)), wert->farbe);
+						}
+						vorher = jetzt;
+					}
+				}
+				delete[] rf;
+			}
+		}
+	}
+	if (daten && daten->werte && daten->werte->getEintragAnzahl() && textRd && schriftGr)
+	{
+		int wAnz = daten->werte->getEintragAnzahl();
+		int rx = 5;
+		int ry = 5;
+		textRd->setSchriftSize(schriftGr);
+		for (int i = 0; i < wAnz; ++i)
+		{
+			DiagWert* w = daten->werte->z(i);
+			if (w && w->name && hatWertStyle(i, DiagWert::Style::Name) && hatWertStyle(i, DiagWert::Style::Sichtbar))
+			{
+				int br = textRd->getTextBreite(w->name->getText());
+				zRObj.alphaRegion(rx, ry, br, schriftGr, 0xA0000000);
+				textRd->renderText(rx, ry, w->name->getText(), zRObj, w->farbe);
+				ry += 15;
+			}
+		}
+	}
+	zRObj.releaseDrawOptions();
+	zRObj.releaseDrawOptions();
+	zRObj.releaseDrawOptions();
+	unlockZeichnung();
 }
 
 // constant
-Schrift *LDiag::getSchrift() const // Gibt die Schrift zurück
+Schrift* LDiag::getSchrift() const // Gibt die Schrift zurück
 {
-    return textRd ? textRd->getSchrift() : 0;
+	return textRd ? textRd->getSchrift() : 0;
 }
 
-Schrift *LDiag::zSchrift() const
+Schrift* LDiag::zSchrift() const
 {
-    return textRd ? textRd->zSchrift() : 0;
+	return textRd ? textRd->zSchrift() : 0;
 }
 
-Rahmen *LDiag::getDatenRahmen() const // Gibt den inneren Rahmen um das eigentliche Diagramm zurück
+Rahmen* LDiag::getDatenRahmen() const // Gibt den inneren Rahmen um das eigentliche Diagramm zurück
 {
-    return dRam ? dynamic_cast<Rahmen *>( dRam->getThis() ) : 0;
+	return dRam ? dynamic_cast<Rahmen*>(dRam->getThis()) : 0;
 }
 
-Rahmen *LDiag::zDatenRahmen() const
+Rahmen* LDiag::zDatenRahmen() const
 {
-    return dRam;
+	return dRam;
 }
 
 int LDiag::getDatenRahmenFarbe() const
 {
-    return dRam ? dRam->getFarbe() : 0;
+	return dRam ? dRam->getFarbe() : 0;
 }
 
 int LDiag::getDatenRahmenBreite() const
 {
-    return dRam ? dRam->getRBreite() : 0;
+	return dRam ? dRam->getRBreite() : 0;
 }
 
 int LDiag::getDatenHintergrundFarbe() const // Gibt den Hintergrund des eigentlichen Diagramms zurück
 {
-    return dBgF;
+	return dBgF;
 }
 
-Bild *LDiag::getDatenHintergrundBild() const
+Bild* LDiag::getDatenHintergrundBild() const
 {
-    return dBgB ? dynamic_cast<Bild *>( dBgB->getThis() ) : 0;
+	return dBgB ? dynamic_cast<Bild*>(dBgB->getThis()) : 0;
 }
 
-Bild *LDiag::zDatenHintergrundBild() const
+Bild* LDiag::zDatenHintergrundBild() const
 {
-    return dBgB;
+	return dBgB;
 }
 
-AlphaFeld *LDiag::getDatenAlphaFeld() const // Gibt das AlphaFeld des eigentlichen Diagramms zurück
+AlphaFeld* LDiag::getDatenAlphaFeld() const // Gibt das AlphaFeld des eigentlichen Diagramms zurück
 {
-    return dAf ? dynamic_cast<AlphaFeld *>( dAf->getThis() ) : 0;
+	return dAf ? dynamic_cast<AlphaFeld*>(dAf->getThis()) : 0;
 }
 
-AlphaFeld *LDiag::zDatenAlphaFeld() const
+AlphaFeld* LDiag::zDatenAlphaFeld() const
 {
-    return dAf;
+	return dAf;
 }
 
 int LDiag::getDatenAlphaFeldFarbe() const
 {
-    return dAf ? dAf->getFarbe() : 0;
+	return dAf ? dAf->getFarbe() : 0;
 }
 
 int LDiag::getDatenAlphaFeldStrength() const
 {
-    return dAf ? dAf->getStrength() : 0;
+	return dAf ? dAf->getStrength() : 0;
 }

+ 547 - 547
Diagramm.h

@@ -7,567 +7,567 @@
 
 namespace Framework
 {
-    class Rahmen; //! Rahmen.h
-    class AlphaFeld; //! AlphaFeld.h
-    class Text; //! Text.h
-    class Schrift; //! Schrift.h
-    class HScrollBar; //! Scroll.h
-    class VScrollBar; //! Scroll.h
-    class SLDiag; //! aus dieser Datei
-    class LDiag; //! aus dieser Datei
-    class TextRenderer;
+	class Rahmen; //! Rahmen.h
+	class AlphaFeld; //! AlphaFeld.h
+	class Text; //! Text.h
+	class Schrift; //! Schrift.h
+	class HScrollBar; //! Scroll.h
+	class VScrollBar; //! Scroll.h
+	class SLDiag; //! aus dieser Datei
+	class LDiag; //! aus dieser Datei
+	class TextRenderer;
 
-    //! Eine Zeichnung de 2D GUI Frameworks, die ein live Diagramm von werten zeichnet
-    class SLDiag : public ZeichnungHintergrund
-    {
-    public:
-        class Style : public ZeichnungHintergrund::Style
-        {
-        public:
-            const static __int64 Gitter = 0x01000; //! Es wird ein Gitter im Diagramm zur Orientierung gezeichnet
-            const static __int64 LinienName = 0x02000; //! Es werden die Namen der Graphen angezeigt
+	//! Eine Zeichnung de 2D GUI Frameworks, die ein live Diagramm von werten zeichnet
+	class SLDiag : public ZeichnungHintergrund
+	{
+	public:
+		class Style : public ZeichnungHintergrund::Style
+		{
+		public:
+			const static __int64 Gitter = 0x01000; //! Es wird ein Gitter im Diagramm zur Orientierung gezeichnet
+			const static __int64 LinienName = 0x02000; //! Es werden die Namen der Graphen angezeigt
 
-            const static __int64 normal = Sichtbar | Hintergrund | Rahmen | Gitter | LinienName; //! Vereinigung der Flags Sichtbar, Hintergrund, Rahmen, Gitter, LinienName
-        };
-    private:
-        int gF;
-        Array< int > *lFarbe;
-        RCArray< Text > *lName;
-        RCArray< Array< int > > *ph;
-        RCArray< Array< int > > *pb;
-        Array< int > *lastValue;
-        TextRenderer *textRd;
-        Punkt gitterGr;
-        int lines;
+			const static __int64 normal = Sichtbar | Hintergrund | Rahmen | Gitter | LinienName; //! Vereinigung der Flags Sichtbar, Hintergrund, Rahmen, Gitter, LinienName
+		};
+	private:
+		int gF;
+		Array< int >* lFarbe;
+		RCArray< Text >* lName;
+		RCArray< Array< int > >* ph;
+		RCArray< Array< int > >* pb;
+		Array< int >* lastValue;
+		TextRenderer* textRd;
+		Punkt gitterGr;
+		int lines;
 
-    public:
-        //! Konstruktor 
-        DLLEXPORT SLDiag();
-        //! Destruktor 
-        DLLEXPORT virtual ~SLDiag();
-        //! Setzt den verwendeten TextRenderer
-        //! \param textRd Der Textrenderer
-        DLLEXPORT void setTextRendererZ( TextRenderer *textRd );
-        //! Setzt einen Zeiger zur verwendeten Schrift
-        //! \param schrift Die Schrift
-        DLLEXPORT void setSchriftZ( Schrift *schrift );
-        //! Setzt die Abstände zwischen den Linien des Gitters
-        //! \param gr Für x den Abstand zwischen jeder vertikalen Linie in Pixeln und für y den Abstand zwischen jeder Horizontalen Linie in den dargestellen y Werten
-        DLLEXPORT void setGSize( Punkt &gr );
-        //! Setzt die Farbe der Raster Linien
-        //! \param f Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setGFarbe( int f );
-        //! Fügt dem Diagramm einen neuen Graphen hinzu
-        //! \param name Der Name des Graphen. Er wird bei dem Flag LinienName im Diagramm angezeigt
-        DLLEXPORT void addLinie( const char *name );
-        //! Fügt dem Diagramm einen neuen Graphen hinzu
-        //! \param name Der Name des Graphen. Er wird bei dem Flag LinienName im Diagramm angezeigt
-        DLLEXPORT void addLinie( Text *txt );
-        //! Setzt die Farbe eines Graphen
-        //! \param lNum Der Index des Graphen
-        //! \param f Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setLFarbe( int lNum, int f );
-        //! Fügt einem Graphen einen Punkt hinzu. Hierdurch verschieben sich alle Punkte des Graphen so weit nach Links, dass der neue Punkt rechts auftaucht. Geht ein Punkt links aus dem Diagramm raus, wird er gelöscht.
-        //! Auf diese Weise erscheint das Diagramm wie eine Abbildung einer Live Messung
-        //! \param x Der Abstand zum Letzten Punkt in Pixeln
-        //! \param y Den Wert der abgebildeten Funktion in dem Punkt
-        DLLEXPORT void addPunkt( int lNum, int x, int h );
-        //! Entfernt einen Graphen
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT void removeLinie( int lNum );
-        //! Zeichnet das Diagramm
-        //! \param zRObj Das Bild, in das gezeichnet werden soll
-        DLLEXPORT void render( Bild &zRObj ) override;
-        //! Gibt die verwendete Schrift zurück
-        DLLEXPORT Schrift *getSchrift() const;
-        //! Gibt die verwendete Schrift ohne erhöhten Reference Counter zurück
-        DLLEXPORT Schrift *zSchrift() const;
-        //! Gibt die Größe eines Quadrats des Gitters zurück, wobei die Braite in Pixeln und die Höhe in Werten der y Achse ist
-        DLLEXPORT const Punkt &getGSize() const;
-        //! Gibt die Farbe des Gitters in A8R8G8B8 Format zurück
-        DLLEXPORT int getGFarbe() const;
-        //! Gibt den Index eines Graphen zurück
-        //! \param name Der Name des Graphen
-        DLLEXPORT int getLinienNummer( const char *name ) const;
-        //! Gibt den Index eines Graphen zurück
-        //! \param name Der Name des Graphen
-        DLLEXPORT int getLinienNummer( Text *name ) const;
-        //! Gibt den Namen eines Graphen zurück
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT Text *getLinienName( int lNum ) const;
-        //! Gibt den Namen eines Graphen ohne erhöhten Reference Counter zurück
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT Text *zLinienNamen( int lNum ) const;
-        //! Gibt den Höchsten y Wert von allen Graphen zurück
-        DLLEXPORT int getHighestValue() const;
-        //! Gibt den Höchsten y Wert von einem Bestimmten Graphen zurück
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT int getHighestValue( int lNum ) const;
-        //! Gibt den Durchschnittswert aller im Diagramm gespeicherten Punkten eines Graphen zurück
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT int getMedian( int lNum ) const;
-        //! Gibt die Anzahl an Graphen zurück
-        DLLEXPORT int getLAnzahl() const;
-        //! Gibt den y Wert des letzten Punktes eines Graphen zurück
-        //! \param lNum Der Index des Graphen
-        DLLEXPORT int getLastValue( int lNum ) const;
-    };
+	public:
+		//! Konstruktor 
+		DLLEXPORT SLDiag();
+		//! Destruktor 
+		DLLEXPORT virtual ~SLDiag();
+		//! Setzt den verwendeten TextRenderer
+		//! \param textRd Der Textrenderer
+		DLLEXPORT void setTextRendererZ(TextRenderer* textRd);
+		//! Setzt einen Zeiger zur verwendeten Schrift
+		//! \param schrift Die Schrift
+		DLLEXPORT void setSchriftZ(Schrift* schrift);
+		//! Setzt die Abstände zwischen den Linien des Gitters
+		//! \param gr Für x den Abstand zwischen jeder vertikalen Linie in Pixeln und für y den Abstand zwischen jeder Horizontalen Linie in den dargestellen y Werten
+		DLLEXPORT void setGSize(Punkt& gr);
+		//! Setzt die Farbe der Raster Linien
+		//! \param f Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setGFarbe(int f);
+		//! Fügt dem Diagramm einen neuen Graphen hinzu
+		//! \param name Der Name des Graphen. Er wird bei dem Flag LinienName im Diagramm angezeigt
+		DLLEXPORT void addLinie(const char* name);
+		//! Fügt dem Diagramm einen neuen Graphen hinzu
+		//! \param name Der Name des Graphen. Er wird bei dem Flag LinienName im Diagramm angezeigt
+		DLLEXPORT void addLinie(Text* txt);
+		//! Setzt die Farbe eines Graphen
+		//! \param lNum Der Index des Graphen
+		//! \param f Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setLFarbe(int lNum, int f);
+		//! Fügt einem Graphen einen Punkt hinzu. Hierdurch verschieben sich alle Punkte des Graphen so weit nach Links, dass der neue Punkt rechts auftaucht. Geht ein Punkt links aus dem Diagramm raus, wird er gelöscht.
+		//! Auf diese Weise erscheint das Diagramm wie eine Abbildung einer Live Messung
+		//! \param x Der Abstand zum Letzten Punkt in Pixeln
+		//! \param y Den Wert der abgebildeten Funktion in dem Punkt
+		DLLEXPORT void addPunkt(int lNum, int x, int h);
+		//! Entfernt einen Graphen
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT void removeLinie(int lNum);
+		//! Zeichnet das Diagramm
+		//! \param zRObj Das Bild, in das gezeichnet werden soll
+		DLLEXPORT void render(Bild& zRObj) override;
+		//! Gibt die verwendete Schrift zurück
+		DLLEXPORT Schrift* getSchrift() const;
+		//! Gibt die verwendete Schrift ohne erhöhten Reference Counter zurück
+		DLLEXPORT Schrift* zSchrift() const;
+		//! Gibt die Größe eines Quadrats des Gitters zurück, wobei die Braite in Pixeln und die Höhe in Werten der y Achse ist
+		DLLEXPORT const Punkt& getGSize() const;
+		//! Gibt die Farbe des Gitters in A8R8G8B8 Format zurück
+		DLLEXPORT int getGFarbe() const;
+		//! Gibt den Index eines Graphen zurück
+		//! \param name Der Name des Graphen
+		DLLEXPORT int getLinienNummer(const char* name) const;
+		//! Gibt den Index eines Graphen zurück
+		//! \param name Der Name des Graphen
+		DLLEXPORT int getLinienNummer(Text* name) const;
+		//! Gibt den Namen eines Graphen zurück
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT Text* getLinienName(int lNum) const;
+		//! Gibt den Namen eines Graphen ohne erhöhten Reference Counter zurück
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT Text* zLinienNamen(int lNum) const;
+		//! Gibt den Höchsten y Wert von allen Graphen zurück
+		DLLEXPORT int getHighestValue() const;
+		//! Gibt den Höchsten y Wert von einem Bestimmten Graphen zurück
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT int getHighestValue(int lNum) const;
+		//! Gibt den Durchschnittswert aller im Diagramm gespeicherten Punkten eines Graphen zurück
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT int getMedian(int lNum) const;
+		//! Gibt die Anzahl an Graphen zurück
+		DLLEXPORT int getLAnzahl() const;
+		//! Gibt den y Wert des letzten Punktes eines Graphen zurück
+		//! \param lNum Der Index des Graphen
+		DLLEXPORT int getLastValue(int lNum) const;
+	};
 
-    //! Punkt eines Wertes eines Diagramms
-    struct DiagPunkt
-    {
-        //! Position des Punktes auf dem Horizontalen Intervall des Diagramms
-        double hIntervall;
-        //! Position des punktes auf dem Vertikalen Intervall des Diagramms
-        double vIntervall;
-    };
+	//! Punkt eines Wertes eines Diagramms
+	struct DiagPunkt
+	{
+		//! Position des Punktes auf dem Horizontalen Intervall des Diagramms
+		double hIntervall;
+		//! Position des punktes auf dem Vertikalen Intervall des Diagramms
+		double vIntervall;
+	};
 
-    //! Wert der in einem Diagramm visualisiert wird
-    struct DiagWert : public virtual ReferenceCounter
-    {
-        //! Style eines Diagramm Wertes
-        class Style
-        {
-        public:
-            const static int Sichtbar = 0x01; //! Legt fest, ob der Wert angezeigt werden soll
-            const static int Alpha = 0x02; //! Legt fest, ob beim zeichnen des Wertes Alphablending verwendet werden soll
-            const static int Hintergrund = 0x04; //! Legt fest, ob der Wert einen Hintergrund hat
-            const static int HAlpha = 0x08; //! Legt fest, ob beim zeichnen des Hintergrundes Alphablending verwendet werden soll
-            const static int Name = 0x10; //! Legt fest, ob der Name des Wertes gezeichnet werden soll
-        };
-        //! Style des Wertes
-        int style;
-        //! Farbe des Wertes
-        int farbe;
-        //! Hintergrundfarbe des Wertes
-        int hintergrund;
-        //! Name des Wertes
-        Text *name;
-        //! Punkte des Wertes
-        Array< DiagPunkt* > *punkte;
+	//! Wert der in einem Diagramm visualisiert wird
+	struct DiagWert : public virtual ReferenceCounter
+	{
+		//! Style eines Diagramm Wertes
+		class Style
+		{
+		public:
+			const static int Sichtbar = 0x01; //! Legt fest, ob der Wert angezeigt werden soll
+			const static int Alpha = 0x02; //! Legt fest, ob beim zeichnen des Wertes Alphablending verwendet werden soll
+			const static int Hintergrund = 0x04; //! Legt fest, ob der Wert einen Hintergrund hat
+			const static int HAlpha = 0x08; //! Legt fest, ob beim zeichnen des Hintergrundes Alphablending verwendet werden soll
+			const static int Name = 0x10; //! Legt fest, ob der Name des Wertes gezeichnet werden soll
+		};
+		//! Style des Wertes
+		int style;
+		//! Farbe des Wertes
+		int farbe;
+		//! Hintergrundfarbe des Wertes
+		int hintergrund;
+		//! Name des Wertes
+		Text* name;
+		//! Punkte des Wertes
+		Array< DiagPunkt* >* punkte;
 
-        //! Konstruktor
-        DLLEXPORT DiagWert();
-        //! Destruktor
-        DLLEXPORT ~DiagWert();
-    };
+		//! Konstruktor
+		DLLEXPORT DiagWert();
+		//! Destruktor
+		DLLEXPORT ~DiagWert();
+	};
 
-    //! Daten für ein Diagramm
-    struct DiagDaten : public virtual ReferenceCounter
-    {
-        class Style
-        {
-        public:
-            const static int Sichtbar = 0x0001; //! Legt Fest, ob die Daten sichtbar sein sollen
-            const static int Raster = 0x0002; //! Legt fest, ob ein Raster zur Orientierung angezeigt werden soll
-            const static int RasterAlpha = 0x0004; //! Legt fest, ob zum Zeichnen des Rasters Alphablending verwendet werden soll
-            const static int AutoIntervallHeight = 0x0008; //! Legt fest, dass alle Werte automatisch so auf der y Achse Skalliert werden, dass immer die komplette Höhe des Diagramms genutzt wird
-            const static int AutoIntervallBreite = 0x0010; //! Legt fest, dass alle Wert automatisch so auf der x Achse Skalliert werden, dass immer die komplette Breite des Diagramms genutzt wird
-            const static int HIntervall = 0x0020; //! Legt fest, ob die X Achse gezeichnet werden soll
-            const static int VIntervall = 0x0040; //! Legt fest, ob die Y Achse gezeichnet werden soll
-            const static int HIntervallTexte = 0x0200; //! Legt fest, ob spezielle Texte für die Werte der X Achse gezeichnet werden sollen
-            const static int VIntervallTexte = 0x0400; //! Left fest, ob spezielle Texte für die Werte der Y Achse gezeichnet werden sollen
-            const static int AutoRasterBreite = 0x0800; //! Legt fest, ob der Abstand zwischen den Vertikalen Linien des Rasters automatisch gewählt werden soll
-            const static int AutoRasterHeight = 0x1000; //! Legt fest, ob der Abstand zwischen den Horizontalen Rasterlinien automatisch gewählt werden soll
+	//! Daten für ein Diagramm
+	struct DiagDaten : public virtual ReferenceCounter
+	{
+		class Style
+		{
+		public:
+			const static int Sichtbar = 0x0001; //! Legt Fest, ob die Daten sichtbar sein sollen
+			const static int Raster = 0x0002; //! Legt fest, ob ein Raster zur Orientierung angezeigt werden soll
+			const static int RasterAlpha = 0x0004; //! Legt fest, ob zum Zeichnen des Rasters Alphablending verwendet werden soll
+			const static int AutoIntervallHeight = 0x0008; //! Legt fest, dass alle Werte automatisch so auf der y Achse Skalliert werden, dass immer die komplette Höhe des Diagramms genutzt wird
+			const static int AutoIntervallBreite = 0x0010; //! Legt fest, dass alle Wert automatisch so auf der x Achse Skalliert werden, dass immer die komplette Breite des Diagramms genutzt wird
+			const static int HIntervall = 0x0020; //! Legt fest, ob die X Achse gezeichnet werden soll
+			const static int VIntervall = 0x0040; //! Legt fest, ob die Y Achse gezeichnet werden soll
+			const static int HIntervallTexte = 0x0200; //! Legt fest, ob spezielle Texte für die Werte der X Achse gezeichnet werden sollen
+			const static int VIntervallTexte = 0x0400; //! Left fest, ob spezielle Texte für die Werte der Y Achse gezeichnet werden sollen
+			const static int AutoRasterBreite = 0x0800; //! Legt fest, ob der Abstand zwischen den Vertikalen Linien des Rasters automatisch gewählt werden soll
+			const static int AutoRasterHeight = 0x1000; //! Legt fest, ob der Abstand zwischen den Horizontalen Rasterlinien automatisch gewählt werden soll
 
-            const static int intervalle = HIntervall | VIntervall; //! Vereiniegt die Flags HIntervall, VIntervall
-            const static int intervallTexte = HIntervallTexte | VIntervallTexte; //! Vereint die Flags HIntervallTexte, VIntervallTexte
-            const static int autoRaster = AutoRasterHeight | AutoRasterBreite | Raster; //! Vereint die Flags AutoRasterHöhe, AutoRasterBreite, Raster
-            const static int autoIntervall = AutoIntervallHeight | AutoIntervallBreite; //! Vereint die Flags AutoIntervallHöhe, AutoIntervallBreite
-        };
-        //! Style eines Diagramms
-        int style;
-        //! Breite einer Rasterlinie
-        int rasterDicke;
-        //! Breite eines Rasterkästchens
-        double rasterBreite;
-        //! Höhe eines Rasterkästchens
-        double rasterHeight;
-        //! Farbe des Rasters
-        int rasterFarbe;
-        //! Schriftfarbe des Horizontalen Intervalls
-        int hIntervallFarbe;
-        //! Schriftfarbe des Vertikalen Intervalls
-        int vIntervallFarbe;
-        //! Name des Horizontalen Intervalls
-        Text *hIntervallName;
-        //! Name des Vertikalen Intervalls
-        Text *vIntervallName;
-        //! Anzeigen des Horizontalen Intervalls
-        RCArray< Text > *hIntervallTexte;
-        //! Anzeigen des Vertikalen Intervalls
-        RCArray< Text > *vIntervallTexte;
-        //! einzelne Horizontale Intervalle
-        Array< double > *hIntervallWerte;
-        //! einzelne Vertikale Intervalle
-        Array< double > *vIntervallWerte;
-        //! Breite des Wertes 1 in Pixeln bei dem horizontalen Intervall ( wird durch das setzen von AutoIntervallBreite überschrieben )
-        double hIntervallBreite;
-        //! Höhe des Wertes 1 in Pixeln bei dem vertikalen Intervall ( wird durch das setzen von AutoIntervallHöhe überschrieben )
-        double vIntervallHeight;
-        //! Werte, die in dem Diagramm visualisiert werden
-        RCArray< DiagWert > *werte;
+			const static int intervalle = HIntervall | VIntervall; //! Vereiniegt die Flags HIntervall, VIntervall
+			const static int intervallTexte = HIntervallTexte | VIntervallTexte; //! Vereint die Flags HIntervallTexte, VIntervallTexte
+			const static int autoRaster = AutoRasterHeight | AutoRasterBreite | Raster; //! Vereint die Flags AutoRasterHöhe, AutoRasterBreite, Raster
+			const static int autoIntervall = AutoIntervallHeight | AutoIntervallBreite; //! Vereint die Flags AutoIntervallHöhe, AutoIntervallBreite
+		};
+		//! Style eines Diagramms
+		int style;
+		//! Breite einer Rasterlinie
+		int rasterDicke;
+		//! Breite eines Rasterkästchens
+		double rasterBreite;
+		//! Höhe eines Rasterkästchens
+		double rasterHeight;
+		//! Farbe des Rasters
+		int rasterFarbe;
+		//! Schriftfarbe des Horizontalen Intervalls
+		int hIntervallFarbe;
+		//! Schriftfarbe des Vertikalen Intervalls
+		int vIntervallFarbe;
+		//! Name des Horizontalen Intervalls
+		Text* hIntervallName;
+		//! Name des Vertikalen Intervalls
+		Text* vIntervallName;
+		//! Anzeigen des Horizontalen Intervalls
+		RCArray< Text >* hIntervallTexte;
+		//! Anzeigen des Vertikalen Intervalls
+		RCArray< Text >* vIntervallTexte;
+		//! einzelne Horizontale Intervalle
+		Array< double >* hIntervallWerte;
+		//! einzelne Vertikale Intervalle
+		Array< double >* vIntervallWerte;
+		//! Breite des Wertes 1 in Pixeln bei dem horizontalen Intervall ( wird durch das setzen von AutoIntervallBreite überschrieben )
+		double hIntervallBreite;
+		//! Höhe des Wertes 1 in Pixeln bei dem vertikalen Intervall ( wird durch das setzen von AutoIntervallHöhe überschrieben )
+		double vIntervallHeight;
+		//! Werte, die in dem Diagramm visualisiert werden
+		RCArray< DiagWert >* werte;
 
-        //! Konstruktor
-        DLLEXPORT DiagDaten();
-        //! Destruktor
-        DLLEXPORT ~DiagDaten();
-    };
+		//! Konstruktor
+		DLLEXPORT DiagDaten();
+		//! Destruktor
+		DLLEXPORT ~DiagDaten();
+	};
 
-    //! Basisklasse der verschiedenen Diagramm Arten
-    class BaseDiag
-    {
-    protected:
-        DiagDaten *daten;
-        bool changed;
-        Critical *lock;
+	//! Basisklasse der verschiedenen Diagramm Arten
+	class BaseDiag
+	{
+	protected:
+		DiagDaten* daten;
+		bool changed;
+		Critical* lock;
 
-    public:
-        //! Konstruktor
-        //! \param lock Ein Zeiger zur Critical, mit der die Diagramm Klasse, die von dieser Klasse erbt Multithread sicher gemacht wird
-        DLLEXPORT BaseDiag( Critical *lock );
-        //! Destruktor
-        DLLEXPORT virtual ~BaseDiag();
-        //! Setzt einen Zeiger auf die Daten des Diagramms
-        //! \param dd Die Daten
-        DLLEXPORT void setDiagDatenZ( DiagDaten *dd );
-        //! Kopiert die Daten eines Diagramms
-        //! \param dd Die Daten
-        DLLEXPORT void setDiagDaten( DiagDaten *dd );
-        //! Rasterdicke setzen
-        //! \param d Die Breite einer Rasterlinie in Pixeln
-        DLLEXPORT void setRasterDicke( int d );
-        //! Rasterbreite setzen
-        //! \param br Der Abstand zwischen zwei Vertikalen Rasterlinien in Pixeln
-        DLLEXPORT void setRasterBreite( int br );
-        //! Rasterhöhe setzen
-        //! \param hi Der Abstand zwischen zwei Horizontalen Rasterlinien in Pixeln
-        DLLEXPORT void setRasterHeight( int hi );
-        //! Rasterfarbe setzen
-        //! \param f Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setRasterFarbe( int f );
-        //! Setzt die Intervall Breite
-        //! \param br Der Abstand zwischen den Werten 0 und 1 auf der X Achse in Pixeln
-        DLLEXPORT void setHIntervallBreite( double br );
-        //! Setzt die Intervall Höhe
-        //! \param hi Der Abstand zwischen den Werten 0 und 1 auf der Y Achse in Pixeln
-        DLLEXPORT void setVIntervallHeight( double hi );
-        //! Setzt die Farbe der X Achse
-        //! \param f Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setHIntervallFarbe( int f );
-        //! Setzt die Farbe der Y Achse
-        //! \param f Die Farbe im A8R8G8B8 Formats
-        DLLEXPORT void setVIntervallFarbe( int f );
-        //! Setzt den Namen der X Achse
-        //! \param name Der Name
-        DLLEXPORT void setHIntervallName( char *name );
-        //! Setzt den Namen der X Achse
-        //! \param name Der Name
-        DLLEXPORT void setHIntervallName( Text *name );
-        //! Setzt den Namen der Y Achse
-        //! \param name Der Name
-        DLLEXPORT void setVIntervallName( char *name );
-        //! Setzt den Namen der Y Achse
-        //! \param name Der Name
-        DLLEXPORT void setVIntervallName( Text *name );
-        //! Beschriftet einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void addHIntervallText( double hIntervall, char *text );
-        //! Beschriftet einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void addHIntervallText( double hIntervall, Text *text );
-        //! setzt den Zeiger auf eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setHIntervallTextZ( double hIntervall, Text *text );
-        //! Ändert eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setHIntervallText( double hIntervall, Text *text );
-        //! Ändert eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setHIntervallText( double hIntervall, char *text );
-        //! Entfernt eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param hIntervall Der Wert, der nicht mehr beschriftet sein soll
-        DLLEXPORT void removeHIntervallText( double hIntervall );
-        //! Beschriftet einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void addVIntervallText( double vIntervall, char *text );
-        //! Beschriftet einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void addVIntervallText( double vIntervall, Text *text );
-        //! setzt den Zeiger auf eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setVIntervallTextZ( double vIntervall, Text *text );
-        //! Ändert eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setVIntervallText( double vIntervall, Text *text );
-        //! Ändert eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der beschriftet werden soll
-        //! \param text Die Beschriftung
-        DLLEXPORT void setVIntervallText( double vIntervall, char *text );
-        //! Entfernt eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
-        //! \param vIntervall Der Wert, der nicht mehr beschriftet sein soll
-        DLLEXPORT void removeVIntervallText( double vIntervall );
-        //! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
-        //! \param w Der neue Wert
-        DLLEXPORT void addWertZ( DiagWert *w );
-        //! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu, indem ein anderer Kopiert wird
-        //! \param w Der Wert, der Kopiert werden soll
-        DLLEXPORT void addWert( DiagWert *w );
-        //! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
-        //! \param name Der Name des Wertes
-        DLLEXPORT void addWert( const char *name );
-        //! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
-        //! \param name Der Name des Wertes
-        DLLEXPORT void addWert( Text *txt );
-        //! setzt die Farbe eines Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setWertFarbe( int wNum, int fc );
-        //! fügt einem Wert einen Punkt hinzu
-        //! \param wNum Der Index des Wertes
-        //! \param p Der neue Punkt
-        DLLEXPORT void addPunktZ( int wNum, DiagPunkt *p );
-        //! fügt einem Wert einen Punkt hinzu, indem ein Punkt kopiert wird
-        //! \param wNum Der Index des Wertes
-        //! \param p Der Punkt, der kopiert werden soll
-        DLLEXPORT void addPunkt( int wNum, DiagPunkt *p );
-        //! Fügt einem Wert einen Punkt hinzu
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert des Punktes auf der X Achse
-        //! \param vI Der Wert des Punktes auf der Y Achse
-        DLLEXPORT void addPunkt( int wNum, double hI, double vI );
-        //! Setzt einen Zeiger auf einen vorhandenen Punkt eines Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
-        //! \param p Der neue Punkt
-        DLLEXPORT void setPunktZ( int wNum, double hI, DiagPunkt *p );
-        //! Setzt einen vorhandenen Punkt eines Wertes, indem ein Punkt kopiert wird
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
-        //! \param p Der neue Punkt
-        DLLEXPORT void setPunkt( int wNum, double hI, DiagPunkt *p );
-        //! Setzt einen vorhandenen Punkt eines Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
-        //! \param h Der Wert auf der X Achse des neuen Punktes
-        //! \param v Der Wert auf der Y Achse des neuen Punktes
-        DLLEXPORT void setPunkt( int wNum, double hI, double h, double v );
-        //! Setzt einen Zeiger auf einen vorhandenen Punkt eines Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param pNum Der Index des Punktes im Wert
-        //! \param p Der neue Punkt
-        DLLEXPORT void setPunktZ( int wNum, int pNum, DiagPunkt *p );
-        //! Setzt einen vorhandenen Punkt eines Wertes, indem ein Punkt kopiert wird
-        //! \param wNum Der Index des Wertes
-        //! \param pNum Der Index des Punktes im Wert
-        //! \param p Der neue Punkt
-        DLLEXPORT void setPunkt( int wNum, int pNum, DiagPunkt *p );
-        //! Setzt einen vorhandenen Punkt eines Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param pNum Der Index des Punktes im Wert
-        //! \param h Der Wert auf der X Achse des neuen Punktes
-        //! \param v Der Wert auf der Y Achse des neuen Punktes
-        DLLEXPORT void setPunkt( int wNum, int pNum, double h, double v );
-        //! Löscht einen vorhandenen Punkt
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert auf der X Achse des Punktes, der gelöscht werden soll
-        DLLEXPORT void removePunkt( int wNum, double hI );
-        //! Löscht einen vorhandenen Punkt
-        //! \param wNum Der Index des Wertes
-        //! \param pNum Der Index des Punktes im Wert
-        DLLEXPORT void removePunkt( int wNum, int pNum );
-        //! entfernt einen Wert
-        //! \param wNum Der Index des Wertes
-        DLLEXPORT void removeWert( int wNum );
-        //! entfernt einen Wert
-        //! \param name Der Name des Wertes
-        DLLEXPORT void removeWert( char *name );
-        //! entfernt einen Wert
-        //! \param name Der Name des Wertes
-        DLLEXPORT void removeWert( Text *name );
-        //! Fügt den DiagDaten bestimmte Styles hinzu
-        //! \param style Die neuen Styles
-        DLLEXPORT void addDatenStyle( int style );
-        //! Setzt die Styles der DiagDaten
-        //! \param style Die neuen Styles
-        DLLEXPORT void setDatenStyle( int style );
-        //! Setzt die Styles der DiagDaten
-        //! \param style Die Styles
-        //! \param addRemove 1, falls die Styles hinzugefügt werden sollem. 0, falls die Styles entfernt werden sollen
-        DLLEXPORT void setDatenStyle( int style, bool addRemove );
-        //! Entfernt Styles der DiagDaten
-        //! \param style Die Styles, die entfernt werden sollen
-        DLLEXPORT void removeDatenStyle( int style );
-        //! Fügt einem bestimmten Wert bestimmte Styles hinzu
-        //! \param wNum Der Index des Wertes
-        //! \param style Die neuen Styles
-        DLLEXPORT void addWertStyle( int wNum, int style );
-        //! Setzt die Styles eines Bestimmten Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param style Die neuen Styles
-        DLLEXPORT void setWertStyle( int wNum, int style );
-        //! Setzt die Styles eines Bestimmten Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param style Die Styles
-        //! \param addRemove 1, falls die Styles hinzugefügt werden sollem. 0, falls die Styles entfernt werden sollen
-        DLLEXPORT void setWertStyle( int wNum, int style, bool addRemove );
-        //! Entfernt Styles eines Bestimmten Wertes
-        //! \param wNum Der Index des Wertes
-        //! \param style Die Styles, die entfernt werden sollen
-        DLLEXPORT void removeWertStyle( int wNum, int style );
-        //! Gibt die Daten des Diagramms zurück
-        DLLEXPORT DiagDaten *getDiagDaten() const;
-        //! Gibt die Daten des Diagramms ohne erhöhten Reference Counter zurück
-        DLLEXPORT DiagDaten *zDiagDaten() const;
-        //! Gibt die Daten eines Wertes zurück
-        //! \param wNum Der Index des Wertes
-        DLLEXPORT DiagWert *getDiagWert( int wNum ) const;
-        //! Gibt die Daten eines Wertes ohne erhöhten Reference Counter zurück
-        //! \param wNum Der Index des Wertes
-        DLLEXPORT DiagWert *zDiagWert( int wNum ) const;
-        //! Gibt die Daten eines Wertes zurück
-        //! \param name Der Name des Wertes
-        DLLEXPORT DiagWert *getDiagWert( char *name ) const;
-        //! Gibt die Daten eines Wertes ohne erhöhten Reference Counter zurück
-        //! \param name Der Name des Wertes
-        DLLEXPORT DiagWert *zDiagWert( char *name ) const;
-        //! Gibt den Index eines Wertes zurück
-        //! \param name Der Name des Wertes
-        DLLEXPORT int getDiagWertPos( char *name ) const;
-        //! Gibt den Index eines Punktes von einem Wert zurück
-        //! \param wNum Der Index des Wertes
-        //! \param hI Der Wert auf der X Achse des Punktes
-        DLLEXPORT int getDiagPunktPos( int wNum, double hI ) const;
-        //! Gibt den Index eines Punktes von einem Wert zurück
-        //! \param wName Der Name des Wertes
-        //! \param hI Der Wert auf der X Achse des Punktes
-        DLLEXPORT int getDiagPunktPos( char *wName, double hI ) const;
-        //! Prüft, ob bestimmte Styles in den DiagDaten gesetzt wurden
-        //! \param style Die Styles
-        DLLEXPORT inline bool hatDatenStyle( int style ) const;
-        //! Prüft, ob bestimmte Styles in den DiagDaten nicht gesetzt wurden
-        //! \param style Die Styles
-        DLLEXPORT inline bool hatDatenStyleNicht( int style ) const;
-        //! Prüft, ob bestimmte Styles für einen bestimmten Wert gesetzt wurden
-        //! \param wNum Der Index des Wertes
-        //! \param style Die Styles
-        DLLEXPORT inline bool hatWertStyle( int wNum, int style ) const;
-        //! Prüft, ob bestimmte Styles für einen bestimmten Wert nicht gesetzt wurden
-        //! \param wNum Der Index des Wertes
-        //! \param style Die Styles
-        DLLEXPORT inline bool hatWertStyleNicht( int wNum, int style ) const;
-    };
+	public:
+		//! Konstruktor
+		//! \param lock Ein Zeiger zur Critical, mit der die Diagramm Klasse, die von dieser Klasse erbt Multithread sicher gemacht wird
+		DLLEXPORT BaseDiag(Critical* lock);
+		//! Destruktor
+		DLLEXPORT virtual ~BaseDiag();
+		//! Setzt einen Zeiger auf die Daten des Diagramms
+		//! \param dd Die Daten
+		DLLEXPORT void setDiagDatenZ(DiagDaten* dd);
+		//! Kopiert die Daten eines Diagramms
+		//! \param dd Die Daten
+		DLLEXPORT void setDiagDaten(DiagDaten* dd);
+		//! Rasterdicke setzen
+		//! \param d Die Breite einer Rasterlinie in Pixeln
+		DLLEXPORT void setRasterDicke(int d);
+		//! Rasterbreite setzen
+		//! \param br Der Abstand zwischen zwei Vertikalen Rasterlinien in Pixeln
+		DLLEXPORT void setRasterBreite(int br);
+		//! Rasterhöhe setzen
+		//! \param hi Der Abstand zwischen zwei Horizontalen Rasterlinien in Pixeln
+		DLLEXPORT void setRasterHeight(int hi);
+		//! Rasterfarbe setzen
+		//! \param f Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setRasterFarbe(int f);
+		//! Setzt die Intervall Breite
+		//! \param br Der Abstand zwischen den Werten 0 und 1 auf der X Achse in Pixeln
+		DLLEXPORT void setHIntervallBreite(double br);
+		//! Setzt die Intervall Höhe
+		//! \param hi Der Abstand zwischen den Werten 0 und 1 auf der Y Achse in Pixeln
+		DLLEXPORT void setVIntervallHeight(double hi);
+		//! Setzt die Farbe der X Achse
+		//! \param f Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setHIntervallFarbe(int f);
+		//! Setzt die Farbe der Y Achse
+		//! \param f Die Farbe im A8R8G8B8 Formats
+		DLLEXPORT void setVIntervallFarbe(int f);
+		//! Setzt den Namen der X Achse
+		//! \param name Der Name
+		DLLEXPORT void setHIntervallName(const char* name);
+		//! Setzt den Namen der X Achse
+		//! \param name Der Name
+		DLLEXPORT void setHIntervallName(Text* name);
+		//! Setzt den Namen der Y Achse
+		//! \param name Der Name
+		DLLEXPORT void setVIntervallName(const char* name);
+		//! Setzt den Namen der Y Achse
+		//! \param name Der Name
+		DLLEXPORT void setVIntervallName(Text* name);
+		//! Beschriftet einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void addHIntervallText(double hIntervall, const char* text);
+		//! Beschriftet einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void addHIntervallText(double hIntervall, Text* text);
+		//! setzt den Zeiger auf eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setHIntervallTextZ(double hIntervall, Text* text);
+		//! Ändert eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setHIntervallText(double hIntervall, Text* text);
+		//! Ändert eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setHIntervallText(double hIntervall, const char* text);
+		//! Entfernt eine Beschriftung in einen Betimmten Wert der X Achse, falls der Flag HIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param hIntervall Der Wert, der nicht mehr beschriftet sein soll
+		DLLEXPORT void removeHIntervallText(double hIntervall);
+		//! Beschriftet einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void addVIntervallText(double vIntervall, const char* text);
+		//! Beschriftet einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void addVIntervallText(double vIntervall, Text* text);
+		//! setzt den Zeiger auf eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setVIntervallTextZ(double vIntervall, Text* text);
+		//! Ändert eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setVIntervallText(double vIntervall, Text* text);
+		//! Ändert eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der beschriftet werden soll
+		//! \param text Die Beschriftung
+		DLLEXPORT void setVIntervallText(double vIntervall, const char* text);
+		//! Entfernt eine Beschriftung in einen Betimmten Wert der Y Achse, falls der Flag VIntervallTexte in den DiagDaten gesetzt wurde
+		//! \param vIntervall Der Wert, der nicht mehr beschriftet sein soll
+		DLLEXPORT void removeVIntervallText(double vIntervall);
+		//! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
+		//! \param w Der neue Wert
+		DLLEXPORT void addWertZ(DiagWert* w);
+		//! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu, indem ein anderer Kopiert wird
+		//! \param w Der Wert, der Kopiert werden soll
+		DLLEXPORT void addWert(DiagWert* w);
+		//! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
+		//! \param name Der Name des Wertes
+		DLLEXPORT void addWert(const char* name);
+		//! Fügt einen im Diagramm dargestellten Wert (Graph) hinzu
+		//! \param name Der Name des Wertes
+		DLLEXPORT void addWert(Text* txt);
+		//! setzt die Farbe eines Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setWertFarbe(int wNum, int fc);
+		//! fügt einem Wert einen Punkt hinzu
+		//! \param wNum Der Index des Wertes
+		//! \param p Der neue Punkt
+		DLLEXPORT void addPunktZ(int wNum, DiagPunkt* p);
+		//! fügt einem Wert einen Punkt hinzu, indem ein Punkt kopiert wird
+		//! \param wNum Der Index des Wertes
+		//! \param p Der Punkt, der kopiert werden soll
+		DLLEXPORT void addPunkt(int wNum, DiagPunkt* p);
+		//! Fügt einem Wert einen Punkt hinzu
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert des Punktes auf der X Achse
+		//! \param vI Der Wert des Punktes auf der Y Achse
+		DLLEXPORT void addPunkt(int wNum, double hI, double vI);
+		//! Setzt einen Zeiger auf einen vorhandenen Punkt eines Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
+		//! \param p Der neue Punkt
+		DLLEXPORT void setPunktZ(int wNum, double hI, DiagPunkt* p);
+		//! Setzt einen vorhandenen Punkt eines Wertes, indem ein Punkt kopiert wird
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
+		//! \param p Der neue Punkt
+		DLLEXPORT void setPunkt(int wNum, double hI, DiagPunkt* p);
+		//! Setzt einen vorhandenen Punkt eines Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert des Punktes auf der X Achse, der ersetzt werden soll
+		//! \param h Der Wert auf der X Achse des neuen Punktes
+		//! \param v Der Wert auf der Y Achse des neuen Punktes
+		DLLEXPORT void setPunkt(int wNum, double hI, double h, double v);
+		//! Setzt einen Zeiger auf einen vorhandenen Punkt eines Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param pNum Der Index des Punktes im Wert
+		//! \param p Der neue Punkt
+		DLLEXPORT void setPunktZ(int wNum, int pNum, DiagPunkt* p);
+		//! Setzt einen vorhandenen Punkt eines Wertes, indem ein Punkt kopiert wird
+		//! \param wNum Der Index des Wertes
+		//! \param pNum Der Index des Punktes im Wert
+		//! \param p Der neue Punkt
+		DLLEXPORT void setPunkt(int wNum, int pNum, DiagPunkt* p);
+		//! Setzt einen vorhandenen Punkt eines Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param pNum Der Index des Punktes im Wert
+		//! \param h Der Wert auf der X Achse des neuen Punktes
+		//! \param v Der Wert auf der Y Achse des neuen Punktes
+		DLLEXPORT void setPunkt(int wNum, int pNum, double h, double v);
+		//! Löscht einen vorhandenen Punkt
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert auf der X Achse des Punktes, der gelöscht werden soll
+		DLLEXPORT void removePunkt(int wNum, double hI);
+		//! Löscht einen vorhandenen Punkt
+		//! \param wNum Der Index des Wertes
+		//! \param pNum Der Index des Punktes im Wert
+		DLLEXPORT void removePunkt(int wNum, int pNum);
+		//! entfernt einen Wert
+		//! \param wNum Der Index des Wertes
+		DLLEXPORT void removeWert(int wNum);
+		//! entfernt einen Wert
+		//! \param name Der Name des Wertes
+		DLLEXPORT void removeWert(const char* name);
+		//! entfernt einen Wert
+		//! \param name Der Name des Wertes
+		DLLEXPORT void removeWert(Text* name);
+		//! Fügt den DiagDaten bestimmte Styles hinzu
+		//! \param style Die neuen Styles
+		DLLEXPORT void addDatenStyle(int style);
+		//! Setzt die Styles der DiagDaten
+		//! \param style Die neuen Styles
+		DLLEXPORT void setDatenStyle(int style);
+		//! Setzt die Styles der DiagDaten
+		//! \param style Die Styles
+		//! \param addRemove 1, falls die Styles hinzugefügt werden sollem. 0, falls die Styles entfernt werden sollen
+		DLLEXPORT void setDatenStyle(int style, bool addRemove);
+		//! Entfernt Styles der DiagDaten
+		//! \param style Die Styles, die entfernt werden sollen
+		DLLEXPORT void removeDatenStyle(int style);
+		//! Fügt einem bestimmten Wert bestimmte Styles hinzu
+		//! \param wNum Der Index des Wertes
+		//! \param style Die neuen Styles
+		DLLEXPORT void addWertStyle(int wNum, int style);
+		//! Setzt die Styles eines Bestimmten Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param style Die neuen Styles
+		DLLEXPORT void setWertStyle(int wNum, int style);
+		//! Setzt die Styles eines Bestimmten Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param style Die Styles
+		//! \param addRemove 1, falls die Styles hinzugefügt werden sollem. 0, falls die Styles entfernt werden sollen
+		DLLEXPORT void setWertStyle(int wNum, int style, bool addRemove);
+		//! Entfernt Styles eines Bestimmten Wertes
+		//! \param wNum Der Index des Wertes
+		//! \param style Die Styles, die entfernt werden sollen
+		DLLEXPORT void removeWertStyle(int wNum, int style);
+		//! Gibt die Daten des Diagramms zurück
+		DLLEXPORT DiagDaten* getDiagDaten() const;
+		//! Gibt die Daten des Diagramms ohne erhöhten Reference Counter zurück
+		DLLEXPORT DiagDaten* zDiagDaten() const;
+		//! Gibt die Daten eines Wertes zurück
+		//! \param wNum Der Index des Wertes
+		DLLEXPORT DiagWert* getDiagWert(int wNum) const;
+		//! Gibt die Daten eines Wertes ohne erhöhten Reference Counter zurück
+		//! \param wNum Der Index des Wertes
+		DLLEXPORT DiagWert* zDiagWert(int wNum) const;
+		//! Gibt die Daten eines Wertes zurück
+		//! \param name Der Name des Wertes
+		DLLEXPORT DiagWert* getDiagWert(const char* name) const;
+		//! Gibt die Daten eines Wertes ohne erhöhten Reference Counter zurück
+		//! \param name Der Name des Wertes
+		DLLEXPORT DiagWert* zDiagWert(const char* name) const;
+		//! Gibt den Index eines Wertes zurück
+		//! \param name Der Name des Wertes
+		DLLEXPORT int getDiagWertPos(const char* name) const;
+		//! Gibt den Index eines Punktes von einem Wert zurück
+		//! \param wNum Der Index des Wertes
+		//! \param hI Der Wert auf der X Achse des Punktes
+		DLLEXPORT int getDiagPunktPos(int wNum, double hI) const;
+		//! Gibt den Index eines Punktes von einem Wert zurück
+		//! \param wName Der Name des Wertes
+		//! \param hI Der Wert auf der X Achse des Punktes
+		DLLEXPORT int getDiagPunktPos(char* wName, double hI) const;
+		//! Prüft, ob bestimmte Styles in den DiagDaten gesetzt wurden
+		//! \param style Die Styles
+		DLLEXPORT inline bool hatDatenStyle(int style) const;
+		//! Prüft, ob bestimmte Styles in den DiagDaten nicht gesetzt wurden
+		//! \param style Die Styles
+		DLLEXPORT inline bool hatDatenStyleNicht(int style) const;
+		//! Prüft, ob bestimmte Styles für einen bestimmten Wert gesetzt wurden
+		//! \param wNum Der Index des Wertes
+		//! \param style Die Styles
+		DLLEXPORT inline bool hatWertStyle(int wNum, int style) const;
+		//! Prüft, ob bestimmte Styles für einen bestimmten Wert nicht gesetzt wurden
+		//! \param wNum Der Index des Wertes
+		//! \param style Die Styles
+		DLLEXPORT inline bool hatWertStyleNicht(int wNum, int style) const;
+	};
 
-    //! Eine Zeichnung des 2D GUI Frameworks, die die Diagrammdaten als Liniengraphen darstellt
-    class LDiag : public ZeichnungHintergrund, public BaseDiag
-    {
-    public:
-        class Style : public ZeichnungHintergrund::Style
-        {
-        public:
-            const static __int64 DatenRahmen = 0x0001000; //! Legt fest, ob um die daten ein Rahmen gezeichnet wird
-            const static __int64 DatenHintergrund = 0x02000; //! legt fest, ob die Daten einen Hintergrund haben
-            const static __int64 DatenHAlpha = 0x04000; //! legt fest, ob beim zeichnen des Hintergrunds der Daten alpha blending benutzt wird
-            const static __int64 DatenHBild = 0x008000; //! Legt fest, ob für den Hintergrund der Daten ein Bild verwendet werden soll
-            const static __int64 DatenBuffered = 0x010000; //! Legt fest, ob die Daten einen Farbübergang haben
+	//! Eine Zeichnung des 2D GUI Frameworks, die die Diagrammdaten als Liniengraphen darstellt
+	class LDiag : public ZeichnungHintergrund, public BaseDiag
+	{
+	public:
+		class Style : public ZeichnungHintergrund::Style
+		{
+		public:
+			const static __int64 DatenRahmen = 0x0001000; //! Legt fest, ob um die daten ein Rahmen gezeichnet wird
+			const static __int64 DatenHintergrund = 0x02000; //! legt fest, ob die Daten einen Hintergrund haben
+			const static __int64 DatenHAlpha = 0x04000; //! legt fest, ob beim zeichnen des Hintergrunds der Daten alpha blending benutzt wird
+			const static __int64 DatenHBild = 0x008000; //! Legt fest, ob für den Hintergrund der Daten ein Bild verwendet werden soll
+			const static __int64 DatenBuffered = 0x010000; //! Legt fest, ob die Daten einen Farbübergang haben
 
-            const static __int64 scroll = VScroll | HScroll; //! Vereint die Flags VScroll und HScroll
-            const static __int64 normal = Hintergrund | scroll | DatenRahmen; //! Vereint die Flags Hintergrund, scroll, DatenRahmen
-        };
-    private:
-        TextRenderer *textRd;
-        Rahmen *dRam;
-        int dBgF;
-        Bild *dBgB;
-        AlphaFeld *dAf;
-        Bild *vIntervallRB;
-        Bild *hIntervallRB;
-        int schriftGr;
-        //! Verarbeitet Maus Nachrichten
-        //! \param me Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        DLLEXPORT void doMausEreignis( MausEreignis &me, bool userRet ) override;
+			const static __int64 scroll = VScroll | HScroll; //! Vereint die Flags VScroll und HScroll
+			const static __int64 normal = Hintergrund | scroll | DatenRahmen; //! Vereint die Flags Hintergrund, scroll, DatenRahmen
+		};
+	private:
+		TextRenderer* textRd;
+		Rahmen* dRam;
+		int dBgF;
+		Bild* dBgB;
+		AlphaFeld* dAf;
+		Bild* vIntervallRB;
+		Bild* hIntervallRB;
+		int schriftGr;
+		//! Verarbeitet Maus Nachrichten
+		//! \param me Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+		DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override;
 
-    public:
-        //! Konstruktor
-        DLLEXPORT LDiag();
-        //! Destruktor
-        DLLEXPORT virtual ~LDiag();
-        //! Setzt den verwendeten TextRenderer
-        //! \param textRd Der Textrenderer
-        DLLEXPORT void setTextRendererZ( TextRenderer *textRd );
-        //! Setzt die Schrift
-        //! \param schrift Die Schrift
-        DLLEXPORT void setSchriftZ( Schrift *schrift );
-        //! Setzt die größe der Schrift
-        //! \param gr Die Höhe einer Zeile in Pixeln
-        DLLEXPORT void setSchriftSize( int gr );
-        //! Setzt den inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
-        //! \param ram Der Rahmen
-        DLLEXPORT void setDatenRahmenZ( Rahmen *ram );
-        //! Setzt den inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten), indem ein Rahmen kopiert wird
-        //! \param ram Der Rahmen, der kopiert werden soll
-        DLLEXPORT void setDatenRahmen( Rahmen *ram );
-        //! Setzt die Breite des inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
-        //! \param br Die Breite in Pixeln
-        DLLEXPORT void setDatenRahmenBreite( int br );
-        //! Setzt die Farbe des inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setDatenRahmenFarbe( int fc );
-        //! Setzt den Hintergrund des eigentlichen Diagramms
-        DLLEXPORT void setDatenHintergrundFarbe( int fc );
-        DLLEXPORT void setDatenHintergrundBildZ( Bild *b );
-        DLLEXPORT void setDatenHintergrundBild( Bild *b );
-        //! Setzt den Farbübergang des eigentlichen Diagramms (Farbübergang der Daten)
-        //! \param af Der Farbübergang
-        DLLEXPORT void setDatenAlphaFeldZ( AlphaFeld *af );
-        //! Setzt den Farbübergang des eigentlichen Diagramms (Farbübergang der Daten), indem ein Farbübergang kopiert wird
-        //! \param af Der Farbübergang, der Kopiert werden soll
-        DLLEXPORT void setDatenAlphaFeld( AlphaFeld *af );
-        //! Setzt die Farbe des Farbübergangs des eigentlichen Diagramms (Farbübergang der Daten)
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setDatenAlphaFeldFarbe( int fc );
-        //! Setzt die FaStärkerbe des Farbübergangs des eigentlichen Diagramms (Farbübergang der Daten)
-        //! \param st Die Stärke
-        DLLEXPORT void setDatenAlphaFeldStrength( int st );
-        //! Zeichnet das Objekt nach zRObj, falls es sichtbar ist
-        //! \param zRObj Das Bild, in welches gezeichnet werden soll
-        DLLEXPORT void render( Bild &zRObj ) override;
-        //! Gibt die Schrift zurück
-        DLLEXPORT Schrift *getSchrift() const;
-        //! Gibt die Schrift ohne erhöhten Reference Counter zurück
-        DLLEXPORT Schrift *zSchrift() const;
-        //! Gibt den inneren Rahmen um das eigentliche Diagramm zurück (Rahmen um die Daten)
-        DLLEXPORT Rahmen *getDatenRahmen() const;
-        //! Gibt den inneren Rahmen um das eigentliche Diagramm ohne erhöhten Reference Counter zurück (Rahmen um die Daten)
-        DLLEXPORT Rahmen *zDatenRahmen() const;
-        //! Gibt die Farbe des inneren Rahmens um das eigentliche Diagramm im A8R8G8B8 Format zurück (Rahmen um die Daten)
-        DLLEXPORT int getDatenRahmenFarbe() const;
-        //! Gibt die Breite des inneren Rahmens um das eigentliche Diagramm in Pixeln zurück (Rahmen um die Daten)
-        DLLEXPORT int getDatenRahmenBreite() const;
-        //! Gibt die Farbe des Hintergrunds des eigentlichen Diagramms im A8R8G8B8 Format zurück (Hintergrund der Daten)
-        DLLEXPORT int getDatenHintergrundFarbe() const;
-        //! Gibt das Hintergrund Bild des eigentlichen Diagramms zurück (Hintergrund Bild der Daten)
-        DLLEXPORT Bild *getDatenHintergrundBild() const;
-        //! Gibt das Hintergrund Bild des eigentlichen Diagramms ohne erhöhten Reference Counter zurück (Hintergrund Bild der Daten)
-        DLLEXPORT Bild *zDatenHintergrundBild() const;
-        //! Gibt den Farbübergang des eigentlichen Diagramms zurück (Farbübergang der Daten)
-        DLLEXPORT AlphaFeld *getDatenAlphaFeld() const;
-        //! Gibt den Farbübergang des eigentlichen Diagramms ohne erhöhten Reference Counter zurück (Farbübergang der Daten)
-        DLLEXPORT AlphaFeld *zDatenAlphaFeld() const;
-        //! Gibt die Farbe des Farbübergangs des eigentlichen Diagramms im A8R8G8B8 Format zurück (Farbübergang der Daten)
-        DLLEXPORT int getDatenAlphaFeldFarbe() const;
-        //! Gibt die Stärke des Farbübergangs des eigentlichen Diagramms zurück (Farbübergang der Daten)
-        DLLEXPORT int getDatenAlphaFeldStrength() const;
-    };
+	public:
+		//! Konstruktor
+		DLLEXPORT LDiag();
+		//! Destruktor
+		DLLEXPORT virtual ~LDiag();
+		//! Setzt den verwendeten TextRenderer
+		//! \param textRd Der Textrenderer
+		DLLEXPORT void setTextRendererZ(TextRenderer* textRd);
+		//! Setzt die Schrift
+		//! \param schrift Die Schrift
+		DLLEXPORT void setSchriftZ(Schrift* schrift);
+		//! Setzt die größe der Schrift
+		//! \param gr Die Höhe einer Zeile in Pixeln
+		DLLEXPORT void setSchriftSize(int gr);
+		//! Setzt den inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
+		//! \param ram Der Rahmen
+		DLLEXPORT void setDatenRahmenZ(Rahmen* ram);
+		//! Setzt den inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten), indem ein Rahmen kopiert wird
+		//! \param ram Der Rahmen, der kopiert werden soll
+		DLLEXPORT void setDatenRahmen(Rahmen* ram);
+		//! Setzt die Breite des inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
+		//! \param br Die Breite in Pixeln
+		DLLEXPORT void setDatenRahmenBreite(int br);
+		//! Setzt die Farbe des inneren Rahmen um das eigentliche Diagramm (Rahmen um die Daten)
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setDatenRahmenFarbe(int fc);
+		//! Setzt den Hintergrund des eigentlichen Diagramms
+		DLLEXPORT void setDatenHintergrundFarbe(int fc);
+		DLLEXPORT void setDatenHintergrundBildZ(Bild* b);
+		DLLEXPORT void setDatenHintergrundBild(Bild* b);
+		//! Setzt den Farbübergang des eigentlichen Diagramms (Farbübergang der Daten)
+		//! \param af Der Farbübergang
+		DLLEXPORT void setDatenAlphaFeldZ(AlphaFeld* af);
+		//! Setzt den Farbübergang des eigentlichen Diagramms (Farbübergang der Daten), indem ein Farbübergang kopiert wird
+		//! \param af Der Farbübergang, der Kopiert werden soll
+		DLLEXPORT void setDatenAlphaFeld(AlphaFeld* af);
+		//! Setzt die Farbe des Farbübergangs des eigentlichen Diagramms (Farbübergang der Daten)
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setDatenAlphaFeldFarbe(int fc);
+		//! Setzt die FaStärkerbe des Farbübergangs des eigentlichen Diagramms (Farbübergang der Daten)
+		//! \param st Die Stärke
+		DLLEXPORT void setDatenAlphaFeldStrength(int st);
+		//! Zeichnet das Objekt nach zRObj, falls es sichtbar ist
+		//! \param zRObj Das Bild, in welches gezeichnet werden soll
+		DLLEXPORT void render(Bild& zRObj) override;
+		//! Gibt die Schrift zurück
+		DLLEXPORT Schrift* getSchrift() const;
+		//! Gibt die Schrift ohne erhöhten Reference Counter zurück
+		DLLEXPORT Schrift* zSchrift() const;
+		//! Gibt den inneren Rahmen um das eigentliche Diagramm zurück (Rahmen um die Daten)
+		DLLEXPORT Rahmen* getDatenRahmen() const;
+		//! Gibt den inneren Rahmen um das eigentliche Diagramm ohne erhöhten Reference Counter zurück (Rahmen um die Daten)
+		DLLEXPORT Rahmen* zDatenRahmen() const;
+		//! Gibt die Farbe des inneren Rahmens um das eigentliche Diagramm im A8R8G8B8 Format zurück (Rahmen um die Daten)
+		DLLEXPORT int getDatenRahmenFarbe() const;
+		//! Gibt die Breite des inneren Rahmens um das eigentliche Diagramm in Pixeln zurück (Rahmen um die Daten)
+		DLLEXPORT int getDatenRahmenBreite() const;
+		//! Gibt die Farbe des Hintergrunds des eigentlichen Diagramms im A8R8G8B8 Format zurück (Hintergrund der Daten)
+		DLLEXPORT int getDatenHintergrundFarbe() const;
+		//! Gibt das Hintergrund Bild des eigentlichen Diagramms zurück (Hintergrund Bild der Daten)
+		DLLEXPORT Bild* getDatenHintergrundBild() const;
+		//! Gibt das Hintergrund Bild des eigentlichen Diagramms ohne erhöhten Reference Counter zurück (Hintergrund Bild der Daten)
+		DLLEXPORT Bild* zDatenHintergrundBild() const;
+		//! Gibt den Farbübergang des eigentlichen Diagramms zurück (Farbübergang der Daten)
+		DLLEXPORT AlphaFeld* getDatenAlphaFeld() const;
+		//! Gibt den Farbübergang des eigentlichen Diagramms ohne erhöhten Reference Counter zurück (Farbübergang der Daten)
+		DLLEXPORT AlphaFeld* zDatenAlphaFeld() const;
+		//! Gibt die Farbe des Farbübergangs des eigentlichen Diagramms im A8R8G8B8 Format zurück (Farbübergang der Daten)
+		DLLEXPORT int getDatenAlphaFeldFarbe() const;
+		//! Gibt die Stärke des Farbübergangs des eigentlichen Diagramms zurück (Farbübergang der Daten)
+		DLLEXPORT int getDatenAlphaFeldStrength() const;
+	};
 }
 
 #endif

+ 160 - 156
Ebene3D.h

@@ -4,160 +4,164 @@
 
 namespace Framework
 {
-    template< typename T >
-    //! Speichert eine 3D Ebene in Koordinaten Form (x*?+y*?+z*?-w=0)
-    class Ebene3D
-    {
-    public:
-        T x; //! Die X Komponente des Normalen Vektors der Ebene
-        T y; //! Die Y Komponente des Normalen Vektors der Ebene
-        T z; //! Die Z Komponente des Normalen Vektors der Ebene
-        T w; //! Der Wert, den das Skalarprodukt eines Vektors mit dem Normalen Vektor haben muss um in der Ebene zu liegen
-        //! Konstruktor
-        inline Ebene3D()
-        {}
-        //! Knstruktor
-        //! \param x Die X Komponente des Normalen Vektors der Ebene
-        //! \param y Die Y Komponente des Normalen Vektors der Ebene
-        //! \param z Die Z Komponente des Normalen Vektors der Ebene
-        //! \param w Der Wert, den das Skalarprodukt eines Vektors mit dem Normalen Vektor haben muss um in der Ebene zu liegen
-        inline Ebene3D( T x, T y, T z, T w )
-            : x( x ),
-            y( y ),
-            z( z ),
-            w( w )
-        {}
-        //! Knstruktor
-        //! \param vect Die Ebene, deren Werte kopiert werden sollen
-        inline Ebene3D( const Ebene3D &vect )
-            : Ebene3D( vect.x, vect.y, vect.z, vect.w )
-        {}
-        //! Bringt den Normalen Vektor der Ebene auf die Länge 1
-        inline Ebene3D &normalize()
-        {
-            const T length = len();
-            x /= length;
-            y /= length;
-            z /= length;
-            w /= length;
-            return *this;
-        }
-        //! Tauscht die Werte zweier Ebenen
-        //! \param vect die zweite Ebene
-        inline Ebene3D &Swap( Ebene3D &vect )
-        {
-            const Ebene3D tmp = vect;
-            vect = *this;
-            *this = tmp;
-            return *this;
-        }
-        //! Kopiert die Werte einer anderen Ebene
-        //! \param r Die andere Ebene
-        inline Ebene3D operator=( const Ebene3D &r )
-        {
-            x = r.x;
-            y = r.y;
-            z = r.z;
-            w = r.w;
-            return *this;
-        }
-        //! Addiert eine andere Ebene dazu
-        //! \param r Die andere Ebene
-        inline Ebene3D operator+=( const Ebene3D &r )
-        {
-            x += r.x;
-            y += r.y;
-            z += r.z;
-            w += r.w;
-            return *this;
-        }
-        //! Subtrahiert eine andere Ebene
-        //! \param r Die andere Ebene
-        inline Ebene3D operator-=( const Ebene3D &r )
-        {
-            x -= r.x;
-            y -= r.y;
-            z -= r.z;
-            w -= r.w;
-            return *this;
-        }
-        //! Multipliziert die Ebene mit einem Faktor
-        //! \param r Der Faktor
-        inline Ebene3D operator*=( const T &r )
-        {
-            x *= r;
-            y *= r;
-            z *= r;
-            w *= r;
-            return *this;
-        }
-        //! Teilt die Ebene durch einen Faktor
-        //! \param r Der Faktor
-        inline Ebene3D operator/=( const T &r )
-        {
-            x /= r;
-            y /= r;
-            z /= r;
-            w /= r;
-            return *this;
-        }
-        template< typename T2 >
-        //! Konvertiert die Ebene in einen anderen Typ
-        inline operator Ebene3D< T2 >() const
-        {
-            return{ (T2)x, (T2)y, (T2)z, (T2)w };
-        }
-        //! Errehnet das Quadrat der Länge des Normalen Vektors der Ebene
-        inline T lenSq() const
-        {
-            return x * x + y * y + z * z;
-        }
-        //! Errechnet die Länge des Normalen Vektors
-        inline T len() const
-        {
-            return sqrt( lenSq() );
-        }
-        //! Berechnet die Entfernung der Ebene zu einem Vektor
-        //! \param r Der Vektor
-        inline T operator*( const Vec3< T > &r ) const
-        {
-            return x * r.x + y * r.y + z * r.z + w;
-        }
-        //! Addiert zwei Ebenen
-        //! \param r Die andere Ebene
-        inline Ebene3D operator+( const Ebene3D &r ) const
-        {
-            return Vec4( *this ) += r;
-        }
-        //! Subtrahiert zwei Ebenen
-        //! \param r Die andere Ebene
-        inline Ebene3D operator-( const Ebene3D &r ) const
-        {
-            return Ebene3D( *this ) -= r;
-        }
-        //! Multiliziert die Ebene mit einem Faktor
-        //! r: Der Faktor
-        inline Ebene3D operator*( const T &r ) const
-        {
-            return Ebene3D( *this ) *= r;
-        }
-        //! Dividiert die Ebene durch einen Faktor
-        //! \param r Der Faktor
-        inline Ebene3D operator/( const T &r ) const
-        {
-            return Ebene3D( *this ) /= r;
-        }
-        //! Überprüft zwei Ebenen auf Gleichheit
-        //! \param r Die andere Ebene
-        inline bool operator==( const Ebene3D &r ) const
-        {
-            return x == r.x && y == r.y && z == r.z && w == r.w;
-        }
-        //! Überprüft zwei Ebenen auf Ungleichheit
-        //! \param r Die andere Ebene
-        inline bool operator!=( const Ebene3D &r ) const
-        {
-            return !( *this == r );
-        }
-    };
+	template< typename T >
+	//! Speichert eine 3D Ebene in Koordinaten Form (x*?+y*?+z*?-w=0)
+	class Ebene3D
+	{
+	public:
+		T x; //! Die X Komponente des Normalen Vektors der Ebene
+		T y; //! Die Y Komponente des Normalen Vektors der Ebene
+		T z; //! Die Z Komponente des Normalen Vektors der Ebene
+		T w; //! Der Wert, den das Skalarprodukt eines Vektors mit dem Normalen Vektor haben muss um in der Ebene zu liegen
+		//! Konstruktor
+		inline Ebene3D()
+			: x((T)0),
+			y((T)0),
+			z((T)0),
+			w((T)0)
+		{}
+		//! Knstruktor
+		//! \param x Die X Komponente des Normalen Vektors der Ebene
+		//! \param y Die Y Komponente des Normalen Vektors der Ebene
+		//! \param z Die Z Komponente des Normalen Vektors der Ebene
+		//! \param w Der Wert, den das Skalarprodukt eines Vektors mit dem Normalen Vektor haben muss um in der Ebene zu liegen
+		inline Ebene3D(T x, T y, T z, T w)
+			: x(x),
+			y(y),
+			z(z),
+			w(w)
+		{}
+		//! Knstruktor
+		//! \param vect Die Ebene, deren Werte kopiert werden sollen
+		inline Ebene3D(const Ebene3D& vect)
+			: Ebene3D(vect.x, vect.y, vect.z, vect.w)
+		{}
+		//! Bringt den Normalen Vektor der Ebene auf die Länge 1
+		inline Ebene3D& normalize()
+		{
+			const T length = len();
+			x /= length;
+			y /= length;
+			z /= length;
+			w /= length;
+			return *this;
+		}
+		//! Tauscht die Werte zweier Ebenen
+		//! \param vect die zweite Ebene
+		inline Ebene3D& Swap(Ebene3D& vect)
+		{
+			const Ebene3D tmp = vect;
+			vect = *this;
+			*this = tmp;
+			return *this;
+		}
+		//! Kopiert die Werte einer anderen Ebene
+		//! \param r Die andere Ebene
+		inline Ebene3D operator=(const Ebene3D& r)
+		{
+			x = r.x;
+			y = r.y;
+			z = r.z;
+			w = r.w;
+			return *this;
+		}
+		//! Addiert eine andere Ebene dazu
+		//! \param r Die andere Ebene
+		inline Ebene3D operator+=(const Ebene3D& r)
+		{
+			x += r.x;
+			y += r.y;
+			z += r.z;
+			w += r.w;
+			return *this;
+		}
+		//! Subtrahiert eine andere Ebene
+		//! \param r Die andere Ebene
+		inline Ebene3D operator-=(const Ebene3D& r)
+		{
+			x -= r.x;
+			y -= r.y;
+			z -= r.z;
+			w -= r.w;
+			return *this;
+		}
+		//! Multipliziert die Ebene mit einem Faktor
+		//! \param r Der Faktor
+		inline Ebene3D operator*=(const T& r)
+		{
+			x *= r;
+			y *= r;
+			z *= r;
+			w *= r;
+			return *this;
+		}
+		//! Teilt die Ebene durch einen Faktor
+		//! \param r Der Faktor
+		inline Ebene3D operator/=(const T& r)
+		{
+			x /= r;
+			y /= r;
+			z /= r;
+			w /= r;
+			return *this;
+		}
+		template< typename T2 >
+		//! Konvertiert die Ebene in einen anderen Typ
+		inline operator Ebene3D< T2 >() const
+		{
+			return{ (T2)x, (T2)y, (T2)z, (T2)w };
+		}
+		//! Errehnet das Quadrat der Länge des Normalen Vektors der Ebene
+		inline T lenSq() const
+		{
+			return x * x + y * y + z * z;
+		}
+		//! Errechnet die Länge des Normalen Vektors
+		inline T len() const
+		{
+			return sqrt(lenSq());
+		}
+		//! Berechnet die Entfernung der Ebene zu einem Vektor
+		//! \param r Der Vektor
+		inline T operator*(const Vec3< T >& r) const
+		{
+			return x * r.x + y * r.y + z * r.z + w;
+		}
+		//! Addiert zwei Ebenen
+		//! \param r Die andere Ebene
+		inline Ebene3D operator+(const Ebene3D& r) const
+		{
+			return Vec4(*this) += r;
+		}
+		//! Subtrahiert zwei Ebenen
+		//! \param r Die andere Ebene
+		inline Ebene3D operator-(const Ebene3D& r) const
+		{
+			return Ebene3D(*this) -= r;
+		}
+		//! Multiliziert die Ebene mit einem Faktor
+		//! r: Der Faktor
+		inline Ebene3D operator*(const T& r) const
+		{
+			return Ebene3D(*this) *= r;
+		}
+		//! Dividiert die Ebene durch einen Faktor
+		//! \param r Der Faktor
+		inline Ebene3D operator/(const T& r) const
+		{
+			return Ebene3D(*this) /= r;
+		}
+		//! Überprüft zwei Ebenen auf Gleichheit
+		//! \param r Die andere Ebene
+		inline bool operator==(const Ebene3D& r) const
+		{
+			return x == r.x && y == r.y && z == r.z && w == r.w;
+		}
+		//! Überprüft zwei Ebenen auf Ungleichheit
+		//! \param r Die andere Ebene
+		inline bool operator!=(const Ebene3D& r) const
+		{
+			return !(*this == r);
+		}
+	};
 }

+ 10 - 10
Errors.cpp

@@ -2,15 +2,15 @@
 #include "Text.h"
 #include <stdexcept>
 
-void Framework::throwOutOfRange( const char *file, int line, int index, int count )
+void Framework::throwOutOfRange(const char* file, int line, int index, int count)
 {
-    Framework::Text err = "Index out of Range Exception File: ";
-    err += file;
-    err += " Line: ";
-    err += line;
-    err += " Index: ";
-    err += index;
-    err += " Element count: ";
-    err += count;
-    throw std::out_of_range( (char *)err );
+	Framework::Text err = "Index out of Range Exception File: ";
+	err += file;
+	err += " Line: ";
+	err += line;
+	err += " Index: ";
+	err += index;
+	err += " Element count: ";
+	err += count;
+	throw std::out_of_range(err);
 }

+ 1 - 1
Framework Linux.vcxproj

@@ -279,7 +279,7 @@
       <OutputFile>$(RemoteProjectDir)/$(TargetName)$(TargetExt)</OutputFile>
     </Link>
     <ClCompile>
-      <AdditionalOptions>-fPIC</AdditionalOptions>
+      <AdditionalOptions>-fPIC -Wno-unknown-pragmas</AdditionalOptions>
     </ClCompile>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 1 - 1
Global.cpp

@@ -133,7 +133,7 @@ void Framework::logLine(char* txt)
 		logFile->schreibe(time->getText(), time->getLength());
 		time->release();
 		logFile->schreibe(txt, textLength(txt));
-		logFile->schreibe((char*)"\n", 1);
+		logFile->schreibe("\n", 1);
 		logFile->close();
 		logC.unlock();
 	}

+ 5 - 5
HashMap.h

@@ -106,7 +106,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			if (iterator.hasNext())
 				return MapIterator(buckets, bucketCount, bucketIndex, iterator.next());
@@ -127,7 +127,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return iterator.val();
 		}
@@ -168,7 +168,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return iterator.val();
 		}
@@ -181,7 +181,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 			return iterator.val();
 		}
@@ -196,7 +196,7 @@ namespace Framework
 				err += __FILE__;
 				err += " Line: ";
 				err += __LINE__;
-				throw std::out_of_range((char*)err);
+				throw std::out_of_range(err);
 			}
 		}
 

+ 1 - 1
InMemoryBuffer.cpp

@@ -84,7 +84,7 @@ Text* InMemoryBuffer::leseZeile()
 	{
 		lese(&c, 1);
 		if (c)
-			ret->append((const char*)&c, 1);
+			ret->append(&c, 1);
 	}
 	return ret;
 }

+ 8 - 10
JSON.cpp

@@ -475,11 +475,9 @@ Text Parser::removeWhitespace(const char* str)
 		}
 	}
 	Text ret;
-	ret.fillText(' ', i - wsc);
 	i = 0;
 	esc = 0;
 	strO = 0;
-	int index = 0;
 	for (; str[i]; i++)
 	{
 		switch (str[i])
@@ -489,24 +487,24 @@ Text Parser::removeWhitespace(const char* str)
 				esc = !esc;
 			else
 				esc = 0;
-			ret.getText()[index++] = str[i];
+			ret.append(str[i]);
 			break;
 		case '"':
 			if (!esc)
 				strO = !strO;
 			esc = 0;
-			ret.getText()[index++] = str[i];
+			ret.append(str[i]);
 			break;
 		case ' ':
 		case '\n':
 		case '\t':
 		case '\r':
 			if (strO)
-				ret.getText()[index++] = str[i];
+				ret.append(str[i]);
 			esc = 0;
 			break;
 		default:
-			ret.getText()[index++] = str[i];
+			ret.append(str[i]);
 			esc = 0;
 			break;
 		}
@@ -532,14 +530,14 @@ JSONValue* Parser::getValue(const char* str)
 	if (string.getText()[0] == '{')
 		return new JSONObject(string);
 	if (Text((int)string).istGleich(string.getText()))
-		return new JSONNumber(string);
+		return new JSONNumber((double)string);
 	if (string.anzahlVon('.') == 1)
 	{
 		bool isNumber = 1;
-		for (char* c = (*string.getText() == '-') ? string.getText() + 1 : string.getText(); *c; c++)
+		for (const char* c = (*string.getText() == '-') ? string.getText() + 1 : string.getText(); *c; c++)
 			isNumber &= (*c >= '0' && *c <= '9') || *c == '.';
 		if (isNumber)
-			return new JSONNumber(string);
+			return new JSONNumber((double)string);
 	}
 	return new JSONValue();
 }
@@ -718,7 +716,7 @@ JSONValue* JSONTypeMissmatch::getValidPart() const
 			if (p->hatAt(0, "[") && p->hatAt(p->getLength() - 1, "]"))
 			{
 				Text* it = p->getTeilText(1, p->getLength() - 1);
-				int i = *it;
+				int i = (int)*it;
 				it->release();
 				if (i >= 0 && foundValue->asArray()->getLength() > i)
 				{

+ 797 - 797
Liste.cpp

@@ -16,962 +16,962 @@ using namespace Framework;
 // Inhalt der AuswahlListe Klasse aus Liste.h
 // Konstruktor 
 AuswahlListe::AuswahlListe()
-    : ZeichnungHintergrund(),
-    tfListe( 0 ),
-    auswahl( -1 ),
-    ahFarbe( 0xFF000000 ),
-    ahBild( 0 ),
-    aBuffer( 0 ),
-    aRahmen( 0 ),
-    styles( 0 ),
-    ahFarbeListe( 0 ),
-    ahBildListe( 0 ),
-    aBufferListe( 0 ),
-    aRahmenListe( 0 ),
-    schrift( 0 )
-{
-    style = 0;
-    this->setMausEreignis( _ret1ME );
-    this->setTastaturEreignis( _ret1TE );
+	: ZeichnungHintergrund(),
+	tfListe(0),
+	auswahl(-1),
+	ahFarbe(0xFF000000),
+	ahBild(0),
+	aBuffer(0),
+	aRahmen(0),
+	styles(0),
+	ahFarbeListe(0),
+	ahBildListe(0),
+	aBufferListe(0),
+	aRahmenListe(0),
+	schrift(0)
+{
+	style = 0;
+	this->setMausEreignis(_ret1ME);
+	this->setTastaturEreignis(_ret1TE);
 }
 
 // Destruktor 
 AuswahlListe::~AuswahlListe()
 {
-    if( tfListe )
-        tfListe->release();
-    if( ahBild )
-        ahBild->release();
-    if( aBuffer )
-        aBuffer->release();
-    if( aRahmen )
-        aRahmen->release();
-    if( styles )
-        styles->release();
-    if( ahFarbeListe )
-        ahFarbeListe->release();
-    if( ahBildListe )
-        ahBildListe->release();
-    if( aBufferListe )
-        aBufferListe->release();
-    if( aRahmenListe )
-        aRahmenListe->release();
-    if( schrift )
-        schrift->release();
-}
-
-void AuswahlListe::doMausEreignis( MausEreignis& me, bool userRet )
-{
-    if( !userRet || hatStyleNicht( Style::Erlaubt ) )
-        return;
-    if( ZeichnungHintergrund::hatStyle( Style::VScroll ) && vertikalScrollBar )
-    {
-        int rbr = 0;
-        if( rahmen && ZeichnungHintergrund::hatStyle( Style::Rahmen ) )
-            rbr = rahmen->getRBreite();
-        if( ((me.mx > gr.x - 15 - rbr) || me.id == ME_UScroll || me.id == ME_DScroll) && me.id != ME_Betritt && me.id != ME_Leaves )
-        {
-            vertikalScrollBar->doMausMessage( gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me );
-            me.verarbeitet = 1;
-        }
-    }
-    if( !me.verarbeitet && me.id == ME_RLinks )
-    {
-        int eintr = getKlickEintrag( me.my );
-        if( eintr >= 0 )
-        {
-            if( hatStyleNicht( Style::MultiSelect ) )
-            {
-                auswahl = eintr;
-                rend = 1;
-            }
-            else
-            {
-                bool shift = TastenStand[ T_Shift ];
-                bool strg = TastenStand[ T_Strg ];
-                if( strg )
-                {
-                    setMsStyle( eintr, Style::Selected, hatMsStyleNicht( eintr, Style::Selected ) );
-                    auswahl = eintr;
-                }
-                else if( shift && auswahl != -1 )
-                {
-                    deSelect();
-                    int beg = auswahl, end = eintr;
-                    if( beg > end )
-                    {
-                        int tmp = end;
-                        end = beg;
-                        beg = tmp;
-                    }
-                    for( int i = beg; i <= end; ++i )
-                    {
-                        addMsStyle( i, Style::Selected );
-                    }
-                }
-                else
-                {
-                    deSelect();
-                    addMsStyle( eintr, Style::Selected );
-                    auswahl = eintr;
-                }
-            }
-        }
-        else
-            deSelect();
-    }
-    me.verarbeitet = 1;
-}
-
-bool AuswahlListe::hatStyle( int styleSet, int styleCheck ) const
-{
-    return (styleSet | styleCheck) == styleSet;
+	if (tfListe)
+		tfListe->release();
+	if (ahBild)
+		ahBild->release();
+	if (aBuffer)
+		aBuffer->release();
+	if (aRahmen)
+		aRahmen->release();
+	if (styles)
+		styles->release();
+	if (ahFarbeListe)
+		ahFarbeListe->release();
+	if (ahBildListe)
+		ahBildListe->release();
+	if (aBufferListe)
+		aBufferListe->release();
+	if (aRahmenListe)
+		aRahmenListe->release();
+	if (schrift)
+		schrift->release();
+}
+
+void AuswahlListe::doMausEreignis(MausEreignis& me, bool userRet)
+{
+	if (!userRet || hatStyleNicht(Style::Erlaubt))
+		return;
+	if (ZeichnungHintergrund::hatStyle(Style::VScroll) && vertikalScrollBar)
+	{
+		int rbr = 0;
+		if (rahmen && ZeichnungHintergrund::hatStyle(Style::Rahmen))
+			rbr = rahmen->getRBreite();
+		if (((me.mx > gr.x - 15 - rbr) || me.id == ME_UScroll || me.id == ME_DScroll) && me.id != ME_Betritt && me.id != ME_Leaves)
+		{
+			vertikalScrollBar->doMausMessage(gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me);
+			me.verarbeitet = 1;
+		}
+	}
+	if (!me.verarbeitet && me.id == ME_RLinks)
+	{
+		int eintr = getKlickEintrag(me.my);
+		if (eintr >= 0)
+		{
+			if (hatStyleNicht(Style::MultiSelect))
+			{
+				auswahl = eintr;
+				rend = 1;
+			}
+			else
+			{
+				bool shift = TastenStand[T_Shift];
+				bool strg = TastenStand[T_Strg];
+				if (strg)
+				{
+					setMsStyle(eintr, Style::Selected, hatMsStyleNicht(eintr, Style::Selected));
+					auswahl = eintr;
+				}
+				else if (shift && auswahl != -1)
+				{
+					deSelect();
+					int beg = auswahl, end = eintr;
+					if (beg > end)
+					{
+						int tmp = end;
+						end = beg;
+						beg = tmp;
+					}
+					for (int i = beg; i <= end; ++i)
+					{
+						addMsStyle(i, Style::Selected);
+					}
+				}
+				else
+				{
+					deSelect();
+					addMsStyle(eintr, Style::Selected);
+					auswahl = eintr;
+				}
+			}
+		}
+		else
+			deSelect();
+	}
+	me.verarbeitet = 1;
+}
+
+bool AuswahlListe::hatStyle(int styleSet, int styleCheck) const
+{
+	return (styleSet | styleCheck) == styleSet;
 }
 
 // nicht constant 
 void AuswahlListe::update() // aktualisiert die Auswahl Liste
 {
-    int rbr = 0;
-    if( rahmen )
-    {
-        rbr = rahmen->getRBreite();
-        rahmen->setPosition( 0, 0 );
-        rahmen->setSize( gr.x, gr.y );
-    }
-    if( hintergrundFeld )
-    {
-        hintergrundFeld->setPosition( rbr, rbr );
-        hintergrundFeld->setSize( gr.x - rbr * 2, gr.y - rbr * 2 );
-    }
-    if( hatStyleNicht( Style::MultiStyled ) && tfListe )
-    {
-        bool FeldRahmen = ZeichnungHintergrund::hatStyle( Style::FeldRahmen );
-        bool FeldHintergrund = ZeichnungHintergrund::hatStyle( Style::FeldHintergrund );
-        bool FeldHBild = ZeichnungHintergrund::hatStyle( Style::FeldHBild );
-        bool FeldHAlpha = ZeichnungHintergrund::hatStyle( Style::FeldHAlpha );
-        bool FeldBuffer = ZeichnungHintergrund::hatStyle( Style::FeldBuffer );
-        for( TextFeld* tf : *tfListe )
-        {
-            tf->setStyle( TextFeld::Style::Rahmen, FeldRahmen );
-            tf->setStyle( TextFeld::Style::Hintergrund, FeldHintergrund );
-            tf->setStyle( TextFeld::Style::HBild, FeldHBild );
-            tf->setStyle( TextFeld::Style::HAlpha, FeldHAlpha );
-            tf->setStyle( TextFeld::Style::Buffered, FeldBuffer );
-            if( schrift )
-                tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
-        }
-    }
-    if( ZeichnungHintergrund::hatStyle( Style::MultiStyled ) && tfListe && styles )
-    {
-        auto style = styles->begin();
-        for( auto tf = tfListe->begin(); tf; tf++, style++ )
-        {
-            tf->setStyle( TextFeld::Style::Rahmen, hatStyle( style, Style::FeldRahmen ) );
-            tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( style, Style::FeldHintergrund ) );
-            tf->setStyle( TextFeld::Style::HBild, hatStyle( style, Style::FeldHBild ) );
-            tf->setStyle( TextFeld::Style::HAlpha, hatStyle( style, Style::FeldHAlpha ) );
-            tf->setStyle( TextFeld::Style::Buffered, hatStyle( style, Style::FeldBuffer ) );
-        }
-    }
-    rend = 1;
-}
-
-void AuswahlListe::addEintrag( Text* txt ) // fügt einen Eintrag hinzu
-{
-    TextFeld* tf = new TextFeld();
-    tf->setStyle( TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen );
-    tf->setSchriftFarbe( 0xFFFFFFFF );
-    tf->setRahmenBreite( 1 );
-    tf->setRahmenFarbe( 0xFFFFFFFF );
-    tf->setTextZ( txt );
-    tf->setSize( 0, 20 );
-    addEintragZ( tf );
-    rend = 1;
-}
-
-void AuswahlListe::addEintrag( const char* txt )
-{
-    Text* tx = new Text( txt );
-    addEintrag( tx );
-    rend = 1;
-}
-
-void AuswahlListe::addEintragZ( TextFeld* tf )
-{
-    if( !tfListe )
-        tfListe = new RCArray< TextFeld >();
-    if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
-    tfListe->add( tf );
-    rend = 1;
-}
-
-void AuswahlListe::addEintrag( int pos, Text* txt ) // fügt einen Eintrag bei position pos ein
-{
-    TextFeld* tf = new TextFeld();
-    tf->setStyle( TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen );
-    tf->setSchriftFarbe( 0xFFFFFFFF );
-    tf->setRahmenBreite( 1 );
-    tf->setRahmenFarbe( 0xFFFFFFFF );
-    tf->setTextZ( txt );
-    tf->setSize( 0, 20 );
-    addEintragZ( pos, tf );
-    rend = 1;
-}
-
-void AuswahlListe::addEintrag( int pos, const char* txt )
-{
-    Text* tx = new Text( txt );
-    addEintrag( pos, tx );
-    rend = 1;
-}
-
-void AuswahlListe::addEintragZ( int pos, TextFeld* tf )
-{
-    if( !tfListe )
-        tfListe = new RCArray< TextFeld >();
-    if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
-    tfListe->add( tf, pos );
-    rend = 1;
-}
-
-void AuswahlListe::setEintrag( int pos, Text* txt ) // ändert den pos - ten Eintrag
-{
-    TextFeld* tf = 0;
-    if( tfListe )
-        tf = tfListe->z( pos );
-    if( !tf )
-    {
-        tf = new TextFeld();
-        tf->setStyle( TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen );
-        tf->setSchriftFarbe( 0xFFFFFFFF );
-        tf->setRahmenFarbe( 0xFFFFFFFF );
-        tf->setRahmenBreite( 1 );
-        tf->setTextZ( txt );
-        tf->setSize( 0, 20 );
-        setEintragZ( pos, tf );
-        rend = 1;
-        return;
-    }
-    tf->setTextZ( txt );
-    rend = 1;
+	int rbr = 0;
+	if (rahmen)
+	{
+		rbr = rahmen->getRBreite();
+		rahmen->setPosition(0, 0);
+		rahmen->setSize(gr.x, gr.y);
+	}
+	if (hintergrundFeld)
+	{
+		hintergrundFeld->setPosition(rbr, rbr);
+		hintergrundFeld->setSize(gr.x - rbr * 2, gr.y - rbr * 2);
+	}
+	if (hatStyleNicht(Style::MultiStyled) && tfListe)
+	{
+		bool FeldRahmen = ZeichnungHintergrund::hatStyle(Style::FeldRahmen);
+		bool FeldHintergrund = ZeichnungHintergrund::hatStyle(Style::FeldHintergrund);
+		bool FeldHBild = ZeichnungHintergrund::hatStyle(Style::FeldHBild);
+		bool FeldHAlpha = ZeichnungHintergrund::hatStyle(Style::FeldHAlpha);
+		bool FeldBuffer = ZeichnungHintergrund::hatStyle(Style::FeldBuffer);
+		for (TextFeld* tf : *tfListe)
+		{
+			tf->setStyle(TextFeld::Style::Rahmen, FeldRahmen);
+			tf->setStyle(TextFeld::Style::Hintergrund, FeldHintergrund);
+			tf->setStyle(TextFeld::Style::HBild, FeldHBild);
+			tf->setStyle(TextFeld::Style::HAlpha, FeldHAlpha);
+			tf->setStyle(TextFeld::Style::Buffered, FeldBuffer);
+			if (schrift)
+				tf->setSchriftZ(dynamic_cast<Schrift*>(schrift->getThis()));
+		}
+	}
+	if (ZeichnungHintergrund::hatStyle(Style::MultiStyled) && tfListe && styles)
+	{
+		auto style = styles->begin();
+		for (auto tf = tfListe->begin(); tf; tf++, style++)
+		{
+			tf->setStyle(TextFeld::Style::Rahmen, hatStyle(style, Style::FeldRahmen));
+			tf->setStyle(TextFeld::Style::Hintergrund, hatStyle(style, Style::FeldHintergrund));
+			tf->setStyle(TextFeld::Style::HBild, hatStyle(style, Style::FeldHBild));
+			tf->setStyle(TextFeld::Style::HAlpha, hatStyle(style, Style::FeldHAlpha));
+			tf->setStyle(TextFeld::Style::Buffered, hatStyle(style, Style::FeldBuffer));
+		}
+	}
+	rend = 1;
+}
+
+void AuswahlListe::addEintrag(Text* txt) // fügt einen Eintrag hinzu
+{
+	TextFeld* tf = new TextFeld();
+	tf->setStyle(TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen);
+	tf->setSchriftFarbe(0xFFFFFFFF);
+	tf->setRahmenBreite(1);
+	tf->setRahmenFarbe(0xFFFFFFFF);
+	tf->setTextZ(txt);
+	tf->setSize(0, 20);
+	addEintragZ(tf);
+	rend = 1;
+}
+
+void AuswahlListe::addEintrag(const char* txt)
+{
+	Text* tx = new Text(txt);
+	addEintrag(tx);
+	rend = 1;
+}
+
+void AuswahlListe::addEintragZ(TextFeld* tf)
+{
+	if (!tfListe)
+		tfListe = new RCArray< TextFeld >();
+	if (schrift && (!tf->zSchrift() || hatStyleNicht(Style::MultiStyled)))
+		tf->setSchriftZ(dynamic_cast<Schrift*>(schrift->getThis()));
+	tfListe->add(tf);
+	rend = 1;
+}
+
+void AuswahlListe::addEintrag(int pos, Text* txt) // fügt einen Eintrag bei position pos ein
+{
+	TextFeld* tf = new TextFeld();
+	tf->setStyle(TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen);
+	tf->setSchriftFarbe(0xFFFFFFFF);
+	tf->setRahmenBreite(1);
+	tf->setRahmenFarbe(0xFFFFFFFF);
+	tf->setTextZ(txt);
+	tf->setSize(0, 20);
+	addEintragZ(pos, tf);
+	rend = 1;
+}
+
+void AuswahlListe::addEintrag(int pos, const char* txt)
+{
+	Text* tx = new Text(txt);
+	addEintrag(pos, tx);
+	rend = 1;
+}
+
+void AuswahlListe::addEintragZ(int pos, TextFeld* tf)
+{
+	if (!tfListe)
+		tfListe = new RCArray< TextFeld >();
+	if (schrift && (!tf->zSchrift() || hatStyleNicht(Style::MultiStyled)))
+		tf->setSchriftZ(dynamic_cast<Schrift*>(schrift->getThis()));
+	tfListe->add(tf, pos);
+	rend = 1;
+}
+
+void AuswahlListe::setEintrag(int pos, Text* txt) // ändert den pos - ten Eintrag
+{
+	TextFeld* tf = 0;
+	if (tfListe)
+		tf = tfListe->z(pos);
+	if (!tf)
+	{
+		tf = new TextFeld();
+		tf->setStyle(TextFeld::Style::Center | TextFeld::Style::Sichtbar | TextFeld::Style::Rahmen);
+		tf->setSchriftFarbe(0xFFFFFFFF);
+		tf->setRahmenFarbe(0xFFFFFFFF);
+		tf->setRahmenBreite(1);
+		tf->setTextZ(txt);
+		tf->setSize(0, 20);
+		setEintragZ(pos, tf);
+		rend = 1;
+		return;
+	}
+	tf->setTextZ(txt);
+	rend = 1;
 }
 
-void AuswahlListe::setEintrag( int pos, unsigned char* txt )
+void AuswahlListe::setEintrag(int pos, const char* txt)
 {
-    Text* tx = new Text( (const char*)txt );
-    setEintrag( pos, tx );
-    rend = 1;
+	Text* tx = new Text(txt);
+	setEintrag(pos, tx);
+	rend = 1;
 }
 
-void AuswahlListe::setEintragZ( int pos, TextFeld* tf )
+void AuswahlListe::setEintragZ(int pos, TextFeld* tf)
 {
-    if( !tfListe )
-        tfListe = new RCArray< TextFeld >();
-    if( schrift && (!tf->zSchrift() || hatStyleNicht( Style::MultiStyled )) )
-        tf->setSchriftZ( dynamic_cast<Schrift*>(schrift->getThis()) );
-    tfListe->set( tf, pos );
-    rend = 1;
+	if (!tfListe)
+		tfListe = new RCArray< TextFeld >();
+	if (schrift && (!tf->zSchrift() || hatStyleNicht(Style::MultiStyled)))
+		tf->setSchriftZ(dynamic_cast<Schrift*>(schrift->getThis()));
+	tfListe->set(tf, pos);
+	rend = 1;
 }
 
-void AuswahlListe::tauschEintragPos( int vpos, int npos ) // taucht den Eintrag vpos mit dem Eintrag npos
+void AuswahlListe::tauschEintragPos(int vpos, int npos) // taucht den Eintrag vpos mit dem Eintrag npos
 {
-    if( tfListe )
-    {
-        tfListe->tausch( vpos, npos );
-        if( styles )
-            styles->tausch( vpos, npos );
-        if( ahFarbeListe )
-            ahFarbeListe->tausch( vpos, npos );
-        if( ahBildListe )
-            ahBildListe->tausch( vpos, npos );
-        if( aBufferListe )
-            aBufferListe->tausch( vpos, npos );
-        if( aRahmenListe )
-            aRahmenListe->tausch( vpos, npos );
-        rend = 1;
-    }
+	if (tfListe)
+	{
+		tfListe->tausch(vpos, npos);
+		if (styles)
+			styles->tausch(vpos, npos);
+		if (ahFarbeListe)
+			ahFarbeListe->tausch(vpos, npos);
+		if (ahBildListe)
+			ahBildListe->tausch(vpos, npos);
+		if (aBufferListe)
+			aBufferListe->tausch(vpos, npos);
+		if (aRahmenListe)
+			aRahmenListe->tausch(vpos, npos);
+		rend = 1;
+	}
 }
 
-void AuswahlListe::removeEintrag( int pos ) // löscht den Eintrag pos
+void AuswahlListe::removeEintrag(int pos) // löscht den Eintrag pos
 {
-    tfListe->remove( pos );
-    rend = 1;
+	tfListe->remove(pos);
+	rend = 1;
 }
 
-void AuswahlListe::setSchriftZ( Schrift* schrift ) // legt die Schrift der Einträge fest
+void AuswahlListe::setSchriftZ(Schrift* schrift) // legt die Schrift der Einträge fest
 {
-    if( this->schrift )
-        this->schrift->release();
-    this->schrift = schrift;
-    rend = 1;
+	if (this->schrift)
+		this->schrift->release();
+	this->schrift = schrift;
+	rend = 1;
 }
 
-void AuswahlListe::setVScrollZuEintrag( int eintrag ) // scrollt zum Eintrag
+void AuswahlListe::setVScrollZuEintrag(int eintrag) // scrollt zum Eintrag
 {
-    if( vertikalScrollBar )
-    {
-        if( eintrag > tfListe->getLastIndex() )
-            eintrag = tfListe->getLastIndex();
-        int y = 0;
-        for( int i = 0; i < eintrag; i++ )
-            y += tfListe->z( i ) ? tfListe->z( i )->getHeight() : 0;
-        vertikalScrollBar->scroll( y );
-    }
+	if (vertikalScrollBar)
+	{
+		if (eintrag > tfListe->getLastIndex())
+			eintrag = tfListe->getLastIndex();
+		int y = 0;
+		for (int i = 0; i < eintrag; i++)
+			y += tfListe->z(i) ? tfListe->z(i)->getHeight() : 0;
+		vertikalScrollBar->scroll(y);
+	}
 }
 
 void AuswahlListe::updateVScroll() // scrollt zur Curser Position oder nach Unten
 {
-    if( vertikalScrollBar )
-    {
-        int y = 0;
-        for( TextFeld* tf : *tfListe )
-            y += (TextFeld*)tf ? tf->getHeight() : 0;
-        vertikalScrollBar->update( y, gr.y - ((rahmen && ZeichnungHintergrund::hatStyle( TextFeld::Style::Rahmen )) ? rahmen->getRBreite() : 0) );
-    }
+	if (vertikalScrollBar)
+	{
+		int y = 0;
+		for (TextFeld* tf : *tfListe)
+			y += (TextFeld*)tf ? tf->getHeight() : 0;
+		vertikalScrollBar->update(y, gr.y - ((rahmen && ZeichnungHintergrund::hatStyle(TextFeld::Style::Rahmen)) ? rahmen->getRBreite() : 0));
+	}
 }
 
-void AuswahlListe::setALRZ( Rahmen* rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur ohne MulitStyled)
+void AuswahlListe::setALRZ(Rahmen* rahmen) // setzt einen Zeiger zum Auswahl Rahmen (nur ohne MulitStyled)
 {
-    if( aRahmen )
-        aRahmen->release();
-    aRahmen = rahmen;
-    rend = 1;
+	if (aRahmen)
+		aRahmen->release();
+	aRahmen = rahmen;
+	rend = 1;
 }
 
-void AuswahlListe::setALRBreite( int br ) // setzt die Breite des Auswahl Rahmens (nur ohne MultiStyled)
+void AuswahlListe::setALRBreite(int br) // setzt die Breite des Auswahl Rahmens (nur ohne MultiStyled)
 {
-    if( !aRahmen )
-        aRahmen = new LRahmen();
-    aRahmen->setRamenBreite( br );
-    rend = 1;
+	if (!aRahmen)
+		aRahmen = new LRahmen();
+	aRahmen->setRamenBreite(br);
+	rend = 1;
 }
 
-void AuswahlListe::setALRFarbe( int fc ) // setzt die Farbe des Auswahl Rahmens (nur ohne MultiStyled)
+void AuswahlListe::setALRFarbe(int fc) // setzt die Farbe des Auswahl Rahmens (nur ohne MultiStyled)
 {
-    if( !aRahmen )
-        aRahmen = new LRahmen();
-    aRahmen->setFarbe( fc );
-    rend = 1;
+	if (!aRahmen)
+		aRahmen = new LRahmen();
+	aRahmen->setFarbe(fc);
+	rend = 1;
 }
 
-void AuswahlListe::setAAFZ( AlphaFeld* buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur ohne MultiStyled)
+void AuswahlListe::setAAFZ(AlphaFeld* buffer) // setzt einen Zeiger zum Auswahl AlpaFeld (nur ohne MultiStyled)
 {
-    if( aBuffer )
-        aBuffer->release();
-    aBuffer = buffer;
-    rend = 1;
+	if (aBuffer)
+		aBuffer->release();
+	aBuffer = buffer;
+	rend = 1;
 }
 
-void AuswahlListe::setAAFStrength( int st ) // setzt die Stärke des Auswahl Hintergrund Buffers (nur ohne MultiStyled)
+void AuswahlListe::setAAFStrength(int st) // setzt die Stärke des Auswahl Hintergrund Buffers (nur ohne MultiStyled)
 {
-    if( !aBuffer )
-        aBuffer = new AlphaFeld();
-    aBuffer->setStrength( st );
-    rend = 1;
+	if (!aBuffer)
+		aBuffer = new AlphaFeld();
+	aBuffer->setStrength(st);
+	rend = 1;
 }
 
-void AuswahlListe::setAAFFarbe( int fc ) // setzt die Farbe des Auswahl Hintergrund Buffers (nur ohne MultiStyled)
+void AuswahlListe::setAAFFarbe(int fc) // setzt die Farbe des Auswahl Hintergrund Buffers (nur ohne MultiStyled)
 {
-    if( !aBuffer )
-        aBuffer = new AlphaFeld();
-    aBuffer->setFarbe( fc );
-    rend = 1;
+	if (!aBuffer)
+		aBuffer = new AlphaFeld();
+	aBuffer->setFarbe(fc);
+	rend = 1;
 }
 
-void AuswahlListe::setAHBild( Bild* bild ) // setzt das Auswahl Hintergrund Bild (nur ohne MultiStyled)
+void AuswahlListe::setAHBild(Bild* bild) // setzt das Auswahl Hintergrund Bild (nur ohne MultiStyled)
 {
-    if( !ahBild )
-        ahBild = new Bild();
-    ahBild->neuBild( bild->getBreite(), bild->getHeight(), 0 );
-    int* buff1 = ahBild->getBuffer();
-    int* buff2 = bild->getBuffer();
-    for( int i = 0; i < bild->getBreite() * bild->getHeight(); ++i )
-        buff1[ i ] = buff2[ i ];
-    bild->release();
-    rend = 1;
+	if (!ahBild)
+		ahBild = new Bild();
+	ahBild->neuBild(bild->getBreite(), bild->getHeight(), 0);
+	int* buff1 = ahBild->getBuffer();
+	int* buff2 = bild->getBuffer();
+	for (int i = 0; i < bild->getBreite() * bild->getHeight(); ++i)
+		buff1[i] = buff2[i];
+	bild->release();
+	rend = 1;
 }
 
-void AuswahlListe::setAHFarbe( int f ) // setzt einen Zeiger zur Auswahl Hintergrund Farbe (nur ohne MultiStyled)
+void AuswahlListe::setAHFarbe(int f) // setzt einen Zeiger zur Auswahl Hintergrund Farbe (nur ohne MultiStyled)
 {
-    ahFarbe = f;
-    rend = 1;
+	ahFarbe = f;
+	rend = 1;
 }
 
-void AuswahlListe::setAHBildZ( Bild* b ) // setzt einen Zeiger zum Hintergrund Bild (nur ohne MultiStyled)
+void AuswahlListe::setAHBildZ(Bild* b) // setzt einen Zeiger zum Hintergrund Bild (nur ohne MultiStyled)
 {
-    if( ahBild )
-        ahBild->release();
-    ahBild = b;
-    rend = 1;
+	if (ahBild)
+		ahBild->release();
+	ahBild = b;
+	rend = 1;
 }
 
-void AuswahlListe::setALRZ( int pos, Rahmen* rahmen ) // setzt einen Zeiger zum Auswahl Rahmen (nur mit MulitStyled)
+void AuswahlListe::setALRZ(int pos, Rahmen* rahmen) // setzt einen Zeiger zum Auswahl Rahmen (nur mit MulitStyled)
 {
-    if( !aRahmenListe )
-        aRahmenListe = new RCArray< Rahmen >();
-    aRahmenListe->set( rahmen, pos );
-    rend = 1;
+	if (!aRahmenListe)
+		aRahmenListe = new RCArray< Rahmen >();
+	aRahmenListe->set(rahmen, pos);
+	rend = 1;
 }
 
-void AuswahlListe::setALRBreite( int pos, int br ) // setzt die Breite des Auswahl Rahmens (nur mit MultiStyled)
+void AuswahlListe::setALRBreite(int pos, int br) // setzt die Breite des Auswahl Rahmens (nur mit MultiStyled)
 {
-    if( !aRahmenListe )
-        aRahmenListe = new RCArray< Rahmen >();
-    if( !aRahmenListe->z( pos ) )
-        aRahmenListe->set( new LRahmen(), pos );
-    aRahmenListe->z( pos )->setRamenBreite( br );
-    rend = 1;
+	if (!aRahmenListe)
+		aRahmenListe = new RCArray< Rahmen >();
+	if (!aRahmenListe->z(pos))
+		aRahmenListe->set(new LRahmen(), pos);
+	aRahmenListe->z(pos)->setRamenBreite(br);
+	rend = 1;
 }
 
-void AuswahlListe::setALRFarbe( int pos, int fc ) // setzt die Farbe des Auswahl Rahmens (nur mit MultiStyled)
+void AuswahlListe::setALRFarbe(int pos, int fc) // setzt die Farbe des Auswahl Rahmens (nur mit MultiStyled)
 {
-    if( !aRahmenListe )
-        aRahmenListe = new RCArray< Rahmen >();
-    if( !aRahmenListe->z( pos ) )
-        aRahmenListe->set( new LRahmen(), pos );
-    aRahmenListe->z( pos )->setFarbe( fc );
-    rend = 1;
+	if (!aRahmenListe)
+		aRahmenListe = new RCArray< Rahmen >();
+	if (!aRahmenListe->z(pos))
+		aRahmenListe->set(new LRahmen(), pos);
+	aRahmenListe->z(pos)->setFarbe(fc);
+	rend = 1;
 }
 
-void AuswahlListe::setAAFZ( int pos, AlphaFeld* buffer ) // setzt einen Zeiger zum Auswahl AlpaFeld (nur mit MultiStyled)
+void AuswahlListe::setAAFZ(int pos, AlphaFeld* buffer) // setzt einen Zeiger zum Auswahl AlpaFeld (nur mit MultiStyled)
 {
-    if( !aBufferListe )
-        aBufferListe = new RCArray< AlphaFeld >();
-    aBufferListe->set( buffer, pos );
-    rend = 1;
+	if (!aBufferListe)
+		aBufferListe = new RCArray< AlphaFeld >();
+	aBufferListe->set(buffer, pos);
+	rend = 1;
 }
 
-void AuswahlListe::setAAFStrength( int pos, int st ) // setzt die Stärke des Auswahl Hintergrund Buffers (nur mit MultiStyled)
+void AuswahlListe::setAAFStrength(int pos, int st) // setzt die Stärke des Auswahl Hintergrund Buffers (nur mit MultiStyled)
 {
-    if( !aBufferListe )
-        aBufferListe = new RCArray< AlphaFeld >();
-    if( !aBufferListe->z( pos ) )
-        aBufferListe->set( new AlphaFeld(), pos );
-    aBufferListe->z( pos )->setStrength( st );
-    rend = 1;
+	if (!aBufferListe)
+		aBufferListe = new RCArray< AlphaFeld >();
+	if (!aBufferListe->z(pos))
+		aBufferListe->set(new AlphaFeld(), pos);
+	aBufferListe->z(pos)->setStrength(st);
+	rend = 1;
 }
 
-void AuswahlListe::setAAFFarbe( int pos, int fc ) // setzt die Farbe des Auswahl Hintergrund Buffers (nur mit MultiStyled)
+void AuswahlListe::setAAFFarbe(int pos, int fc) // setzt die Farbe des Auswahl Hintergrund Buffers (nur mit MultiStyled)
 {
-    if( !aBufferListe )
-        aBufferListe = new RCArray< AlphaFeld >();
-    if( !aBufferListe->z( pos ) )
-        aBufferListe->set( new AlphaFeld(), pos );
-    aBufferListe->z( pos )->setFarbe( fc );
-    rend = 1;
+	if (!aBufferListe)
+		aBufferListe = new RCArray< AlphaFeld >();
+	if (!aBufferListe->z(pos))
+		aBufferListe->set(new AlphaFeld(), pos);
+	aBufferListe->z(pos)->setFarbe(fc);
+	rend = 1;
 }
 
-void AuswahlListe::setAHBild( int pos, Bild* bild ) // setzt das Auswahl Hintergrund Bild (nur mit MultiStyled)
+void AuswahlListe::setAHBild(int pos, Bild* bild) // setzt das Auswahl Hintergrund Bild (nur mit MultiStyled)
 {
-    if( ahBildListe )
-        ahBildListe = new RCArray< Bild >();
-    if( !ahBildListe->z( pos ) )
-        ahBildListe->set( new Bild(), pos );
-    ahBildListe->z( pos )->neuBild( bild->getBreite(), bild->getHeight(), 0 );
-    int* buff1 = ahBildListe->z( pos )->getBuffer();
-    int* buff2 = bild->getBuffer();
-    for( int i = 0; i < bild->getBreite() * bild->getHeight(); ++i )
-        buff1[ i ] = buff2[ i ];
-    bild->release();
-    rend = 1;
+	if (ahBildListe)
+		ahBildListe = new RCArray< Bild >();
+	if (!ahBildListe->z(pos))
+		ahBildListe->set(new Bild(), pos);
+	ahBildListe->z(pos)->neuBild(bild->getBreite(), bild->getHeight(), 0);
+	int* buff1 = ahBildListe->z(pos)->getBuffer();
+	int* buff2 = bild->getBuffer();
+	for (int i = 0; i < bild->getBreite() * bild->getHeight(); ++i)
+		buff1[i] = buff2[i];
+	bild->release();
+	rend = 1;
 }
 
-void AuswahlListe::setAHFarbe( int pos, int f ) // setzt einen Zeiger zur Auswahl Hintergrund Farbe (nur miz MultiStyled)
+void AuswahlListe::setAHFarbe(int pos, int f) // setzt einen Zeiger zur Auswahl Hintergrund Farbe (nur miz MultiStyled)
 {
-    if( ahFarbeListe )
-        ahFarbeListe = new Array< int >();
-    ahFarbeListe->set( f, pos );
-    rend = 1;
-}
-
-void AuswahlListe::setAHBildZ( int pos, Bild* b ) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
-{
-    if( ahBildListe )
-        ahBildListe = new RCArray< Bild >();
-    ahBildListe->set( b, pos );
-    rend = 1;
+	if (ahFarbeListe)
+		ahFarbeListe = new Array< int >();
+	ahFarbeListe->set(f, pos);
+	rend = 1;
+}
+
+void AuswahlListe::setAHBildZ(int pos, Bild* b) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
+{
+	if (ahBildListe)
+		ahBildListe = new RCArray< Bild >();
+	ahBildListe->set(b, pos);
+	rend = 1;
 }
-
-void AuswahlListe::setMsStyle( int pos, __int64 style ) // setzt den Style des Eintrags (nur mit MultiStyled)
-{
-    if( !styles )
-        styles = new Array< __int64 >();
-    styles->set( style, pos );
-    rend = 1;
-}
-
-void AuswahlListe::setMsStyle( int pos, __int64 style, bool add_remove )
-{
-    if( !styles )
-        styles = new Array< __int64 >();
-    if( add_remove )
-        styles->set( styles->get( pos ) | style, pos );
-    else
-        styles->set( styles->get( pos ) & ~style, pos );
-    rend = 1;
-}
-
-void AuswahlListe::addMsStyle( int pos, __int64 style )
-{
-    if( !styles )
-        styles = new Array< __int64 >();
-    styles->set( styles->get( pos ) | style, pos );
-    rend = 1;
-}
-
-void AuswahlListe::removeMsStyle( int pos, __int64 style )
-{
-    if( !styles )
-        styles = new Array< __int64 >();
-    styles->set( styles->get( pos ) & ~style, pos );
-    rend = 1;
-}
-
-void AuswahlListe::doTastaturEreignis( TastaturEreignis& te )
-{
-    bool ntakc = !te.verarbeitet;
-    if( hatStyleNicht( Style::Fokus ) || !tak || te.verarbeitet )
-        return;
-    getThis();
-    if( tak( takParam, this, te ) )
-    {
-        if( te.id == TE_Press )
-        {
-            if( hatStyleNicht( Style::MultiSelect ) )
-            {
-                switch( te.taste )
-                {
-                case T_Unten:
-                    ++auswahl;
-                    if( auswahl > tfListe->getEintragAnzahl() )
-                        auswahl = tfListe->getEintragAnzahl();
-                    rend = 1;
-                    break;
-                case T_Oben:
-                    --auswahl;
-                    if( auswahl < -1 )
-                        auswahl = -1;
-                    rend = 1;
-                    break;
-                }
-            }
-            else
-            {
-                switch( te.taste )
-                {
-                case T_Unten:
-                    deSelect();
-                    ++auswahl;
-                    if( auswahl > tfListe->getEintragAnzahl() )
-                        auswahl = tfListe->getEintragAnzahl();
-                    if( auswahl >= 0 )
-                        addMsStyle( auswahl, Style::Selected );
-                    rend = 1;
-                    break;
-                case T_Oben:
-                    deSelect();
-                    --auswahl;
-                    if( auswahl < -1 )
-                        auswahl = -1;
-                    if( auswahl >= 0 )
-                        addMsStyle( auswahl, Style::Selected );
-                    rend = 1;
-                    break;
-                }
-            }
-        }
-        te.verarbeitet = 1;
-    }
-    if( ntakc && te.verarbeitet && nTak )
-        te.verarbeitet = nTak( ntakParam, this, te );
-    release();
-}
-
-void AuswahlListe::render( Bild& zRObj ) // zeichnet nach zRObj
-{
-    if( !ZeichnungHintergrund::hatStyle( Style::Sichtbar ) )
-        return;
-    removeStyle( Style::HScroll );
-    ZeichnungHintergrund::render( zRObj );
-    lockZeichnung();
-    if( !zRObj.setDrawOptions( innenPosition, innenSize ) )
-    {
-        unlockZeichnung();
-        return;
-    }
-    int rbr = 0;
-    if( rahmen && ZeichnungHintergrund::hatStyle( Style::Rahmen ) )
-        rbr = rahmen->getRBreite();
-    if( tfListe )
-    {
-        int maxHeight = 0;
-        int dx = 0, dy = 0;
-        if( vertikalScrollBar && ZeichnungHintergrund::hatStyle( Style::VScroll ) )
-            dy -= vertikalScrollBar->getScroll();
-        int mdy = innenSize.y + rbr;
-        auto style = styles->begin();
-        int i = 0;
-        for( auto tf = tfListe->begin(); tf; tf++, style++, i++ )
-        {
-            if( dy + tf->getHeight() > mdy && !(vertikalScrollBar && ZeichnungHintergrund::hatStyle( Style::VScroll )) )
-                break;
-            tf->setPosition( dx, dy );
-            tf->setSize( innenSize.x, tf->getHeight() );
-            maxHeight += tf->getHeight();
-            bool selected = 0;
-            if( ZeichnungHintergrund::hatStyle( Style::MultiSelect ) && styles )
-                selected = hatStyle( style, Style::Selected );
-            else
-                selected = auswahl == i;
-            AlphaFeld* tmpBuffer = 0;
-            bool tmpB = 0;
-            int tmpHFarbe = 0;
-            bool tmpH = 0;
-            Bild* tmpHBild = 0;
-            bool tmpHB = 0;
-            bool tmpHAlpha = 0;
-            Rahmen* tmpRahmen = 0;
-            bool tmpR = 0;
-            if( selected )
-            {
-                if( hatStyleNicht( Style::MultiStyled ) || !styles )
-                {
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlBuffer ) && aBuffer )
-                    {
-                        tmpBuffer = tf->getAlphaFeld();
-                        tf->setAlphaFeldZ( dynamic_cast<AlphaFeld*>(aBuffer->getThis()) );
-                        tmpB = tf->hatStyle( TextFeld::Style::Buffered );
-                        tf->setStyle( TextFeld::Style::Buffered, ZeichnungHintergrund::hatStyle( Style::AuswahlBuffer ) );
-                    }
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlHintergrund ) )
-                    {
-                        tmpH = tf->hatStyle( TextFeld::Style::Hintergrund );
-                        tmpHFarbe = tf->getHintergrundFarbe();
-                        tf->setHintergrundFarbe( ahFarbe );
-                        tf->setStyle( TextFeld::Style::Hintergrund, ZeichnungHintergrund::hatStyle( Style::Hintergrund ) );
-                        if( ZeichnungHintergrund::hatStyle( Style::AuswahlHBild ) && ahBild )
-                        {
-                            tmpHBild = tf->getHintergrundBild();
-                            tf->setHintergrundBildZ( dynamic_cast<Bild*>(ahBild->getThis()) );
-                            tmpHB = tf->hatStyle( TextFeld::Style::HBild );
-                            tf->setStyle( TextFeld::Style::HBild, ZeichnungHintergrund::hatStyle( Style::HBild ) );
-                        }
-                        if( ZeichnungHintergrund::hatStyle( Style::AuswahlHAlpha ) )
-                        {
-                            tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
-                            tf->setStyle( TextFeld::Style::HAlpha, ZeichnungHintergrund::hatStyle( Style::AuswahlHAlpha ) );
-                        }
-                    }
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlRahmen ) && aRahmen )
-                    {
-                        tmpRahmen = tf->getRahmen();
-                        tf->setRahmenZ( dynamic_cast<Rahmen*>(aRahmen->getThis()) );
-                        tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
-                        tf->setStyle( TextFeld::Style::Rahmen, ZeichnungHintergrund::hatStyle( Style::AuswahlRahmen ) );
-                    }
-                }
-                else
-                {
-                    if( hatStyle( style, Style::AuswahlBuffer ) && aBufferListe )
-                    {
-                        tmpBuffer = tf->getAlphaFeld();
-                        tf->setAlphaFeldZ( aBufferListe->get( i ) );
-                        tmpB = tf->hatStyle( TextFeld::Style::Buffered );
-                        tf->setStyle( TextFeld::Style::Buffered, hatStyle( style, Style::AuswahlBuffer ) );
-                    }
-                    if( hatStyle( style, Style::AuswahlHintergrund ) )
-                    {
-                        tmpH = tf->hatStyle( Style::Hintergrund );
-                        tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( style, Style::AuswahlHintergrund ) );
-                        if( ahFarbeListe && ahFarbeListe->hat( i ) )
-                        {
-                            tmpHFarbe = tf->getHintergrundFarbe();
-                            tf->setHintergrundFarbe( ahFarbeListe->get( i ) );
-                        }
-                        if( hatStyle( style, Style::AuswahlHBild ) && ahBildListe )
-                        {
-                            tmpHBild = tf->getHintergrundBild();
-                            tf->setHintergrundBildZ( ahBildListe->get( i ) );
-                            tmpHB = tf->hatStyle( TextFeld::Style::HBild );
-                            tf->setStyle( TextFeld::Style::HBild, hatStyle( style, Style::HBild ) );
-                        }
-                        if( hatStyle( style, Style::AuswahlHAlpha ) )
-                        {
-                            tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
-                            tf->setStyle( TextFeld::Style::HAlpha, hatStyle( style, Style::AuswahlHAlpha ) );
-                        }
-                    }
-                    if( hatStyle( style, Style::AuswahlRahmen ) && aRahmenListe )
-                    {
-                        tmpRahmen = tf->getRahmen();
-                        tf->setRahmenZ( aRahmenListe->get( i ) );
-                        tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
-                        tf->setStyle( TextFeld::Style::Rahmen, hatStyle( style, Style::AuswahlRahmen ) );
-                    }
-                }
-            }
-            tf->render( zRObj );
-            if( selected )
-            {
-                if( hatStyleNicht( Style::MultiStyled ) || !styles )
-                {
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlBuffer ) )
-                    {
-                        tf->setAlphaFeldZ( tmpBuffer );
-                        tf->setStyle( TextFeld::Style::Buffered, tmpB );
-                    }
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlHintergrund ) )
-                    {
-                        tf->setHintergrundFarbe( tmpHFarbe );
-                        tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
-                        if( ZeichnungHintergrund::hatStyle( Style::AuswahlHBild ) )
-                        {
-                            tf->setHintergrundBildZ( tmpHBild );
-                            tf->setStyle( TextFeld::Style::HBild, tmpHB );
-                        }
-                        if( ZeichnungHintergrund::hatStyle( Style::AuswahlHAlpha ) )
-                            tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
-                    }
-                    if( ZeichnungHintergrund::hatStyle( Style::AuswahlRahmen ) )
-                    {
-                        tf->setRahmenZ( tmpRahmen );
-                        tf->setStyle( TextFeld::Style::Rahmen, tmpR );
-                    }
-                }
-                else
-                {
-                    if( hatMsStyle( i, Style::AuswahlBuffer ) && aBufferListe )
-                    {
-                        tf->setAlphaFeldZ( tmpBuffer );
-                        tf->setStyle( TextFeld::Style::Buffered, tmpB );
-                    }
-                    if( hatMsStyle( i, Style::AuswahlHintergrund ) )
-                    {
-                        tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
-                        if( ahFarbeListe && ahFarbeListe->hat( i ) )
-                            tf->setHintergrundFarbe( tmpHFarbe );
-                        if( hatMsStyle( i, Style::AuswahlHBild ) && ahBildListe )
-                        {
-                            tf->setHintergrundBildZ( tmpHBild );
-                            tf->setStyle( TextFeld::Style::HBild, tmpHB );
-                        }
-                        if( hatMsStyle( i, Style::AuswahlHAlpha ) )
-                            tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
-                    }
-                    if( hatMsStyle( i, Style::AuswahlRahmen ) && aRahmenListe )
-                    {
-                        tf->setRahmenZ( tmpRahmen );
-                        tf->setStyle( TextFeld::Style::Rahmen, tmpR );
-                    }
-                }
-            }
-            dy += tf->getHeight();
-        }
-        if( vertikalScrollBar )
-            vertikalScrollBar->getScrollData()->max = maxHeight;
-    }
-    zRObj.releaseDrawOptions();
-    unlockZeichnung();
-}
-
-int AuswahlListe::getKlickEintrag( int my )
-{
-    if( !tfListe )
-        return -1;
-    int y = 0;
-    if( ZeichnungHintergrund::hatStyle( Style::VScroll ) && vertikalScrollBar )
-        y -= vertikalScrollBar->getScroll();
-    int i = 0;
-    for( auto tf = tfListe->begin(); tf; tf++, i++ )
-    {
-        y += tf->getHeight();
-        if( y > my )
-            return i;
-    }
-    return -1;
-}
-
-void AuswahlListe::setAuswahl( int ausw ) // setzt die Auswahl
-{
-    if( hatStyleNicht( Style::MultiSelect ) )
-        auswahl = ausw;
-    else if( styles )
-    {
-        for( int i = 0; i < styles->getEintragAnzahl(); ++i )
-            removeMsStyle( i, Style::Selected );
-        addMsStyle( ausw, Style::Selected );
-    }
+
+void AuswahlListe::setMsStyle(int pos, __int64 style) // setzt den Style des Eintrags (nur mit MultiStyled)
+{
+	if (!styles)
+		styles = new Array< __int64 >();
+	styles->set(style, pos);
+	rend = 1;
+}
+
+void AuswahlListe::setMsStyle(int pos, __int64 style, bool add_remove)
+{
+	if (!styles)
+		styles = new Array< __int64 >();
+	if (add_remove)
+		styles->set(styles->get(pos) | style, pos);
+	else
+		styles->set(styles->get(pos) & ~style, pos);
+	rend = 1;
+}
+
+void AuswahlListe::addMsStyle(int pos, __int64 style)
+{
+	if (!styles)
+		styles = new Array< __int64 >();
+	styles->set(styles->get(pos) | style, pos);
+	rend = 1;
+}
+
+void AuswahlListe::removeMsStyle(int pos, __int64 style)
+{
+	if (!styles)
+		styles = new Array< __int64 >();
+	styles->set(styles->get(pos) & ~style, pos);
+	rend = 1;
+}
+
+void AuswahlListe::doTastaturEreignis(TastaturEreignis& te)
+{
+	bool ntakc = !te.verarbeitet;
+	if (hatStyleNicht(Style::Fokus) || !tak || te.verarbeitet)
+		return;
+	getThis();
+	if (tak(takParam, this, te))
+	{
+		if (te.id == TE_Press)
+		{
+			if (hatStyleNicht(Style::MultiSelect))
+			{
+				switch (te.taste)
+				{
+				case T_Unten:
+					++auswahl;
+					if (auswahl > tfListe->getEintragAnzahl())
+						auswahl = tfListe->getEintragAnzahl();
+					rend = 1;
+					break;
+				case T_Oben:
+					--auswahl;
+					if (auswahl < -1)
+						auswahl = -1;
+					rend = 1;
+					break;
+				}
+			}
+			else
+			{
+				switch (te.taste)
+				{
+				case T_Unten:
+					deSelect();
+					++auswahl;
+					if (auswahl > tfListe->getEintragAnzahl())
+						auswahl = tfListe->getEintragAnzahl();
+					if (auswahl >= 0)
+						addMsStyle(auswahl, Style::Selected);
+					rend = 1;
+					break;
+				case T_Oben:
+					deSelect();
+					--auswahl;
+					if (auswahl < -1)
+						auswahl = -1;
+					if (auswahl >= 0)
+						addMsStyle(auswahl, Style::Selected);
+					rend = 1;
+					break;
+				}
+			}
+		}
+		te.verarbeitet = 1;
+	}
+	if (ntakc && te.verarbeitet && nTak)
+		te.verarbeitet = nTak(ntakParam, this, te);
+	release();
+}
+
+void AuswahlListe::render(Bild& zRObj) // zeichnet nach zRObj
+{
+	if (!ZeichnungHintergrund::hatStyle(Style::Sichtbar))
+		return;
+	removeStyle(Style::HScroll);
+	ZeichnungHintergrund::render(zRObj);
+	lockZeichnung();
+	if (!zRObj.setDrawOptions(innenPosition, innenSize))
+	{
+		unlockZeichnung();
+		return;
+	}
+	int rbr = 0;
+	if (rahmen && ZeichnungHintergrund::hatStyle(Style::Rahmen))
+		rbr = rahmen->getRBreite();
+	if (tfListe)
+	{
+		int maxHeight = 0;
+		int dx = 0, dy = 0;
+		if (vertikalScrollBar && ZeichnungHintergrund::hatStyle(Style::VScroll))
+			dy -= vertikalScrollBar->getScroll();
+		int mdy = innenSize.y + rbr;
+		auto style = styles->begin();
+		int i = 0;
+		for (auto tf = tfListe->begin(); tf; tf++, style++, i++)
+		{
+			if (dy + tf->getHeight() > mdy && !(vertikalScrollBar && ZeichnungHintergrund::hatStyle(Style::VScroll)))
+				break;
+			tf->setPosition(dx, dy);
+			tf->setSize(innenSize.x, tf->getHeight());
+			maxHeight += tf->getHeight();
+			bool selected = 0;
+			if (ZeichnungHintergrund::hatStyle(Style::MultiSelect) && styles)
+				selected = hatStyle(style, Style::Selected);
+			else
+				selected = auswahl == i;
+			AlphaFeld* tmpBuffer = 0;
+			bool tmpB = 0;
+			int tmpHFarbe = 0;
+			bool tmpH = 0;
+			Bild* tmpHBild = 0;
+			bool tmpHB = 0;
+			bool tmpHAlpha = 0;
+			Rahmen* tmpRahmen = 0;
+			bool tmpR = 0;
+			if (selected)
+			{
+				if (hatStyleNicht(Style::MultiStyled) || !styles)
+				{
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlBuffer) && aBuffer)
+					{
+						tmpBuffer = tf->getAlphaFeld();
+						tf->setAlphaFeldZ(dynamic_cast<AlphaFeld*>(aBuffer->getThis()));
+						tmpB = tf->hatStyle(TextFeld::Style::Buffered);
+						tf->setStyle(TextFeld::Style::Buffered, ZeichnungHintergrund::hatStyle(Style::AuswahlBuffer));
+					}
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlHintergrund))
+					{
+						tmpH = tf->hatStyle(TextFeld::Style::Hintergrund);
+						tmpHFarbe = tf->getHintergrundFarbe();
+						tf->setHintergrundFarbe(ahFarbe);
+						tf->setStyle(TextFeld::Style::Hintergrund, ZeichnungHintergrund::hatStyle(Style::Hintergrund));
+						if (ZeichnungHintergrund::hatStyle(Style::AuswahlHBild) && ahBild)
+						{
+							tmpHBild = tf->getHintergrundBild();
+							tf->setHintergrundBildZ(dynamic_cast<Bild*>(ahBild->getThis()));
+							tmpHB = tf->hatStyle(TextFeld::Style::HBild);
+							tf->setStyle(TextFeld::Style::HBild, ZeichnungHintergrund::hatStyle(Style::HBild));
+						}
+						if (ZeichnungHintergrund::hatStyle(Style::AuswahlHAlpha))
+						{
+							tmpHAlpha = tf->hatStyle(TextFeld::Style::HAlpha);
+							tf->setStyle(TextFeld::Style::HAlpha, ZeichnungHintergrund::hatStyle(Style::AuswahlHAlpha));
+						}
+					}
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlRahmen) && aRahmen)
+					{
+						tmpRahmen = tf->getRahmen();
+						tf->setRahmenZ(dynamic_cast<Rahmen*>(aRahmen->getThis()));
+						tmpR = tf->hatStyle(TextFeld::Style::Rahmen);
+						tf->setStyle(TextFeld::Style::Rahmen, ZeichnungHintergrund::hatStyle(Style::AuswahlRahmen));
+					}
+				}
+				else
+				{
+					if (hatStyle(style, Style::AuswahlBuffer) && aBufferListe)
+					{
+						tmpBuffer = tf->getAlphaFeld();
+						tf->setAlphaFeldZ(aBufferListe->get(i));
+						tmpB = tf->hatStyle(TextFeld::Style::Buffered);
+						tf->setStyle(TextFeld::Style::Buffered, hatStyle(style, Style::AuswahlBuffer));
+					}
+					if (hatStyle(style, Style::AuswahlHintergrund))
+					{
+						tmpH = tf->hatStyle(Style::Hintergrund);
+						tf->setStyle(TextFeld::Style::Hintergrund, hatStyle(style, Style::AuswahlHintergrund));
+						if (ahFarbeListe && ahFarbeListe->hat(i))
+						{
+							tmpHFarbe = tf->getHintergrundFarbe();
+							tf->setHintergrundFarbe(ahFarbeListe->get(i));
+						}
+						if (hatStyle(style, Style::AuswahlHBild) && ahBildListe)
+						{
+							tmpHBild = tf->getHintergrundBild();
+							tf->setHintergrundBildZ(ahBildListe->get(i));
+							tmpHB = tf->hatStyle(TextFeld::Style::HBild);
+							tf->setStyle(TextFeld::Style::HBild, hatStyle(style, Style::HBild));
+						}
+						if (hatStyle(style, Style::AuswahlHAlpha))
+						{
+							tmpHAlpha = tf->hatStyle(TextFeld::Style::HAlpha);
+							tf->setStyle(TextFeld::Style::HAlpha, hatStyle(style, Style::AuswahlHAlpha));
+						}
+					}
+					if (hatStyle(style, Style::AuswahlRahmen) && aRahmenListe)
+					{
+						tmpRahmen = tf->getRahmen();
+						tf->setRahmenZ(aRahmenListe->get(i));
+						tmpR = tf->hatStyle(TextFeld::Style::Rahmen);
+						tf->setStyle(TextFeld::Style::Rahmen, hatStyle(style, Style::AuswahlRahmen));
+					}
+				}
+			}
+			tf->render(zRObj);
+			if (selected)
+			{
+				if (hatStyleNicht(Style::MultiStyled) || !styles)
+				{
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlBuffer))
+					{
+						tf->setAlphaFeldZ(tmpBuffer);
+						tf->setStyle(TextFeld::Style::Buffered, tmpB);
+					}
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlHintergrund))
+					{
+						tf->setHintergrundFarbe(tmpHFarbe);
+						tf->setStyle(TextFeld::Style::Hintergrund, tmpH);
+						if (ZeichnungHintergrund::hatStyle(Style::AuswahlHBild))
+						{
+							tf->setHintergrundBildZ(tmpHBild);
+							tf->setStyle(TextFeld::Style::HBild, tmpHB);
+						}
+						if (ZeichnungHintergrund::hatStyle(Style::AuswahlHAlpha))
+							tf->setStyle(TextFeld::Style::HAlpha, tmpHAlpha);
+					}
+					if (ZeichnungHintergrund::hatStyle(Style::AuswahlRahmen))
+					{
+						tf->setRahmenZ(tmpRahmen);
+						tf->setStyle(TextFeld::Style::Rahmen, tmpR);
+					}
+				}
+				else
+				{
+					if (hatMsStyle(i, Style::AuswahlBuffer) && aBufferListe)
+					{
+						tf->setAlphaFeldZ(tmpBuffer);
+						tf->setStyle(TextFeld::Style::Buffered, tmpB);
+					}
+					if (hatMsStyle(i, Style::AuswahlHintergrund))
+					{
+						tf->setStyle(TextFeld::Style::Hintergrund, tmpH);
+						if (ahFarbeListe && ahFarbeListe->hat(i))
+							tf->setHintergrundFarbe(tmpHFarbe);
+						if (hatMsStyle(i, Style::AuswahlHBild) && ahBildListe)
+						{
+							tf->setHintergrundBildZ(tmpHBild);
+							tf->setStyle(TextFeld::Style::HBild, tmpHB);
+						}
+						if (hatMsStyle(i, Style::AuswahlHAlpha))
+							tf->setStyle(TextFeld::Style::HAlpha, tmpHAlpha);
+					}
+					if (hatMsStyle(i, Style::AuswahlRahmen) && aRahmenListe)
+					{
+						tf->setRahmenZ(tmpRahmen);
+						tf->setStyle(TextFeld::Style::Rahmen, tmpR);
+					}
+				}
+			}
+			dy += tf->getHeight();
+		}
+		if (vertikalScrollBar)
+			vertikalScrollBar->getScrollData()->max = maxHeight;
+	}
+	zRObj.releaseDrawOptions();
+	unlockZeichnung();
+}
+
+int AuswahlListe::getKlickEintrag(int my)
+{
+	if (!tfListe)
+		return -1;
+	int y = 0;
+	if (ZeichnungHintergrund::hatStyle(Style::VScroll) && vertikalScrollBar)
+		y -= vertikalScrollBar->getScroll();
+	int i = 0;
+	for (auto tf = tfListe->begin(); tf; tf++, i++)
+	{
+		y += tf->getHeight();
+		if (y > my)
+			return i;
+	}
+	return -1;
+}
+
+void AuswahlListe::setAuswahl(int ausw) // setzt die Auswahl
+{
+	if (hatStyleNicht(Style::MultiSelect))
+		auswahl = ausw;
+	else if (styles)
+	{
+		for (int i = 0; i < styles->getEintragAnzahl(); ++i)
+			removeMsStyle(i, Style::Selected);
+		addMsStyle(ausw, Style::Selected);
+	}
 }
 
 void AuswahlListe::deSelect()
 {
-    if( hatStyleNicht( Style::MultiSelect ) )
-        auswahl = -1;
-    else if( styles )
-    {
-        for( int i = 0; i < styles->getEintragAnzahl(); ++i )
-            removeMsStyle( i, Style::Selected );
-    }
+	if (hatStyleNicht(Style::MultiSelect))
+		auswahl = -1;
+	else if (styles)
+	{
+		for (int i = 0; i < styles->getEintragAnzahl(); ++i)
+			removeMsStyle(i, Style::Selected);
+	}
 }
 
 // constant 
 int AuswahlListe::getEintragAnzahl() const // gibt die Anzahl der Einträge zurück
 {
-    return tfListe ? tfListe->getEintragAnzahl() : 0;
+	return tfListe ? tfListe->getEintragAnzahl() : 0;
 }
 
 int AuswahlListe::getAuswahl() const // gibt den ersten ausgewählten Eintrag zurück
 {
-    return auswahl;
+	return auswahl;
 }
 
-int AuswahlListe::getEintragPos( Text* eintragText ) // gibt die Position des eintrages mit dem entsprechenden Textes zurück
+int AuswahlListe::getEintragPos(Text* eintragText) // gibt die Position des eintrages mit dem entsprechenden Textes zurück
 {
-    int i = 0;
-    for( auto tf = tfListe->begin(); tf; tf++, i++ )
-    {
-        if( tf->zText()->istGleich( eintragText->getText() ) )
-        {
-            eintragText->release();
-            return i;
-        }
-    }
-    return -1;
+	int i = 0;
+	for (auto tf = tfListe->begin(); tf; tf++, i++)
+	{
+		if (tf->zText()->istGleich(eintragText->getText()))
+		{
+			eintragText->release();
+			return i;
+		}
+	}
+	return -1;
 }
 
-TextFeld* AuswahlListe::getEintrag( int pos ) const // gibt den pos- ten Eintrag zurück
+TextFeld* AuswahlListe::getEintrag(int pos) const // gibt den pos- ten Eintrag zurück
 {
-    if( !tfListe )
-        return 0;
-    TextFeld* ret = (TextFeld*)tfListe->get( pos );
-    if( ret )
-        return dynamic_cast<TextFeld*>(ret->getThis());
-    return 0;
+	if (!tfListe)
+		return 0;
+	TextFeld* ret = (TextFeld*)tfListe->get(pos);
+	if (ret)
+		return dynamic_cast<TextFeld*>(ret->getThis());
+	return 0;
 }
 
-TextFeld* AuswahlListe::zEintrag( int pos ) const
+TextFeld* AuswahlListe::zEintrag(int pos) const
 {
-    if( !tfListe )
-        return 0;
-    return (TextFeld*)tfListe->z( pos );
+	if (!tfListe)
+		return 0;
+	return (TextFeld*)tfListe->z(pos);
 }
 
 Rahmen* AuswahlListe::getARahmen() const // gibt den Auswahl Rahmen zurück (ohne MultiStyled)
 {
-    if( aRahmen )
-        return dynamic_cast<Rahmen*>(aRahmen->getThis());
-    return 0;
+	if (aRahmen)
+		return dynamic_cast<Rahmen*>(aRahmen->getThis());
+	return 0;
 }
 
 Rahmen* AuswahlListe::zARahmen() const
 {
-    return aRahmen;
+	return aRahmen;
 }
 
 int AuswahlListe::getAHFarbe() const // gibt die Auswahl Hintergrund Farbe zurück (ohne MultiStyled)
 {
-    return ahFarbe;
+	return ahFarbe;
 }
 
 Bild* AuswahlListe::getAHBild() const // gibt das Auswahl Hintergrund Bild zurück (ohne MultiStyled)
 {
-    if( ahBild )
-        return dynamic_cast<Bild*>(ahBild->getThis());
-    return 0;
+	if (ahBild)
+		return dynamic_cast<Bild*>(ahBild->getThis());
+	return 0;
 }
 
 Bild* AuswahlListe::zAHBild() const
 {
-    return ahBild;
+	return ahBild;
 }
 
 AlphaFeld* AuswahlListe::getABuffer() const // gibt den Auswahl Buffer zurück (ohne MultiStyled)
 {
-    if( aBuffer )
-        return dynamic_cast<AlphaFeld*>(aBuffer->getThis());
-    return 0;
+	if (aBuffer)
+		return dynamic_cast<AlphaFeld*>(aBuffer->getThis());
+	return 0;
 }
 
 AlphaFeld* AuswahlListe::zABuffer() const
 {
-    return aBuffer;
+	return aBuffer;
 }
 
-Rahmen* AuswahlListe::getARahmen( int pos ) const // gibt den Auswahl Rahmen zurück (mit MultiStyled)
+Rahmen* AuswahlListe::getARahmen(int pos) const // gibt den Auswahl Rahmen zurück (mit MultiStyled)
 {
-    Rahmen* ret = 0;
-    if( aRahmenListe )
-        ret = (Rahmen*)aRahmenListe->get( pos );
-    if( ret )
-        return dynamic_cast<Rahmen*>(ret->getThis());
-    return 0;
+	Rahmen* ret = 0;
+	if (aRahmenListe)
+		ret = (Rahmen*)aRahmenListe->get(pos);
+	if (ret)
+		return dynamic_cast<Rahmen*>(ret->getThis());
+	return 0;
 }
 
-Rahmen* AuswahlListe::zARahmen( int pos ) const
+Rahmen* AuswahlListe::zARahmen(int pos) const
 {
-    Rahmen* ret = 0;
-    if( aRahmenListe )
-        ret = (Rahmen*)aRahmenListe->z( pos );
-    return ret;
+	Rahmen* ret = 0;
+	if (aRahmenListe)
+		ret = (Rahmen*)aRahmenListe->z(pos);
+	return ret;
 }
 
-int AuswahlListe::getAHFarbe( int pos ) const // gibt die Auswahl Hintergrund Farbe zurück (mit MultiStyled)
+int AuswahlListe::getAHFarbe(int pos) const // gibt die Auswahl Hintergrund Farbe zurück (mit MultiStyled)
 {
-    if( ahFarbeListe && ahFarbeListe->hat( pos ) )
-        return ahFarbeListe->get( pos );
-    return 0;
+	if (ahFarbeListe && ahFarbeListe->hat(pos))
+		return ahFarbeListe->get(pos);
+	return 0;
 }
 
-Bild* AuswahlListe::getAHBild( int pos ) const // gibt das Auswahl Hintergrund Bild zurück (mit MultiStyled)
+Bild* AuswahlListe::getAHBild(int pos) const // gibt das Auswahl Hintergrund Bild zurück (mit MultiStyled)
 {
-    Bild* ret = 0;
-    if( ahBildListe )
-        ret = (Bild*)ahBildListe->get( pos );
-    if( ret )
-        return dynamic_cast<Bild*>(ret->getThis());
-    return 0;
+	Bild* ret = 0;
+	if (ahBildListe)
+		ret = (Bild*)ahBildListe->get(pos);
+	if (ret)
+		return dynamic_cast<Bild*>(ret->getThis());
+	return 0;
 }
 
-Bild* AuswahlListe::zAHBild( int pos ) const
+Bild* AuswahlListe::zAHBild(int pos) const
 {
-    Bild* ret = 0;
-    if( ahBildListe )
-        ret = (Bild*)ahBildListe->z( pos );
-    return ret;
+	Bild* ret = 0;
+	if (ahBildListe)
+		ret = (Bild*)ahBildListe->z(pos);
+	return ret;
 }
 
-AlphaFeld* AuswahlListe::getABuffer( int pos ) const // gibt den Auswahl Buffer zurück (mit MultiStyled)
+AlphaFeld* AuswahlListe::getABuffer(int pos) const // gibt den Auswahl Buffer zurück (mit MultiStyled)
 {
-    AlphaFeld* ret = 0;
-    if( aBufferListe )
-        ret = (AlphaFeld*)aBufferListe->get( pos );
-    if( ret )
-        return dynamic_cast<AlphaFeld*>(ret->getThis());
-    return 0;
+	AlphaFeld* ret = 0;
+	if (aBufferListe)
+		ret = (AlphaFeld*)aBufferListe->get(pos);
+	if (ret)
+		return dynamic_cast<AlphaFeld*>(ret->getThis());
+	return 0;
 }
 
-AlphaFeld* AuswahlListe::zABuffer( int pos ) const
+AlphaFeld* AuswahlListe::zABuffer(int pos) const
 {
-    AlphaFeld* ret = 0;
-    if( aBufferListe )
-        ret = (AlphaFeld*)aBufferListe->z( pos );
-    return ret;
+	AlphaFeld* ret = 0;
+	if (aBufferListe)
+		ret = (AlphaFeld*)aBufferListe->z(pos);
+	return ret;
 }
 
-bool AuswahlListe::hatMsStyle( int pos, __int64 style ) const // prüft ob style vorhanden (mit MultiStyled)
+bool AuswahlListe::hatMsStyle(int pos, __int64 style) const // prüft ob style vorhanden (mit MultiStyled)
 {
-    __int64 st = 0;
-    if( styles )
-        st = styles->get( pos );
-    return (st | style) == st;
+	__int64 st = 0;
+	if (styles)
+		st = styles->get(pos);
+	return (st | style) == st;
 }
 
-bool AuswahlListe::hatMsStyleNicht( int pos, __int64 style ) const // prüft obt style nicht vorhanden (mit MultiStyled)
+bool AuswahlListe::hatMsStyleNicht(int pos, __int64 style) const // prüft obt style nicht vorhanden (mit MultiStyled)
 {
-    __int64 st = 0;
-    if( styles )
-        st = styles->get( pos );
-    return (st | style) != st;
+	__int64 st = 0;
+	if (styles)
+		st = styles->get(pos);
+	return (st | style) != st;
 }

+ 248 - 248
Liste.h

@@ -6,257 +6,257 @@
 
 namespace Framework
 {
-    class Rahmen; //! Rahmen.h
-    class AlphaFeld; //! AlphaFeld.h
-    class Bild; //! Bild.h
-    class Text; //! Text.h
-    class TextFeld; //! TextFeld.h
-    class VScrollBar; //! Scroll.h
-    struct TastaturEreignis; //! TastaturEreignis.h
-    struct MausEreignis; //! MausEreignis.h
-    class Schrift; //! Schrift.h
-    class AuswahlListe; //! aus dieser datei
+	class Rahmen; //! Rahmen.h
+	class AlphaFeld; //! AlphaFeld.h
+	class Bild; //! Bild.h
+	class Text; //! Text.h
+	class TextFeld; //! TextFeld.h
+	class VScrollBar; //! Scroll.h
+	struct TastaturEreignis; //! TastaturEreignis.h
+	struct MausEreignis; //! MausEreignis.h
+	class Schrift; //! Schrift.h
+	class AuswahlListe; //! aus dieser datei
 
-    //! Eine Zeichnung des 2D GUI Frameworks, die eine Liste darstellt, aus der der Benutzer Elemente aus und abwählen kann
-    class AuswahlListe : public ZeichnungHintergrund
-    {
-    public:
-        class Style : public ZeichnungHintergrund::Style
-        {
-        public:
-            const static __int64 FeldRahmen = 0x0001000; //! Legt fest, ob die Einträge der Liste einen Rahmen haben
-            const static __int64 FeldHintergrund = 0x0002000; //! Legt fest, ob die Einträge einen Hintergrund haben
-            const static __int64 FeldHBild = 0x0004000; //! Legt fest, ob die Einträge ein Hintergrund Bild haben
-            const static __int64 FeldHAlpha = 0x0008000; //! Legt fest, ob beim zeichnen der Eintrag Hintergründe alpha blending verwendet werden soll
-            const static __int64 FeldBuffer = 0x0010000; //! Legt fest, ob die Einträge einen Farbübergang besitzen
-            const static __int64 AuswahlHintergrund = 0x0020000; //! Legt fest, ob die ausgewählten Einträge einen Hintergrund haben
-            const static __int64 AuswahlHBild = 0x0040000; //! Legt fest, ob die ausgewählten einträge ein Bild als Hintergrund haben
-            const static __int64 AuswahlHAlpha = 0x0080000; //! Legt fest, ob für das Zeichnen der Hintergründe der ausgewählten Einträge alpha blending verwendet wird
-            const static __int64 AuswahlBuffer = 0x0100000; //! Legt fest, ob die ausgewählten Einträge einen Farbübergang besitzen
-            const static __int64 AuswahlRahmen = 0x0200000; //! Legt fest, ob die ausgewählten Einträge einen Rahmen besitzen
-            const static __int64 MultiStyled = 0x0400000; //! Legt fest, ob jeder Eintrag seine eigenen Hintergrund, Farbübergang und Rahmen hat, fals er ausgewählt ist
-            const static __int64 MultiSelect = 0x0800000; //! Legt fest, das mehrere Einträge gleichzeitig ausgewählt sein können
-            const static __int64 Selected = 0x1000000; //! Legt fest, ob ein bestimmter Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde.
+	//! Eine Zeichnung des 2D GUI Frameworks, die eine Liste darstellt, aus der der Benutzer Elemente aus und abwählen kann
+	class AuswahlListe : public ZeichnungHintergrund
+	{
+	public:
+		class Style : public ZeichnungHintergrund::Style
+		{
+		public:
+			const static __int64 FeldRahmen = 0x0001000; //! Legt fest, ob die Einträge der Liste einen Rahmen haben
+			const static __int64 FeldHintergrund = 0x0002000; //! Legt fest, ob die Einträge einen Hintergrund haben
+			const static __int64 FeldHBild = 0x0004000; //! Legt fest, ob die Einträge ein Hintergrund Bild haben
+			const static __int64 FeldHAlpha = 0x0008000; //! Legt fest, ob beim zeichnen der Eintrag Hintergründe alpha blending verwendet werden soll
+			const static __int64 FeldBuffer = 0x0010000; //! Legt fest, ob die Einträge einen Farbübergang besitzen
+			const static __int64 AuswahlHintergrund = 0x0020000; //! Legt fest, ob die ausgewählten Einträge einen Hintergrund haben
+			const static __int64 AuswahlHBild = 0x0040000; //! Legt fest, ob die ausgewählten einträge ein Bild als Hintergrund haben
+			const static __int64 AuswahlHAlpha = 0x0080000; //! Legt fest, ob für das Zeichnen der Hintergründe der ausgewählten Einträge alpha blending verwendet wird
+			const static __int64 AuswahlBuffer = 0x0100000; //! Legt fest, ob die ausgewählten Einträge einen Farbübergang besitzen
+			const static __int64 AuswahlRahmen = 0x0200000; //! Legt fest, ob die ausgewählten Einträge einen Rahmen besitzen
+			const static __int64 MultiStyled = 0x0400000; //! Legt fest, ob jeder Eintrag seine eigenen Hintergrund, Farbübergang und Rahmen hat, fals er ausgewählt ist
+			const static __int64 MultiSelect = 0x0800000; //! Legt fest, das mehrere Einträge gleichzeitig ausgewählt sein können
+			const static __int64 Selected = 0x1000000; //! Legt fest, ob ein bestimmter Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde.
 
-            const static __int64 Normal = Sichtbar | Erlaubt | Rahmen | FeldHAlpha | FeldHintergrund | FeldRahmen | AuswahlBuffer | AuswahlRahmen; //! Vereint die Flags Sichtbar, Erlaubt, Rahmen, FeldHAlpha, FeldHintergrund, FeldRahmen, AuswahlBuffer, AuswahlRahmen
-        };
-    private:
-        RCArray< TextFeld > *tfListe;
-        int auswahl;
-        int ahFarbe;
-        Bild *ahBild;
-        AlphaFeld *aBuffer;
-        Rahmen *aRahmen;
-        Array< __int64 > *styles;
-        Array< int > *ahFarbeListe;
-        RCArray< Bild > *ahBildListe;
-        RCArray< AlphaFeld > *aBufferListe;
-        RCArray< Rahmen > *aRahmenListe;
-        Schrift *schrift;
-        //! Verarbeitet Tastatur Nachrichten
-        //! \param me Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
-        DLLEXPORT void doMausEreignis( MausEreignis &me, bool userRet ) override;
-        DLLEXPORT bool hatStyle( int styleSet, int styleCheck ) const;
+			const static __int64 Normal = Sichtbar | Erlaubt | Rahmen | FeldHAlpha | FeldHintergrund | FeldRahmen | AuswahlBuffer | AuswahlRahmen; //! Vereint die Flags Sichtbar, Erlaubt, Rahmen, FeldHAlpha, FeldHintergrund, FeldRahmen, AuswahlBuffer, AuswahlRahmen
+		};
+	private:
+		RCArray< TextFeld >* tfListe;
+		int auswahl;
+		int ahFarbe;
+		Bild* ahBild;
+		AlphaFeld* aBuffer;
+		Rahmen* aRahmen;
+		Array< __int64 >* styles;
+		Array< int >* ahFarbeListe;
+		RCArray< Bild >* ahBildListe;
+		RCArray< AlphaFeld >* aBufferListe;
+		RCArray< Rahmen >* aRahmenListe;
+		Schrift* schrift;
+		//! Verarbeitet Tastatur Nachrichten
+		//! \param me Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
+		DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override;
+		DLLEXPORT bool hatStyle(int styleSet, int styleCheck) const;
 
-    public:
-        //! Konstruktor 
-        DLLEXPORT AuswahlListe();
-        //! Destruktor 
-        DLLEXPORT virtual ~AuswahlListe();
-        //! Aktualisiert die Styles, größe und Position der Einträge
-        DLLEXPORT void update();
-        //! Fügt einen Eintrag hinzu
-        //! \param txt Der Text des Eintrags
-        DLLEXPORT void addEintrag( Text *txt );
-        //! Fügt einen Eintrag hinzu
-        //! \param txt Der Text des Eintrags
-        DLLEXPORT void addEintrag( const char *txt );
-        //! Fügt einen zeiger auf einen Eintrag hinzu
-        //! \param tf Das TextFeld, mit dem der Eintrag gezeichnet wird
-        DLLEXPORT void addEintragZ( TextFeld *tf );
-        //! Fügt einen Eintrag an einer bestimmten Position hinzu
-        //! \param pos Der Index des neuen Eintrags
-        //! \param txt Der Text des Eintrags
-        DLLEXPORT void addEintrag( int pos, Text *txt );
-        //! Fügt einen Eintrag an einer bestimmten Position hinzu
-        //! \param pos Der Index des neuen Eintrags
-        //! \param txt Der Text des Eintrags
-        DLLEXPORT void addEintrag( int pos, const char *txt );
-        //! Fügt einen zeiger auf einen Eintrag an einer bestimmten Position hinzu
-        //! \param pos Der Index des neuen Eintrags
-        //! \param tf Das TextFeld, mit dem der Eintrag gezeichnet wird
-        DLLEXPORT void addEintragZ( int pos, TextFeld *tf );
-        //! Ändert einen Eintrag
-        //! \param pos Der Index des Eintrags
-        //! \param txt Der neue Text des Eintrags
-        DLLEXPORT void setEintrag( int pos, Text *txt );
-        //! Ändert einen Eintrag
-        //! \param pos Der Index des Eintrags
-        //! \param txt Der neue Text des Eintrags
-        DLLEXPORT void setEintrag( int pos, unsigned char *txt );
-        //! Ändert den Zeiger eines Eintrags
-        //! \param pos Der Index des Eintrags
-        //! \param tf Der neue Eintrag
-        DLLEXPORT void setEintragZ( int pos, TextFeld *tf );
-        //! Vertauscht die Positionen zweier Einträge
-        //! \param vpos Der Index des ersten Eintrags
-        //! \param npos Der Index des zweiten Eintrags
-        DLLEXPORT void tauschEintragPos( int vpos, int npos );
-        //! Löscht einen Eintrag
-        //! pos: Der Index des Eintrags
-        DLLEXPORT void removeEintrag( int pos );
-        //! Setzt die verwendete Schrift
-        //! \param schrift Die Schrift
-        DLLEXPORT void setSchriftZ( Schrift *schrift );
-        //! Scrollt zu einem bestimmen Eintrag
-        //! \param eintrag Der Index des Eintrags
-        DLLEXPORT void setVScrollZuEintrag( int eintrag );
-        //! Aktualisiert die maximale Scroll Höhe indem die Höhe aller Einträge addiert wird
-        DLLEXPORT void updateVScroll();
-        //! Setzt den Zeiger auf den Rahmen, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param rahmen Der Rahmen
-        DLLEXPORT void setALRZ( Rahmen *rahmen );
-        //! Setzt die Breite des Rahmens, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param br Die Breite in Pixeln
-        DLLEXPORT void setALRBreite( int br );
-        //! Setzt die Farbe des Rahmens, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setALRFarbe( int fc );
-        //! Setzt den Zeiger auf den Farbübergnag, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param buffer Der Farbübergang
-        DLLEXPORT void setAAFZ( AlphaFeld *buffer );
-        //! Setzt die Stärke des Farbübergnags, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param st Die Stärke
-        DLLEXPORT void setAAFStrength( int st );
-        //! Setzt die Farbe des Farbübergnags, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setAAFFarbe( int fc );
-        //! Setzt das Hintergrund Bild durch kopieren, das bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param bild Das Bild, das kopiert werden soll
-        DLLEXPORT void setAHBild( Bild *bild );
-        //! Setzt einen Zeiger auf das Hintergrund Bild, das bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param bild Das Bild, das kopiert werden soll
-        DLLEXPORT void setAHBildZ( Bild *bild );
-        //! Setzt die Hintergrund Farbe, die bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setAHFarbe( int fc );
-        //! Setzt den Zeiger auf den Rahmen, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param rahmen Der Rahmen
-        DLLEXPORT void setALRZ( int pos, Rahmen *rahmen );
-        //! Setzt die Breite des Rahmens, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param br Die Breite in Pixeln
-        DLLEXPORT void setALRBreite( int pos, int br );
-        //! Setzt die Farbe des Rahmens, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setALRFarbe( int pos, int fc );
-        //! Setzt den Zeiger auf den Farbübergnag, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param buffer Der Farbübergang
-        DLLEXPORT void setAAFZ( int pos, AlphaFeld *buffer );
-        //! Setzt die Stärke des Farbübergnags, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param st Die Stärke
-        DLLEXPORT void setAAFStrength( int pos, int st );
-        //! Setzt die Farbe des Farbübergnags, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setAAFFarbe( int pos, int fc );
-        //! Setzt das Hintergrund Bild durch kopieren, das bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param bild Das Bild, das kopiert werden soll
-        DLLEXPORT void setAHBild( int pos, Bild *bild );
-        //! Setzt einen Zeiger auf das Hintergrund Bild, das bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param bild Das Bild, das kopiert werden soll
-        DLLEXPORT void setAHBildZ( int pos, Bild *bild );
-        //! Setzt die Hintergrund Farbe, die bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param fc Die Farbe im A8R8G8B8 Format
-        DLLEXPORT void setAHFarbe( int pos, int fc );
-        //! Setzt den Style eines Eintrags, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Der neue Style
-        DLLEXPORT void setMsStyle( int pos, __int64 style );
-        //! Ändert den Style eines Eintrags, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Der Style
-        //!  add_remove: 1, falls der Style hinzugefügt werden soll. 0, falls der Style entfernt weden soll
-        DLLEXPORT void setMsStyle( int pos, __int64 style, bool add_remove );
-        //! Fügt Styles zu einem Eintrag hinzu, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Der Style, der hinzugefügt werden soll
-        DLLEXPORT void addMsStyle( int pos, __int64 style );
-        //! Entfernt Styles von einem Eintrag, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Der Style, der entfernt werden soll
-        DLLEXPORT void removeMsStyle( int pos, __int64 style );
-        //! Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
-        //! \param te Das Ereignis
-        DLLEXPORT void doTastaturEreignis( TastaturEreignis &te ) override;
-        //! Zeichnet das Objekt nach zRObj, falls es sichtbar ist
-        //! \param zRObj Das Bild, in welches gezeichnet werden soll
-        DLLEXPORT void render( Bild &zRObj ) override;
-        //! Gibt den Index eines Eintrags zurück, auf den die Maus zeigt
-        //! \param my Die Position der Maus auf der Y Achse basierend auf dem oberend Rand der Liste
-        DLLEXPORT int getKlickEintrag( int my );
-        //! Wählt einen Eintrag aus
-        //! \param ausw Der Index des Eintrags
-        DLLEXPORT void setAuswahl( int ausw );
-        //! Wählt alle ausgewählten Einträge ab
-        DLLEXPORT void deSelect();
-        //! Gibt die Anzahl an Einträgen zurück
-        DLLEXPORT int getEintragAnzahl() const;
-        //! Gibt den Index des ausgewählten Eintrags zurück, fals MultiSelect nicht gesetzt ist. Wenn MultiSelect gesetzt wurde, kann die Auswahl eines Eintrags mit hatMsStyle( Eintrag Index, AuswahlListe::Style::Ausgewählt ) geprüft werden
-        DLLEXPORT int getAuswahl() const;
-        //! Gibt den Index eines Eintrags zurück
-        //! \param eintragText Der Text des Eintrags
-        DLLEXPORT int getEintragPos( Text *eintragText );
-        //! Gibt einen Eintrag zurück
-        //! \param pos Der Index des Eintrags
-        DLLEXPORT TextFeld *getEintrag( int pos ) const;
-        //! Gibt einen Eintrag ohne erhöhten reference Counter zurück
-        //! \param pos Der Index des Eintrags
-        DLLEXPORT TextFeld *zEintrag( int pos ) const;
-        //! Gibt den Rahmen zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT Rahmen *getARahmen() const;
-        //! Gibt den Rahmen ohne erhöhten Reference Counter zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT Rahmen *zARahmen() const;
-        //! Gibt die Hintergrund Farbe im A8R8G8B8 Format zurück, die für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT int getAHFarbe() const;
-        //! Gibt das Hintergrund Bild zurück, das für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT Bild *getAHBild() const;
-        //! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, das für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT Bild *zAHBild() const;
-        //! Gibt den Farbverlauf zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT AlphaFeld *getABuffer() const;
-        //! Gibt den Farbverlauf ohne erhöhten Reference Counter zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
-        DLLEXPORT AlphaFeld *zABuffer() const;
-        //! Gibt den Rahmen zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT Rahmen *getARahmen( int pos ) const;
-        //! Gibt den Rahmen ohne erhöhten Reference Counter zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT Rahmen *zARahmen( int pos ) const;
-        //! Gibt die Hintegrrund Farbe im A8R8G8B8 Format zurück, die für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT int getAHFarbe( int pos ) const;
-        //! Gibt das Hintergrund Bild zurück, das für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT Bild *getAHBild( int pos ) const;
-        //! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, das für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT Bild *zAHBild( int pos ) const;
-        //! Gibt den Farbübergang zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT AlphaFeld *getABuffer( int pos ) const;
-        //! Gibt den Farbübergang ohne erhöhten Reference Counter zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
-        DLLEXPORT AlphaFeld *zABuffer( int pos ) const;
-        //! Überprüft, ob für einen Bestimmten Eintarg betimmte Styles gesetzt wurden, falls MultiStyled gesetzt wurde. Überprüft auch, ob ein Eintrag ausgewählt wurde, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Die zu prüfenden Styles
-        DLLEXPORT inline bool hatMsStyle( int pos, __int64 style ) const;
-        //! Überprüft, ob für einen Bestimmten Eintarg betimmte Styles nicht gesetzt wurden, falls MultiStyled gesetzt wurde. Überprüft auch, ob ein Eintrag nicht ausgewählt wurde, falls MultiSelect gesetzt wurde
-        //! \param pos Der Index des Eintrags
-        //! \param style Die zu prüfenden Styles
-        DLLEXPORT inline bool hatMsStyleNicht( int pos, __int64 style ) const;
-    };
+	public:
+		//! Konstruktor 
+		DLLEXPORT AuswahlListe();
+		//! Destruktor 
+		DLLEXPORT virtual ~AuswahlListe();
+		//! Aktualisiert die Styles, größe und Position der Einträge
+		DLLEXPORT void update();
+		//! Fügt einen Eintrag hinzu
+		//! \param txt Der Text des Eintrags
+		DLLEXPORT void addEintrag(Text* txt);
+		//! Fügt einen Eintrag hinzu
+		//! \param txt Der Text des Eintrags
+		DLLEXPORT void addEintrag(const char* txt);
+		//! Fügt einen zeiger auf einen Eintrag hinzu
+		//! \param tf Das TextFeld, mit dem der Eintrag gezeichnet wird
+		DLLEXPORT void addEintragZ(TextFeld* tf);
+		//! Fügt einen Eintrag an einer bestimmten Position hinzu
+		//! \param pos Der Index des neuen Eintrags
+		//! \param txt Der Text des Eintrags
+		DLLEXPORT void addEintrag(int pos, Text* txt);
+		//! Fügt einen Eintrag an einer bestimmten Position hinzu
+		//! \param pos Der Index des neuen Eintrags
+		//! \param txt Der Text des Eintrags
+		DLLEXPORT void addEintrag(int pos, const char* txt);
+		//! Fügt einen zeiger auf einen Eintrag an einer bestimmten Position hinzu
+		//! \param pos Der Index des neuen Eintrags
+		//! \param tf Das TextFeld, mit dem der Eintrag gezeichnet wird
+		DLLEXPORT void addEintragZ(int pos, TextFeld* tf);
+		//! Ändert einen Eintrag
+		//! \param pos Der Index des Eintrags
+		//! \param txt Der neue Text des Eintrags
+		DLLEXPORT void setEintrag(int pos, Text* txt);
+		//! Ändert einen Eintrag
+		//! \param pos Der Index des Eintrags
+		//! \param txt Der neue Text des Eintrags
+		DLLEXPORT void setEintrag(int pos, const char* txt);
+		//! Ändert den Zeiger eines Eintrags
+		//! \param pos Der Index des Eintrags
+		//! \param tf Der neue Eintrag
+		DLLEXPORT void setEintragZ(int pos, TextFeld* tf);
+		//! Vertauscht die Positionen zweier Einträge
+		//! \param vpos Der Index des ersten Eintrags
+		//! \param npos Der Index des zweiten Eintrags
+		DLLEXPORT void tauschEintragPos(int vpos, int npos);
+		//! Löscht einen Eintrag
+		//! pos: Der Index des Eintrags
+		DLLEXPORT void removeEintrag(int pos);
+		//! Setzt die verwendete Schrift
+		//! \param schrift Die Schrift
+		DLLEXPORT void setSchriftZ(Schrift* schrift);
+		//! Scrollt zu einem bestimmen Eintrag
+		//! \param eintrag Der Index des Eintrags
+		DLLEXPORT void setVScrollZuEintrag(int eintrag);
+		//! Aktualisiert die maximale Scroll Höhe indem die Höhe aller Einträge addiert wird
+		DLLEXPORT void updateVScroll();
+		//! Setzt den Zeiger auf den Rahmen, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param rahmen Der Rahmen
+		DLLEXPORT void setALRZ(Rahmen* rahmen);
+		//! Setzt die Breite des Rahmens, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param br Die Breite in Pixeln
+		DLLEXPORT void setALRBreite(int br);
+		//! Setzt die Farbe des Rahmens, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setALRFarbe(int fc);
+		//! Setzt den Zeiger auf den Farbübergnag, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param buffer Der Farbübergang
+		DLLEXPORT void setAAFZ(AlphaFeld* buffer);
+		//! Setzt die Stärke des Farbübergnags, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param st Die Stärke
+		DLLEXPORT void setAAFStrength(int st);
+		//! Setzt die Farbe des Farbübergnags, der bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setAAFFarbe(int fc);
+		//! Setzt das Hintergrund Bild durch kopieren, das bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param bild Das Bild, das kopiert werden soll
+		DLLEXPORT void setAHBild(Bild* bild);
+		//! Setzt einen Zeiger auf das Hintergrund Bild, das bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param bild Das Bild, das kopiert werden soll
+		DLLEXPORT void setAHBildZ(Bild* bild);
+		//! Setzt die Hintergrund Farbe, die bei ausgewählten Einträgen verwendet wird, fals MulitStyled nicht gesetzt wurde
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setAHFarbe(int fc);
+		//! Setzt den Zeiger auf den Rahmen, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param rahmen Der Rahmen
+		DLLEXPORT void setALRZ(int pos, Rahmen* rahmen);
+		//! Setzt die Breite des Rahmens, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param br Die Breite in Pixeln
+		DLLEXPORT void setALRBreite(int pos, int br);
+		//! Setzt die Farbe des Rahmens, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setALRFarbe(int pos, int fc);
+		//! Setzt den Zeiger auf den Farbübergnag, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param buffer Der Farbübergang
+		DLLEXPORT void setAAFZ(int pos, AlphaFeld* buffer);
+		//! Setzt die Stärke des Farbübergnags, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param st Die Stärke
+		DLLEXPORT void setAAFStrength(int pos, int st);
+		//! Setzt die Farbe des Farbübergnags, der bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setAAFFarbe(int pos, int fc);
+		//! Setzt das Hintergrund Bild durch kopieren, das bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param bild Das Bild, das kopiert werden soll
+		DLLEXPORT void setAHBild(int pos, Bild* bild);
+		//! Setzt einen Zeiger auf das Hintergrund Bild, das bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param bild Das Bild, das kopiert werden soll
+		DLLEXPORT void setAHBildZ(int pos, Bild* bild);
+		//! Setzt die Hintergrund Farbe, die bei einem ausgewählten Eintrag verwendet wird, fals MulitStyled gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param fc Die Farbe im A8R8G8B8 Format
+		DLLEXPORT void setAHFarbe(int pos, int fc);
+		//! Setzt den Style eines Eintrags, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Der neue Style
+		DLLEXPORT void setMsStyle(int pos, __int64 style);
+		//! Ändert den Style eines Eintrags, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Der Style
+		//!  add_remove: 1, falls der Style hinzugefügt werden soll. 0, falls der Style entfernt weden soll
+		DLLEXPORT void setMsStyle(int pos, __int64 style, bool add_remove);
+		//! Fügt Styles zu einem Eintrag hinzu, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Der Style, der hinzugefügt werden soll
+		DLLEXPORT void addMsStyle(int pos, __int64 style);
+		//! Entfernt Styles von einem Eintrag, falls MulitStyled gesetzt wurde und legt fest, ob ein Eintrag ausgewählt ist, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Der Style, der entfernt werden soll
+		DLLEXPORT void removeMsStyle(int pos, __int64 style);
+		//! Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
+		//! \param te Das Ereignis
+		DLLEXPORT void doTastaturEreignis(TastaturEreignis& te) override;
+		//! Zeichnet das Objekt nach zRObj, falls es sichtbar ist
+		//! \param zRObj Das Bild, in welches gezeichnet werden soll
+		DLLEXPORT void render(Bild& zRObj) override;
+		//! Gibt den Index eines Eintrags zurück, auf den die Maus zeigt
+		//! \param my Die Position der Maus auf der Y Achse basierend auf dem oberend Rand der Liste
+		DLLEXPORT int getKlickEintrag(int my);
+		//! Wählt einen Eintrag aus
+		//! \param ausw Der Index des Eintrags
+		DLLEXPORT void setAuswahl(int ausw);
+		//! Wählt alle ausgewählten Einträge ab
+		DLLEXPORT void deSelect();
+		//! Gibt die Anzahl an Einträgen zurück
+		DLLEXPORT int getEintragAnzahl() const;
+		//! Gibt den Index des ausgewählten Eintrags zurück, fals MultiSelect nicht gesetzt ist. Wenn MultiSelect gesetzt wurde, kann die Auswahl eines Eintrags mit hatMsStyle( Eintrag Index, AuswahlListe::Style::Ausgewählt ) geprüft werden
+		DLLEXPORT int getAuswahl() const;
+		//! Gibt den Index eines Eintrags zurück
+		//! \param eintragText Der Text des Eintrags
+		DLLEXPORT int getEintragPos(Text* eintragText);
+		//! Gibt einen Eintrag zurück
+		//! \param pos Der Index des Eintrags
+		DLLEXPORT TextFeld* getEintrag(int pos) const;
+		//! Gibt einen Eintrag ohne erhöhten reference Counter zurück
+		//! \param pos Der Index des Eintrags
+		DLLEXPORT TextFeld* zEintrag(int pos) const;
+		//! Gibt den Rahmen zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT Rahmen* getARahmen() const;
+		//! Gibt den Rahmen ohne erhöhten Reference Counter zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT Rahmen* zARahmen() const;
+		//! Gibt die Hintergrund Farbe im A8R8G8B8 Format zurück, die für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT int getAHFarbe() const;
+		//! Gibt das Hintergrund Bild zurück, das für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT Bild* getAHBild() const;
+		//! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, das für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT Bild* zAHBild() const;
+		//! Gibt den Farbverlauf zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT AlphaFeld* getABuffer() const;
+		//! Gibt den Farbverlauf ohne erhöhten Reference Counter zurück, der für ausgewählte Einträge verwendet wird, falls MultiStyled nicht gesetzt wurde
+		DLLEXPORT AlphaFeld* zABuffer() const;
+		//! Gibt den Rahmen zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT Rahmen* getARahmen(int pos) const;
+		//! Gibt den Rahmen ohne erhöhten Reference Counter zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT Rahmen* zARahmen(int pos) const;
+		//! Gibt die Hintegrrund Farbe im A8R8G8B8 Format zurück, die für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT int getAHFarbe(int pos) const;
+		//! Gibt das Hintergrund Bild zurück, das für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT Bild* getAHBild(int pos) const;
+		//! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, das für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT Bild* zAHBild(int pos) const;
+		//! Gibt den Farbübergang zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT AlphaFeld* getABuffer(int pos) const;
+		//! Gibt den Farbübergang ohne erhöhten Reference Counter zurück, der für einen ausgewählten Eintrag verwendet wird, falls MultiStyled gesetzt wurde
+		DLLEXPORT AlphaFeld* zABuffer(int pos) const;
+		//! Überprüft, ob für einen Bestimmten Eintarg betimmte Styles gesetzt wurden, falls MultiStyled gesetzt wurde. Überprüft auch, ob ein Eintrag ausgewählt wurde, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Die zu prüfenden Styles
+		DLLEXPORT inline bool hatMsStyle(int pos, __int64 style) const;
+		//! Überprüft, ob für einen Bestimmten Eintarg betimmte Styles nicht gesetzt wurden, falls MultiStyled gesetzt wurde. Überprüft auch, ob ein Eintrag nicht ausgewählt wurde, falls MultiSelect gesetzt wurde
+		//! \param pos Der Index des Eintrags
+		//! \param style Die zu prüfenden Styles
+		DLLEXPORT inline bool hatMsStyleNicht(int pos, __int64 style) const;
+	};
 }
 
 #endif

+ 328 - 328
M2Datei.cpp

@@ -8,384 +8,384 @@ using namespace Framework;
 // Inhalt der M2Datei Klasse aus M2Datei.h
 // Konstruktor
 M2Datei::M2Datei()
-    : ReferenceCounter()
+	: ReferenceCounter()
 {
-    pfad = new Text();
-    modelName = new RCArray< Text >();
-    modelPos = new Array< __int64 >();
+	pfad = new Text();
+	modelName = new RCArray< Text >();
+	modelPos = new Array< __int64 >();
 }
 
-M2Datei::M2Datei( const char *pfad )
-    : ReferenceCounter()
+M2Datei::M2Datei(const char* pfad)
+	: ReferenceCounter()
 {
-    this->pfad = new Text( pfad );
-    modelName = new RCArray< Text >();
-    modelPos = new Array< __int64 >();
+	this->pfad = new Text(pfad);
+	modelName = new RCArray< Text >();
+	modelPos = new Array< __int64 >();
 }
 
-M2Datei::M2Datei( Text *pfad )
-    : ReferenceCounter()
+M2Datei::M2Datei(Text* pfad)
+	: ReferenceCounter()
 {
-    this->pfad = pfad;
-    modelName = new RCArray< Text >();
-    modelPos = new Array< __int64 >();
+	this->pfad = pfad;
+	modelName = new RCArray< Text >();
+	modelPos = new Array< __int64 >();
 }
 
 // Destruktor
 M2Datei::~M2Datei()
 {
-    pfad->release();
-    modelName->release();
-    modelPos->release();
+	pfad->release();
+	modelName->release();
+	modelPos->release();
 }
 
 // nicht constant
-void M2Datei::setPfad( const char *pfad )
+void M2Datei::setPfad(const char* pfad)
 {
-    this->pfad->setText( pfad );
+	this->pfad->setText(pfad);
 }
 
-void M2Datei::setPfadZ( Text *pfad )
+void M2Datei::setPfadZ(Text* pfad)
 {
-    if( this->pfad )
-        this->pfad->release();
-    this->pfad = pfad;
+	if (this->pfad)
+		this->pfad->release();
+	this->pfad = pfad;
 }
 
 void M2Datei::leseDaten()
 {
-    Datei d;
-    d.setDatei( pfad->getText() );
-    d.open( Datei::Style::lesen );
-    char anz = 0;
-    d.lese( &anz, 1 );
-    modelName->leeren();
-    modelPos->leeren();
-    for( int i = 0; i < anz; i++ )
-    {
-        char len = 0;
-        d.lese( &len, 1 );
-        char *txt = new char[ len + 1 ];
-        d.lese( txt, len );
-        txt[ (int)len ] = 0;
-        modelName->set( new Text( txt ), i );
-        delete[] txt;
-        __int64 pos = 0;
-        d.lese( (char *)&pos, 8 );
-        modelPos->set( pos, i );
-    }
-    d.close();
+	Datei d;
+	d.setDatei(pfad->getText());
+	d.open(Datei::Style::lesen);
+	char anz = 0;
+	d.lese(&anz, 1);
+	modelName->leeren();
+	modelPos->leeren();
+	for (int i = 0; i < anz; i++)
+	{
+		char len = 0;
+		d.lese(&len, 1);
+		char* txt = new char[len + 1];
+		d.lese(txt, len);
+		txt[(int)len] = 0;
+		modelName->set(new Text(txt), i);
+		delete[] txt;
+		__int64 pos = 0;
+		d.lese((char*)&pos, 8);
+		modelPos->set(pos, i);
+	}
+	d.close();
 }
 
-bool M2Datei::saveModel( Model2DData *zMdr, Text *name )
+bool M2Datei::saveModel(Model2DData* zMdr, Text* name)
 {
-    bool ret = saveModel( zMdr, name->getText() );
-    name->release();
-    return ret;
+	bool ret = saveModel(zMdr, name->getText());
+	name->release();
+	return ret;
 }
 
-bool M2Datei::saveModel( Model2DData *zMdr, const char *name )
+bool M2Datei::saveModel(Model2DData* zMdr, const char* name)
 {
-    int anz = modelName->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        if( modelName->z( i )->istGleich( name ) )
-        {
-            if( !removeModel( name ) )
-                return 0;
-            break;
-        }
-    }
-    anz = modelName->getEintragAnzahl();
-    Datei d;
-    d.setDatei( pfad->getText() );
-    d.open( Datei::Style::lesen );
-    Datei neu;
-    neu.setDatei( pfad->getText() );
-    neu.zPfad()->append( "0" );
-    while( neu.existiert() )
-        neu.zPfad()->append( "0" );
-    if( !neu.open( Datei::Style::schreiben ) )
-    {
-        if( d.istOffen() )
-            d.close();
-        return 0;
-    }
-    modelName->add( new Text( name ) );
-    int offs = textLength( name ) + 9;
-    for( int i = 0; i < anz; i++ )
-        modelPos->set( modelPos->get( i ) + offs, i );
-    if( d.getSize() < 0 )
-        modelPos->add( offs + 1 );
-    else
-        modelPos->add( d.getSize() + offs );
-    anz++;
-    char tmp = (char)anz;
-    neu.schreibe( &tmp, 1 );
-    for( int i = 0; i < anz; i++ )
-    {
-        char len = (char)modelName->z( i )->getLength();
-        neu.schreibe( &len, 1 );
-        neu.schreibe( modelName->z( i )->getText(), len );
-        __int64 pos = modelPos->get( i );
-        neu.schreibe( (char *)&pos, 8 );
-    }
-    if( d.existiert() )
-    {
-        d.setLPosition( modelPos->get( 0 ) - offs, 0 );
-        __int64 dl = d.getSize() - d.getLPosition();
-        char bytes[ 2048 ];
-        while( dl )
-        {
-            int l = dl > 2048 ? 2048 : (int)dl;
-            d.lese( bytes, l );
-            neu.schreibe( bytes, l );
-            dl -= l;
-        }
-    }
-    d.close();
-    char pAnz = (char)zMdr->polygons->getEintragAnzahl();
-    neu.schreibe( &pAnz, 1 );
-    for( int p = 0; p < pAnz; p++ )
-    {
-        char pNameL = (char)zMdr->polygons->get( p ).name->getLength();
-        int vAnz = zMdr->polygons->get( p ).vertex->getEintragAnzahl();
-        char options = 1;
-        for( int i = 0; i < vAnz; i++ )
-            options = (char)( options & (char)zMdr->polygons->get( p ).tKordinaten->hat( i ) );
-        if( pNameL != 0 )
-            options |= 2;
-        if( zMdr->polygons->get( p ).transparent )
-            options |= 4;
-        neu.schreibe( &options, 1 );
-        if( ( options | 2 ) == options ) // name
-        {
-            neu.schreibe( &pNameL, 1 );
-            neu.schreibe( zMdr->polygons->get( p ).name->getText(), pNameL );
-        }
-        neu.schreibe( (char *)&vAnz, 4 );
-        for( int i = 0; i < vAnz; i++ )
-        {
-            float v = zMdr->polygons->get( p ).vertex->get( i ).x;
-            neu.schreibe( (char *)&v, 4 );
-            v = zMdr->polygons->get( p ).vertex->get( i ).y;
-            neu.schreibe( (char *)&v, 4 );
-            if( ( options | 1 ) == options ) // textur
-            {
-                float t = zMdr->polygons->get( p ).tKordinaten->get( i ).x;
-                neu.schreibe( (char *)&t, 4 );
-                t = zMdr->polygons->get( p ).tKordinaten->get( i ).y;
-                neu.schreibe( (char *)&t, 4 );
-            }
-        }
-    }
-    d.remove();
-    neu.close();
-    neu.umbenennen( pfad->getText() );
-    leseDaten();
-    return 1;
+	int anz = modelName->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		if (modelName->z(i)->istGleich(name))
+		{
+			if (!removeModel(name))
+				return 0;
+			break;
+		}
+	}
+	anz = modelName->getEintragAnzahl();
+	Datei d;
+	d.setDatei(pfad->getText());
+	d.open(Datei::Style::lesen);
+	Datei neu;
+	neu.setDatei(pfad->getText());
+	neu.zPfad()->append("0");
+	while (neu.existiert())
+		neu.zPfad()->append("0");
+	if (!neu.open(Datei::Style::schreiben))
+	{
+		if (d.istOffen())
+			d.close();
+		return 0;
+	}
+	modelName->add(new Text(name));
+	int offs = textLength(name) + 9;
+	for (int i = 0; i < anz; i++)
+		modelPos->set(modelPos->get(i) + offs, i);
+	if (d.getSize() < 0)
+		modelPos->add(offs + 1);
+	else
+		modelPos->add(d.getSize() + offs);
+	anz++;
+	char tmp = (char)anz;
+	neu.schreibe(&tmp, 1);
+	for (int i = 0; i < anz; i++)
+	{
+		char len = (char)modelName->z(i)->getLength();
+		neu.schreibe(&len, 1);
+		neu.schreibe(modelName->z(i)->getText(), len);
+		__int64 pos = modelPos->get(i);
+		neu.schreibe((char*)&pos, 8);
+	}
+	if (d.existiert())
+	{
+		d.setLPosition(modelPos->get(0) - offs, 0);
+		__int64 dl = d.getSize() - d.getLPosition();
+		char bytes[2048];
+		while (dl)
+		{
+			int l = dl > 2048 ? 2048 : (int)dl;
+			d.lese(bytes, l);
+			neu.schreibe(bytes, l);
+			dl -= l;
+		}
+	}
+	d.close();
+	char pAnz = (char)zMdr->polygons->getEintragAnzahl();
+	neu.schreibe(&pAnz, 1);
+	for (int p = 0; p < pAnz; p++)
+	{
+		char pNameL = (char)zMdr->polygons->get(p).name->getLength();
+		int vAnz = zMdr->polygons->get(p).vertex->getEintragAnzahl();
+		char options = 1;
+		for (int i = 0; i < vAnz; i++)
+			options = (char)(options & (char)zMdr->polygons->get(p).tKordinaten->hat(i));
+		if (pNameL != 0)
+			options |= 2;
+		if (zMdr->polygons->get(p).transparent)
+			options |= 4;
+		neu.schreibe(&options, 1);
+		if ((options | 2) == options) // name
+		{
+			neu.schreibe(&pNameL, 1);
+			neu.schreibe(zMdr->polygons->get(p).name->getText(), pNameL);
+		}
+		neu.schreibe((char*)&vAnz, 4);
+		for (int i = 0; i < vAnz; i++)
+		{
+			float v = zMdr->polygons->get(p).vertex->get(i).x;
+			neu.schreibe((char*)&v, 4);
+			v = zMdr->polygons->get(p).vertex->get(i).y;
+			neu.schreibe((char*)&v, 4);
+			if ((options | 1) == options) // textur
+			{
+				float t = zMdr->polygons->get(p).tKordinaten->get(i).x;
+				neu.schreibe((char*)&t, 4);
+				t = zMdr->polygons->get(p).tKordinaten->get(i).y;
+				neu.schreibe((char*)&t, 4);
+			}
+		}
+	}
+	d.remove();
+	neu.close();
+	neu.umbenennen(pfad->getText());
+	leseDaten();
+	return 1;
 }
 
-bool M2Datei::removeModel( Text *name )
+bool M2Datei::removeModel(Text* name)
 {
-    bool ret = removeModel( name->getText() );
-    name->release();
-    return ret;
+	bool ret = removeModel(name->getText());
+	name->release();
+	return ret;
 }
 
-bool M2Datei::removeModel( const char *name )
+bool M2Datei::removeModel(const char* name)
 {
-    int anz = modelName->getEintragAnzahl();
-    int p = -1;
-    for( int i = 0; i < anz; i++ )
-    {
-        if( modelName->z( i )->istGleich( name ) )
-        {
-            p = i;
-            break;
-        }
-    }
-    if( p < 0 )
-        return 0;
-    Datei d;
-    d.setDatei( pfad->getText() );
-    if( !d.open( Datei::Style::lesen ) )
-        return 0;
-    Datei neu;
-    neu.setDatei( pfad->getText() );
-    neu.zPfad()->append( "0" );
-    while( neu.existiert() )
-        neu.zPfad()->append( "0" );
-    if( !neu.open( Datei::Style::schreiben ) )
-    {
-        if( d.istOffen() )
-            d.close();
-        return 0;
-    }
-    char nAnz = (char)( anz - 1 );
-    neu.schreibe( &nAnz, 1 );
-    int offs = modelName->z( p )->getLength() + 9;
-    __int64 startP = 0, endP = 0, start2P = 0;
-    for( int i = 0; i < anz; i++ )
-    {
-        char nLen = (char)modelName->z( i )->getLength();
-        char *n = modelName->z( i )->getText();
-        __int64 pos = modelPos->get( i );
-        if( !startP )
-            startP = pos;
-        if( i == p + 1 )
-            start2P = pos;
-        if( i == p )
-        {
-            if( !endP )
-                endP = pos;
-            if( i < anz - 1 )
-                offs += (int)( modelPos->get( i + 1 ) - pos );
-        }
-        if( i != p )
-        {
-            pos -= offs;
-            neu.schreibe( &nLen, 1 );
-            neu.schreibe( n, nLen );
-            neu.schreibe( (char *)&pos, 8 );
-        }
-    }
-    if( d.istOffen() )
-    {
-        d.setLPosition( startP, 0 );
-        __int64 bLen = endP - startP;
-        char bytes[ 2048 ];
-        while( bLen > 0 )
-        {
-            int l = 2048 > bLen ? (int)bLen : 2048;
-            d.lese( bytes, l );
-            neu.schreibe( bytes, l );
-            bLen -= l;
-        }
-        if( start2P )
-        {
-            d.setLPosition( start2P, 0 );
-            bLen = d.getSize() - start2P;
-            while( bLen > 0 )
-            {
-                int l = 2048 > bLen ? (int)bLen : 2048;
-                d.lese( bytes, l );
-                neu.schreibe( bytes, l );
-                bLen -= l;
-            }
-        }
-        d.close();
-    }
-    d.remove();
-    neu.close();
-    neu.umbenennen( pfad->getText() );
-    leseDaten();
-    return 1;
+	int anz = modelName->getEintragAnzahl();
+	int p = -1;
+	for (int i = 0; i < anz; i++)
+	{
+		if (modelName->z(i)->istGleich(name))
+		{
+			p = i;
+			break;
+		}
+	}
+	if (p < 0)
+		return 0;
+	Datei d;
+	d.setDatei(pfad->getText());
+	if (!d.open(Datei::Style::lesen))
+		return 0;
+	Datei neu;
+	neu.setDatei(pfad->getText());
+	neu.zPfad()->append("0");
+	while (neu.existiert())
+		neu.zPfad()->append("0");
+	if (!neu.open(Datei::Style::schreiben))
+	{
+		if (d.istOffen())
+			d.close();
+		return 0;
+	}
+	char nAnz = (char)(anz - 1);
+	neu.schreibe(&nAnz, 1);
+	int offs = modelName->z(p)->getLength() + 9;
+	__int64 startP = 0, endP = 0, start2P = 0;
+	for (int i = 0; i < anz; i++)
+	{
+		char nLen = (char)modelName->z(i)->getLength();
+		const char* n = modelName->z(i)->getText();
+		__int64 pos = modelPos->get(i);
+		if (!startP)
+			startP = pos;
+		if (i == p + 1)
+			start2P = pos;
+		if (i == p)
+		{
+			if (!endP)
+				endP = pos;
+			if (i < anz - 1)
+				offs += (int)(modelPos->get(i + 1) - pos);
+		}
+		if (i != p)
+		{
+			pos -= offs;
+			neu.schreibe(&nLen, 1);
+			neu.schreibe(n, nLen);
+			neu.schreibe((char*)&pos, 8);
+		}
+	}
+	if (d.istOffen())
+	{
+		d.setLPosition(startP, 0);
+		__int64 bLen = endP - startP;
+		char bytes[2048];
+		while (bLen > 0)
+		{
+			int l = 2048 > bLen ? (int)bLen : 2048;
+			d.lese(bytes, l);
+			neu.schreibe(bytes, l);
+			bLen -= l;
+		}
+		if (start2P)
+		{
+			d.setLPosition(start2P, 0);
+			bLen = d.getSize() - start2P;
+			while (bLen > 0)
+			{
+				int l = 2048 > bLen ? (int)bLen : 2048;
+				d.lese(bytes, l);
+				neu.schreibe(bytes, l);
+				bLen -= l;
+			}
+		}
+		d.close();
+	}
+	d.remove();
+	neu.close();
+	neu.umbenennen(pfad->getText());
+	leseDaten();
+	return 1;
 }
 
 // constant
-Model2DData *M2Datei::ladeModel( Text *name ) const
+Model2DData* M2Datei::ladeModel(Text* name) const
 {
-    Model2DData *ret = ladeModel( name->getText() );
-    name->release();
-    return ret;
+	Model2DData* ret = ladeModel(name->getText());
+	name->release();
+	return ret;
 }
 
-Model2DData *M2Datei::ladeModel( const char *name ) const
+Model2DData* M2Datei::ladeModel(const char* name) const
 {
-    Datei d;
-    d.setDatei( pfad->getText() );
-    if( !d.open( Datei::Style::lesen ) )
-        return 0;
-    int anz = modelName->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        if( modelName->z( i )->istGleich( name ) )
-        {
-            d.setLPosition( modelPos->get( i ), 0 );
-            break;
-        }
-    }
-    if( !d.getLPosition() )
-    {
-        d.close();
-        return 0;
-    }
-    char pAnz = 0;
-    d.lese( &pAnz, 1 );
-    Array< Polygon2D > *polygons = new Array< Polygon2D >();
-    for( int p = 0; p < pAnz; p++ )
-    {
-        char options = 0;
-        d.lese( &options, 1 );
-        Polygon2D polygon;
-        polygon.schwerpunkt = new Vertex( 0, 0 );
-        polygon.transparent = ( options | 4 ) == options;
-        polygon.name = new Text();
-        if( ( options | 2 ) == options )
-        {
-            char nameL = 0;
-            d.lese( &nameL, 1 );
-            char *name = new char[ nameL + 1 ];
-            name[ (int)nameL ] = 0;
-            d.lese( name, nameL );
-            polygon.name->setText( name );
-            delete[] name;
-        }
-        int vAnz = 0;
-        d.lese( (char *)&vAnz, 4 );
-        if( polygons->hat( p ) )
-        {
-            if( polygons->get( p ).vertex )
-                polygons->get( p ).vertex->release();
-            if( polygons->get( p ).tKordinaten )
-                polygons->get( p ).tKordinaten->release();
-        }
-        polygon.vertex = new Array< Vertex >();
-        if( ( options | 1 ) == options ) // wenn textur
-            polygon.tKordinaten = new Array< Vertex >();
-        else
-            polygon.tKordinaten = 0;
-        for( int v = 0; v < vAnz; v++ )
-        {
-            Vertex p;
-            d.lese( (char *)&p.x, 4 );
-            d.lese( (char *)&p.y, 4 );
-            *polygon.schwerpunkt += p * (float)( 1.0 / vAnz );
-            polygon.vertex->add( p );
-            if( ( options | 1 ) == options ) // wenn textur
-            {
-                Vertex tp;
-                d.lese( (char *)&tp.x, 4 );
-                d.lese( (char *)&tp.y, 4 );
-                polygon.tKordinaten->add( tp );
-            }
-        }
-        polygons->add( polygon );
-    }
-    d.close();
-    Model2DData *ret = new Model2DData();
-    ret->erstelleModell( polygons );
-    return ret;
+	Datei d;
+	d.setDatei(pfad->getText());
+	if (!d.open(Datei::Style::lesen))
+		return 0;
+	int anz = modelName->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		if (modelName->z(i)->istGleich(name))
+		{
+			d.setLPosition(modelPos->get(i), 0);
+			break;
+		}
+	}
+	if (!d.getLPosition())
+	{
+		d.close();
+		return 0;
+	}
+	char pAnz = 0;
+	d.lese(&pAnz, 1);
+	Array< Polygon2D >* polygons = new Array< Polygon2D >();
+	for (int p = 0; p < pAnz; p++)
+	{
+		char options = 0;
+		d.lese(&options, 1);
+		Polygon2D polygon;
+		polygon.schwerpunkt = new Vertex(0, 0);
+		polygon.transparent = (options | 4) == options;
+		polygon.name = new Text();
+		if ((options | 2) == options)
+		{
+			char nameL = 0;
+			d.lese(&nameL, 1);
+			char* name = new char[nameL + 1];
+			name[(int)nameL] = 0;
+			d.lese(name, nameL);
+			polygon.name->setText(name);
+			delete[] name;
+		}
+		int vAnz = 0;
+		d.lese((char*)&vAnz, 4);
+		if (polygons->hat(p))
+		{
+			if (polygons->get(p).vertex)
+				polygons->get(p).vertex->release();
+			if (polygons->get(p).tKordinaten)
+				polygons->get(p).tKordinaten->release();
+		}
+		polygon.vertex = new Array< Vertex >();
+		if ((options | 1) == options) // wenn textur
+			polygon.tKordinaten = new Array< Vertex >();
+		else
+			polygon.tKordinaten = 0;
+		for (int v = 0; v < vAnz; v++)
+		{
+			Vertex p;
+			d.lese((char*)&p.x, 4);
+			d.lese((char*)&p.y, 4);
+			*polygon.schwerpunkt += p * (float)(1.0 / vAnz);
+			polygon.vertex->add(p);
+			if ((options | 1) == options) // wenn textur
+			{
+				Vertex tp;
+				d.lese((char*)&tp.x, 4);
+				d.lese((char*)&tp.y, 4);
+				polygon.tKordinaten->add(tp);
+			}
+		}
+		polygons->add(polygon);
+	}
+	d.close();
+	Model2DData* ret = new Model2DData();
+	ret->erstelleModell(polygons);
+	return ret;
 }
 
-bool M2Datei::hatModel( const char *name ) const
+bool M2Datei::hatModel(const char* name) const
 {
-    int anz = modelName->getEintragAnzahl();
-    for( int i = 0; i < anz; i++ )
-    {
-        if( modelName->z( i )->istGleich( name ) )
-            return 1;
-    }
-    return 0;
+	int anz = modelName->getEintragAnzahl();
+	for (int i = 0; i < anz; i++)
+	{
+		if (modelName->z(i)->istGleich(name))
+			return 1;
+	}
+	return 0;
 }
 
 int M2Datei::getModelAnzahl() const
 {
-    return modelName->getEintragAnzahl();
+	return modelName->getEintragAnzahl();
 }
 
-Text *M2Datei::zModelName( int i ) const
+Text* M2Datei::zModelName(int i) const
 {
-    return modelName->z( i );
+	return modelName->z(i);
 }

+ 1 - 1
Model3D.cpp

@@ -82,7 +82,7 @@ void Knochen::addKind(int id, Knochen* k)
 			err += __LINE__;
 			err += "!";
 			delete k;
-			throw std::out_of_range((const char*)err);
+			throw std::out_of_range(err);
 		}
 	}
 }

+ 1 - 0
ObjFile.cpp

@@ -97,6 +97,7 @@ void ObjFile::readModel(Model3DData* zTarget)
 	for (Vec3<int> index : indices)
 	{
 		Vertex3D current;
+		current.id = 0;
 		current.pos = vertices.get(index.x - 1);
 		current.tPos = textureCoordinates.get(index.y - 1);
 		current.normal = normals.get(index.z - 1);

+ 1 - 1
Reader.cpp

@@ -40,7 +40,7 @@ Text* ByteArrayReader::leseZeile()
 	for (; buffer[position] != '\n' && position < length; position++);
 	Text* ret = new Text("");
 	ret->fillText('\0', position - start + 1);
-	lese(ret->getText(), position - start + 1);
+	lese((char*)ret->getText(), position - start + 1);
 	return ret;
 }
 

+ 15 - 15
Text.cpp

@@ -859,7 +859,7 @@ bool Text::istGleich(Text* t) const
 	return ret;
 }
 
-char* Text::getText() const // gibt Text zurück
+const char* Text::getText() const // gibt Text zurück
 {
 	return txt;
 }
@@ -1180,7 +1180,7 @@ Text& Text::operator=(const Text& txt)
 	return *this;
 }
 
-Text::operator char* () const
+Text::operator const char* () const
 {
 	return txt;
 }
@@ -1213,7 +1213,7 @@ bool Text::operator>(Text& t) const
 {
 	int len1 = getLength();
 	int len2 = t.getLength();
-	char* txt2 = t;
+	const char* txt2 = t;
 	for (int i = 0; i < len1 && i < len2; ++i)
 	{
 		if (txt[i] > txt2[i])
@@ -1230,7 +1230,7 @@ bool Text::operator<(Text& t) const
 {
 	int len1 = getLength();
 	int len2 = t.getLength();
-	char* txt2 = t;
+	const char* txt2 = t;
 	for (int i = 0; i < len1 && i < len2; ++i)
 	{
 		if (txt[i] < txt2[i])
@@ -1338,7 +1338,7 @@ Text* TextReader::leseZeile()
 	{
 		lese(&c, 1);
 		if (c)
-			ret->append((const char*)&c, 1);
+			ret->append(&c, 1);
 	}
 	return ret;
 }
@@ -1364,7 +1364,7 @@ __int64 TextReader::getSize() const
 }
 
 // char* operationen
-int Framework::stringPositionVonChar(char* string, char c, int num) // sucht die position des num-ten c-s in string, -1 bei nicht gefunden
+int Framework::stringPositionVonChar(const char* string, char c, int num) // sucht die position des num-ten c-s in string, -1 bei nicht gefunden
 {
 	int gef = 0;
 	int p = 0;
@@ -1382,7 +1382,7 @@ int Framework::stringPositionVonChar(char* string, char c, int num) // sucht die
 	return -1;
 }
 
-int Framework::stringPositionVonString(char* string, char* suche, int sBegPos) // sucht die position von 'suche' in 'string' ab der Position 'sBegPos', -1 bei nicht gefunden
+int Framework::stringPositionVonString(const char* string, char* suche, int sBegPos) // sucht die position von 'suche' in 'string' ab der Position 'sBegPos', -1 bei nicht gefunden
 {
 	for (int i = 0; i < sBegPos; ++i)
 	{
@@ -1583,50 +1583,50 @@ bool Framework::istSchreibbar(unsigned char zeichen) // pr
 	return 0;
 }
 
-unsigned int Framework::TextZuInt(char* c, int system) // Konvertiert c zu int
+unsigned int Framework::TextZuInt(const char* c, int system) // Konvertiert c zu int
 {
 	if (system == 16)
 		return (unsigned int)strtoul(c, 0, system);
 	return (unsigned int)strtol(c, 0, system);
 }
 
-unsigned int Framework::TextZuInt(char* c, char** c_ende, int system)
+unsigned int Framework::TextZuInt(const char* c, char** c_ende, int system)
 {
 	if (system == 16)
 		return (unsigned int)strtoul(c, c_ende, system);
 	return (unsigned int)strtol(c, c_ende, system);
 }
 
-unsigned __int64 Framework::TextZuInt64(char* c, int system)
+unsigned __int64 Framework::TextZuInt64(const char* c, int system)
 {
 	if (system == 16)
 		return strtoull(c, 0, system);
 	return (unsigned __int64)strtoll(c, 0, system);
 }
 
-unsigned __int64 Framework::TextZuInt64(char* c, char** c_ende, int system)
+unsigned __int64 Framework::TextZuInt64(const char* c, char** c_ende, int system)
 {
 	if (system == 16)
 		return strtoull(c, c_ende, system);
 	return (unsigned __int64)strtoll(c, c_ende, system);
 }
 
-double Framework::TextZuDouble(char* c) // Konvertiert c zu double
+double Framework::TextZuDouble(const char* c) // Konvertiert c zu double
 {
 	return strtod(c, 0);
 }
 
-float Framework::TextZuFloat(char* c) // Konvertiert c zu double
+float Framework::TextZuFloat(const char* c) // Konvertiert c zu double
 {
 	return strtof(c, 0);
 }
 
-double Framework::TextZuDouble(char* c, char** c_ende)
+double Framework::TextZuDouble(const char* c, char** c_ende)
 {
 	return strtod(c, c_ende);
 }
 
-float Framework::TextZuFloat(char* c, char** c_ende)
+float Framework::TextZuFloat(const char* c, char** c_ende)
 {
 	return strtof(c, c_ende);
 }

+ 16 - 16
Text.h

@@ -244,7 +244,7 @@ namespace Framework
 		//! \return (true), wenn die Inhalte der Texte übereinstimmen. (false) sonst
 		DLLEXPORT bool istGleich(Text* t) const;
 		//! Gibt den Inhalt des Textes als Zeichenkette zurück
-		DLLEXPORT char* getText() const;
+		DLLEXPORT const char* getText() const;
 		//! Zählt, wie oft ein bestimmter Buchstabe im Text vorkomt
 		//! \param c Der Buchstabe, der gezählt werden soll
 		//! \return Die Anzahl des Buchstabens im Text
@@ -316,15 +316,15 @@ namespace Framework
 		//! Setzt den Inhalt des Textes gleich einer Kopie des Inhalts eines anderen Textes
 		DLLEXPORT Text& operator=(const Text& txt);
 		//! Gibt den Inhalt des Textes als Zeichenkette zurück
-		DLLEXPORT operator char* () const;
+		DLLEXPORT operator const char* () const;
 		//! Konviertiert den Inhalt des Textes zu einer Zahl
-		DLLEXPORT operator int() const;
+		DLLEXPORT explicit operator int() const;
 		//! Konviertiert den Inhalt des Textes zu einer Zahl
-		DLLEXPORT operator __int64() const;
+		DLLEXPORT explicit operator __int64() const;
 		//! Konviertiert den Inhalt des Textes zu einer Kommazahl
-		DLLEXPORT operator double() const;
+		DLLEXPORT explicit operator double() const;
 		//! Konviertiert den Inhalt des Textes zu einer Kommazahl
-		DLLEXPORT operator float() const;
+		DLLEXPORT explicit operator float() const;
 		//! Prüft, ob der Inhalt des Textes nach alphabetischer Ordnung später kommt als der Inhalt eines anderen Textes
 		DLLEXPORT bool operator>(Text& t) const;
 		//! Prüft, ob der Inhalt des Textes nach alphabetischer Ordnung früher kommt als der Inhalt eines anderen Textes
@@ -383,13 +383,13 @@ namespace Framework
 	//! \param c Der zu suchende Buchstabe
 	//! \param num Das wievielte Vorkommen des Buchtaben gefunden werden soll
 	//! \return (-1), wenn es kein num-tes Vorkommen des Buchstaben gibt. Sonst die Position des num-ten Vorkommens in der Zeichenkette
-	DLLEXPORT int stringPositionVonChar(char* string, char c, int num); //! sucht die position des num-ten c-s in string, -1 bei nicht gefunden
+	DLLEXPORT int stringPositionVonChar(const char* string, char c, int num); //! sucht die position des num-ten c-s in string, -1 bei nicht gefunden
 	//! Durchsucht eine Zeichenkette nach einer Anderen Zeichenkette
 	//! \param string Die zu durchsuchende Zeichenkette
 	//! \param suche Die Zeichenkette, nach der gesucht werden soll
 	//! \param sBegPos Die Position, ab der die Suche begonnen werden soll
 	//! \return Die Position, an der die zu suchende Zeichenkette erstmals gefunden wurde. (-1) Wenn nichts gefunden wurde.
-	DLLEXPORT int stringPositionVonString(char* string, char* suche, int sBegPos);
+	DLLEXPORT int stringPositionVonString(const char* string, char* suche, int sBegPos);
 
 	//! Kopiert eine bestimmte Zeichenkette in die Zwischenablage des Betriebssystems
 	//! \param txt Die Zeichenkette, die kopiert werden soll
@@ -410,42 +410,42 @@ namespace Framework
 	//! \param c Die Zeichenkette, in der Die Zahl steht
 	//! \param system Die Basis der Zahl
 	//! \return Die Zahl, die im Text stand
-	DLLEXPORT unsigned int TextZuInt(char* c, int system);
+	DLLEXPORT unsigned int TextZuInt(const char* c, int system);
 	//! Konvertiert eine Zahl aus einer Zeichenkette in belibiger Basis zu einer Zahl
 	//! \param c Die Zeichenkette, in der Die Zahl steht
 	//!  c_ende: Wird duch die Funktion gesetzt und darf 0 sein. Zeigt auf das nächste Zeichen in der Zeichenkette, das nach der Zah steht
 	//! \param system Die Basis der Zahl
 	//! \return Die Zahl, die im Text stand
-	DLLEXPORT unsigned int TextZuInt(char* c, char** c_ende, int system);
+	DLLEXPORT unsigned int TextZuInt(const char* c, char** c_ende, int system);
 	//! Konvertiert eine Zahl aus einer Zeichenkette in belibiger Basis zu einer Zahl
 	//! \param c Die Zeichenkette, in der Die Zahl steht
 	//! \param system Die Basis der Zahl
 	//! \return Die Zahl, die im Text stand
-	DLLEXPORT unsigned __int64 TextZuInt64(char* c, int system);
+	DLLEXPORT unsigned __int64 TextZuInt64(const char* c, int system);
 	//! Konvertiert eine Zahl aus einer Zeichenkette in belibiger Basis zu einer Zahl
 	//! \param c Die Zeichenkette, in der Die Zahl steht
 	//!  c_ende: Wird duch die Funktion gesetzt und darf 0 sein. Zeigt auf das nächste Zeichen in der Zeichenkette, das nach der Zah steht
 	//! \param system Die Basis der Zahl
 	//! \return Die Zahl, die im Text stand
-	DLLEXPORT unsigned __int64 TextZuInt64(char* c, char** c_ende, int system);
+	DLLEXPORT unsigned __int64 TextZuInt64(const char* c, char** c_ende, int system);
 	//! Konvertiert eine Zeichenkette zu einem Double
 	//! \param c Die Zeichenkette, die konvertiert werden soll
 	//! \return Das double, was in der Zeichenkette stand
-	DLLEXPORT double TextZuDouble(char* c);
+	DLLEXPORT double TextZuDouble(const char* c);
 	//! Konvertiert eine Zeichenkette zu einem Float
 	//! \param c Die Zeichenkette, die konvertiert werden soll
 	//! \return Das float, was in der Zeichenkette stand
-	DLLEXPORT float TextZuFloat(char* c);
+	DLLEXPORT float TextZuFloat(const char* c);
 	//! Konvertiert eine Zeichenkette zu einem Double
 	//! \param c Die Zeichenkette, die konvertiert werden soll
 	//!  c_ende: Wird duch die Funktion gesetzt und darf 0 sein. Ein Zeiger auf das nächste Zeichen nach dem Double in der Zeichenkette
 	//! \return Das double, was in der Zeichenkette stand
-	DLLEXPORT double TextZuDouble(char* c, char** c_ende);
+	DLLEXPORT double TextZuDouble(const char* c, char** c_ende);
 	//! Konvertiert eine Zeichenkette zu einem float
 	//! \param c Die Zeichenkette, die konvertiert werden soll
 	//!  c_ende: Wird duch die Funktion gesetzt und darf 0 sein. Ein Zeiger auf das nächste Zeichen nach dem float in der Zeichenkette
 	//! \return Das float, was in der Zeichenkette stand
-	DLLEXPORT float TextZuFloat(char* c, char** c_ende);
+	DLLEXPORT float TextZuFloat(const char* c, char** c_ende);
 	//! Ermittelt die Länge einer bestimmten Zeichenkette
 	//! \param txt Die Zeichenkette, deren Länge ermittelt werden soll
 	//! \return Die Länge der Zeichenkette

+ 1452 - 1452
TextFeld.cpp

@@ -16,503 +16,503 @@
 using namespace Framework;
 
 
-bool TextFeld::TextStyle::operator==( const TextStyle &rhs )
+bool TextFeld::TextStyle::operator==(const TextStyle& rhs)
 {
-    return fontSize == rhs.fontSize && fontColor == rhs.fontColor &&
-        selectedColor == rhs.selectedColor && selectedBackcroundColor == rhs.selectedBackcroundColor &&
-        underlined == rhs.underlined && selected == rhs.selected && interactParam == rhs.interactParam && rendererIndex == rhs.rendererIndex;
+	return fontSize == rhs.fontSize && fontColor == rhs.fontColor &&
+		selectedColor == rhs.selectedColor && selectedBackcroundColor == rhs.selectedBackcroundColor &&
+		underlined == rhs.underlined && selected == rhs.selected && interactParam == rhs.interactParam && rendererIndex == rhs.rendererIndex;
 }
 
 
 TextFeld::TextStyleManager::TextStyleManager()
-    : ReferenceCounter(),
-    renderer( new RCArray< TextRenderer >() ),
-    index( 0 ),
-    styleIndex( 0 ),
-    text( 0 )
-{
-    current.beginIndex = 0;
-    current.fontColor = 0xFFFFFFFF;
-    current.fontSize = 12;
-    current.selected = 0;
-    current.selectedColor = 0xFFFFFFFF;
-    current.selectedBackcroundColor = 0xFF0000FF;
-    current.underlined = 0;
-    current.interactParam = 0;
-    current.rendererIndex = 0;
-    textStyle.add( current );
+	: ReferenceCounter(),
+	renderer(new RCArray< TextRenderer >()),
+	index(0),
+	styleIndex(0),
+	text(0)
+{
+	current.beginIndex = 0;
+	current.fontColor = 0xFFFFFFFF;
+	current.fontSize = 12;
+	current.selected = 0;
+	current.selectedColor = 0xFFFFFFFF;
+	current.selectedBackcroundColor = 0xFF0000FF;
+	current.underlined = 0;
+	current.interactParam = 0;
+	current.rendererIndex = 0;
+	textStyle.add(current);
 }
 
 TextFeld::TextStyleManager::~TextStyleManager()
 {
-    if( renderer )
-        renderer->release();
-    if( text )
-        text->release();
+	if (renderer)
+		renderer->release();
+	if (text)
+		text->release();
 }
 
 // Setzt den Style eines Textabschnittes
 //  begin: die startposition des Abschnittes
 //  end: die endposition des Abschnittes (nicht enthalten)
-void TextFeld::TextStyleManager::setTextStyle( int begin, int end, TextFeld::TextStyle style )
-{
-    if( begin < 0 || begin > end || begin > text->getLength() )
-        return;
-    int sc = textStyle.getEintragAnzahl();
-    int index = -1;
-    TextStyle s = textStyle.get( 0 );
-    // suche bis zur richtigen stelle im stylearray
-    for( int i = 0; i < sc; i++ )
-    {
-        if( textStyle.get( i ).beginIndex >= begin )
-        {
-            index = i;
-            if( textStyle.get( i ).beginIndex > begin )
-                s = textStyle.get( i - 1 );
-            else
-            {
-                s = textStyle.get( i );
-                textStyle.remove( i );
-                sc--;
-            }
-            break;
-        }
-    }
-    style.beginIndex = begin;
-    s.beginIndex = end;
-    if( index < 0 )
-    { // hinten an styles anfügen
-        textStyle.add( style );
-        textStyle.add( s );
-    }
-    else
-    { // in die mitte des style arrays einfügen
-        textStyle.add( style, index );
-        for( int i = index + 1; i < sc + 1; i++ )
-        { // styles entfernen die überschrieben wurden
-            if( textStyle.get( i ).beginIndex <= end && textStyle.get( i ).beginIndex > begin )
-            {
-                s = textStyle.get( i );
-                textStyle.remove( i );
-                i--;
-                sc--;
-            }
-        }
-        s.beginIndex = end;
-        textStyle.add( s, index + 1 );
-    }
-    cleanupStyles();
+void TextFeld::TextStyleManager::setTextStyle(int begin, int end, TextFeld::TextStyle style)
+{
+	if (begin < 0 || begin > end || begin > text->getLength())
+		return;
+	int sc = textStyle.getEintragAnzahl();
+	int index = -1;
+	TextStyle s = textStyle.get(0);
+	// suche bis zur richtigen stelle im stylearray
+	for (int i = 0; i < sc; i++)
+	{
+		if (textStyle.get(i).beginIndex >= begin)
+		{
+			index = i;
+			if (textStyle.get(i).beginIndex > begin)
+				s = textStyle.get(i - 1);
+			else
+			{
+				s = textStyle.get(i);
+				textStyle.remove(i);
+				sc--;
+			}
+			break;
+		}
+	}
+	style.beginIndex = begin;
+	s.beginIndex = end;
+	if (index < 0)
+	{ // hinten an styles anfügen
+		textStyle.add(style);
+		textStyle.add(s);
+	}
+	else
+	{ // in die mitte des style arrays einfügen
+		textStyle.add(style, index);
+		for (int i = index + 1; i < sc + 1; i++)
+		{ // styles entfernen die überschrieben wurden
+			if (textStyle.get(i).beginIndex <= end && textStyle.get(i).beginIndex > begin)
+			{
+				s = textStyle.get(i);
+				textStyle.remove(i);
+				i--;
+				sc--;
+			}
+		}
+		s.beginIndex = end;
+		textStyle.add(s, index + 1);
+	}
+	cleanupStyles();
 }
 
 // Entfernt einen Textabschnitt
 //  begin: der index des ersten betroffenen zeichens
 //  end: der index des ersten zeichens nach dem abschnitt
-void TextFeld::TextStyleManager::removeText( int begin, int end )
-{
-    int sc = textStyle.getEintragAnzahl();
-    for( int i = 1; i < sc; i++ )
-    {
-        TextStyle s = textStyle.get( i );
-        if( s.beginIndex >= begin && s.beginIndex < end )
-        {
-            textStyle.remove( i );
-            i--;
-            sc--;
-        }
-        if( s.beginIndex >= end )
-        {
-            s.beginIndex -= end - begin;
-            textStyle.set( s, i );
-        }
-    }
-    text->remove( begin, end );
-    cleanupStyles();
+void TextFeld::TextStyleManager::removeText(int begin, int end)
+{
+	int sc = textStyle.getEintragAnzahl();
+	for (int i = 1; i < sc; i++)
+	{
+		TextStyle s = textStyle.get(i);
+		if (s.beginIndex >= begin && s.beginIndex < end)
+		{
+			textStyle.remove(i);
+			i--;
+			sc--;
+		}
+		if (s.beginIndex >= end)
+		{
+			s.beginIndex -= end - begin;
+			textStyle.set(s, i);
+		}
+	}
+	text->remove(begin, end);
+	cleanupStyles();
 }
 
 // Fügt ein Text an einer bestimmten Position ein
 //  pos: die position des neuen Textausschnitts
 //  text: der neue Text
-void TextFeld::TextStyleManager::insertText( int pos, const char *text )
-{
-    int len = textLength( text );
-    this->text->insert( pos, text );
-    int sc = textStyle.getEintragAnzahl();
-    for( int i = 0; i < sc; i++ )
-    {
-        TextStyle s = textStyle.get( i );
-        if( s.beginIndex > pos )
-        {
-            s.beginIndex += len;
-            textStyle.set( s, i );
-        }
-    }
-    cleanupStyles();
+void TextFeld::TextStyleManager::insertText(int pos, const char* text)
+{
+	int len = textLength(text);
+	this->text->insert(pos, text);
+	int sc = textStyle.getEintragAnzahl();
+	for (int i = 0; i < sc; i++)
+	{
+		TextStyle s = textStyle.get(i);
+		if (s.beginIndex > pos)
+		{
+			s.beginIndex += len;
+			textStyle.set(s, i);
+		}
+	}
+	cleanupStyles();
 }
 
 // Entfernt nicht benötiegte gleiche styles
 void TextFeld::TextStyleManager::cleanupStyles()
 {
-    int sc = textStyle.getEintragAnzahl();
-    TextStyle last = textStyle.get( 0 );
-    for( int i = 1; i < sc; i++ )
-    {
-        if( textStyle.get( i ).beginIndex == last.beginIndex )
-        {
-            last = textStyle.get( i );
-            textStyle.remove( i - 1 );
-            i--;
-            sc--;
-            continue;
-        }
-        if( textStyle.get( i ) == last || ( text && textStyle.get( i ).beginIndex > text->getLength() ) )
-        {
-            textStyle.remove( i );
-            i--;
-            sc--;
-        }
-        else
-            last = textStyle.get( i );
-    }
+	int sc = textStyle.getEintragAnzahl();
+	TextStyle last = textStyle.get(0);
+	for (int i = 1; i < sc; i++)
+	{
+		if (textStyle.get(i).beginIndex == last.beginIndex)
+		{
+			last = textStyle.get(i);
+			textStyle.remove(i - 1);
+			i--;
+			sc--;
+			continue;
+		}
+		if (textStyle.get(i) == last || (text && textStyle.get(i).beginIndex > text->getLength()))
+		{
+			textStyle.remove(i);
+			i--;
+			sc--;
+		}
+		else
+			last = textStyle.get(i);
+	}
 }
 
 // gibt eine referenz auf das style objekt zurück
-TextFeld::TextStyle &TextFeld::TextStyleManager::currentStyle()
+TextFeld::TextStyle& TextFeld::TextStyleManager::currentStyle()
 {
-    return current;
+	return current;
 }
 
 // gibt den aktuellen text renderer zurück
-TextRenderer *TextFeld::TextStyleManager::zCurrentRenderer()
+TextRenderer* TextFeld::TextStyleManager::zCurrentRenderer()
 {
-    TextRenderer *tr = renderer->z( current.rendererIndex );
-    if( !tr )
-        tr = renderer->z( 0 );
-    if( tr )
-        tr->setSchriftSize( current.fontSize );
-    return tr;
+	TextRenderer* tr = renderer->z(current.rendererIndex);
+	if (!tr)
+		tr = renderer->z(0);
+	if (tr)
+		tr->setSchriftSize(current.fontSize);
+	return tr;
 }
 
 // ändert den inhalt des style objektes auf den style des nächsten zeichens
 bool TextFeld::TextStyleManager::nextStyle()
 {
-    index++;
-    if( textStyle.getEintragAnzahl() > styleIndex + 1 && index >= textStyle.get( styleIndex + 1 ).beginIndex )
-        current = textStyle.get( styleIndex++ + 1 );
-    return text && index < text->getLength();
+	index++;
+	if (textStyle.getEintragAnzahl() > styleIndex + 1 && index >= textStyle.get(styleIndex + 1).beginIndex)
+		current = textStyle.get(styleIndex++ + 1);
+	return text && index < text->getLength();
 }
 
 // ändert den inhalt des style objektes auf den style des angegebenen zeichens
 //  index: der Index des Zeichens zu dem gesprungen werden soll
 //  gibt 0 zurück falls es das zeichen nicht gibt
-bool TextFeld::TextStyleManager::stepTo( int index )
+bool TextFeld::TextStyleManager::stepTo(int index)
 {
-    resetIteration();
-    while( this->index < index && nextStyle() );
-    return text && this->index == index;
+	resetIteration();
+	while (this->index < index && nextStyle());
+	return text && this->index == index;
 }
 
 // ändert den inhalt des style objektes auf den style des ersten zeichens
 void TextFeld::TextStyleManager::resetIteration()
 {
-    index = 0;
-    styleIndex = 0;
-    current = textStyle.get( 0 );
+	index = 0;
+	styleIndex = 0;
+	current = textStyle.get(0);
 }
 
 // Gibt den Style eines bestimmten zeichens zurück
 //  index: Der index des Zeichensf
-TextFeld::TextStyle TextFeld::TextStyleManager::getTextStyle( int index ) const
+TextFeld::TextStyle TextFeld::TextStyleManager::getTextStyle(int index) const
 {
-    TextStyle last = textStyle.get( 0 );
-    int ind = 0;
-    for( auto i = textStyle.begin(); i && ind <= index; ind++ )
-    {
-        if( i._.beginIndex <= ind )
-        {
-            last = i;
-            i++;
-        }
-    }
-    return last;
+	TextStyle last = textStyle.get(0);
+	int ind = 0;
+	for (auto i = textStyle.begin(); i && ind <= index; ind++)
+	{
+		if (i._.beginIndex <= ind)
+		{
+			last = i;
+			i++;
+		}
+	}
+	return last;
 }
 
 
 // Inhalt der TextFeld Klasse aus TextFeld.h 
 // Konstruktor 
 TextFeld::TextFeld()
-    : ZeichnungHintergrund(),
-    tm( new TextStyleManager() ),
-    showChar( 0 ),
-    cpos( 0 ),
-    tickVal( 0 ),
-    mausKlick( 0 )
+	: ZeichnungHintergrund(),
+	tm(new TextStyleManager()),
+	showChar(0),
+	cpos(0),
+	tickVal(0),
+	mausKlick(0)
 {
-    charEvent = 0;
-    horizontalScrollBar = new HScrollBar();
-    vertikalScrollBar = new VScrollBar();
-    this->setMausEreignis( _ret1ME );
-    this->setTastaturEreignis( _ret1TE );
+	charEvent = 0;
+	horizontalScrollBar = new HScrollBar();
+	vertikalScrollBar = new VScrollBar();
+	this->setMausEreignis(_ret1ME);
+	this->setTastaturEreignis(_ret1TE);
 }
 
 // Destruktor 
 TextFeld::~TextFeld()
 {
-    tm->release();
-}
-
-void TextFeld::doMausEreignis( MausEreignis &me, bool userRet ) // Maus Ereignis
-{
-    if( !userRet )
-        return;
-    if( hatStyleNicht( Style::Editierbar ) )
-    {
-        int rbr = 0;
-        if( rahmen )
-            rbr = rahmen->getRBreite();
-        if( ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ||
-              ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ) &&
-            me.mx > rbr && me.mx < gr.x - rbr &&
-            me.my > rbr && me.my < gr.y - rbr )
-        {
-            me.verarbeitet |= vertikalScrollBar->doMausMessage( gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me );
-            me.verarbeitet |= horizontalScrollBar->doMausMessage( rbr, gr.y - rbr * 2 - 15, gr.x - rbr * 2 - ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? 15 : 0 ), 15, me );
-        }
-        if( me.mx >= 0 && me.mx <= gr.x && me.my >= 0 && me.my <= gr.y && !me.verarbeitet && hatStyle( Style::Sichtbar ) )
-        {
-            int scrollHi = ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0;
-            int scrollBr = ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0;
-            int xxx = me.mx - rbr + scrollBr;
-            int yyy = me.my - rbr + scrollHi;
-            int mausChar = getTextIndexAt( xxx, yyy );
-            if( mausChar >= 0 )
-            {
-                TextStyle s = tm->getTextStyle( mausChar );
-                if( charEvent && s.interactParam )
-                    charEvent( mausChar, s.interactParam, me );
-            }
-            if( charEvent )
-                me.verarbeitet = 1;
-        }
-        mausKlick = 0;
-        return;
-    }
-    if( !me.verarbeitet )
-    {
-        if( hatStyleNicht( Style::Fokus ) )
-        {
-            mausKlick = 0;
-            if( me.id == Framework::ME_PLinks )
-                addStyle( Style::Fokus );
-        }
-        int rbr = 0;
-        if( rahmen )
-            rbr = rahmen->getRBreite();
-        if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-        {
-            if( vertikalScrollBar->doMausMessage( gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me ) )
-            {
-                me.verarbeitet = 1;
-                return;
-            }
-        }
-        if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-        {
-            if( horizontalScrollBar->doMausMessage( rbr, gr.y - rbr - 15, gr.x - rbr * 2 - ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? 15 : 0 ), 15, me ) )
-            {
-                me.verarbeitet = 1;
-                return;
-            }
-        }
-        bool shift = TastenStand[ T_Shift ];
-        bool strg = TastenStand[ T_Strg ];
-        int tbr = getTextWidth();
-        int thi = getTextHeight();
-        int scrollHi = ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0;
-        int scrollBr = ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0;
-        int xxx = me.mx - rbr + scrollBr;
-        int yyy = me.my - rbr + scrollHi;
-        int mausChar = getTextIndexAt( xxx, yyy );
-        int scrollBreite = ( vertikalScrollBar && hatStyle( Style::VScroll ) ) * 15;
-        int scrollHeight = ( horizontalScrollBar && hatStyle( Style::HScroll ) ) * 15;
-        if( hatStyle( Style::HCenter ) )
-            xxx -= ( ( ( gr.x - scrollBreite ) / 2 ) - tbr / 2 ) - rbr;
-        if( hatStyle( Style::VCenter ) && hatStyleNicht( Style::VScroll ) )
-            yyy -= ( ( ( gr.y - scrollHeight ) / 2 ) - thi / 2 ) - rbr;
-        if( mausChar >= 0 )
-        {
-            TextStyle s = tm->getTextStyle( mausChar );
-            if( charEvent )
-                charEvent( mausChar, s.interactParam, me );
-        }
-        if( me.mx < gr.x - rbr - 15 )
-        {
-            if( tm->renderer )
-            {
-                int ncpos = getCurserPosAt( xxx, yyy );
-                if( me.id == Framework::ME_PLinks )
-                {
-                    if( ncpos != -1 )
-                    {
-                        if( shift && cpos != ncpos )
-                            addAuswahl( MIN( cpos, ncpos ), MAX( cpos, ncpos ) );
-                        else if( !shift && !mausKlick && !strg )
-                            deselectAuswahl();
-                        cpos = ncpos;
-                        rend = 1;
-                        if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                            updateVScroll();
-                        if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                            updateHScroll();
-                    }
-                    mausKlick = 1;
-                }
-                if( me.id == ME_Bewegung && mausKlick )
-                {
-                    if( ncpos != -1 )
-                    {
-                        rend = 1;
-                        if( cpos != ncpos )
-                            invertAuswahl( MIN( cpos, ncpos ), MAX( cpos, ncpos ) );
-                        cpos = ncpos;
-                        if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                            updateVScroll( cpos );
-                        if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                            updateHScroll( cpos );
-                    }
-                }
-                if( me.id == ME_RLinks )
-                {
-                    if( ncpos != -1 )
-                    {
-                        rend = 1;
-                        if( cpos != ncpos )
-                            invertAuswahl( MIN( cpos, ncpos ), MAX( cpos, ncpos ) );
-                        cpos = ncpos;
-                        if( vertikalScrollBar && hatStyle( Style::VScroll ) )
-                            updateVScroll( cpos );
-                        if( horizontalScrollBar && hatStyle( Style::HScroll ) )
-                            updateHScroll( cpos );
-                    }
-                    mausKlick = 0;
-                }
-            }
-        }
-    }
-    me.verarbeitet = 1;
+	tm->release();
+}
+
+void TextFeld::doMausEreignis(MausEreignis& me, bool userRet) // Maus Ereignis
+{
+	if (!userRet)
+		return;
+	if (hatStyleNicht(Style::Editierbar))
+	{
+		int rbr = 0;
+		if (rahmen)
+			rbr = rahmen->getRBreite();
+		if (((vertikalScrollBar && hatStyle(Style::VScroll)) ||
+			(horizontalScrollBar && hatStyle(Style::HScroll))) &&
+			me.mx > rbr && me.mx < gr.x - rbr &&
+			me.my > rbr && me.my < gr.y - rbr)
+		{
+			me.verarbeitet |= vertikalScrollBar->doMausMessage(gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me);
+			me.verarbeitet |= horizontalScrollBar->doMausMessage(rbr, gr.y - rbr * 2 - 15, gr.x - rbr * 2 - ((vertikalScrollBar && hatStyle(Style::VScroll)) ? 15 : 0), 15, me);
+		}
+		if (me.mx >= 0 && me.mx <= gr.x && me.my >= 0 && me.my <= gr.y && !me.verarbeitet && hatStyle(Style::Sichtbar))
+		{
+			int scrollHi = (vertikalScrollBar && hatStyle(Style::VScroll)) ? vertikalScrollBar->getScroll() : 0;
+			int scrollBr = (horizontalScrollBar && hatStyle(Style::HScroll)) ? horizontalScrollBar->getScroll() : 0;
+			int xxx = me.mx - rbr + scrollBr;
+			int yyy = me.my - rbr + scrollHi;
+			int mausChar = getTextIndexAt(xxx, yyy);
+			if (mausChar >= 0)
+			{
+				TextStyle s = tm->getTextStyle(mausChar);
+				if (charEvent && s.interactParam)
+					charEvent(mausChar, s.interactParam, me);
+			}
+			if (charEvent)
+				me.verarbeitet = 1;
+		}
+		mausKlick = 0;
+		return;
+	}
+	if (!me.verarbeitet)
+	{
+		if (hatStyleNicht(Style::Fokus))
+		{
+			mausKlick = 0;
+			if (me.id == Framework::ME_PLinks)
+				addStyle(Style::Fokus);
+		}
+		int rbr = 0;
+		if (rahmen)
+			rbr = rahmen->getRBreite();
+		if (vertikalScrollBar && hatStyle(Style::VScroll))
+		{
+			if (vertikalScrollBar->doMausMessage(gr.x - rbr - 15, rbr, 15, gr.y - rbr * 2, me))
+			{
+				me.verarbeitet = 1;
+				return;
+			}
+		}
+		if (horizontalScrollBar && hatStyle(Style::HScroll))
+		{
+			if (horizontalScrollBar->doMausMessage(rbr, gr.y - rbr - 15, gr.x - rbr * 2 - ((vertikalScrollBar && hatStyle(Style::VScroll)) ? 15 : 0), 15, me))
+			{
+				me.verarbeitet = 1;
+				return;
+			}
+		}
+		bool shift = TastenStand[T_Shift];
+		bool strg = TastenStand[T_Strg];
+		int tbr = getTextWidth();
+		int thi = getTextHeight();
+		int scrollHi = (vertikalScrollBar && hatStyle(Style::VScroll)) ? vertikalScrollBar->getScroll() : 0;
+		int scrollBr = (horizontalScrollBar && hatStyle(Style::HScroll)) ? horizontalScrollBar->getScroll() : 0;
+		int xxx = me.mx - rbr + scrollBr;
+		int yyy = me.my - rbr + scrollHi;
+		int mausChar = getTextIndexAt(xxx, yyy);
+		int scrollBreite = (vertikalScrollBar && hatStyle(Style::VScroll)) * 15;
+		int scrollHeight = (horizontalScrollBar && hatStyle(Style::HScroll)) * 15;
+		if (hatStyle(Style::HCenter))
+			xxx -= (((gr.x - scrollBreite) / 2) - tbr / 2) - rbr;
+		if (hatStyle(Style::VCenter) && hatStyleNicht(Style::VScroll))
+			yyy -= (((gr.y - scrollHeight) / 2) - thi / 2) - rbr;
+		if (mausChar >= 0)
+		{
+			TextStyle s = tm->getTextStyle(mausChar);
+			if (charEvent)
+				charEvent(mausChar, s.interactParam, me);
+		}
+		if (me.mx < gr.x - rbr - 15)
+		{
+			if (tm->renderer)
+			{
+				int ncpos = getCurserPosAt(xxx, yyy);
+				if (me.id == Framework::ME_PLinks)
+				{
+					if (ncpos != -1)
+					{
+						if (shift && cpos != ncpos)
+							addAuswahl(MIN(cpos, ncpos), MAX(cpos, ncpos));
+						else if (!shift && !mausKlick && !strg)
+							deselectAuswahl();
+						cpos = ncpos;
+						rend = 1;
+						if (vertikalScrollBar && hatStyle(Style::VScroll))
+							updateVScroll();
+						if (horizontalScrollBar && hatStyle(Style::HScroll))
+							updateHScroll();
+					}
+					mausKlick = 1;
+				}
+				if (me.id == ME_Bewegung && mausKlick)
+				{
+					if (ncpos != -1)
+					{
+						rend = 1;
+						if (cpos != ncpos)
+							invertAuswahl(MIN(cpos, ncpos), MAX(cpos, ncpos));
+						cpos = ncpos;
+						if (vertikalScrollBar && hatStyle(Style::VScroll))
+							updateVScroll(cpos);
+						if (horizontalScrollBar && hatStyle(Style::HScroll))
+							updateHScroll(cpos);
+					}
+				}
+				if (me.id == ME_RLinks)
+				{
+					if (ncpos != -1)
+					{
+						rend = 1;
+						if (cpos != ncpos)
+							invertAuswahl(MIN(cpos, ncpos), MAX(cpos, ncpos));
+						cpos = ncpos;
+						if (vertikalScrollBar && hatStyle(Style::VScroll))
+							updateVScroll(cpos);
+						if (horizontalScrollBar && hatStyle(Style::HScroll))
+							updateHScroll(cpos);
+					}
+					mausKlick = 0;
+				}
+			}
+		}
+	}
+	me.verarbeitet = 1;
 }
 
 int TextFeld::getTextHeight() const
 {
-    if( !tm || !tm->text )
-        return 0;
-    tm->resetIteration();
-    int th = 0;
-    int len = tm->text->getLength();
-    char *text = tm->text->getText();
-    int max = 0;
-    int abstand = 0;
-    for( int i = 0; i < len; i++ )
-    {
-        if( text[ i ] == '\n' )
-        {
-            th += max + abstand;
-            abstand = 0;
-            max = 0;
-            tm->nextStyle();
-            continue;
-        }
-        TextRenderer *r = tm->zCurrentRenderer();
-        if( r )
-        {
-            int tmp = r->getZeilenHeight();
-            max = max >= tmp ? max : tmp;
-            if( max == tmp )
-                abstand = r->getZeilenAbstand();
-        }
-        tm->nextStyle();
-    }
-    if( max > 0 )
-        th += max;
-    return th;
+	if (!tm || !tm->text)
+		return 0;
+	tm->resetIteration();
+	int th = 0;
+	int len = tm->text->getLength();
+	const char* text = tm->text->getText();
+	int max = 0;
+	int abstand = 0;
+	for (int i = 0; i < len; i++)
+	{
+		if (text[i] == '\n')
+		{
+			th += max + abstand;
+			abstand = 0;
+			max = 0;
+			tm->nextStyle();
+			continue;
+		}
+		TextRenderer* r = tm->zCurrentRenderer();
+		if (r)
+		{
+			int tmp = r->getZeilenHeight();
+			max = max >= tmp ? max : tmp;
+			if (max == tmp)
+				abstand = r->getZeilenAbstand();
+		}
+		tm->nextStyle();
+	}
+	if (max > 0)
+		th += max;
+	return th;
 }
 
 int TextFeld::getTextWidth() const
 {
-    if( !tm || !tm->text )
-        return 0;
-    tm->resetIteration();
-    int maxBr = 0;
-    int len = tm->text->getLength();
-    char *text = tm->text->getText();
-    int lineBr = 0;
-    char buff[] = { 0,0 };
-    for( int i = 0; i < len; i++ )
-    {
-        buff[ 0 ] = text[ i ];
-        if( text[ i ] == '\n' )
-        {
-            maxBr = maxBr >= lineBr ? maxBr : lineBr;
-            lineBr = 0;
-            tm->nextStyle();
-            continue;
-        }
-        TextRenderer *r = tm->zCurrentRenderer();
-        if( r )
-            lineBr += r->getTextBreite( buff );
-        tm->nextStyle();
-    }
-    if( lineBr > 0 )
-        maxBr = maxBr >= lineBr ? maxBr : lineBr;
-    return maxBr;
+	if (!tm || !tm->text)
+		return 0;
+	tm->resetIteration();
+	int maxBr = 0;
+	int len = tm->text->getLength();
+	const char* text = tm->text->getText();
+	int lineBr = 0;
+	char buff[] = { 0,0 };
+	for (int i = 0; i < len; i++)
+	{
+		buff[0] = text[i];
+		if (text[i] == '\n')
+		{
+			maxBr = maxBr >= lineBr ? maxBr : lineBr;
+			lineBr = 0;
+			tm->nextStyle();
+			continue;
+		}
+		TextRenderer* r = tm->zCurrentRenderer();
+		if (r)
+			lineBr += r->getTextBreite(buff);
+		tm->nextStyle();
+	}
+	if (lineBr > 0)
+		maxBr = maxBr >= lineBr ? maxBr : lineBr;
+	return maxBr;
 }
 
 // charEvent: eine funktion die aufgerufen wird, wenn sich die maus auf einem bestimmten zeichen befindet und der interactParam im style != 0 ist
 //  aufruf: charEvent( charIndex, interactParam, mausEreignis );
-void TextFeld::setCharEvent( std::function< void( int, int, MausEreignis me ) > charEvent )
+void TextFeld::setCharEvent(std::function< void(int, int, MausEreignis me) > charEvent)
 {
-    this->charEvent = charEvent;
+	this->charEvent = charEvent;
 }
 
-void TextFeld::setText( Text *txt ) // setzt den angezeigten Text
+void TextFeld::setText(Text* txt) // setzt den angezeigten Text
 {
-    lockZeichnung();
-    if( !tm->text )
-        tm->text = new Text();
-    tm->text->setText( txt );
-    if( hatStyle( Style::VScroll ) )
-        updateVScroll();
-    if( hatStyle( Style::HScroll ) )
-        updateHScroll();
-    unlockZeichnung();
-    rend = 1;
+	lockZeichnung();
+	if (!tm->text)
+		tm->text = new Text();
+	tm->text->setText(txt);
+	if (hatStyle(Style::VScroll))
+		updateVScroll();
+	if (hatStyle(Style::HScroll))
+		updateHScroll();
+	unlockZeichnung();
+	rend = 1;
 }
 
-void TextFeld::setTextZ( Text *txt ) // setzt einen Zeiger zum angezeigten Text
+void TextFeld::setTextZ(Text* txt) // setzt einen Zeiger zum angezeigten Text
 {
-    lockZeichnung();
-    if( tm->text )
-        tm->text->release();
-    tm->text = txt;
-    if( hatStyle( Style::VScroll ) )
-        updateVScroll();
-    if( hatStyle( Style::HScroll ) )
-        updateHScroll();
-    rend = 1;
-    unlockZeichnung();
+	lockZeichnung();
+	if (tm->text)
+		tm->text->release();
+	tm->text = txt;
+	if (hatStyle(Style::VScroll))
+		updateVScroll();
+	if (hatStyle(Style::HScroll))
+		updateHScroll();
+	rend = 1;
+	unlockZeichnung();
 }
 
-void TextFeld::setText( const char *txt ) // setzt den angezeigten Text
+void TextFeld::setText(const char* txt) // setzt den angezeigten Text
 {
-    lockZeichnung();
-    if( !tm->text )
-        tm->text = new Text();
-    tm->text->setText( txt );
-    if( hatStyle( Style::VScroll ) )
-        updateVScroll();
-    if( hatStyle( Style::HScroll ) )
-        updateHScroll();
-    rend = 1;
-    unlockZeichnung();
+	lockZeichnung();
+	if (!tm->text)
+		tm->text = new Text();
+	tm->text->setText(txt);
+	if (hatStyle(Style::VScroll))
+		updateVScroll();
+	if (hatStyle(Style::HScroll))
+		updateHScroll();
+	rend = 1;
+	unlockZeichnung();
 }
 
 // setzt den Text mit styles
@@ -525,1228 +525,1228 @@ void TextFeld::setText( const char *txt ) // setzt den angezeigten Text
 //          \x6\xY: setzt text renderer index auf y
 //          \x7: deaktiviert unterschtrich
 //          \x8\xA\xB\xC\xD: set interact param to ABCD
-void TextFeld::setFormattedText( const char *txt )
-{
-    lockZeichnung();
-    if( !tm->text )
-        tm->text = new Text();
-    tm->textStyle.leeren();
-    TextStyle current;
-    current.beginIndex = 0;
-    current.fontColor = 0xFFFFFFFF;
-    current.fontSize = 12;
-    current.selected = 0;
-    current.selectedColor = 0xFFFFFFFF;
-    current.selectedBackcroundColor = 0xFF0000FF;
-    current.underlined = 0;
-    current.interactParam = 0;
-    current.rendererIndex = 0;
-    tm->textStyle.add( current );
-    Text result = "";
-    for( int i = 0; 1; i++ )
-    {
-        bool br = 0;
-        current.beginIndex = result.getLength();
-        switch( txt[ i ] )
-        {
-        case 0:
-            br = 1;
-            break;
-        case 1:
-            current.underlined = 1;
-            tm->textStyle.add( current );
-            break;
-        case 2:
-            current.fontSize = (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        case 3:
-            current.fontColor = 0;
-            current.fontColor |= (unsigned char)txt[ ++i ] << 24;
-            current.fontColor |= (unsigned char)txt[ ++i ] << 16;
-            current.fontColor |= (unsigned char)txt[ ++i ] << 8;
-            current.fontColor |= (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        case 4:
-            current.selectedColor = 0;
-            current.selectedColor |= (unsigned char)txt[ ++i ] << 24;
-            current.selectedColor |= (unsigned char)txt[ ++i ] << 16;
-            current.selectedColor |= (unsigned char)txt[ ++i ] << 8;
-            current.selectedColor |= (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        case 5:
-            current.selectedBackcroundColor = 0;
-            current.selectedBackcroundColor |= (unsigned char)txt[ ++i ] << 24;
-            current.selectedBackcroundColor |= (unsigned char)txt[ ++i ] << 16;
-            current.selectedBackcroundColor |= (unsigned char)txt[ ++i ] << 8;
-            current.selectedBackcroundColor |= (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        case 6:
-            current.rendererIndex = (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        case 7:
-            current.underlined = 0;
-            tm->textStyle.add( current );
-            break;
-        case 8:
-            current.interactParam = 0;
-            current.interactParam |= (unsigned char)txt[ ++i ] << 24;
-            current.interactParam |= (unsigned char)txt[ ++i ] << 16;
-            current.interactParam |= (unsigned char)txt[ ++i ] << 8;
-            current.interactParam |= (unsigned char)txt[ ++i ];
-            tm->textStyle.add( current );
-            break;
-        default:
-            result.append( txt[ i ] );
-        }
-        if( br )
-            break;
-    }
-    tm->text->setText( result );
-    tm->cleanupStyles();
-    if( hatStyle( Style::VScroll ) )
-        updateVScroll();
-    if( hatStyle( Style::HScroll ) )
-        updateHScroll();
-    rend = 1;
-    unlockZeichnung();
+void TextFeld::setFormattedText(const char* txt)
+{
+	lockZeichnung();
+	if (!tm->text)
+		tm->text = new Text();
+	tm->textStyle.leeren();
+	TextStyle current;
+	current.beginIndex = 0;
+	current.fontColor = 0xFFFFFFFF;
+	current.fontSize = 12;
+	current.selected = 0;
+	current.selectedColor = 0xFFFFFFFF;
+	current.selectedBackcroundColor = 0xFF0000FF;
+	current.underlined = 0;
+	current.interactParam = 0;
+	current.rendererIndex = 0;
+	tm->textStyle.add(current);
+	Text result = "";
+	for (int i = 0; 1; i++)
+	{
+		bool br = 0;
+		current.beginIndex = result.getLength();
+		switch (txt[i])
+		{
+		case 0:
+			br = 1;
+			break;
+		case 1:
+			current.underlined = 1;
+			tm->textStyle.add(current);
+			break;
+		case 2:
+			current.fontSize = (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		case 3:
+			current.fontColor = 0;
+			current.fontColor |= (unsigned char)txt[++i] << 24;
+			current.fontColor |= (unsigned char)txt[++i] << 16;
+			current.fontColor |= (unsigned char)txt[++i] << 8;
+			current.fontColor |= (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		case 4:
+			current.selectedColor = 0;
+			current.selectedColor |= (unsigned char)txt[++i] << 24;
+			current.selectedColor |= (unsigned char)txt[++i] << 16;
+			current.selectedColor |= (unsigned char)txt[++i] << 8;
+			current.selectedColor |= (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		case 5:
+			current.selectedBackcroundColor = 0;
+			current.selectedBackcroundColor |= (unsigned char)txt[++i] << 24;
+			current.selectedBackcroundColor |= (unsigned char)txt[++i] << 16;
+			current.selectedBackcroundColor |= (unsigned char)txt[++i] << 8;
+			current.selectedBackcroundColor |= (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		case 6:
+			current.rendererIndex = (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		case 7:
+			current.underlined = 0;
+			tm->textStyle.add(current);
+			break;
+		case 8:
+			current.interactParam = 0;
+			current.interactParam |= (unsigned char)txt[++i] << 24;
+			current.interactParam |= (unsigned char)txt[++i] << 16;
+			current.interactParam |= (unsigned char)txt[++i] << 8;
+			current.interactParam |= (unsigned char)txt[++i];
+			tm->textStyle.add(current);
+			break;
+		default:
+			result.append(txt[i]);
+		}
+		if (br)
+			break;
+	}
+	tm->text->setText(result);
+	tm->cleanupStyles();
+	if (hatStyle(Style::VScroll))
+		updateVScroll();
+	if (hatStyle(Style::HScroll))
+		updateHScroll();
+	rend = 1;
+	unlockZeichnung();
 }
 
 // fügt zeilenumbrüche so ein, dass der text nicht die breite des textfeldes überschreitet
-void TextFeld::addLineBreaks( const char *spacing )
-{
-    if( !tm->text )
-        return;
-    int lastPos = -1;
-    int lastPos2 = -1;
-    int x = 0;
-    const char *txt = tm->text->getText();
-    Text result = "";
-    int len = tm->text->getLength();
-    lockZeichnung();
-    int maxBr = getBreite();
-    if( hatStyle( Style::VScroll ) && vertikalScrollBar )
-        maxBr -= 15;
-    tm->resetIteration();
-    TextStyle last;
-    last.beginIndex = 0;
-    last.fontColor = 0xFFFFFFFF;
-    last.fontSize = 12;
-    last.selected = 0;
-    last.selectedColor = 0xFFFFFFFF;
-    last.selectedBackcroundColor = 0xFF0000FF;
-    last.underlined = 0;
-    last.interactParam = 0;
-    last.rendererIndex = 0;
-    for( int i = 0; i < len; ++i )
-    {
-        if( last.fontSize != tm->current.fontSize )
-        {
-            char tmp[ 3 ] = { 2, (char)tm->current.fontSize, 0 };
-            result += tmp;
-            last.fontSize = tm->current.fontSize;
-        }
-        if( last.fontColor != tm->current.fontColor )
-        {
-            char tmp[ 6 ] = { 3, (char)( ( tm->current.fontColor >> 24 ) & 0xFF ),
-                (char)( ( tm->current.fontColor >> 16 ) & 0xFF ),
-                (char)( ( tm->current.fontColor >> 8 ) & 0xFF ),
-                (char)( tm->current.fontColor & 0xFF ), 0 };
-            result += tmp;
-            last.fontColor = tm->current.fontColor;
-        }
-        if( last.selectedColor != tm->current.selectedColor )
-        {
-            char tmp[ 6 ] = { 4, (char)( ( tm->current.selectedColor >> 24 ) & 0xFF ),
-                (char)( ( tm->current.selectedColor >> 16 ) & 0xFF ),
-                (char)( ( tm->current.selectedColor >> 8 ) & 0xFF ),
-                (char)( tm->current.selectedColor & 0xFF ), 0 };
-            result += tmp;
-            last.selectedColor = tm->current.selectedColor;
-        }
-        if( last.selectedBackcroundColor != tm->current.selectedBackcroundColor )
-        {
-            char tmp[ 6 ] = { 5, (char)( ( tm->current.selectedBackcroundColor >> 24 ) & 0xFF ),
-                (char)( ( tm->current.selectedBackcroundColor >> 16 ) & 0xFF ),
-                (char)( ( tm->current.selectedBackcroundColor >> 8 ) & 0xFF ),
-                (char)( tm->current.selectedBackcroundColor & 0xFF ), 0 };
-            result += tmp;
-            last.selectedBackcroundColor = tm->current.selectedBackcroundColor;
-        }
-        if( last.underlined != tm->current.underlined )
-        {
-            char tmp[ 2 ] = { tm->current.underlined ? (char)1 : (char)7, 0 };
-            result += tmp;
-            last.underlined = tm->current.underlined;
-        }
-        if( last.interactParam != tm->current.interactParam )
-        {
-            char tmp[ 6 ] = { 8, (char)( ( tm->current.interactParam >> 24 ) & 0xFF ),
-                (char)( ( tm->current.interactParam >> 16 ) & 0xFF ),
-                (char)( ( tm->current.interactParam >> 8 ) & 0xFF ),
-                (char)( tm->current.interactParam & 0xFF ), 0 };
-            result += tmp;
-            last.interactParam = tm->current.interactParam;
-        }
-        if( last.rendererIndex != tm->current.rendererIndex )
-        {
-            char tmp[ 3 ] = { 6, (char)tm->current.rendererIndex, 0 };
-            result += tmp;
-            last.rendererIndex = tm->current.rendererIndex;
-        }
-        if( txt[ i ] == ' ' )
-        {
-            lastPos = i;
-            lastPos2 = result.getLength();
-            x += tm->zCurrentRenderer()->getTextBreite( " " );
-            result += " ";
-            tm->nextStyle();
-            continue;
-        }
-        if( txt[ i ] == '\t' )
-        {
-            lastPos = i;
-            lastPos2 = result.getLength();
-            x += tm->zCurrentRenderer()->getTextBreite( "\t" );
-            result += "\t";
-            tm->nextStyle();
-            continue;
-        }
-        if( txt[ i ] == '\n' )
-        {
-            x = 0;
-            lastPos = -1;
-            lastPos2 = -1;
-            result += "\n";
-            tm->nextStyle();
-            continue;
-        }
-        char buff[ 2 ] = { txt[ i ], 0 };
-        x += tm->zCurrentRenderer()->getTextBreite( buff );
-        result += buff;
-        if( x > maxBr && lastPos > -1 )
-        {
-            result.remove( lastPos2, result.getLength() );
-            result += "\n";
-            result += spacing;
-            x = tm->zCurrentRenderer()->getTextBreite( spacing );
-            i = lastPos;
-            tm->stepTo( lastPos );
-            lastPos = -1;
-            lastPos2 = -1;
-            last = tm->currentStyle();
-        }
-        tm->nextStyle();
-    }
-    unlockZeichnung();
-    setFormattedText( result );
+void TextFeld::addLineBreaks(const char* spacing)
+{
+	if (!tm->text)
+		return;
+	int lastPos = -1;
+	int lastPos2 = -1;
+	int x = 0;
+	const char* txt = tm->text->getText();
+	Text result = "";
+	int len = tm->text->getLength();
+	lockZeichnung();
+	int maxBr = getBreite();
+	if (hatStyle(Style::VScroll) && vertikalScrollBar)
+		maxBr -= 15;
+	tm->resetIteration();
+	TextStyle last;
+	last.beginIndex = 0;
+	last.fontColor = 0xFFFFFFFF;
+	last.fontSize = 12;
+	last.selected = 0;
+	last.selectedColor = 0xFFFFFFFF;
+	last.selectedBackcroundColor = 0xFF0000FF;
+	last.underlined = 0;
+	last.interactParam = 0;
+	last.rendererIndex = 0;
+	for (int i = 0; i < len; ++i)
+	{
+		if (last.fontSize != tm->current.fontSize)
+		{
+			char tmp[3] = { 2, (char)tm->current.fontSize, 0 };
+			result += tmp;
+			last.fontSize = tm->current.fontSize;
+		}
+		if (last.fontColor != tm->current.fontColor)
+		{
+			char tmp[6] = { 3, (char)((tm->current.fontColor >> 24) & 0xFF),
+				(char)((tm->current.fontColor >> 16) & 0xFF),
+				(char)((tm->current.fontColor >> 8) & 0xFF),
+				(char)(tm->current.fontColor & 0xFF), 0 };
+			result += tmp;
+			last.fontColor = tm->current.fontColor;
+		}
+		if (last.selectedColor != tm->current.selectedColor)
+		{
+			char tmp[6] = { 4, (char)((tm->current.selectedColor >> 24) & 0xFF),
+				(char)((tm->current.selectedColor >> 16) & 0xFF),
+				(char)((tm->current.selectedColor >> 8) & 0xFF),
+				(char)(tm->current.selectedColor & 0xFF), 0 };
+			result += tmp;
+			last.selectedColor = tm->current.selectedColor;
+		}
+		if (last.selectedBackcroundColor != tm->current.selectedBackcroundColor)
+		{
+			char tmp[6] = { 5, (char)((tm->current.selectedBackcroundColor >> 24) & 0xFF),
+				(char)((tm->current.selectedBackcroundColor >> 16) & 0xFF),
+				(char)((tm->current.selectedBackcroundColor >> 8) & 0xFF),
+				(char)(tm->current.selectedBackcroundColor & 0xFF), 0 };
+			result += tmp;
+			last.selectedBackcroundColor = tm->current.selectedBackcroundColor;
+		}
+		if (last.underlined != tm->current.underlined)
+		{
+			char tmp[2] = { tm->current.underlined ? (char)1 : (char)7, 0 };
+			result += tmp;
+			last.underlined = tm->current.underlined;
+		}
+		if (last.interactParam != tm->current.interactParam)
+		{
+			char tmp[6] = { 8, (char)((tm->current.interactParam >> 24) & 0xFF),
+				(char)((tm->current.interactParam >> 16) & 0xFF),
+				(char)((tm->current.interactParam >> 8) & 0xFF),
+				(char)(tm->current.interactParam & 0xFF), 0 };
+			result += tmp;
+			last.interactParam = tm->current.interactParam;
+		}
+		if (last.rendererIndex != tm->current.rendererIndex)
+		{
+			char tmp[3] = { 6, (char)tm->current.rendererIndex, 0 };
+			result += tmp;
+			last.rendererIndex = tm->current.rendererIndex;
+		}
+		if (txt[i] == ' ')
+		{
+			lastPos = i;
+			lastPos2 = result.getLength();
+			x += tm->zCurrentRenderer()->getTextBreite(" ");
+			result += " ";
+			tm->nextStyle();
+			continue;
+		}
+		if (txt[i] == '\t')
+		{
+			lastPos = i;
+			lastPos2 = result.getLength();
+			x += tm->zCurrentRenderer()->getTextBreite("\t");
+			result += "\t";
+			tm->nextStyle();
+			continue;
+		}
+		if (txt[i] == '\n')
+		{
+			x = 0;
+			lastPos = -1;
+			lastPos2 = -1;
+			result += "\n";
+			tm->nextStyle();
+			continue;
+		}
+		char buff[2] = { txt[i], 0 };
+		x += tm->zCurrentRenderer()->getTextBreite(buff);
+		result += buff;
+		if (x > maxBr && lastPos > -1)
+		{
+			result.remove(lastPos2, result.getLength());
+			result += "\n";
+			result += spacing;
+			x = tm->zCurrentRenderer()->getTextBreite(spacing);
+			i = lastPos;
+			tm->stepTo(lastPos);
+			lastPos = -1;
+			lastPos2 = -1;
+			last = tm->currentStyle();
+		}
+		tm->nextStyle();
+	}
+	unlockZeichnung();
+	setFormattedText(result);
 }
 
 // Setzt den Style eines Textabschnittes
 //  begin: die startposition des Abschnittes
 //  end: die endposition des Abschnittes (nicht enthalten)
-void TextFeld::setTextStyle( int begin, int end, TextStyle style )
-{
-    tm->setTextStyle( begin, end, style );
-}
-
-void TextFeld::addZeile( const char *zeile ) // fügt Zeile An
-{
-    if( tm->text )
-    {
-        Text *txt = new Text( zeile );
-        if( zeile[ txt->getLength() - 1 ] != '\n' )
-            txt->append( "\n" );
-        TextRenderer *r = tm->renderer->z( 0 );
-        if( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).rendererIndex < tm->renderer->getEintragAnzahl() )
-            r = tm->renderer->z( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).rendererIndex );
-        if( r )
-        {
-            bool vs = vertikalScrollBar && hatStyle( Style::VScroll );
-            int rbr = ( rahmen && hatStyle( Style::Rahmen ) ) ? rahmen->getRBreite() : 0;
-            r->setSchriftSize( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).fontSize );
-            r->textFormatieren( txt, gr.x - ( (int)vs * 15 ) - rbr * 2 );
-        }
-        lockZeichnung();
-        tm->text->append( txt->getText() );
-        unlockZeichnung();
-        txt->release();
-        if( hatStyle( Style::VScroll ) )
-            updateVScroll();
-        if( hatStyle( Style::HScroll ) )
-            updateHScroll();
-        rend = 1;
-    }
+void TextFeld::setTextStyle(int begin, int end, TextStyle style)
+{
+	tm->setTextStyle(begin, end, style);
+}
+
+void TextFeld::addZeile(const char* zeile) // fügt Zeile An
+{
+	if (tm->text)
+	{
+		Text* txt = new Text(zeile);
+		if (zeile[txt->getLength() - 1] != '\n')
+			txt->append("\n");
+		TextRenderer* r = tm->renderer->z(0);
+		if (tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).rendererIndex < tm->renderer->getEintragAnzahl())
+			r = tm->renderer->z(tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).rendererIndex);
+		if (r)
+		{
+			bool vs = vertikalScrollBar && hatStyle(Style::VScroll);
+			int rbr = (rahmen && hatStyle(Style::Rahmen)) ? rahmen->getRBreite() : 0;
+			r->setSchriftSize(tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).fontSize);
+			r->textFormatieren(txt, gr.x - ((int)vs * 15) - rbr * 2);
+		}
+		lockZeichnung();
+		tm->text->append(txt->getText());
+		unlockZeichnung();
+		txt->release();
+		if (hatStyle(Style::VScroll))
+			updateVScroll();
+		if (hatStyle(Style::HScroll))
+			updateHScroll();
+		rend = 1;
+	}
 }
 
 // Fügt eine Zeile an den Text an
 //  zeile: Die neue Zeile
 //  color: Die Farbe der Zeile
-void TextFeld::addZeile( const char *zeile, int color )
-{
-    if( tm->text )
-    {
-        Text *txt = new Text( zeile );
-        if( zeile[ txt->getLength() - 1 ] != '\n' )
-            txt->append( "\n" );
-        TextRenderer *r = tm->renderer->z( 0 );
-        if( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).rendererIndex < tm->renderer->getEintragAnzahl() )
-            r = tm->renderer->z( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).rendererIndex );
-        if( r )
-        {
-            bool vs = vertikalScrollBar && hatStyle( Style::VScroll );
-            int rbr = ( rahmen && hatStyle( Style::Rahmen ) ) ? rahmen->getRBreite() : 0;
-            r->setSchriftSize( tm->textStyle.get( tm->textStyle.getEintragAnzahl() - 1 ).fontSize );
-            r->textFormatieren( txt, gr.x - ( (int)vs * 15 ) - rbr * 2 );
-        }
-        lockZeichnung();
-        tm->text->append( txt->getText() );
-        setSchriftFarbe( tm->text->getLength() - txt->getLength(), tm->text->getLength(), color );
-        unlockZeichnung();
-        txt->release();
-        if( hatStyle( Style::VScroll ) )
-            updateVScroll();
-        if( hatStyle( Style::HScroll ) )
-            updateHScroll();
-        rend = 1;
-    }
+void TextFeld::addZeile(const char* zeile, int color)
+{
+	if (tm->text)
+	{
+		Text* txt = new Text(zeile);
+		if (zeile[txt->getLength() - 1] != '\n')
+			txt->append("\n");
+		TextRenderer* r = tm->renderer->z(0);
+		if (tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).rendererIndex < tm->renderer->getEintragAnzahl())
+			r = tm->renderer->z(tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).rendererIndex);
+		if (r)
+		{
+			bool vs = vertikalScrollBar && hatStyle(Style::VScroll);
+			int rbr = (rahmen && hatStyle(Style::Rahmen)) ? rahmen->getRBreite() : 0;
+			r->setSchriftSize(tm->textStyle.get(tm->textStyle.getEintragAnzahl() - 1).fontSize);
+			r->textFormatieren(txt, gr.x - ((int)vs * 15) - rbr * 2);
+		}
+		lockZeichnung();
+		tm->text->append(txt->getText());
+		setSchriftFarbe(tm->text->getLength() - txt->getLength(), tm->text->getLength(), color);
+		unlockZeichnung();
+		txt->release();
+		if (hatStyle(Style::VScroll))
+			updateVScroll();
+		if (hatStyle(Style::HScroll))
+			updateHScroll();
+		rend = 1;
+	}
 }
 
 // Deselectiert alle textabschnitte
 void TextFeld::deselectAuswahl()
 {
-    for( int i = 0; i < tm->textStyle.getEintragAnzahl(); i++ )
-    {
-        TextStyle s = tm->textStyle.get( i );
-        if( s.selected )
-        {
-            s.selected = 0;
-            tm->textStyle.set( s, i );
-        }
-    }
-    tm->cleanupStyles();
+	for (int i = 0; i < tm->textStyle.getEintragAnzahl(); i++)
+	{
+		TextStyle s = tm->textStyle.get(i);
+		if (s.selected)
+		{
+			s.selected = 0;
+			tm->textStyle.set(s, i);
+		}
+	}
+	tm->cleanupStyles();
 }
 
-void TextFeld::setAuswahl( int pos1, int pos2 ) // setzt den Ausgewählten Text
+void TextFeld::setAuswahl(int pos1, int pos2) // setzt den Ausgewählten Text
 {
-    deselectAuswahl();
-    TextStyle s = tm->getTextStyle( pos1 );
-    s.selected = 1;
-    tm->setTextStyle( pos1, pos2, s );
+	deselectAuswahl();
+	TextStyle s = tm->getTextStyle(pos1);
+	s.selected = 1;
+	tm->setTextStyle(pos1, pos2, s);
 }
 
-void TextFeld::setAuswahl( Punkt &auswahl )
+void TextFeld::setAuswahl(Punkt& auswahl)
 {
-    deselectAuswahl();
-    TextStyle s = tm->getTextStyle( auswahl.x );
-    s.selected = 1;
-    tm->setTextStyle( auswahl.x, auswahl.y, s );
-    rend = 1;
+	deselectAuswahl();
+	TextStyle s = tm->getTextStyle(auswahl.x);
+	s.selected = 1;
+	tm->setTextStyle(auswahl.x, auswahl.y, s);
+	rend = 1;
 }
 
-void TextFeld::addAuswahl( int pos1, int pos2 )
+void TextFeld::addAuswahl(int pos1, int pos2)
 {
-    TextStyle s = tm->getTextStyle( pos1 );
-    s.selected = 1;
-    tm->setTextStyle( pos1, pos2, s );
+	TextStyle s = tm->getTextStyle(pos1);
+	s.selected = 1;
+	tm->setTextStyle(pos1, pos2, s);
 }
 
-void TextFeld::addAuswahl( Punkt &auswahl )
+void TextFeld::addAuswahl(Punkt& auswahl)
 {
-    TextStyle s = tm->getTextStyle( auswahl.x );
-    s.selected = 1;
-    tm->setTextStyle( auswahl.x, auswahl.y, s );
-    rend = 1;
+	TextStyle s = tm->getTextStyle(auswahl.x);
+	s.selected = 1;
+	tm->setTextStyle(auswahl.x, auswahl.y, s);
+	rend = 1;
 }
 
 // Setzt den ausgewählten textabschnitt fest
 //  begin: Die Cursorposition im Text
 //  end: Die Position im Text, bis zu der der Text eingefärbt werden soll
-void TextFeld::invertAuswahl( int begin, int end )
+void TextFeld::invertAuswahl(int begin, int end)
 {
-    for( int i = begin; i < end; i++ )
-    {
-        TextStyle s = tm->getTextStyle( i );
-        s.selected = !s.selected;
-        tm->setTextStyle( i, i + 1, s );
-        rend = 1;
-    }
+	for (int i = begin; i < end; i++)
+	{
+		TextStyle s = tm->getTextStyle(i);
+		s.selected = !s.selected;
+		tm->setTextStyle(i, i + 1, s);
+		rend = 1;
+	}
 }
 
 // ersetzt alle ausgewählten Textabschnitte mit einem text
 //  text: der neue Text
-void TextFeld::replaceAuswahl( const char *text )
-{
-    tm->cleanupStyles();
-    int sa = tm->textStyle.getEintragAnzahl();
-    int last = tm->text->getLength();
-    int si = 0;
-    for( int i = sa - 1; i >= 0; i-- )
-    {
-        TextStyle s = tm->textStyle.get( i );
-        si = i;
-        if( s.selected )
-        {
-            if( ( i > 0 && !tm->textStyle.get( i - 1 ).selected ) || i == 0 )
-            {
-                s.selected = false;
-                tm->textStyle.set( s, si );
-                tm->removeText( s.beginIndex, last );
-                tm->insertText( s.beginIndex, text );
-            }
-        }
-        else
-            last = s.beginIndex;
-    }
-}
-
-void TextFeld::setTextRendererZ( TextRenderer *textRd )
-{
-    if( tm->renderer )
-        tm->renderer->leeren();
-    else
-        tm->renderer = new RCArray< TextRenderer >();
-    tm->renderer->add( textRd );
-    rend = 1;
+void TextFeld::replaceAuswahl(const char* text)
+{
+	tm->cleanupStyles();
+	int sa = tm->textStyle.getEintragAnzahl();
+	int last = tm->text->getLength();
+	int si = 0;
+	for (int i = sa - 1; i >= 0; i--)
+	{
+		TextStyle s = tm->textStyle.get(i);
+		si = i;
+		if (s.selected)
+		{
+			if ((i > 0 && !tm->textStyle.get(i - 1).selected) || i == 0)
+			{
+				s.selected = false;
+				tm->textStyle.set(s, si);
+				tm->removeText(s.beginIndex, last);
+				tm->insertText(s.beginIndex, text);
+			}
+		}
+		else
+			last = s.beginIndex;
+	}
+}
+
+void TextFeld::setTextRendererZ(TextRenderer* textRd)
+{
+	if (tm->renderer)
+		tm->renderer->leeren();
+	else
+		tm->renderer = new RCArray< TextRenderer >();
+	tm->renderer->add(textRd);
+	rend = 1;
 }
 
 // Fügt einen TextRenderer hinzu
 //  textRd: Der Textrenderer
-void TextFeld::addTextRendererZ( TextRenderer *textRd )
+void TextFeld::addTextRendererZ(TextRenderer* textRd)
 {
-    if( !tm->renderer )
-        tm->renderer = new RCArray< TextRenderer >();
-    tm->renderer->add( textRd );
+	if (!tm->renderer)
+		tm->renderer = new RCArray< TextRenderer >();
+	tm->renderer->add(textRd);
 }
 
 // Setzt die verwendeten TextRenderer
 //  textRd: Die Textrenderer
-void TextFeld::setTextRendererZ( RCArray< TextRenderer > *textRd )
+void TextFeld::setTextRendererZ(RCArray< TextRenderer >* textRd)
 {
-    if( tm->renderer )
-        tm->renderer->release();
-    tm->renderer = textRd;
+	if (tm->renderer)
+		tm->renderer->release();
+	tm->renderer = textRd;
 }
 
-void TextFeld::setSchriftZ( Schrift *schrift ) // setzt einen Zeiger zur Schrift
+void TextFeld::setSchriftZ(Schrift* schrift) // setzt einen Zeiger zur Schrift
 {
-    if( !tm->renderer )
-        tm->renderer = new RCArray< TextRenderer >();
-    if( !tm->renderer->getEintragAnzahl() )
-        tm->renderer->add( new TextRenderer( schrift ) );
-    else
-        tm->renderer->z( 0 )->setSchriftZ( schrift );
-    rend = 1;
+	if (!tm->renderer)
+		tm->renderer = new RCArray< TextRenderer >();
+	if (!tm->renderer->getEintragAnzahl())
+		tm->renderer->add(new TextRenderer(schrift));
+	else
+		tm->renderer->z(0)->setSchriftZ(schrift);
+	rend = 1;
 }
 
 // Setzt einen Zeiger zur Schrift
 //  rendererIndex: Der Index des Renderers dessen Schrift gesetzt werden soll
 //  schrift: Die Schrift, die zum Textzeichnen verwendet werden soll.
-void TextFeld::setSchriftZ( int rendererIndex, Schrift *schrift )
+void TextFeld::setSchriftZ(int rendererIndex, Schrift* schrift)
 {
-    if( !tm->renderer )
-        tm->renderer = new RCArray< TextRenderer >();
-    if( tm->renderer->getEintragAnzahl() <= rendererIndex )
-        tm->renderer->add( new TextRenderer( schrift ), rendererIndex );
-    else
-        tm->renderer->z( rendererIndex )->setSchriftZ( schrift );
+	if (!tm->renderer)
+		tm->renderer = new RCArray< TextRenderer >();
+	if (tm->renderer->getEintragAnzahl() <= rendererIndex)
+		tm->renderer->add(new TextRenderer(schrift), rendererIndex);
+	else
+		tm->renderer->z(rendererIndex)->setSchriftZ(schrift);
 }
 
-void TextFeld::setSchriftSize( unsigned char gr ) // setzt die Schriftgröße
+void TextFeld::setSchriftSize(unsigned char gr) // setzt die Schriftgröße
 {
-    TextStyle s = tm->textStyle.get( 0 );
-    s.fontSize = gr;
-    tm->textStyle.set( s, 0 );
-    rend = 1;
+	TextStyle s = tm->textStyle.get(0);
+	s.fontSize = gr;
+	tm->textStyle.set(s, 0);
+	rend = 1;
 }
 
 // Setzt die Schriftgröße (Standart: 12)
 //  begin: Der Index des ersten betroffenen Zeichens
 //  end: Der Index des ersten nicht betroffenen Zeichens
 //  gr: Die Schriftgröße, die zum Textzeichnen verwendet werden soll
-void TextFeld::setSchriftSize( int begin, int end, unsigned char gr )
+void TextFeld::setSchriftSize(int begin, int end, unsigned char gr)
 {
-    TextStyle s = tm->getTextStyle( begin );
-    s.fontSize = gr;
-    tm->setTextStyle( begin, end, s );
-    rend = 1;
+	TextStyle s = tm->getTextStyle(begin);
+	s.fontSize = gr;
+	tm->setTextStyle(begin, end, s);
+	rend = 1;
 }
 
-void TextFeld::setSchriftFarbe( int fc ) // setzt die Schrift Farbe
+void TextFeld::setSchriftFarbe(int fc) // setzt die Schrift Farbe
 {
-    TextStyle s = tm->textStyle.get( 0 );
-    s.fontColor = fc;
-    tm->textStyle.set( s, 0 );
-    rend = 1;
+	TextStyle s = tm->textStyle.get(0);
+	s.fontColor = fc;
+	tm->textStyle.set(s, 0);
+	rend = 1;
 }
 
 // Setzt die Schrift Farbe
 //  begin: Der Index des ersten betroffenen Zeichens
 //  end: Der Index des ersten nicht betroffenen Zeichens
 //  fc: Die Farbe, die zum Textzeichnen verwendet werden soll
-void TextFeld::setSchriftFarbe( int begin, int end, int fc )
-{
-    TextStyle s = tm->getTextStyle( begin );
-    s.fontColor = fc;
-    tm->setTextStyle( begin, end, s );
-    rend = 1;
-}
-
-void TextFeld::setSchowChar( unsigned char c ) // bei Passwortfeld *
-{
-    showChar = c;
-    rend = 1;
-}
-
-void TextFeld::setVScrollZuZeile( int zeile ) // scrollt zur Zeile
-{
-    if( vertikalScrollBar && tm->renderer && tm->renderer->getEintragAnzahl() && tm->text && hatStyle( Style::Mehrzeilig ) )
-    {
-        lockZeichnung();
-        tm->resetIteration();
-        int len = tm->text->getLength();
-        int y = 0;
-        int lnum = 0;
-        char *text = tm->text->getText();
-        int max = 0;
-        for( int i = 0; i < len && lnum < zeile; i++ )
-        {
-            if( text[ i ] == '\n' )
-            {
-                lnum++;
-                y += max;
-                max = 0;
-                tm->nextStyle();
-                continue;
-            }
-            TextRenderer *r = tm->zCurrentRenderer();
-            if( r )
-            {
-                int tmp = r->getZeilenabstand() + r->getZeilenHeight();
-                max = max >= tmp ? max : tmp;
-            }
-            tm->nextStyle();
-        }
-        unlockZeichnung();
-        vertikalScrollBar->scroll( y );
-        rend = 1;
-    }
-}
-
-void TextFeld::updateVScroll( int pos ) // scrollt nach unten
-{
-    if( pos == -1 )
-        pos = cpos;
-    if( vertikalScrollBar )
-    {
-        int sPos = 0;
-        int hi = 0;
-        int sPosZH = 0;
-        if( tm->text && tm->renderer )
-        {
-            if( hatStyleNicht( Style::Mehrzeilig ) )
-                tm->text->remove( '\n' );
-            hi = gr.y;
-            if( hatStyle( Style::Rahmen ) && rahmen )
-                hi -= rahmen->getRBreite() * 2;
-            if( hatStyle( Style::HScroll ) && horizontalScrollBar )
-                hi -= 15;
-            int th = 0;
-            lockZeichnung();
-            tm->resetIteration();
-            int len = tm->text->getLength();
-            char *text = tm->text->getText();
-            int max = 0;
-            int lastMax = 0;
-            for( int i = 0; i < len; i++ )
-            {
-                if( text[ i ] == '\n' )
-                {
-                    if( i <= pos )
-                    {
-                        sPos += max;
-                        sPosZH = max;
-                    }
-                    th += max;
-                    lastMax = max;
-                    max = 0;
-                    tm->nextStyle();
-                    continue;
-                }
-                TextRenderer *r = tm->zCurrentRenderer();
-                if( r )
-                {
-                    int tmp = r->getZeilenabstand() + r->getZeilenHeight();
-                    max = max >= tmp ? max : tmp;
-                }
-                tm->nextStyle();
-            }
-            if( max != lastMax && max > 0 )
-            {
-                th += max;
-                lastMax = max;
-            }
-            th += lastMax;
-            unlockZeichnung();
-            vertikalScrollBar->update( th, hi );
-        }
-        if( sPos - sPosZH < vertikalScrollBar->getScroll() )
-            vertikalScrollBar->scroll( sPos - sPosZH );
-        if( sPos + sPosZH > vertikalScrollBar->getScroll() + vertikalScrollBar->getScrollData()->anzeige )
-            vertikalScrollBar->scroll( sPos + sPosZH * 2 - hi );
-        rend = 1;
-    }
-}
-
-void TextFeld::updateHScroll( int pos ) // scrollt zur Curser Position
-{
-    if( pos == -1 )
-        pos = cpos;
-    lockZeichnung();
-    if( horizontalScrollBar && tm->text && tm->renderer )
-    {
-        if( hatStyleNicht( Style::Mehrzeilig ) )
-            tm->text->remove( '\n' );
-        int br = gr.x;
-        if( hatStyle( Style::Rahmen ) && rahmen )
-            br -= rahmen->getRBreite() * 2;
-        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
-            br -= 15;
-        tm->resetIteration();
-        int maxBr = 0;
-        int len = tm->text->getLength();
-        char *text = tm->text->getText();
-        int lineBr = 0;
-        char buff[] = { 0,0 };
-        int cbr = 0;
-        for( int i = 0; i < len; i++ )
-        {
-            buff[ 0 ] = text[ i ];
-            if( text[ i ] == '\n' )
-            {
-                maxBr = maxBr >= lineBr ? maxBr : lineBr;
-                lineBr = 0;
-                tm->nextStyle();
-                continue;
-            }
-            TextRenderer *r = tm->zCurrentRenderer();
-            if( r )
-            {
-                lineBr += r->getTextBreite( buff );
-                if( i <= pos )
-                    cbr = lineBr;
-            }
-            tm->nextStyle();
-        }
-        maxBr = maxBr >= lineBr ? maxBr : lineBr;
-        horizontalScrollBar->update( maxBr, br );
-        if( cbr > horizontalScrollBar->getScroll() + horizontalScrollBar->getScrollData()->anzeige )
-            horizontalScrollBar->scroll( cbr - br );
-        if( cbr < horizontalScrollBar->getScroll() )
-            horizontalScrollBar->scroll( cbr );
-    }
-    unlockZeichnung();
+void TextFeld::setSchriftFarbe(int begin, int end, int fc)
+{
+	TextStyle s = tm->getTextStyle(begin);
+	s.fontColor = fc;
+	tm->setTextStyle(begin, end, s);
+	rend = 1;
+}
+
+void TextFeld::setSchowChar(unsigned char c) // bei Passwortfeld *
+{
+	showChar = c;
+	rend = 1;
+}
+
+void TextFeld::setVScrollZuZeile(int zeile) // scrollt zur Zeile
+{
+	if (vertikalScrollBar && tm->renderer && tm->renderer->getEintragAnzahl() && tm->text && hatStyle(Style::Mehrzeilig))
+	{
+		lockZeichnung();
+		tm->resetIteration();
+		int len = tm->text->getLength();
+		int y = 0;
+		int lnum = 0;
+		const char* text = tm->text->getText();
+		int max = 0;
+		for (int i = 0; i < len && lnum < zeile; i++)
+		{
+			if (text[i] == '\n')
+			{
+				lnum++;
+				y += max;
+				max = 0;
+				tm->nextStyle();
+				continue;
+			}
+			TextRenderer* r = tm->zCurrentRenderer();
+			if (r)
+			{
+				int tmp = r->getZeilenabstand() + r->getZeilenHeight();
+				max = max >= tmp ? max : tmp;
+			}
+			tm->nextStyle();
+		}
+		unlockZeichnung();
+		vertikalScrollBar->scroll(y);
+		rend = 1;
+	}
+}
+
+void TextFeld::updateVScroll(int pos) // scrollt nach unten
+{
+	if (pos == -1)
+		pos = cpos;
+	if (vertikalScrollBar)
+	{
+		int sPos = 0;
+		int hi = 0;
+		int sPosZH = 0;
+		if (tm->text && tm->renderer)
+		{
+			if (hatStyleNicht(Style::Mehrzeilig))
+				tm->text->remove('\n');
+			hi = gr.y;
+			if (hatStyle(Style::Rahmen) && rahmen)
+				hi -= rahmen->getRBreite() * 2;
+			if (hatStyle(Style::HScroll) && horizontalScrollBar)
+				hi -= 15;
+			int th = 0;
+			lockZeichnung();
+			tm->resetIteration();
+			int len = tm->text->getLength();
+			const char* text = tm->text->getText();
+			int max = 0;
+			int lastMax = 0;
+			for (int i = 0; i < len; i++)
+			{
+				if (text[i] == '\n')
+				{
+					if (i <= pos)
+					{
+						sPos += max;
+						sPosZH = max;
+					}
+					th += max;
+					lastMax = max;
+					max = 0;
+					tm->nextStyle();
+					continue;
+				}
+				TextRenderer* r = tm->zCurrentRenderer();
+				if (r)
+				{
+					int tmp = r->getZeilenabstand() + r->getZeilenHeight();
+					max = max >= tmp ? max : tmp;
+				}
+				tm->nextStyle();
+			}
+			if (max != lastMax && max > 0)
+			{
+				th += max;
+				lastMax = max;
+			}
+			th += lastMax;
+			unlockZeichnung();
+			vertikalScrollBar->update(th, hi);
+		}
+		if (sPos - sPosZH < vertikalScrollBar->getScroll())
+			vertikalScrollBar->scroll(sPos - sPosZH);
+		if (sPos + sPosZH > vertikalScrollBar->getScroll() + vertikalScrollBar->getScrollData()->anzeige)
+			vertikalScrollBar->scroll(sPos + sPosZH * 2 - hi);
+		rend = 1;
+	}
+}
+
+void TextFeld::updateHScroll(int pos) // scrollt zur Curser Position
+{
+	if (pos == -1)
+		pos = cpos;
+	lockZeichnung();
+	if (horizontalScrollBar && tm->text && tm->renderer)
+	{
+		if (hatStyleNicht(Style::Mehrzeilig))
+			tm->text->remove('\n');
+		int br = gr.x;
+		if (hatStyle(Style::Rahmen) && rahmen)
+			br -= rahmen->getRBreite() * 2;
+		if (hatStyle(Style::VScroll) && vertikalScrollBar)
+			br -= 15;
+		tm->resetIteration();
+		int maxBr = 0;
+		int len = tm->text->getLength();
+		const char* text = tm->text->getText();
+		int lineBr = 0;
+		char buff[] = { 0,0 };
+		int cbr = 0;
+		for (int i = 0; i < len; i++)
+		{
+			buff[0] = text[i];
+			if (text[i] == '\n')
+			{
+				maxBr = maxBr >= lineBr ? maxBr : lineBr;
+				lineBr = 0;
+				tm->nextStyle();
+				continue;
+			}
+			TextRenderer* r = tm->zCurrentRenderer();
+			if (r)
+			{
+				lineBr += r->getTextBreite(buff);
+				if (i <= pos)
+					cbr = lineBr;
+			}
+			tm->nextStyle();
+		}
+		maxBr = maxBr >= lineBr ? maxBr : lineBr;
+		horizontalScrollBar->update(maxBr, br);
+		if (cbr > horizontalScrollBar->getScroll() + horizontalScrollBar->getScrollData()->anzeige)
+			horizontalScrollBar->scroll(cbr - br);
+		if (cbr < horizontalScrollBar->getScroll())
+			horizontalScrollBar->scroll(cbr);
+	}
+	unlockZeichnung();
 }
 
 // Gibt die breite in pixeln zurück, die benötigt wird um den aktuellen text mit den aktuellen styles voll anzuzeigen
 int TextFeld::getNeededWidth()
 {
-    int maxBr = 0;
-    lockZeichnung();
-    if( tm->text && tm->renderer )
-        maxBr = getTextWidth();
-    unlockZeichnung();
-    return maxBr;
+	int maxBr = 0;
+	lockZeichnung();
+	if (tm->text && tm->renderer)
+		maxBr = getTextWidth();
+	unlockZeichnung();
+	return maxBr;
 }
 
 // Gibt die höhe in pixeln zurück, die benötigt wird um den aktuellen text mit den aktuellen styles voll anzuzeigen
 int TextFeld::getNeededHeight()
 {
-    int th = 0;
-    lockZeichnung();
-    if( tm->text && tm->renderer )
-        th = getTextHeight();
-    unlockZeichnung();
-    return th;
-}
-
-bool TextFeld::tick( double tickval ) // tick
-{
-    if( hatStyle( Style::Fokus ) )
-    {
-        if( tickVal < 0.5 && tickVal + tickval >= 0.5 )
-            rend = 1;
-        if( tickVal >= 0.5 && tickVal + tickval >= 1 )
-            rend = 1;
-        tickVal += tickval;
-        if( tickVal >= 1 )
-            tickVal -= 1;
-    }
-    return ZeichnungHintergrund::tick( tickval );
-}
-
-void TextFeld::doTastaturEreignis( TastaturEreignis &te )
-{
-    bool ntakc = !te.verarbeitet;
-    if( te.verarbeitet || hatStyleNicht( Style::Fokus ) )
-        return;
-    if( !tak )
-        return;
-    getThis();
-    if( tak( takParam, this, te ) )
-    {
-        if( hatStyleNicht( Style::Editierbar ) )
-        {
-            release();
-            return;
-        }
-        if( te.id == TE_Press )
-        {
-            bool shift = TastenStand[ T_Shift ];
-            bool strg = TastenStand[ T_Strg ];
-            switch( te.taste )
-            {
-            case T_Entf:
-                if( !tm->getTextStyle( cpos ).selected )
-                    tm->removeText( cpos, cpos + 1 );
-                else
-                {
-                    cpos = tm->getTextStyle( cpos ).beginIndex;
-                    while( cpos > 0 && tm->getTextStyle( cpos - 1 ).selected )
-                        cpos = tm->getTextStyle( cpos - 1 ).beginIndex;
-                }
-                replaceAuswahl( "" );
-                deselectAuswahl();
-                rend = 1;
-                break;
-            case T_BackSpace:
-                if( !tm->getTextStyle( cpos ).selected )
-                {
-                    tm->removeText( cpos - 1, cpos );
-                    cpos--;
-                }
-                else
-                {
-                    cpos = tm->getTextStyle( cpos ).beginIndex;
-                    while( cpos > 0 && tm->getTextStyle( cpos - 1 ).selected )
-                        cpos = tm->getTextStyle( cpos - 1 ).beginIndex;
-                }
-                replaceAuswahl( "" );
-                deselectAuswahl();
-                rend = 1;
-                break;
-            case T_Enter:
-                if( !tm->getTextStyle( cpos ).selected )
-                    tm->insertText( cpos, "\n" );
-                else
-                {
-                    cpos = tm->getTextStyle( cpos ).beginIndex;
-                    while( cpos > 0 && tm->getTextStyle( cpos - 1 ).selected )
-                        cpos = tm->getTextStyle( cpos - 1 ).beginIndex;
-                }
-                replaceAuswahl( "\n" );
-                ++cpos;
-                rend = 1;
-                break;
-            case T_Links:
-                if( shift )
-                {
-                    if( strg )
-                    {
-                        int tmp = tm->text->getLKick( cpos );
-                        invertAuswahl( tmp, cpos );
-                        cpos = tmp;
-                    }
-                    else
-                    {
-                        invertAuswahl( cpos - 1, cpos );
-                        --cpos;
-                    }
-                }
-                else
-                {
-                    if( strg )
-                        cpos = tm->text->getLKick( cpos );
-                    else
-                        --cpos;
-                    deselectAuswahl();
-                }
-                rend = 1;
-                break;
-            case T_Oben:
-            {
-                int tmp = tm->text->getOKick( cpos );
-                invertAuswahl( tmp, cpos );
-                cpos = tmp;
-                if( !shift )
-                    deselectAuswahl();
-                rend = 1;
-                break;
-            }
-            case T_Rechts:
-                if( shift )
-                {
-                    if( strg )
-                    {
-                        int tmp = tm->text->getRKick( cpos );
-                        invertAuswahl( cpos, tmp );
-                        cpos = tmp;
-                    }
-                    else
-                    {
-                        invertAuswahl( cpos, cpos + 1 );
-                        ++cpos;
-                    }
-                }
-                else
-                {
-                    if( strg )
-                        cpos = tm->text->getRKick( cpos );
-                    else
-                        ++cpos;
-                    deselectAuswahl();
-                }
-                rend = 1;
-                break;
-            case T_Unten:
-            {
-                int tmp = tm->text->getUKick( cpos );
-                invertAuswahl( cpos, tmp );
-                cpos = tmp;
-                if( !shift )
-                    deselectAuswahl();
-                rend = 1;
-                break;
-            }
-            default:
-                if( strg && te.id == TE_Press )
-                {
-                    if( te.taste == 'c' || te.taste == 'C' )
-                    {
-                        int sa = tm->textStyle.getEintragAnzahl();
-                        int length = 0;
-                        for( int i = 0; i < sa; i++ )
-                        {
-                            TextStyle s = tm->textStyle.get( i );
-                            if( s.selected )
-                            {
-                                int max = tm->text->getLength();
-                                if( i < sa - 1 )
-                                    max = tm->textStyle.get( i + 1 ).beginIndex;
-                                length += max - s.beginIndex;
-                            }
-                        }
-                        if( length )
-                        {
-                            char *txt = new char[ length + 1 ];
-                            txt[ length ] = 0;
-                            int index = 0;
-                            for( int i = 0; i < sa; i++ )
-                            {
-                                TextStyle s = tm->textStyle.get( i );
-                                if( s.selected )
-                                {
-                                    int max = tm->text->getLength();
-                                    if( i < sa - 1 )
-                                        max = tm->textStyle.get( i + 1 ).beginIndex;
-                                    memcpy( txt + index, tm->text->getText() + s.beginIndex, max - s.beginIndex );
-                                    index += max - s.beginIndex;
-                                }
-                            }
-                            TextKopieren( txt );
-                            delete[] txt;
-                        }
-                        else
-                            TextKopieren( tm->text->getText() );
-                    }
-                    if( te.taste == 'v' || te.taste == 'V' )
-                    {
-                        char *txt = TextInsert();
-                        if( !tm->getTextStyle( cpos ).selected )
-                            tm->insertText( cpos, txt );
-                        else
-                        {
-                            cpos = tm->getTextStyle( cpos ).beginIndex;
-                            while( cpos > 0 && tm->getTextStyle( cpos - 1 ).selected )
-                                cpos = tm->getTextStyle( cpos - 1 ).beginIndex;
-                        }
-                        replaceAuswahl( txt );
-                        cpos += textLength( txt );
-                        rend = 1;
-                    }
-                    break;
-                }
-                if( istSchreibbar( te.taste ) )
-                {
-                    char buff[] = { (char)te.taste, 0 };
-                    if( !tm->getTextStyle( cpos ).selected )
-                        tm->insertText( cpos, buff );
-                    else
-                    {
-                        cpos = tm->getTextStyle( cpos ).beginIndex;
-                        while( cpos > 0 && tm->getTextStyle( cpos - 1 ).selected )
-                            cpos = tm->getTextStyle( cpos - 1 ).beginIndex;
-                    }
-                    replaceAuswahl( buff );
-                    ++cpos;
-                    rend = 1;
-                }
-                break;
-            }
-        }
-        if( cpos < 0 )
-            cpos = 0;
-        if( cpos > tm->text->getLength() )
-            cpos = tm->text->getLength();
-        if( hatStyle( Style::VScroll ) )
-            updateVScroll( cpos );
-        if( hatStyle( Style::HScroll ) )
-            updateHScroll( cpos );
-        te.verarbeitet = 1;
-    }
-    if( ntakc && te.verarbeitet && nTak )
-        te.verarbeitet = nTak( ntakParam, this, te );
-    release();
-}
-
-void TextFeld::render( Bild &zRObj ) // zeichenet nach zRObj
-{
-    if( hatStyleNicht( Style::Sichtbar ) )
-        return;
-    ZeichnungHintergrund::render( zRObj );
-    if( !tm->text || !tm->renderer )
-        return;
-    lockZeichnung();
-    if( !zRObj.setDrawOptions( innenPosition, innenSize ) )
-    {
-        unlockZeichnung();
-        return;
-    }
-    if( hatStyleNicht( Style::Mehrzeilig ) )
-        tm->text->remove( '\n' );
-    int tbr = getTextWidth();
-    int thi = getTextHeight();
-    int xxx = 0;
-    int yyy = 0;
-    int breite = innenSize.x;
-    int height = innenSize.y;
-    bool hs = horizontalScrollBar && hatStyle( Style::HScroll );
-    bool vs = vertikalScrollBar && hatStyle( Style::VScroll );
-    if( vs )
-        yyy -= vertikalScrollBar->getScroll();
-    if( hs )
-        xxx -= horizontalScrollBar->getScroll();
-    if( hatStyle( Style::HCenter ) && !hs )
-        xxx = ( breite / 2 ) - tbr / 2;
-    if( hatStyle( Style::VCenter ) && !vs )
-        yyy = ( height / 2 ) - thi / 2;
-    int x = xxx;
-    int y = yyy;
-    int len = tm->text->getLength();
-    char *text = tm->text->getText();
-    lockZeichnung();
-    tm->resetIteration();
-    TextStyle &style = tm->currentStyle();
-    int maxLH = 0;
-    for( int i = 0; i <= len; i++ )
-    {
-        int oldX = x;
-        if( i < len &&tm->zCurrentRenderer() )
-            tm->zCurrentRenderer()->renderChar( x, y, istSchreibbar( showChar ) ? showChar : text[ i ],
-                                                zRObj, style.selected ? style.selectedColor : style.fontColor, style.underlined, style.selected, style.selectedBackcroundColor );
-        if( i == cpos && tickVal <= 0.5 && hatStyle( Style::Fokus ) && hatStyle( Style::Editierbar ) && tm->zCurrentRenderer() )
-            zRObj.drawLinieV( oldX, y, tm->zCurrentRenderer()->getZeilenHeight(), 0xFFFF5555 );
-        if( tm->zCurrentRenderer() )
-        {
-            int tmp = tm->zCurrentRenderer()->getZeilenHeight() + tm->zCurrentRenderer()->getZeilenAbstand();
-            maxLH = tmp > maxLH ? tmp : maxLH;
-        }
-        if( i < len && text[ i ] == '\n' )
-        {
-            x = xxx;
-            y += maxLH;
-        }
-        tm->nextStyle();
-    }
-    unlockZeichnung();
-    zRObj.releaseDrawOptions();
-    unlockZeichnung();
+	int th = 0;
+	lockZeichnung();
+	if (tm->text && tm->renderer)
+		th = getTextHeight();
+	unlockZeichnung();
+	return th;
+}
+
+bool TextFeld::tick(double tickval) // tick
+{
+	if (hatStyle(Style::Fokus))
+	{
+		if (tickVal < 0.5 && tickVal + tickval >= 0.5)
+			rend = 1;
+		if (tickVal >= 0.5 && tickVal + tickval >= 1)
+			rend = 1;
+		tickVal += tickval;
+		if (tickVal >= 1)
+			tickVal -= 1;
+	}
+	return ZeichnungHintergrund::tick(tickval);
+}
+
+void TextFeld::doTastaturEreignis(TastaturEreignis& te)
+{
+	bool ntakc = !te.verarbeitet;
+	if (te.verarbeitet || hatStyleNicht(Style::Fokus))
+		return;
+	if (!tak)
+		return;
+	getThis();
+	if (tak(takParam, this, te))
+	{
+		if (hatStyleNicht(Style::Editierbar))
+		{
+			release();
+			return;
+		}
+		if (te.id == TE_Press)
+		{
+			bool shift = TastenStand[T_Shift];
+			bool strg = TastenStand[T_Strg];
+			switch (te.taste)
+			{
+			case T_Entf:
+				if (!tm->getTextStyle(cpos).selected)
+					tm->removeText(cpos, cpos + 1);
+				else
+				{
+					cpos = tm->getTextStyle(cpos).beginIndex;
+					while (cpos > 0 && tm->getTextStyle(cpos - 1).selected)
+						cpos = tm->getTextStyle(cpos - 1).beginIndex;
+				}
+				replaceAuswahl("");
+				deselectAuswahl();
+				rend = 1;
+				break;
+			case T_BackSpace:
+				if (!tm->getTextStyle(cpos).selected)
+				{
+					tm->removeText(cpos - 1, cpos);
+					cpos--;
+				}
+				else
+				{
+					cpos = tm->getTextStyle(cpos).beginIndex;
+					while (cpos > 0 && tm->getTextStyle(cpos - 1).selected)
+						cpos = tm->getTextStyle(cpos - 1).beginIndex;
+				}
+				replaceAuswahl("");
+				deselectAuswahl();
+				rend = 1;
+				break;
+			case T_Enter:
+				if (!tm->getTextStyle(cpos).selected)
+					tm->insertText(cpos, "\n");
+				else
+				{
+					cpos = tm->getTextStyle(cpos).beginIndex;
+					while (cpos > 0 && tm->getTextStyle(cpos - 1).selected)
+						cpos = tm->getTextStyle(cpos - 1).beginIndex;
+				}
+				replaceAuswahl("\n");
+				++cpos;
+				rend = 1;
+				break;
+			case T_Links:
+				if (shift)
+				{
+					if (strg)
+					{
+						int tmp = tm->text->getLKick(cpos);
+						invertAuswahl(tmp, cpos);
+						cpos = tmp;
+					}
+					else
+					{
+						invertAuswahl(cpos - 1, cpos);
+						--cpos;
+					}
+				}
+				else
+				{
+					if (strg)
+						cpos = tm->text->getLKick(cpos);
+					else
+						--cpos;
+					deselectAuswahl();
+				}
+				rend = 1;
+				break;
+			case T_Oben:
+			{
+				int tmp = tm->text->getOKick(cpos);
+				invertAuswahl(tmp, cpos);
+				cpos = tmp;
+				if (!shift)
+					deselectAuswahl();
+				rend = 1;
+				break;
+			}
+			case T_Rechts:
+				if (shift)
+				{
+					if (strg)
+					{
+						int tmp = tm->text->getRKick(cpos);
+						invertAuswahl(cpos, tmp);
+						cpos = tmp;
+					}
+					else
+					{
+						invertAuswahl(cpos, cpos + 1);
+						++cpos;
+					}
+				}
+				else
+				{
+					if (strg)
+						cpos = tm->text->getRKick(cpos);
+					else
+						++cpos;
+					deselectAuswahl();
+				}
+				rend = 1;
+				break;
+			case T_Unten:
+			{
+				int tmp = tm->text->getUKick(cpos);
+				invertAuswahl(cpos, tmp);
+				cpos = tmp;
+				if (!shift)
+					deselectAuswahl();
+				rend = 1;
+				break;
+			}
+			default:
+				if (strg && te.id == TE_Press)
+				{
+					if (te.taste == 'c' || te.taste == 'C')
+					{
+						int sa = tm->textStyle.getEintragAnzahl();
+						int length = 0;
+						for (int i = 0; i < sa; i++)
+						{
+							TextStyle s = tm->textStyle.get(i);
+							if (s.selected)
+							{
+								int max = tm->text->getLength();
+								if (i < sa - 1)
+									max = tm->textStyle.get(i + 1).beginIndex;
+								length += max - s.beginIndex;
+							}
+						}
+						if (length)
+						{
+							char* txt = new char[length + 1];
+							txt[length] = 0;
+							int index = 0;
+							for (int i = 0; i < sa; i++)
+							{
+								TextStyle s = tm->textStyle.get(i);
+								if (s.selected)
+								{
+									int max = tm->text->getLength();
+									if (i < sa - 1)
+										max = tm->textStyle.get(i + 1).beginIndex;
+									memcpy(txt + index, tm->text->getText() + s.beginIndex, max - s.beginIndex);
+									index += max - s.beginIndex;
+								}
+							}
+							TextKopieren(txt);
+							delete[] txt;
+						}
+						else
+							TextKopieren(tm->text->getText());
+					}
+					if (te.taste == 'v' || te.taste == 'V')
+					{
+						char* txt = TextInsert();
+						if (!tm->getTextStyle(cpos).selected)
+							tm->insertText(cpos, txt);
+						else
+						{
+							cpos = tm->getTextStyle(cpos).beginIndex;
+							while (cpos > 0 && tm->getTextStyle(cpos - 1).selected)
+								cpos = tm->getTextStyle(cpos - 1).beginIndex;
+						}
+						replaceAuswahl(txt);
+						cpos += textLength(txt);
+						rend = 1;
+					}
+					break;
+				}
+				if (istSchreibbar(te.taste))
+				{
+					char buff[] = { (char)te.taste, 0 };
+					if (!tm->getTextStyle(cpos).selected)
+						tm->insertText(cpos, buff);
+					else
+					{
+						cpos = tm->getTextStyle(cpos).beginIndex;
+						while (cpos > 0 && tm->getTextStyle(cpos - 1).selected)
+							cpos = tm->getTextStyle(cpos - 1).beginIndex;
+					}
+					replaceAuswahl(buff);
+					++cpos;
+					rend = 1;
+				}
+				break;
+			}
+		}
+		if (cpos < 0)
+			cpos = 0;
+		if (cpos > tm->text->getLength())
+			cpos = tm->text->getLength();
+		if (hatStyle(Style::VScroll))
+			updateVScroll(cpos);
+		if (hatStyle(Style::HScroll))
+			updateHScroll(cpos);
+		te.verarbeitet = 1;
+	}
+	if (ntakc && te.verarbeitet && nTak)
+		te.verarbeitet = nTak(ntakParam, this, te);
+	release();
+}
+
+void TextFeld::render(Bild& zRObj) // zeichenet nach zRObj
+{
+	if (hatStyleNicht(Style::Sichtbar))
+		return;
+	ZeichnungHintergrund::render(zRObj);
+	if (!tm->text || !tm->renderer)
+		return;
+	lockZeichnung();
+	if (!zRObj.setDrawOptions(innenPosition, innenSize))
+	{
+		unlockZeichnung();
+		return;
+	}
+	if (hatStyleNicht(Style::Mehrzeilig))
+		tm->text->remove('\n');
+	int tbr = getTextWidth();
+	int thi = getTextHeight();
+	int xxx = 0;
+	int yyy = 0;
+	int breite = innenSize.x;
+	int height = innenSize.y;
+	bool hs = horizontalScrollBar && hatStyle(Style::HScroll);
+	bool vs = vertikalScrollBar && hatStyle(Style::VScroll);
+	if (vs)
+		yyy -= vertikalScrollBar->getScroll();
+	if (hs)
+		xxx -= horizontalScrollBar->getScroll();
+	if (hatStyle(Style::HCenter) && !hs)
+		xxx = (breite / 2) - tbr / 2;
+	if (hatStyle(Style::VCenter) && !vs)
+		yyy = (height / 2) - thi / 2;
+	int x = xxx;
+	int y = yyy;
+	int len = tm->text->getLength();
+	const char* text = tm->text->getText();
+	lockZeichnung();
+	tm->resetIteration();
+	TextStyle& style = tm->currentStyle();
+	int maxLH = 0;
+	for (int i = 0; i <= len; i++)
+	{
+		int oldX = x;
+		if (i < len&& tm->zCurrentRenderer())
+			tm->zCurrentRenderer()->renderChar(x, y, istSchreibbar(showChar) ? showChar : text[i],
+				zRObj, style.selected ? style.selectedColor : style.fontColor, style.underlined, style.selected, style.selectedBackcroundColor);
+		if (i == cpos && tickVal <= 0.5 && hatStyle(Style::Fokus) && hatStyle(Style::Editierbar) && tm->zCurrentRenderer())
+			zRObj.drawLinieV(oldX, y, tm->zCurrentRenderer()->getZeilenHeight(), 0xFFFF5555);
+		if (tm->zCurrentRenderer())
+		{
+			int tmp = tm->zCurrentRenderer()->getZeilenHeight() + tm->zCurrentRenderer()->getZeilenAbstand();
+			maxLH = tmp > maxLH ? tmp : maxLH;
+		}
+		if (i < len && text[i] == '\n')
+		{
+			x = xxx;
+			y += maxLH;
+		}
+		tm->nextStyle();
+	}
+	unlockZeichnung();
+	zRObj.releaseDrawOptions();
+	unlockZeichnung();
 }
 
 // Konstant 
-Text *TextFeld::getText() const // gibt vom Text zurück
+Text* TextFeld::getText() const // gibt vom Text zurück
 {
-    if( !tm->text )
-        return 0;
-    return dynamic_cast<Text *>( tm->text->getThis() );
+	if (!tm->text)
+		return 0;
+	return dynamic_cast<Text*>(tm->text->getThis());
 }
 
-Text *TextFeld::zText() const // gibt den Text zurück
+Text* TextFeld::zText() const // gibt den Text zurück
 {
-    return tm->text;
+	return tm->text;
 }
 
-Schrift *TextFeld::getSchrift() const// gint getThis der Schrift Zurück
+Schrift* TextFeld::getSchrift() const// gint getThis der Schrift Zurück
 {
-    tm->resetIteration();
-    return tm->zCurrentRenderer() ? tm->zCurrentRenderer()->getSchrift() : 0;
+	tm->resetIteration();
+	return tm->zCurrentRenderer() ? tm->zCurrentRenderer()->getSchrift() : 0;
 }
 
-Schrift *TextFeld::zSchrift() const// gibt die Schrift zurück
+Schrift* TextFeld::zSchrift() const// gibt die Schrift zurück
 {
-    tm->resetIteration();
-    return tm->zCurrentRenderer() ? tm->zCurrentRenderer()->zSchrift() : 0;
+	tm->resetIteration();
+	return tm->zCurrentRenderer() ? tm->zCurrentRenderer()->zSchrift() : 0;
 }
 
 // Gibt die Schrift zurück.
 //  rendererIndex: Der Index des Renderers dessen Schrift zurückgegeben werden soll
 //  return: 0, falls die Schrift nicht gesetzt wurde
-Schrift *TextFeld::getSchrift( int rendererIndex ) const
+Schrift* TextFeld::getSchrift(int rendererIndex) const
 {
-    if( tm->renderer && tm->renderer->z( rendererIndex ) )
-        return tm->renderer->z( rendererIndex )->getSchrift();
-    return 0;
+	if (tm->renderer && tm->renderer->z(rendererIndex))
+		return tm->renderer->z(rendererIndex)->getSchrift();
+	return 0;
 }
 
 // Gibt die Schrift ohne erhöhten Reference Counter zurük
 //  rendererIndex: Der Index des Renderers dessen Schrift zurückgegeben werden soll
 //  return: 0, falls die Schrift nicht gesetzt wurde
-Schrift *TextFeld::zSchrift( int rendererIndex ) const
+Schrift* TextFeld::zSchrift(int rendererIndex) const
 {
-    if( tm->renderer && tm->renderer->z( rendererIndex ) )
-        return tm->renderer->z( rendererIndex )->zSchrift();
-    return 0;
+	if (tm->renderer && tm->renderer->z(rendererIndex))
+		return tm->renderer->z(rendererIndex)->zSchrift();
+	return 0;
 }
 
-TextRenderer *TextFeld::getTextRenderer() const
+TextRenderer* TextFeld::getTextRenderer() const
 {
-    tm->resetIteration();
-    return dynamic_cast<TextRenderer *>( tm->zCurrentRenderer()->getThis() );
+	tm->resetIteration();
+	return dynamic_cast<TextRenderer*>(tm->zCurrentRenderer()->getThis());
 }
 
-TextRenderer *TextFeld::zTextRenderer() const
+TextRenderer* TextFeld::zTextRenderer() const
 {
-    tm->resetIteration();
-    return tm->zCurrentRenderer();
+	tm->resetIteration();
+	return tm->zCurrentRenderer();
 }
 
 // Gibt den TextRenderer zurück.
 //  index: Der Index des Renderers der zurückgegeben werden soll
 //  return: 0, falls der TextRenderer nicht gesetzt wurde
-TextRenderer *TextFeld::getTextRenderer( int index ) const
+TextRenderer* TextFeld::getTextRenderer(int index) const
 {
-    if( tm->renderer && tm->renderer->z( index ) )
-        return tm->renderer->get( index );
-    return 0;
+	if (tm->renderer && tm->renderer->z(index))
+		return tm->renderer->get(index);
+	return 0;
 }
 
 // Gibt dien TextRenderer ohne erhöhten Reference Counter zurük
 //  index: Der Index des Renderers der zurückgegeben werden soll
 //  return: 0, falls der TextRenderer nicht gesetzt wurde
-TextRenderer *TextFeld::zTextRenderer( int index ) const
+TextRenderer* TextFeld::zTextRenderer(int index) const
 {
-    if( tm->renderer && tm->renderer->z( index ) )
-        return tm->renderer->z( index );
-    return 0;
+	if (tm->renderer && tm->renderer->z(index))
+		return tm->renderer->z(index);
+	return 0;
 }
 
 unsigned char TextFeld::getSchriftSize() const // gibt die Schriftgröße zurück
 {
-    tm->resetIteration();
-    return tm->current.fontSize;
+	tm->resetIteration();
+	return tm->current.fontSize;
 }
 
 // Gibt die Schriftgröße zurück
 //  index: Der Index des Zeichens
-unsigned char TextFeld::getSchriftSize( int index ) const
+unsigned char TextFeld::getSchriftSize(int index) const
 {
-    tm->resetIteration();
-    return tm->current.fontSize;
+	tm->resetIteration();
+	return tm->current.fontSize;
 }
 
 int TextFeld::getSchriftFarbe() const// gibt getThis der Schriftfarbe zurück
 {
-    tm->resetIteration();
-    return tm->current.fontColor;
+	tm->resetIteration();
+	return tm->current.fontColor;
 }
 
 // Gibt die Schriftfarbe im A8R8G8B8 Format zurück
 //  index: Der Index des Zeichens
-int TextFeld::getSchriftFarbe( int index ) const
+int TextFeld::getSchriftFarbe(int index) const
 {
-    return tm->getTextStyle( index ).fontColor;
+	return tm->getTextStyle(index).fontColor;
 }
 
 unsigned char TextFeld::getShowChar() const // gibt den Anzeige Char zurück
 {
-    return showChar;
+	return showChar;
 }
 
 int TextFeld::getCursorPos() const
 {
-    return cpos;
+	return cpos;
 }
 
 // Gibt 1 zurück wenn das Zeichen ausgewählt ist
 //  index: Der Index des Zeichens
-bool TextFeld::isCharSelected( int index ) const
+bool TextFeld::isCharSelected(int index) const
 {
-    return tm->getTextStyle( index ).selected;
+	return tm->getTextStyle(index).selected;
 }
 
 // Gibt den Index des Zeichens zurück, das sich unter der Maus befindet
 //  mx: die x position der maus relativ zur position des textfeldes
 //  my: die y position der maus relativ zut position des textfeldes
 //  return: -1, falls sich an der Position kein zeichen befindet
-int TextFeld::getTextIndexAt( int mx, int my ) const
-{
-    if( !tm || !tm->text || !tm->zCurrentRenderer() )
-        return -1;
-    int tbr = getTextWidth();
-    int thi = getTextHeight();
-    int xxx = 0;
-    int yyy = 0;
-    int breite = innenSize.x;
-    int height = innenSize.y;
-    bool hs = horizontalScrollBar && hatStyle( Style::HScroll );
-    bool vs = vertikalScrollBar && hatStyle( Style::VScroll );
-    if( vs )
-        yyy -= vertikalScrollBar->getScroll();
-    if( hs )
-        xxx -= horizontalScrollBar->getScroll();
-    if( hatStyle( Style::HCenter ) && !hs )
-        xxx = ( breite / 2 ) - tbr / 2;
-    if( hatStyle( Style::VCenter ) && !vs )
-        yyy = ( height / 2 ) - thi / 2;
-    int x = xxx;
-    int y = yyy;
-    int len = tm->text->getLength();
-    char *text = tm->text->getText();
-    tm->resetIteration();
-    int maxLH = 0;
-    for( int i = 0; i < len; i++ )
-    {
-        char buff[ 2 ] = { istSchreibbar( showChar ) ? (char)showChar : text[ i ], 0 };
-        int tmpx = tm->zCurrentRenderer()->getTextBreite( buff );
-        int tmpy = tm->zCurrentRenderer()->getZeilenHeight();
-        if( mx >= x && mx < x + tmpx && my >= y && my < y + tmpy )
-            return i;
-        if( mx < x + tmpx && my < y + tmpy )
-            return -1;
-        x += tmpx;
-        tmpy += tm->zCurrentRenderer()->getZeilenAbstand();
-        maxLH = tmpy > maxLH ? tmpy : maxLH;
-        if( text[ i ] == '\n' )
-        {
-            x = xxx;
-            y += maxLH;
-        }
-        tm->nextStyle();
-    }
-    return -1;
+int TextFeld::getTextIndexAt(int mx, int my) const
+{
+	if (!tm || !tm->text || !tm->zCurrentRenderer())
+		return -1;
+	int tbr = getTextWidth();
+	int thi = getTextHeight();
+	int xxx = 0;
+	int yyy = 0;
+	int breite = innenSize.x;
+	int height = innenSize.y;
+	bool hs = horizontalScrollBar && hatStyle(Style::HScroll);
+	bool vs = vertikalScrollBar && hatStyle(Style::VScroll);
+	if (vs)
+		yyy -= vertikalScrollBar->getScroll();
+	if (hs)
+		xxx -= horizontalScrollBar->getScroll();
+	if (hatStyle(Style::HCenter) && !hs)
+		xxx = (breite / 2) - tbr / 2;
+	if (hatStyle(Style::VCenter) && !vs)
+		yyy = (height / 2) - thi / 2;
+	int x = xxx;
+	int y = yyy;
+	int len = tm->text->getLength();
+	const char* text = tm->text->getText();
+	tm->resetIteration();
+	int maxLH = 0;
+	for (int i = 0; i < len; i++)
+	{
+		char buff[2] = { istSchreibbar(showChar) ? (char)showChar : text[i], 0 };
+		int tmpx = tm->zCurrentRenderer()->getTextBreite(buff);
+		int tmpy = tm->zCurrentRenderer()->getZeilenHeight();
+		if (mx >= x && mx < x + tmpx && my >= y && my < y + tmpy)
+			return i;
+		if (mx < x + tmpx && my < y + tmpy)
+			return -1;
+		x += tmpx;
+		tmpy += tm->zCurrentRenderer()->getZeilenAbstand();
+		maxLH = tmpy > maxLH ? tmpy : maxLH;
+		if (text[i] == '\n')
+		{
+			x = xxx;
+			y += maxLH;
+		}
+		tm->nextStyle();
+	}
+	return -1;
 }
 
 // Gibt den Index des Zeichens zurück, vor dem der curser gesetzt wird, wenn mit der maus geklickt wird
 //  mx: die x position der maus relativ zur position des textfeldes
 //  my: die y position der maus relativ zut position des textfeldes
-int TextFeld::getCurserPosAt( int mx, int my ) const
-{
-    if( !tm || !tm->text || !tm->zCurrentRenderer() )
-        return tm->text->getLength();
-    int tbr = getTextWidth();
-    int thi = getTextHeight();
-    int xxx = 0;
-    int yyy = 0;
-    int breite = innenSize.x;
-    int height = innenSize.y;
-    bool hs = horizontalScrollBar && hatStyle( Style::HScroll );
-    bool vs = vertikalScrollBar && hatStyle( Style::VScroll );
-    if( vs )
-        yyy -= vertikalScrollBar->getScroll();
-    if( hs )
-        xxx -= horizontalScrollBar->getScroll();
-    if( hatStyle( Style::HCenter ) && !hs )
-        xxx = ( breite / 2 ) - tbr / 2;
-    if( hatStyle( Style::VCenter ) && !vs )
-        yyy = ( height / 2 ) - thi / 2;
-    int x = xxx;
-    int y = yyy;
-    int len = tm->text->getLength();
-    char *text = tm->text->getText();
-    tm->resetIteration();
-    int maxLH = 0;
-    for( int i = 0; i < len; i++ )
-    {
-        int tmpx = tm->zCurrentRenderer()->getCharWidth( istSchreibbar( showChar ) ? showChar : text[ i ] );
-        int tmpy = tm->zCurrentRenderer()->getZeilenHeight() + tm->zCurrentRenderer()->getZeilenAbstand();
-        if( mx < x + tmpx / 2 && my < y + tmpy - tm->zCurrentRenderer()->getZeilenAbstand() / 2 )
-            return i;
-        x += tmpx + tm->zCurrentRenderer()->getZeichenAbstand();
-        maxLH = tmpy > maxLH ? tmpy : maxLH;
-        if( text[ i ] == '\n' )
-        {
-            if( my >= y - tm->zCurrentRenderer()->getZeilenAbstand() / 2 && my < y + maxLH - tm->zCurrentRenderer()->getZeilenAbstand() / 2 )
-                return i;
-            x = xxx;
-            y += maxLH;
-        }
-        tm->nextStyle();
-    }
-    return tm->text->getLength();
+int TextFeld::getCurserPosAt(int mx, int my) const
+{
+	if (!tm || !tm->text || !tm->zCurrentRenderer())
+		return tm->text->getLength();
+	int tbr = getTextWidth();
+	int thi = getTextHeight();
+	int xxx = 0;
+	int yyy = 0;
+	int breite = innenSize.x;
+	int height = innenSize.y;
+	bool hs = horizontalScrollBar && hatStyle(Style::HScroll);
+	bool vs = vertikalScrollBar && hatStyle(Style::VScroll);
+	if (vs)
+		yyy -= vertikalScrollBar->getScroll();
+	if (hs)
+		xxx -= horizontalScrollBar->getScroll();
+	if (hatStyle(Style::HCenter) && !hs)
+		xxx = (breite / 2) - tbr / 2;
+	if (hatStyle(Style::VCenter) && !vs)
+		yyy = (height / 2) - thi / 2;
+	int x = xxx;
+	int y = yyy;
+	int len = tm->text->getLength();
+	const char* text = tm->text->getText();
+	tm->resetIteration();
+	int maxLH = 0;
+	for (int i = 0; i < len; i++)
+	{
+		int tmpx = tm->zCurrentRenderer()->getCharWidth(istSchreibbar(showChar) ? showChar : text[i]);
+		int tmpy = tm->zCurrentRenderer()->getZeilenHeight() + tm->zCurrentRenderer()->getZeilenAbstand();
+		if (mx < x + tmpx / 2 && my < y + tmpy - tm->zCurrentRenderer()->getZeilenAbstand() / 2)
+			return i;
+		x += tmpx + tm->zCurrentRenderer()->getZeichenAbstand();
+		maxLH = tmpy > maxLH ? tmpy : maxLH;
+		if (text[i] == '\n')
+		{
+			if (my >= y - tm->zCurrentRenderer()->getZeilenAbstand() / 2 && my < y + maxLH - tm->zCurrentRenderer()->getZeilenAbstand() / 2)
+				return i;
+			x = xxx;
+			y += maxLH;
+		}
+		tm->nextStyle();
+	}
+	return tm->text->getLength();
 }
 
 // Gibt den Style eines bestimmten zeichens zurück
 //  index: Der index des Zeichensf
-TextFeld::TextStyle TextFeld::getTextStyle( int index ) const
-{
-    return tm->getTextStyle( index );
-}
-
-Zeichnung *TextFeld::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
-{
-    TextFeld *obj = new TextFeld();
-    obj->setPosition( pos );
-    obj->setSize( gr );
-    obj->setMausEreignisParameter( makParam );
-    obj->setTastaturEreignisParameter( takParam );
-    obj->setMausEreignis( mak );
-    obj->setTastaturEreignis( tak );
-    if( toolTip )
-        obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
-    obj->setStyle( style );
-    obj->tm->renderer->release();
-    obj->tm->renderer = dynamic_cast<RCArray<TextRenderer> *>( tm->renderer->getThis() );
-    obj->tm->textStyle.leeren();
-    for( auto i : tm->textStyle )
-        obj->tm->textStyle.add( i );
-    obj->tm->index = tm->index;
-    obj->tm->styleIndex = tm->styleIndex;
-    obj->tm->current = tm->current;
-    if( tm->text )
-        obj->setText( tm->text->getText() );
-    obj->setHintergrundFarbe( hintergrundFarbe );
-    if( hintergrundFeld )
-        obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
-    if( rahmen )
-        obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
-    if( hintergrundBild )
-        obj->setHintergrundBild( dynamic_cast<Bild *>( hintergrundBild->getThis() ) );
-    if( vertikalScrollBar )
-    {
-        obj->setVertikalKlickScroll( vertikalScrollBar->getKlickScroll() );
-        obj->setVertikalScrollPos( vertikalScrollBar->getScroll() );
-        obj->setVertikalScrollFarbe( vertikalScrollBar->getFarbe(), vertikalScrollBar->getBgFarbe() );
-    }
-    if( horizontalScrollBar )
-    {
-        obj->setHorizontalKlickScroll( horizontalScrollBar->getKlickScroll() );
-        obj->setHorizontalScrollPos( horizontalScrollBar->getScroll() );
-        obj->setHorizontalScrollFarbe( horizontalScrollBar->getFarbe(), horizontalScrollBar->getBgFarbe() );
-    }
-    obj->setSchowChar( showChar );
-    return obj;
+TextFeld::TextStyle TextFeld::getTextStyle(int index) const
+{
+	return tm->getTextStyle(index);
+}
+
+Zeichnung* TextFeld::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
+{
+	TextFeld* obj = new TextFeld();
+	obj->setPosition(pos);
+	obj->setSize(gr);
+	obj->setMausEreignisParameter(makParam);
+	obj->setTastaturEreignisParameter(takParam);
+	obj->setMausEreignis(mak);
+	obj->setTastaturEreignis(tak);
+	if (toolTip)
+		obj->setToolTipZ((ToolTip*)toolTip->dublizieren());
+	obj->setStyle(style);
+	obj->tm->renderer->release();
+	obj->tm->renderer = dynamic_cast<RCArray<TextRenderer> *>(tm->renderer->getThis());
+	obj->tm->textStyle.leeren();
+	for (auto i : tm->textStyle)
+		obj->tm->textStyle.add(i);
+	obj->tm->index = tm->index;
+	obj->tm->styleIndex = tm->styleIndex;
+	obj->tm->current = tm->current;
+	if (tm->text)
+		obj->setText(tm->text->getText());
+	obj->setHintergrundFarbe(hintergrundFarbe);
+	if (hintergrundFeld)
+		obj->setAlphaFeldZ((AlphaFeld*)hintergrundFeld->dublizieren());
+	if (rahmen)
+		obj->setRahmenZ((Rahmen*)rahmen->dublizieren());
+	if (hintergrundBild)
+		obj->setHintergrundBild(dynamic_cast<Bild*>(hintergrundBild->getThis()));
+	if (vertikalScrollBar)
+	{
+		obj->setVertikalKlickScroll(vertikalScrollBar->getKlickScroll());
+		obj->setVertikalScrollPos(vertikalScrollBar->getScroll());
+		obj->setVertikalScrollFarbe(vertikalScrollBar->getFarbe(), vertikalScrollBar->getBgFarbe());
+	}
+	if (horizontalScrollBar)
+	{
+		obj->setHorizontalKlickScroll(horizontalScrollBar->getKlickScroll());
+		obj->setHorizontalScrollPos(horizontalScrollBar->getScroll());
+		obj->setHorizontalScrollFarbe(horizontalScrollBar->getFarbe(), horizontalScrollBar->getBgFarbe());
+	}
+	obj->setSchowChar(showChar);
+	return obj;
 }

+ 11 - 11
UIMLView.cpp

@@ -28,14 +28,14 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 	if (element.hasAttribute("width"))
 	{
 		Text w = element.getAttributeValue("width");
-		width = w;
+		width = (int)w;
 		if (w.getText()[w.getLength() - 1] == '%')
 			width = (int)((pWidth / 100.0) * width);
 	}
 	if (element.hasAttribute("height"))
 	{
 		Text h = element.getAttributeValue("height");
-		height = h;
+		height = (int)h;
 		if (h.getText()[h.getLength() - 1] == '%')
 			height = (int)((pHeight / 100.0) * height);
 	}
@@ -61,7 +61,7 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 		if (element.hasAttribute("margin-left"))
 		{
 			Text mt = element.getAttributeValue("margin-left");
-			int m = mt;
+			int m = (int)mt;
 			if (mt.getText()[mt.getLength() - 1] == '%')
 				m = (int)((pWidth / 100.0) * m);
 			x += m;
@@ -89,7 +89,7 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 		if (element.hasAttribute("margin-right"))
 		{
 			Text mt = element.getAttributeValue("margin-right");
-			int m = mt;
+			int m = (int)mt;
 			if (mt.getText()[mt.getLength() - 1] == '%')
 				m = (int)((pWidth / 100.0) * m);
 			x -= m;
@@ -117,7 +117,7 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 		if (element.hasAttribute("margin-top"))
 		{
 			Text mt = element.getAttributeValue("margin-top");
-			int m = mt;
+			int m = (int)mt;
 			if (mt.getText()[mt.getLength() - 1] == '%')
 				m = (int)((pHeight / 100.0) * m);
 			y += m;
@@ -145,7 +145,7 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 		if (element.hasAttribute("margin-bottom"))
 		{
 			Text mt = element.getAttributeValue("margin-bottom");
-			int m = mt;
+			int m = (int)mt;
 			if (mt.getText()[mt.getLength() - 1] == '%')
 				m = (int)((pHeight / 100.0) * m);
 			y -= m;
@@ -157,14 +157,14 @@ void UIMLElement::layout(XML::Element& element, Zeichnung& z, int pWidth, int pH
 	if (element.hasAttribute("x"))
 	{
 		Text xt = element.getAttributeValue("x");
-		x = xt;
+		x = (int)xt;
 		if (xt.getText()[xt.getLength() - 1] == '%')
 			x = (int)((pWidth / 100.0) * x);
 	}
 	if (element.hasAttribute("y"))
 	{
 		Text yt = element.getAttributeValue("y");
-		y = yt;
+		y = (int)yt;
 		if (yt.getText()[yt.getLength() - 1] == '%')
 			y = (int)((pHeight / 100.0) * y);
 	}
@@ -354,7 +354,7 @@ Zeichnung* UIMLTable::parseElement(XML::Element& element, UIMLContainer& general
 				if (t->getSpaltenAnzahl() < c)
 					t->addSpalte(Text(c - 1));
 				if (z)
-					t->setZeichnungZ((char*)Text(c - 1), (char*)line, dynamic_cast<Zeichnung*>(z->getThis()));
+					t->setZeichnungZ(Text(c - 1), line, dynamic_cast<Zeichnung*>(z->getThis()));
 				c++;
 			}
 		}
@@ -373,7 +373,7 @@ void UIMLTable::layout(XML::Element& element, Zeichnung& z, int pWidth, int pHei
 	{
 		if (element.hasAttribute("line-height"))
 		{
-			int height = element.getAttributeValue("line-height");
+			int height = (int)element.getAttributeValue("line-height");
 			for (int i = 0; i < objT->getZeilenAnzahl(); i++)
 				objT->setZeilenHeight(i, height);
 		}
@@ -412,7 +412,7 @@ void UIMLFrame::layout(XML::Element& element, Zeichnung& z, int pWidth, int pHei
 	if (element.hasAttribute("title"))
 		((Fenster*)&z)->setTitel(element.getAttributeValue("title"));
 	if (element.hasAttribute("title-height"))
-		((Fenster*)&z)->zTTextFeld()->setSize(((Fenster*)&z)->zTTextFeld()->getBreite(), element.getAttributeValue("title-height"));
+		((Fenster*)&z)->zTTextFeld()->setSize(((Fenster*)&z)->zTTextFeld()->getBreite(), (int)element.getAttributeValue("title-height"));
 	UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
 }
 

+ 111 - 111
UIPixelShader.h

@@ -353,10 +353,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67, 161,   4, 
-    101, 159,  34,  15, 255, 222, 
-    239,  31, 113, 201,  84, 112, 
-    142, 193,   1,   0,   0,   0, 
+     68,  88,  66,  67,  47, 227, 
+    110, 209,  31,  11,  37, 249, 
+    196, 222,  82, 135,  45, 114, 
+     75, 154,   1,   0,   0,   0, 
      64, 134,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     192,   6,   0,   0,  80,   7, 
@@ -1815,10 +1815,10 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    247,  68, 143,  98,   1,   0, 
-      0,   0,  51, 188,  51, 171, 
-    255,  42, 148,  71, 164,  20, 
-     96,  58,  36,   2,  35,  19, 
+    104,   3, 161,  98,   1,   0, 
+      0,   0, 117,  93, 185, 101, 
+    182, 125, 188,  78, 131, 164, 
+    108, 238, 212, 206, 150, 159, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1990,9 +1990,9 @@ const BYTE UIPixelShader[] =
     242,  56,   1,   0,  43, 236, 
       3,   0,  28,  19,   2,   0, 
      65,  36,   1,   0, 236, 179, 
-      1,   0, 115, 135,   3,   0, 
+      1,   0, 240,  37,   2,   0, 
     125,  10,   2,   0, 125, 181, 
-      2,   0, 253, 203,   2,   0, 
+      2,   0, 122,  76,   0,   0, 
     193,  33,   3,   0,  65, 185, 
       2,   0,   9, 241,   2,   0, 
     146, 230,   3,   0, 125, 218, 
@@ -2000,11 +2000,11 @@ const BYTE UIPixelShader[] =
     202, 179,   0,   0, 125, 226, 
       0,   0, 220, 192,   1,   0, 
     201, 241,   2,   0,  12, 238, 
-      0,   0, 218, 152,   2,   0, 
+      0,   0, 232, 163,   0,   0, 
     162, 254,   2,   0, 228, 199, 
       3,   0, 110,  77,   0,   0, 
-    144, 132,   1,   0, 103, 185, 
-      1,   0,  42, 246,   0,   0, 
+    144, 132,   1,   0, 123, 190, 
+      3,   0,  42, 246,   0,   0, 
     240, 203,   3,   0,   0,  16, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3010,8 +3010,8 @@ const BYTE UIPixelShader[] =
     120, 116, 117, 114, 101,  50, 
      68,  32, 115, 104,  97, 100, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,  59, 190, 131,   2, 
-    225, 112, 216,   1,   1,   0, 
+      0,   0, 127, 105, 191, 131, 
+    116, 123, 216,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4122,7 +4122,7 @@ const BYTE UIPixelShader[] =
     102, 102, 117, 115, 101,  76, 
     105, 103, 104, 116,   0, 241, 
      14,   0,  23,  21,  22,  16, 
-      0,   0,  26,   2,   0,   0, 
+      0,   0,  26,   2,  80,   0, 
       0,   0, 242, 241,  10,   0, 
      24,  21,  23,  16,   0,   0, 
       1,   0,   1,   0,  10,   0, 
@@ -4145,7 +4145,7 @@ const BYTE UIPixelShader[] =
     116,  76, 105, 103, 104, 116, 
       0, 243, 242, 241,  14,   0, 
      23,  21,  27,  16,   0,   0, 
-     26,   2,   0,   0,   0,   0, 
+     26,   2,  80,   0,   0,   0, 
     242, 241,  10,   0,  24,  21, 
      28,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
@@ -4253,14 +4253,14 @@ const BYTE UIPixelShader[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2, 176, 121,   0,   0, 
+      3,   2,  80,   0,   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, 121,   0,   0, 242, 241, 
+     80,   0,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -5483,52 +5483,69 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 148,  46, 
-     49,   1, 247,  68, 143,  98, 
-      1,   0,   0,   0,  51, 188, 
-     51, 171, 255,  42, 148,  71, 
-    164,  20,  96,  58,  36,   2, 
-     35,  19, 128,   0,   0,   0, 
-     47,  76, 105, 110, 107,  73, 
-    110, 102, 111,   0,  47, 110, 
-     97, 109, 101, 115,   0,  47, 
-    115, 114,  99,  47, 104, 101, 
-     97, 100, 101, 114,  98, 108, 
-    111,  99, 107,   0,  47, 115, 
-    114,  99,  47, 102, 105, 108, 
-    101, 115,  47,  99,  58,  92, 
-    117, 115, 101, 114, 115,  92, 
-    107, 111, 108, 106,  97,  92, 
-    100, 101, 115, 107, 116, 111, 
-    112,  92, 107, 111, 108, 106, 
-     97,  45, 115, 116, 114, 111, 
-    104, 109,  45, 103,  97, 109, 
-    101, 115,  92,  97, 108, 108, 
-    103, 101, 109, 101, 105, 110, 
-     92, 102, 114,  97, 109, 101, 
-    119, 111, 114, 107,  92, 100, 
-    120,  49,  49, 112, 105, 120, 
-    101, 108, 115, 104,  97, 100, 
-    101, 114,  46, 104, 108, 115, 
-    108,   0,   4,   0,   0,   0, 
-      6,   0,   0,   0,   1,   0, 
-      0,   0,  58,   0,   0,   0, 
-      0,   0,   0,   0,  17,   0, 
-      0,   0,   7,   0,   0,   0, 
-     10,   0,   0,   0,   6,   0, 
-      0,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  34,   0, 
-      0,   0,   8,   0,   0,   0, 
-      0,   0,   0,   0, 220,  81, 
-     51,   1,   0,   0,   0,   0, 
+      0,   0,   0,   0, 255, 255, 
+    255, 255, 119,   9,  49,   1, 
+      1,   0,   0,   0,  13,   0, 
+      0, 142,  14,   0,  63,  92, 
+     15,   0,   0,   0,  88,   0, 
+      0,   0,  32,   0,   0,   0, 
+     44,   0,   0,   0,  96,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,  22,   0, 
+      0,   0,  25,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      1,   0,   0,   0,   0,   0, 
+      0,   0,  16,  16,   0,   0, 
+     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   2,   0, 
+      9,   0, 204,   8,   0,   0, 
+      0,   0,   0,   0, 164,  14, 
+      0,   0,   1,   0,   0,   0, 
+    160, 166, 136,   2,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+     84, 101, 120, 116, 117, 114, 
+    101,  80, 105, 120, 101, 108, 
+     83, 104,  97, 100, 101, 114, 
+      0, 110, 111, 110, 101,   0, 
+     45, 186,  46, 241,   1,   0, 
       0,   0,   0,   0,   0,   0, 
+     16,  16,   0,   0,  32,   0, 
+      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   2,   0,   2,   0, 
+      7,   0,   0,   0,   0,   0, 
+      1,   0, 255, 255, 255, 255, 
+      0,   0,   0,   0,  16,  16, 
+      0,   0,   8,   2,   0,   0, 
+      0,   0,   0,   0, 255, 255, 
+    255, 255,   0,   0,   0,   0, 
+    255, 255, 255, 255,   1,   0, 
+      1,   0,   0,   0,   1,   0, 
+      0,   0,   0,   0,  67,  58, 
+     92,  85, 115, 101, 114, 115, 
+     92, 107, 111, 108, 106,  97, 
+     92,  68, 101, 115, 107, 116, 
+    111, 112,  92,  75, 111, 108, 
+    106,  97,  45,  83, 116, 114, 
+    111, 104, 109,  45,  71,  97, 
+    109, 101, 115,  92,  65, 108, 
+    108, 103, 101, 109, 101, 105, 
+    110,  92,  70, 114,  97, 109, 
+    101, 119, 111, 114, 107,  92, 
+     68,  88,  49,  49,  80, 105, 
+    120, 101, 108,  83, 104,  97, 
+    100, 101, 114,  46, 104, 108, 
+    115, 108,   0,   0, 254, 239, 
+    254, 239,   1,   0,   0,   0, 
+      1,   0,   0,   0,   0,   1, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255, 255, 255,  12,   0, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255, 255, 255,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -5552,8 +5569,43 @@ 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, 104,   3, 
+    161,  98,   1,   0,   0,   0, 
+    117,  93, 185, 101, 182, 125, 
+    188,  78, 131, 164, 108, 238, 
+    212, 206, 150, 159, 128,   0, 
+      0,   0,  47,  76, 105, 110, 
+    107,  73, 110, 102, 111,   0, 
+     47, 110,  97, 109, 101, 115, 
+      0,  47, 115, 114,  99,  47, 
+    104, 101,  97, 100, 101, 114, 
+     98, 108, 111,  99, 107,   0, 
+     47, 115, 114,  99,  47, 102, 
+    105, 108, 101, 115,  47,  99, 
+     58,  92, 117, 115, 101, 114, 
+    115,  92, 107, 111, 108, 106, 
+     97,  92, 100, 101, 115, 107, 
+    116, 111, 112,  92, 107, 111, 
+    108, 106,  97,  45, 115, 116, 
+    114, 111, 104, 109,  45, 103, 
+     97, 109, 101, 115,  92,  97, 
+    108, 108, 103, 101, 109, 101, 
+    105, 110,  92, 102, 114,  97, 
+    109, 101, 119, 111, 114, 107, 
+     92, 100, 120,  49,  49, 112, 
+    105, 120, 101, 108, 115, 104, 
+     97, 100, 101, 114,  46, 104, 
+    108, 115, 108,   0,   4,   0, 
+      0,   0,   6,   0,   0,   0, 
+      1,   0,   0,   0,  58,   0, 
       0,   0,   0,   0,   0,   0, 
+     17,   0,   0,   0,   7,   0, 
+      0,   0,  10,   0,   0,   0, 
+      6,   0,   0,   0,   0,   0, 
+      0,   0,   5,   0,   0,   0, 
+     34,   0,   0,   0,   8,   0, 
       0,   0,   0,   0,   0,   0, 
+    220,  81,  51,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -5569,68 +5621,16 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255, 119,   9, 
-     49,   1,   1,   0,   0,   0, 
-     13,   0,   0, 142,  14,   0, 
-     63,  92,  15,   0,   0,   0, 
-     88,   0,   0,   0,  32,   0, 
-      0,   0,  44,   0,   0,   0, 
-     96,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-     22,   0,   0,   0,  25,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  16,  16, 
-      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      2,   0,   9,   0, 204,   8, 
       0,   0,   0,   0,   0,   0, 
-    164,  14,   0,   0,   1,   0, 
-     20, 186,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,  84, 101, 120, 116, 
-    117, 114, 101,  80, 105, 120, 
-    101, 108,  83, 104,  97, 100, 
-    101, 114,   0, 110, 111, 110, 
-    101,   0,  45, 186,  46, 241, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,  16,  16,   0,   0, 
-     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      2,   0,   7,   0,   0,   0, 
-      0,   0,   1,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-     16,  16,   0,   0,   8,   2, 
       0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      1,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-     67,  58,  92,  85, 115, 101, 
-    114, 115,  92, 107, 111, 108, 
-    106,  97,  92,  68, 101, 115, 
-    107, 116, 111, 112,  92,  75, 
-    111, 108, 106,  97,  45,  83, 
-    116, 114, 111, 104, 109,  45, 
-     71,  97, 109, 101, 115,  92, 
-     65, 108, 108, 103, 101, 109, 
-    101, 105, 110,  92,  70, 114, 
-     97, 109, 101, 119, 111, 114, 
-    107,  92,  68,  88,  49,  49, 
-     80, 105, 120, 101, 108,  83, 
-    104,  97, 100, 101, 114,  46, 
-    104, 108, 115, 108,   0,   0, 
-    254, 239, 254, 239,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   1,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0, 255, 255, 255, 255, 255, 
-    255, 255, 255, 255, 255,  12, 
-      0, 255, 255, 255, 255, 255, 
-    255, 255, 255, 255, 255,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -5666,9 +5666,9 @@ const BYTE UIPixelShader[] =
      40,   0,   0,   0, 188,   2, 
       0,   0,  44,   0,   0,   0, 
     248,   1,   0,   0,   3,   0, 
-      0,   0,  48,   0,   0,   0, 
-     33,   0,   0,   0,  32,   0, 
       0,   0,  49,   0,   0,   0, 
+     33,   0,   0,   0,  32,   0, 
+      0,   0,  48,   0,   0,   0, 
      34,   0,   0,   0,  18,   0, 
       0,   0,   6,   0,   0,   0, 
      35,   0,   0,   0,  36,   0, 

+ 107 - 107
UIVertexShader.h

@@ -121,10 +121,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67,  82,  95, 
-    215, 127,  52, 245,  78, 111, 
-    103,  99, 103, 178, 161, 129, 
-    247,  97,   1,   0,   0,   0, 
+     68,  88,  66,  67, 211, 251, 
+    248,  47,  73, 245, 140,   8, 
+     95,  19,  34,  70, 142, 206, 
+      6, 104,   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, 
-    248,  68, 143,  98,   1,   0, 
-      0,   0, 120,  78, 132, 176, 
-    223, 186,  11,  76, 132, 199, 
-     43,  72, 162,   8, 228, 202, 
+    104,   3, 161,  98,   1,   0, 
+      0,   0,  99,  76, 246, 186, 
+    201, 112,  58,  79, 177,  25, 
+    140,  96,  86, 184, 159, 242, 
       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,  57, 235, 193,   2, 
-    225, 112, 216,   1,   1,   0, 
+      0,   0, 242, 198,  21, 132, 
+    116, 123, 216,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2928,52 +2928,69 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0, 148,  46,  49,   1, 
-    248,  68, 143,  98,   1,   0, 
-      0,   0, 120,  78, 132, 176, 
-    223, 186,  11,  76, 132, 199, 
-     43,  72, 162,   8, 228, 202, 
-    129,   0,   0,   0,  47,  76, 
-    105, 110, 107,  73, 110, 102, 
-    111,   0,  47, 110,  97, 109, 
-    101, 115,   0,  47, 115, 114, 
-     99,  47, 104, 101,  97, 100, 
-    101, 114,  98, 108, 111,  99, 
-    107,   0,  47, 115, 114,  99, 
-     47, 102, 105, 108, 101, 115, 
-     47,  99,  58,  92, 117, 115, 
-    101, 114, 115,  92, 107, 111, 
-    108, 106,  97,  92, 100, 101, 
-    115, 107, 116, 111, 112,  92, 
-    107, 111, 108, 106,  97,  45, 
-    115, 116, 114, 111, 104, 109, 
-     45, 103,  97, 109, 101, 115, 
-     92,  97, 108, 108, 103, 101, 
-    109, 101, 105, 110,  92, 102, 
-    114,  97, 109, 101, 119, 111, 
-    114, 107,  92, 100, 120,  49, 
-     49, 118, 101, 114, 116, 101, 
-    120, 115, 104,  97, 100, 101, 
-    114,  46, 104, 108, 115, 108, 
-      0,   4,   0,   0,   0,   6, 
-      0,   0,   0,   1,   0,   0, 
-      0,  30,   0,   0,   0,   0, 
-      0,   0,   0,  17,   0,   0, 
-      0,   7,   0,   0,   0,  34, 
-      0,   0,   0,   8,   0,   0, 
-      0,  10,   0,   0,   0,   6, 
-      0,   0,   0,   0,   0,   0, 
-      0,   5,   0,   0,   0,   0, 
-      0,   0,   0, 220,  81,  51, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+    119,   9,  49,   1,   1,   0, 
+      0,   0,  13,   0,   0, 142, 
+     14,   0,  63,  92,  15,   0, 
+      0,   0,  92,   0,   0,   0, 
+     32,   0,   0,   0,  44,   0, 
+      0,   0,  96,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,  22,   0,   0,   0, 
+     25,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
+    196,   3,   0,   0,  32,   0, 
+      0,  96,   0,   0, 159, 242, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   2,   0,   9,   0, 
+    104,   5,   0,   0,   0,   0, 
+      0,   0, 236,   2,   0,   0, 
+      1,   0,   0,   0, 224, 216, 
+    196,   2,   0,   0,   0,   0, 
+      0,   0,   0,   0,  84, 101, 
+    120, 116, 117, 114, 101,  86, 
+    101, 114, 116, 101, 120,  83, 
+    104,  97, 100, 101, 114,   0, 
+    110, 111, 110, 101,   0,   0, 
+      0,   0,  45, 186,  46, 241, 
+      1,   0,   0,   0,   0,   0, 
+      0,   0, 196,   3,   0,   0, 
+     32,   0,   0,  96,   0,   0, 
+    159, 242,   0,   0,   0,   0, 
+      0,   0,   0,   0,   2,   0, 
+      2,   0,   7,   0,   0,   0, 
+      0,   0,   1,   0, 255, 255, 
+    255, 255,   0,   0,   0,   0, 
+    196,   3,   0,   0,   8,   2, 
       0,   0,   0,   0,   0,   0, 
+    255, 255, 255, 255,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+      1,   0,   1,   0,   0,   0, 
+      1,   0,   0,   0,   0,   0, 
+     67,  58,  92,  85, 115, 101, 
+    114, 115,  92, 107, 111, 108, 
+    106,  97,  92,  68, 101, 115, 
+    107, 116, 111, 112,  92,  75, 
+    111, 108, 106,  97,  45,  83, 
+    116, 114, 111, 104, 109,  45, 
+     71,  97, 109, 101, 115,  92, 
+     65, 108, 108, 103, 101, 109, 
+    101, 105, 110,  92,  70, 114, 
+     97, 109, 101, 119, 111, 114, 
+    107,  92,  68,  88,  49,  49, 
+     86, 101, 114, 116, 101, 120, 
+     83, 104,  97, 100, 101, 114, 
+     46, 104, 108, 115, 108,   0, 
+    254, 239, 254, 239,   1,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   1,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0, 255, 255, 255, 255, 255, 
+    255, 255, 255, 255, 255,  12, 
+      0, 255, 255, 255, 255, 255, 
+    255, 255, 255, 255, 255,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2996,6 +3013,44 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0, 148,  46, 
+     49,   1, 104,   3, 161,  98, 
+      1,   0,   0,   0,  99,  76, 
+    246, 186, 201, 112,  58,  79, 
+    177,  25, 140,  96,  86, 184, 
+    159, 242, 129,   0,   0,   0, 
+     47,  76, 105, 110, 107,  73, 
+    110, 102, 111,   0,  47, 110, 
+     97, 109, 101, 115,   0,  47, 
+    115, 114,  99,  47, 104, 101, 
+     97, 100, 101, 114,  98, 108, 
+    111,  99, 107,   0,  47, 115, 
+    114,  99,  47, 102, 105, 108, 
+    101, 115,  47,  99,  58,  92, 
+    117, 115, 101, 114, 115,  92, 
+    107, 111, 108, 106,  97,  92, 
+    100, 101, 115, 107, 116, 111, 
+    112,  92, 107, 111, 108, 106, 
+     97,  45, 115, 116, 114, 111, 
+    104, 109,  45, 103,  97, 109, 
+    101, 115,  92,  97, 108, 108, 
+    103, 101, 109, 101, 105, 110, 
+     92, 102, 114,  97, 109, 101, 
+    119, 111, 114, 107,  92, 100, 
+    120,  49,  49, 118, 101, 114, 
+    116, 101, 120, 115, 104,  97, 
+    100, 101, 114,  46, 104, 108, 
+    115, 108,   0,   4,   0,   0, 
+      0,   6,   0,   0,   0,   1, 
+      0,   0,   0,  30,   0,   0, 
+      0,   0,   0,   0,   0,  17, 
+      0,   0,   0,   7,   0,   0, 
+      0,  34,   0,   0,   0,   8, 
+      0,   0,   0,  10,   0,   0, 
+      0,   6,   0,   0,   0,   0, 
+      0,   0,   0,   5,   0,   0, 
+      0,   0,   0,   0,   0, 220, 
+     81,  51,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3013,70 +3068,15 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255, 119,   9,  49,   1, 
-      1,   0,   0,   0,  13,   0, 
-      0, 142,  14,   0,  63,  92, 
-     15,   0,   0,   0,  92,   0, 
-      0,   0,  32,   0,   0,   0, 
-     44,   0,   0,   0,  96,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  22,   0, 
-      0,   0,  25,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 196,   3,   0,   0, 
-     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      9,   0, 104,   5,   0,   0, 
-      0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0, 123, 196, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-     84, 101, 120, 116, 117, 114, 
-    101,  86, 101, 114, 116, 101, 
-    120,  83, 104,  97, 100, 101, 
-    114,   0, 110, 111, 110, 101, 
-      0,   0,   0,   0,  45, 186, 
-     46, 241,   1,   0,   0,   0, 
-      0,   0,   0,   0, 196,   3, 
-      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      2,   0,   2,   0,   7,   0, 
-      0,   0,   0,   0,   1,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 196,   3,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   1,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,  67,  58,  92,  85, 
-    115, 101, 114, 115,  92, 107, 
-    111, 108, 106,  97,  92,  68, 
-    101, 115, 107, 116, 111, 112, 
-     92,  75, 111, 108, 106,  97, 
-     45,  83, 116, 114, 111, 104, 
-    109,  45,  71,  97, 109, 101, 
-    115,  92,  65, 108, 108, 103, 
-    101, 109, 101, 105, 110,  92, 
-     70, 114,  97, 109, 101, 119, 
-    111, 114, 107,  92,  68,  88, 
-     49,  49,  86, 101, 114, 116, 
-    101, 120,  83, 104,  97, 100, 
-    101, 114,  46, 104, 108, 115, 
-    108,   0, 254, 239, 254, 239, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   0,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,  12,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3111,8 +3111,8 @@ const BYTE UIVertexShader[] =
       0,   0,  68,   2,   0,   0, 
      44,   0,   0,   0, 132,   0, 
       0,   0,   3,   0,   0,   0, 
-     29,   0,   0,   0,  19,   0, 
-      0,   0,  30,   0,   0,   0, 
+     30,   0,   0,   0,  19,   0, 
+      0,   0,  29,   0,   0,   0, 
      20,   0,   0,   0,  12,   0, 
       0,   0,   6,   0,   0,   0, 
      21,   0,   0,   0,  22,   0, 

+ 72 - 72
Zeit.cpp

@@ -141,17 +141,17 @@ int Uhrzeit::setUhrzeit(const char* format, const char* zeit) // format Beispiel
 		switch (*f)
 		{
 		case 'h':
-			stunde = TextZuInt((char*)zeit, &ende, 10);
+			stunde = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			minute = TextZuInt((char*)zeit, &ende, 10);
+			minute = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sekunde = TextZuInt((char*)zeit, &ende, 10);
+			sekunde = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -213,17 +213,17 @@ int Uhrzeit::plusUhrzeit(const char* format, const char* zeit)
 		switch (*f)
 		{
 		case 'h':
-			stunde += TextZuInt((char*)zeit, &ende, 10);
+			stunde += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			minute += TextZuInt((char*)zeit, &ende, 10);
+			minute += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sekunde += TextZuInt((char*)zeit, &ende, 10);
+			sekunde += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -286,17 +286,17 @@ int Uhrzeit::minusUhrzeit(const char* format, const char* zeit)
 		switch (*f)
 		{
 		case 'h':
-			stunde -= TextZuInt((char*)zeit, &ende, 10);
+			stunde -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			minute -= TextZuInt((char*)zeit, &ende, 10);
+			minute -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sekunde -= TextZuInt((char*)zeit, &ende, 10);
+			sekunde -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -393,17 +393,17 @@ bool Uhrzeit::istGleich(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'h':
-			st = TextZuInt((char*)zeit, &ende, 10);
+			st = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			min = TextZuInt((char*)zeit, &ende, 10);
+			min = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sek = TextZuInt((char*)zeit, &ende, 10);
+			sek = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -488,17 +488,17 @@ bool Uhrzeit::istKleiner(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'h':
-			st = TextZuInt((char*)zeit, &ende, 10);
+			st = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			min = TextZuInt((char*)zeit, &ende, 10);
+			min = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sek = TextZuInt((char*)zeit, &ende, 10);
+			sek = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -558,17 +558,17 @@ bool Uhrzeit::istLater(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'h':
-			st = TextZuInt((char*)zeit, &ende, 10);
+			st = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			min = TextZuInt((char*)zeit, &ende, 10);
+			min = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			sek = TextZuInt((char*)zeit, &ende, 10);
+			sek = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -680,17 +680,17 @@ void Datum::setDatum(const char* format, const char* datum) // format Beispiele:
 		switch (*f)
 		{
 		case 'y':
-			jahr = TextZuInt((char*)datum, &ende, 10);
+			jahr = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			monat = TextZuInt((char*)datum, &ende, 10);
+			monat = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			tag = TextZuInt((char*)datum, &ende, 10);
+			tag = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -752,17 +752,17 @@ void Datum::plusDatum(const char* format, const char* datum)
 		switch (*f)
 		{
 		case 'y':
-			jahr += TextZuInt((char*)datum, &ende, 10);
+			jahr += TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			monat += TextZuInt((char*)datum, &ende, 10);
+			monat += TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			tag += TextZuInt((char*)datum, &ende, 10);
+			tag += TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -824,17 +824,17 @@ void Datum::minusDatum(const char* format, const char* datum)
 		switch (*f)
 		{
 		case 'y':
-			jahr -= TextZuInt((char*)datum, &ende, 10);
+			jahr -= TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			monat -= TextZuInt((char*)datum, &ende, 10);
+			monat -= TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			tag -= TextZuInt((char*)datum, &ende, 10);
+			tag -= TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -930,17 +930,17 @@ bool Datum::istGleich(const char* format, const char* datum) const
 		switch (*f)
 		{
 		case 'y':
-			j = TextZuInt((char*)datum, &ende, 10);
+			j = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)datum, &ende, 10);
+			m = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			t = TextZuInt((char*)datum, &ende, 10);
+			t = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -1025,17 +1025,17 @@ bool Datum::istKleiner(const char* format, const char* datum) const
 		switch (*f)
 		{
 		case 'y':
-			j = TextZuInt((char*)datum, &ende, 10);
+			j = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)datum, &ende, 10);
+			m = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			t = TextZuInt((char*)datum, &ende, 10);
+			t = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -1095,17 +1095,17 @@ bool Datum::istLater(const char* format, const char* datum) const
 		switch (*f)
 		{
 		case 'y':
-			j = TextZuInt((char*)datum, &ende, 10);
+			j = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)datum, &ende, 10);
+			m = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
 		case 'd':
-			t = TextZuInt((char*)datum, &ende, 10);
+			t = TextZuInt(datum, &ende, 10);
 			datum = ende;
 			ende = 0;
 			break;
@@ -1169,32 +1169,32 @@ void Zeit::setZeit(const char* format, const char* zeit) // format Beispiele: "Y
 		switch (*f)
 		{
 		case 'y':
-			y = TextZuInt((char*)zeit, &ende, 10);
+			y = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)zeit, &ende, 10);
+			m = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d = TextZuInt((char*)zeit, &ende, 10);
+			d = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h = TextZuInt((char*)zeit, &ende, 10);
+			h = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i = TextZuInt((char*)zeit, &ende, 10);
+			i = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s = TextZuInt((char*)zeit, &ende, 10);
+			s = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -1272,32 +1272,32 @@ void Zeit::plusZeit(const char* format, const char* zeit)
 		switch (*f)
 		{
 		case 'y':
-			y += TextZuInt((char*)zeit, &ende, 10);
+			y += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m += TextZuInt((char*)zeit, &ende, 10);
+			m += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d += TextZuInt((char*)zeit, &ende, 10);
+			d += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h += TextZuInt((char*)zeit, &ende, 10);
+			h += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i += TextZuInt((char*)zeit, &ende, 10);
+			i += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s += TextZuInt((char*)zeit, &ende, 10);
+			s += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -1375,32 +1375,32 @@ void Zeit::minusZeit(const char* format, const char* zeit)
 		switch (*f)
 		{
 		case 'y':
-			y -= TextZuInt((char*)zeit, &ende, 10);
+			y -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m -= TextZuInt((char*)zeit, &ende, 10);
+			m -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d -= TextZuInt((char*)zeit, &ende, 10);
+			d -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h += TextZuInt((char*)zeit, &ende, 10);
+			h += TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i -= TextZuInt((char*)zeit, &ende, 10);
+			i -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s -= TextZuInt((char*)zeit, &ende, 10);
+			s -= TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -1506,32 +1506,32 @@ bool Zeit::istGleich(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'y':
-			y = TextZuInt((char*)zeit, &ende, 10);
+			y = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)zeit, &ende, 10);
+			m = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d = TextZuInt((char*)zeit, &ende, 10);
+			d = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h = TextZuInt((char*)zeit, &ende, 10);
+			h = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i = TextZuInt((char*)zeit, &ende, 10);
+			i = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s = TextZuInt((char*)zeit, &ende, 10);
+			s = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -1633,32 +1633,32 @@ bool Zeit::istKleiner(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'y':
-			y = TextZuInt((char*)zeit, &ende, 10);
+			y = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)zeit, &ende, 10);
+			m = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d = TextZuInt((char*)zeit, &ende, 10);
+			d = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h = TextZuInt((char*)zeit, &ende, 10);
+			h = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i = TextZuInt((char*)zeit, &ende, 10);
+			i = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s = TextZuInt((char*)zeit, &ende, 10);
+			s = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
@@ -1745,32 +1745,32 @@ bool Zeit::istLater(const char* format, const char* zeit) const
 		switch (*f)
 		{
 		case 'y':
-			y = TextZuInt((char*)zeit, &ende, 10);
+			y = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'm':
-			m = TextZuInt((char*)zeit, &ende, 10);
+			m = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'd':
-			d = TextZuInt((char*)zeit, &ende, 10);
+			d = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'h':
-			h = TextZuInt((char*)zeit, &ende, 10);
+			h = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 'i':
-			i = TextZuInt((char*)zeit, &ende, 10);
+			i = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;
 		case 's':
-			s = TextZuInt((char*)zeit, &ende, 10);
+			s = TextZuInt(zeit, &ende, 10);
 			zeit = ende;
 			ende = 0;
 			break;