Browse Source

Neues Mausereignis Verarbeitungssystem

Kolja Strohm 5 years ago
parent
commit
519dc6644c
29 changed files with 1396 additions and 1705 deletions
  1. 101 165
      AuswahlBox.cpp
  2. 9 4
      AuswahlBox.h
  3. 82 123
      Bild.cpp
  4. 4 3
      Bild.h
  5. 4 4
      Bildschirm.cpp
  6. 22 70
      Diagramm.cpp
  7. 3 3
      Diagramm.h
  8. 309 348
      Fenster.cpp
  9. 4 4
      Fenster.h
  10. 48 144
      Knopf.cpp
  11. 6 6
      Knopf.h
  12. 100 144
      Liste.cpp
  13. 3 3
      Liste.h
  14. 50 89
      M2DVorschau.cpp
  15. 3 3
      M2DVorschau.h
  16. 2 6
      MausEreignis.h
  17. 7 12
      Model2D.cpp
  18. 3 3
      Model2D.h
  19. 12 0
      Scroll.cpp
  20. 239 266
      Tabelle.cpp
  21. 4 4
      Tabelle.h
  22. 140 204
      TextFeld.cpp
  23. 3 3
      TextFeld.h
  24. 72 23
      ToolTip.cpp
  25. 3 3
      ToolTip.h
  26. 65 33
      UIMLView.cpp
  27. 3 3
      UIMLView.h
  28. 76 31
      Zeichnung.cpp
  29. 19 1
      Zeichnung.h

+ 101 - 165
AuswahlBox.cpp

@@ -113,6 +113,98 @@ AuswahlBox::~AuswahlBox()
         msMausBgF->release();
 }
 
+void AuswahlBox::doMausEreignis( MausEreignis &me, bool userRet ) // Maus
+{
+    if( hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Fokus ) )
+    {
+        ausgeklappt = 0;
+        me.verarbeitet = 1;
+        return;
+    }
+    if( !userRet )
+        return;
+    mausEintrag = -1;
+    bool insideParent = me.insideParent;
+    me.insideParent = me.mx >= 0 && me.mx < gr.x && me.my >= 0 && me.my < gr.y + ausklappHeight;
+    bool vera = me.verarbeitet;
+    if( ausfahren )
+    {
+        int tmpMx = me.mx;
+        int tmpMy = me.my;
+        if( me.mx >= 0 && me.my >= 0 && me.mx < gr.x && me.my < gr.y )
+            me.mx = ausfahren->getX(), me.my = ausfahren->getY() + 1;
+        ausfahren->doPublicMausEreignis( me );
+        me.mx = tmpMx, me.my = tmpMy;
+    }
+    if( me.verarbeitet && !vera && me.id == ME_RLinks )
+    {
+        ausgeklappt = !ausgeklappt;
+        if( ausgeklappt )
+            mausEintrag = auswahl;
+        if( scrollAnzeigen )
+            scrollZuEintrag( mausEintrag );
+    }
+    if( hatStyle( Style::VScroll ) && vertikalScrollBar && ausgeklappt && scrollAnzeigen )
+    {
+        int rbr = 0;
+        if( rahmen && hatStyle( Style::Rahmen ) )
+            rbr = rahmen->getRBreite();
+        if( ( me.mx > gr.x - 15 - rbr && me.my > gr.y ) || me.id == ME_UScroll || me.id == ME_DScroll )
+        {
+            vertikalScrollBar->doMausMessage( gr.x - rbr - 15, gr.y, 15, vertikalScrollBar->getScrollData()->anzeige, me );
+            me.verarbeitet = 1;
+        }
+    }
+    if( !me.verarbeitet )
+    {
+        int eintr = -1;
+        int tmp = me.my - gr.y + ( vertikalScrollBar ? vertikalScrollBar->getScroll() : 0 );
+        if( hatStyle( Style::MultiStyled ) )
+        {
+            for( int i = 0; i < anzahl; ++i )
+            {
+                if( tmp > 0 && tmp < ( members->z( i ) ? members->z( i )->getHeight() : 0 ) )
+                {
+                    eintr = i;
+                    break;
+                }
+                tmp -= members->z( i ) ? members->z( i )->getHeight() : 0;
+            }
+        }
+        else
+        {
+            for( int i = 0; i < anzahl; ++i )
+            {
+                if( tmp > 0 && tmp < eintragHeight )
+                {
+                    eintr = i;
+                    break;
+                }
+                tmp -= eintragHeight;
+            }
+        }
+        if( ausgeklappt && me.mx > 0 && me.mx < gr.x && me.my > gr.y && me.my < gr.y + ausklappHeight )
+        {
+            if( eintr >= 0 )
+            {
+                if( me.id == ME_RLinks )
+                {
+                    if( auswahl != eintr )
+                        rend = 1;
+                    auswahl = eintr;
+                    if( eAk )
+                        eAk( eAkP, this, 0, auswahl );
+                }
+                if( mausEintrag != eintr )
+                    rend = 1;
+                mausEintrag = eintr;
+            }
+        }
+    }
+    me.verarbeitet = 1;
+    me.insideParent = insideParent;
+}
+
 // nicht constant
 void AuswahlBox::setEventParam( void *p ) // setzt den Event Parameter
 {
@@ -858,171 +950,6 @@ bool AuswahlBox::tick( double tickVal ) // tick
     return ZeichnungHintergrund::tick( tickVal );
 }
 
-void AuswahlBox::doMausEreignis( MausEreignis &me ) // Maus
-{
-    mausEintrag = -1;
-    if( hatStyleNicht( Style::Sichtbar ) || hatStyleNicht( Style::Erlaubt ) )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        ausgeklappt = 0;
-        return;
-    }
-    MausEreignis backup = me;
-    if( me.id != me.rid )
-    {
-        me.id = me.rid;
-        me.mx = me.rmx;
-        me.my = me.rmy;
-        me.verarbeitet = 0;
-    }
-    bool removeFokus = 0;
-    bool nmakc = me.verarbeitet == 0;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y + ausklappHeight ) )
-    {
-        if( mausIn )
-        {
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            mausIn = 0;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            bool v = me.verarbeitet;
-            me = backup;
-            me.verarbeitet |= v;
-            return;
-        }
-        removeFokus = 1;
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y + ausklappHeight ) && me.id != ME_Leaves )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-        {
-            if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-                removeStyle( Style::Fokus );
-            ausgeklappt = 0;
-            me.mx -= pos.x, me.my -= pos.y;
-            if( nmakc && me.verarbeitet && nMak )
-                me.verarbeitet = nMak( nmakParam, this, me );
-            me.mx += pos.x, me.my += pos.y;
-        }
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        bool v = me.verarbeitet;
-        me = backup;
-        me.verarbeitet |= v;
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    me.mx -= pos.x, me.my -= pos.y;
-    if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-    {
-        bool vera = me.verarbeitet;
-        if( ausfahren )
-        {
-            int tmpMx = me.mx;
-            int tmpMy = me.my;
-            if( me.mx > 0 && me.my > 0 && me.mx < gr.x && me.my < gr.y )
-                me.mx = ausfahren->getX() + 1, me.my = ausfahren->getY() + 1;
-            else
-                me.mx = ausfahren->getX() - 1, me.my = ausfahren->getY() - 1;
-            ausfahren->doMausEreignis( me );
-            me.mx = tmpMx, me.my = tmpMy;
-        }
-        if( me.verarbeitet && !vera && me.id == ME_RLinks )
-        {
-            ausgeklappt = !ausgeklappt;
-            if( ausgeklappt )
-                mausEintrag = auswahl;
-            if( scrollAnzeigen )
-                scrollZuEintrag( mausEintrag );
-        }
-        if( removeFokus && me.id == ME_RLinks )
-            removeStyle( Style::Fokus );
-        if( !me.verarbeitet && hatStyleNicht( Style::Fokus ) && me.id == ME_RLinks )
-            addStyle( Style::Fokus );
-        if( hatStyle( Style::VScroll ) && vertikalScrollBar && ausgeklappt && scrollAnzeigen )
-        {
-            int rbr = 0;
-            if( rahmen && hatStyle( Style::Rahmen ) )
-                rbr = rahmen->getRBreite();
-            if( ( ( me.mx > gr.x - 15 - rbr && me.my > gr.y ) || me.id == ME_UScroll || me.id == ME_DScroll ) && me.id != ME_Betritt && me.id != ME_Leaves )
-            {
-                vertikalScrollBar->doMausMessage( gr.x - rbr - 15, gr.y, 15, vertikalScrollBar->getScrollData()->anzeige, me );
-                me.verarbeitet = 1;
-            }
-        }
-        if( !me.verarbeitet )
-        {
-            int eintr = -1;
-            int tmp = me.my - gr.y + ( vertikalScrollBar ? vertikalScrollBar->getScroll() : 0 );
-            if( hatStyle( Style::MultiStyled ) )
-            {
-                for( int i = 0; i < anzahl; ++i )
-                {
-                    if( tmp > 0 && tmp < ( members->z( i ) ? members->z( i )->getHeight() : 0 ) )
-                    {
-                        eintr = i;
-                        break;
-                    }
-                    tmp -= members->z( i ) ? members->z( i )->getHeight() : 0;
-                }
-            }
-            else
-            {
-                for( int i = 0; i < anzahl; ++i )
-                {
-                    if( tmp > 0 && tmp < eintragHeight )
-                    {
-                        eintr = i;
-                        break;
-                    }
-                    tmp -= eintragHeight;
-                }
-            }
-            if( ausgeklappt && me.mx > 0 && me.mx < gr.x && me.my > gr.y && me.my < gr.y + ausklappHeight )
-            {
-                if( eintr >= 0 )
-                {
-                    if( me.id == ME_RLinks )
-                    {
-                        if( auswahl != eintr )
-                            rend = 1;
-                        auswahl = eintr;
-                        if( eAk )
-                            eAk( eAkP, this, 0, auswahl );
-                    }
-                    if( mausEintrag != eintr )
-                        rend = 1;
-                    mausEintrag = eintr;
-                }
-            }
-        }
-        me.verarbeitet = 1;
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x, me.my += pos.y;
-    bool v = me.verarbeitet;
-    me = backup;
-    me.verarbeitet |= v;
-}
-
 void AuswahlBox::doTastaturEreignis( TastaturEreignis &te ) // Tastatur
 {
     if( te.verarbeitet || hatStyleNicht( Style::Fokus ) || hatStyleNicht( Style::Erlaubt ) )
@@ -2132,6 +2059,15 @@ Bild *AuswahlBox::zMsMausHintergrundBild( int i ) const
     return msMausBgB->z( i );
 }
 
+// Prüft, ob ein Punkt in diesem Objekt liegt
+//  x: die x koordinate des punktes
+//  y: die y koordinate des punktes
+//  return: 1, wenn der punkt innen ist, 0 sonst
+bool AuswahlBox::istPunktInnen( int x, int y ) const
+{
+    return x >= pos.x && x < pos.x + gr.x && y >= pos.y && y < pos.y + gr.y + ausklappHeight;
+}
+
 bool AuswahlBox::hatMsStyle( int i, __int64 abStyle ) const // prüft ob Multistyle style vorhanden
 {
     if( ( style | Style::MultiStyled ) != style || !msStyle || !msStyle->hat( i ) )

+ 9 - 4
AuswahlBox.h

@@ -42,7 +42,7 @@ namespace Framework
             //const int NachObenAusklappen	= 0x100000000;
             //const int AutoAusklappRichtung	= 0x200000000;
 
-            const static __int64 Normal = Sichtbar | Erlaubt | Rahmen | FeldRahmen | AuswahlBuffer | AuswahlRahmen | MaxHeight | VScroll | MausRahmen | MausBuffer; // Normaler Style: Sichtbar, Erlaubt, Rahmen, FeldRahmen, AuswahlBuffer, AuswahlRahmen, MaxHöhe, VScroll, MausRahmen, MausBuffer
+            const static __int64 Normal = Sichtbar | Erlaubt | Rahmen | FeldRahmen | AuswahlBuffer | AuswahlRahmen | MaxHeight | VScroll | MausRahmen | MausBuffer | Hintergrund | MEIgnoreParentInside; // Normaler Style: Sichtbar, Erlaubt, Rahmen, FeldRahmen, AuswahlBuffer, AuswahlRahmen, MaxHöhe, VScroll, MausRahmen, MausBuffer
         };
     private:
         TextRenderer *textRd;
@@ -76,6 +76,9 @@ namespace Framework
         bool scrollAnzeigen;
         void *eAkP;
         std::function< void( void *, AuswahlBox *, int, int ) > eAk;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -320,9 +323,6 @@ namespace Framework
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst
         __declspec( dllexport ) bool tick( double tickVal ) override;
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet Tastatur Nachrichten
         //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
         __declspec( dllexport ) void doTastaturEreignis( TastaturEreignis &te ) override;
@@ -504,6 +504,11 @@ namespace Framework
         // Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, das bei dem Flag Multistyle verwendet wird, wenn die Maus auf einen bestimmten Eintrag zeigt
         //  i: Der Index des Eintrags
         __declspec( dllexport ) Bild *zMsMausHintergrundBild( int i ) const;
+        // Prüft, ob ein Punkt in diesem Objekt liegt
+        //  x: die x koordinate des punktes
+        //  y: die y koordinate des punktes
+        //  return: 1, wenn der punkt innen ist, 0 sonst
+        __declspec( dllexport ) bool istPunktInnen( int x, int y ) const override;
         // Prüft, ob bei dem Flag MultiStyled für einen Bestimmten Eintrag ein bestimmter Style gesetzt wurde
         //  i: Der Index des Eintrags
         //  abStyle: Der Style

+ 82 - 123
Bild.cpp

@@ -75,8 +75,8 @@ inline void Bild::alphaPixelP3D( int x, int y, int f )
 
 inline void Bild::alphaPixelAssozP( int &fc, int f )
 {
-    unsigned char *fc1 = (unsigned char*)&fc;
-    unsigned char *fc2 = (unsigned char*)&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 )
@@ -151,7 +151,7 @@ void Bild::drawFlatDreieck( int y1, int y2, float m1, float b1, float m2, float
 }
 
 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 )
+                                  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 );
@@ -191,7 +191,7 @@ void Bild::drawFlatDreieckAlpha( int y1, int y2, float m1, float b1, float m2, f
 }
 
 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 )
+                                       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 );
@@ -204,7 +204,7 @@ void Bild::drawFlatDreieckTexturAlpha( int y1, int y2, double m1, double b1, dou
     }
 }
 
-void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild &textur ) // zeichnet eine horizontale Linie
+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;
@@ -253,7 +253,7 @@ void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Ve
     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
+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;
@@ -297,7 +297,7 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
             f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
             if( alpha[ alphaAnzahl ] )
             {
-                unsigned char *cf = (unsigned char*)&f;
+                unsigned char *cf = (unsigned char *)& f;
                 cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
             }
             alphaPixelP3D( *fc, f );
@@ -311,7 +311,7 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
             f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
             if( alpha[ alphaAnzahl ] )
             {
-                unsigned char *cf = (unsigned char*)&f;
+                unsigned char *cf = (unsigned char *)& f;
                 cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
             }
             alphaPixelP( *fc, f );
@@ -395,7 +395,7 @@ void Bild::setFarbe( int f )
     else
     {
         for( int *i = fc, *end = i + size.x * size.y; i < end; i++ )
-            *i = f;
+            * i = f;
     }
     rend = 1;
 }
@@ -434,7 +434,7 @@ void Bild::fillRegion( int x, int y, int b, int h, int ff )
     for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
     {
         for( ; pixel < rowEnd; ++pixel )
-            *pixel = ff;
+            * pixel = ff;
     }
     rend = 1;
 }
@@ -465,7 +465,7 @@ void Bild::alphaRegion( int x, int y, int b, int h, int ff )
     h = ( y + h ) >= dgy ? ( dgy - y ) : h;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&ff;
+        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;
@@ -507,7 +507,7 @@ void Bild::alphaPixel2D( int i, int f )
         alphaPixelP( fc[ i ], f );
     if( alpha[ alphaAnzahl ] < 0xFF )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        unsigned char *cf = (unsigned char *)& f;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
         alphaPixelP( fc[ i ], f );
         rend = 1;
@@ -520,7 +520,7 @@ void Bild::alphaPixel3D( int i, int f )
         alphaPixelP3D( fc[ i ], f );
     if( alpha[ alphaAnzahl ] < 0xFF )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        unsigned char *cf = (unsigned char *)& f;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
         alphaPixelP3D( fc[ i ], f );
         rend = 1;
@@ -533,7 +533,7 @@ void Bild::alphaPixel2D( int x, int y, int f )
         alphaPixelP( fc[ x + y * size.x ], f );
     if( alpha[ alphaAnzahl ] < 0xFF )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        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;
@@ -546,7 +546,7 @@ void Bild::alphaPixel3D( int x, int y, int f )
         alphaPixelP3D( fc[ x + y * size.x ], f );
     if( alpha[ alphaAnzahl ] < 0xFF )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        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;
@@ -565,7 +565,7 @@ void Bild::alphaPixelDP2D( int x, int y, int f )
         return;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        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 );
@@ -584,7 +584,7 @@ void Bild::alphaPixelDP3D( int x, int y, int f )
         return;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        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 );
@@ -672,7 +672,7 @@ void Bild::drawLinieH( int x, int y, int len, int f ) // zeichnet eine horizonta
     int pval = len < 0 ? -1 : 1;
     len = len > 0 ? len : -len;
     for( int i = 0; i < len; ++i, fc += pval )
-        *fc = f;
+        * fc = f;
     rend = 1;
 }
 
@@ -711,7 +711,7 @@ void Bild::drawLinieV( int x, int y, int len, int f ) // zeichnet eine vertikale
     int pval = len < 0 ? -br : br;
     len = len > 0 ? len : -len;
     for( int i = 0; i < len; ++i, fc += pval )
-        *fc = f;
+        * fc = f;
     rend = 1;
 }
 
@@ -746,7 +746,7 @@ void Bild::drawLinieHAlpha( int x, int y, int len, int f ) // zeichnet eine hori
     int end = 0;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        unsigned char *cf = (unsigned char *)& f;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
     }
     int alpha = ( ( f >> 24 ) & 0xFF );
@@ -793,7 +793,7 @@ void Bild::drawLinieVAlpha( int x, int y, int len, int f ) // zeichnet eine vert
     int end = 0;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&f;
+        unsigned char *cf = (unsigned char *)& f;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
     }
     int alpha = ( ( f >> 24 ) & 0xFF );
@@ -979,7 +979,7 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
         double x = (double)a.x, y = (double)a.y;
         if( alpha[ alphaAnzahl ] )
         {
-            unsigned char *cf = (unsigned char*)&fc;
+            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 );
@@ -1197,7 +1197,7 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
         double x = (double)a.x, y = (double)a.y;
         if( alpha[ alphaAnzahl ] )
         {
-            unsigned char *cf = (unsigned char*)&fc;
+            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 );
@@ -1281,7 +1281,7 @@ void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
         return;
     if( alpha[ alphaAnzahl ] < 0xFF )
     {
-        unsigned char *cf = (unsigned char*)&fc;
+        unsigned char *cf = (unsigned char *)& fc;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
     }
     int alpha = ( ( fc >> 24 ) & 0xFF );
@@ -1352,7 +1352,7 @@ void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
     rend = 1;
 }
 
-void Bild::drawBild( int x, int y, int br, int hi, Bild &zBild ) // zeichet zBild
+void Bild::drawBild( int x, int y, int br, int hi, Bild & zBild ) // zeichet zBild
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1390,7 +1390,7 @@ void Bild::drawBild( int x, int y, int br, int hi, Bild &zBild ) // zeichet zBil
     rend = 1;
 }
 
-void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1433,7 +1433,7 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
             for( xx = xst2; xx < dgx; ++xx )
             {
                 int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
-                unsigned char *cf = (unsigned char*)&fc;
+                unsigned char *cf = (unsigned char *)& fc;
                 cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                 alphaPixelAssozP( this->fc[ xx + ygr ], fc );
             }
@@ -1442,7 +1442,7 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
     rend = 1;
 }
 
-void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBild( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1504,7 +1504,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
                 for( xx = xst2; xx < dgx; ++xx )
                 {
                     int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP( this->fc[ xx + ygr ], fc );
                 }
@@ -1519,7 +1519,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
                 for( xx = xst2; xx < dgx; ++xx )
                 {
                     int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP3D( this->fc[ xx + ygr ], fc );
                 }
@@ -1529,7 +1529,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
     rend = 1;
 }
 
-void Bild::drawBild90( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet ein um 90 Grad nach rchts gedrehtes Bild
+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;
@@ -1566,7 +1566,7 @@ void Bild::drawBild90( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet e
     rend = 1;
 }
 
-void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBild90( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1621,7 +1621,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
                 for( yy = yst2; yy < dgy; ++yy )
                 {
                     int fc = ff[ ( yy - yst2 + yst ) + xbb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP3D( xx, yy, fc );
                 }
@@ -1635,7 +1635,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
                 for( yy = yst2; yy < dgy; ++yy )
                 {
                     int fc = ff[ ( yy - yst2 + yst ) + xbb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP( xx, yy, fc );
                 }
@@ -1645,7 +1645,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
     rend = 1;
 }
 
-void Bild::drawBild180( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet ein um 180 Grad nach rchts gedrehtes Bild
+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;
@@ -1683,7 +1683,7 @@ void Bild::drawBild180( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet
     rend = 1;
 }
 
-void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBild180( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1741,7 +1741,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
                 for( xx = xst2; xx < dgx; ++xx )
                 {
                     int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP3D( this->fc[ xx + ygr ], fc );
                 }
@@ -1756,7 +1756,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
                 for( xx = xst2; xx < dgx; ++xx )
                 {
                     int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP( this->fc[ xx + ygr ], fc );
                 }
@@ -1766,7 +1766,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
     rend = 1;
 }
 
-void Bild::drawBild270( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet ein um 270 Grad nach rchts gedrehtes Bild
+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;
@@ -1803,7 +1803,7 @@ void Bild::drawBild270( int x, int y, int br, int hi, Bild &zBild ) // Zeichnet
     rend = 1;
 }
 
-void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBild270( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1858,7 +1858,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
                 for( yy = yst2; yy < dgy; ++yy )
                 {
                     int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP3D( xx, yy, fc );
                 }
@@ -1872,7 +1872,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
                 for( yy = yst2; yy < dgy; ++yy )
                 {
                     int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
-                    unsigned char *cf = (unsigned char*)&fc;
+                    unsigned char *cf = (unsigned char *)& fc;
                     cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                     alphaPixelP( xx, yy, fc );
                 }
@@ -1882,7 +1882,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
     rend = 1;
 }
 
-void Bild::drawBildSkall( int x, int y, int br, int hi, Bild &zBild ) // zeichet zBild Skalliert
+void Bild::drawBildSkall( int x, int y, int br, int hi, Bild & zBild ) // zeichet zBild Skalliert
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1921,7 +1921,7 @@ void Bild::drawBildSkall( int x, int y, int br, int hi, Bild &zBild ) // zeichet
     rend = 1;
 }
 
-void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
+void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild & zBild )
 {
     if( alpha[ alphaAnzahl ] == 0xFF )
         return;
@@ -1954,7 +1954,7 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
             for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
             {
                 int f = ff[ (int)xb + ygr2 ];
-                unsigned char *cf = (unsigned char*)&f;
+                unsigned char *cf = (unsigned char *)& f;
                 cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                 alphaPixelP3D( fc[ xx + ygr ], f );
             }
@@ -1969,7 +1969,7 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
             for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
             {
                 int f = ff[ (int)xb + ygr2 ];
-                unsigned char *cf = (unsigned char*)&f;
+                unsigned char *cf = (unsigned char *)& f;
                 cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
                 alphaPixelP( fc[ xx + ygr ], f );
             }
@@ -2046,7 +2046,7 @@ void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe ) // f
     rend = 1;
 }
 
-void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild &textur ) // füllt eine Dreieck aus
+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;
@@ -2202,7 +2202,7 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe ) // f
         return;
     if( alpha[ alphaAnzahl ] )
     {
-        unsigned char *cf = (unsigned char*)&farbe;
+        unsigned char *cf = (unsigned char *)& farbe;
         cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
     }
     if( b.y < a.y )
@@ -2254,7 +2254,7 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe ) // f
     rend = 1;
 }
 
-void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild &textur ) // füllt eine Dreieck aus
+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;
@@ -2402,7 +2402,7 @@ void Bild::replaceColorWithAlpha( int color )
         int ygr = y * size.x;
         for( int x = dx + xx; x < bb; x++ )
         {
-            unsigned char *cf = ( unsigned char* )&( fc[ x + ygr ] );
+            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;
@@ -2411,7 +2411,7 @@ void Bild::replaceColorWithAlpha( int color )
     }
 }
 
-bool Bild::setDrawOptions( const Punkt &pos, const Punkt &gr ) // setzt die Drawoptionen
+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;
@@ -2451,7 +2451,7 @@ bool Bild::setDrawOptions( int x, int y, int br, int hi )
     return 1;
 }
 
-bool Bild::setDrawOptionsErzwingen( const Punkt &pos, const Punkt &gr ) // setzt die Drawoptionen
+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 )
@@ -2576,7 +2576,7 @@ BildZ::BildZ()
     : ZeichnungHintergrund(),
     bild( 0 )
 {
-    style = 0;
+    style = Style::MELockZeichnung;
     mak = _ret1ME;
 }
 
@@ -2587,8 +2587,29 @@ BildZ::~BildZ()
         bild->release();
 }
 
+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;
+}
+
 // nicht constant 
-void BildZ::setBildZ( Bild *b ) // setzt das Bild
+void BildZ::setBildZ( Bild * b ) // setzt das Bild
 {
     if( bild )
         bild->release();
@@ -2605,7 +2626,7 @@ void BildZ::setBildZ( Bild *b ) // setzt das Bild
     rend = 1;
 }
 
-void BildZ::setBild( Bild *b )
+void BildZ::setBild( Bild * b )
 {
     if( !bild )
         bild = new Bild();
@@ -2626,69 +2647,7 @@ bool BildZ::tick( double tickVal ) // tick
     return ZeichnungHintergrund::tick( tickVal );
 }
 
-void BildZ::doMausEreignis( MausEreignis &me ) // ruft Mak auf
-{
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    me.mx -= pos.x;
-    me.my -= pos.y;
-    if( hatStyle( Style::Sichtbar ) )
-    {
-        if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-        {
-            if( me.id != ME_Betritt && me.id != ME_Leaves )
-            {
-                lockZeichnung();
-                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 );
-                unlockZeichnung();
-                if( vs || hs )
-                    me.verarbeitet = 1;
-            }
-        }
-    }
-    me.mx += pos.x;
-    me.my += pos.y;
-}
-
-void BildZ::render( Bild &zRObj ) // zeichnet nach zRObj
+void BildZ::render( Bild & zRObj ) // zeichnet nach zRObj
 {
     if( hatStyle( Style::Sichtbar ) )
     {
@@ -2755,13 +2714,13 @@ Zeichnung *BildZ::dublizieren() const // erstellt eine Kopie des Zeichnungs
     obj->setMausEreignis( mak );
     obj->setTastaturEreignis( tak );
     if( toolTip )
-        obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
+        obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
     obj->setStyle( style );
     obj->setHintergrundFarbe( hintergrundFarbe );
     if( hintergrundFeld )
-        obj->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
+        obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
     if( rahmen )
-        obj->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
+        obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
     if( hintergrundBild )
         obj->setHintergrundBild( hintergrundBild->getThis() );
     if( bild )
@@ -2771,7 +2730,7 @@ Zeichnung *BildZ::dublizieren() const // erstellt eine Kopie des Zeichnungs
 }
 
 #ifdef WIN32
-Bild *Framework::ladeBild( char *pfad, Text *zError )
+Bild *Framework::ladeBild( char *pfad, Text * zError )
 {
     Text p = pfad;
     Text *txt = p.getTeilText( p.positionVon( '.', p.anzahlVon( '.' ) - 1 ) );
@@ -2791,7 +2750,7 @@ Bild *Framework::ladeBild( char *pfad, Text *zError )
     Gdiplus::Color pix;
     delete[]name;
 
-    Bild *ret = new Bild();
+    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++ )

+ 4 - 3
Bild.h

@@ -384,6 +384,10 @@ namespace Framework
     private:
         Bild *bild;
 
+        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
+        //  me: Das Ereignis
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
+
     public:
         // Konstruktor 
         __declspec( dllexport ) BildZ();
@@ -399,9 +403,6 @@ namespace Framework
         //  tickVal: Die vergangene Zeit in Sekunden, die seit dem Letzten Aufruf dieser Funktion verstrichen ist
         //  return: 1, wenn das Bild neu gezeichnet werden muss. 0 sonnst
         __declspec( dllexport ) bool tick( double tickVal ) override;
-        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
-        //  me: Das Ereignis
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Zeichnet die Zeihnung in ein bestimmtes Bild
         //  zRObj: Das Bild, in das gezeichnet werden soll
         __declspec( dllexport ) void render( Bild &zRObj ) override;

+ 4 - 4
Bildschirm.cpp

@@ -214,15 +214,15 @@ void Bildschirm::doMausEreignis( MausEreignis & me ) // sendet maus Ereignis
     if( !renderOnTop )
     {
         for( int i = tipAnzahl - 1; i >= 0; i-- )
-            tips->z( i )->doMausEreignis( me );
+            tips->z( i )->doPublicMausEreignis( me );
         for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
-            members->z( i )->doMausEreignis( me );
+            members->z( i )->doPublicMausEreignis( me );
     }
     else if( onTop )
     {
-        onTop->doMausEreignis( me );
+        onTop->doPublicMausEreignis( me );
         for( int i = tipAnzahl - 1; i >= 0; i-- )
-            tips->z( i )->doMausEreignis( me );
+            tips->z( i )->doPublicMausEreignis( me );
     }
     unlock();
 }

+ 22 - 70
Diagramm.cpp

@@ -1301,6 +1301,7 @@ LDiag::LDiag()
     hIntervallRB( new Bild() ),
     schriftGr( 12 )
 {
+    style = Style::MELockZeichnung;
     vertikalScrollBar = new VScrollBar();
     horizontalScrollBar = new HScrollBar();
 }
@@ -1322,6 +1323,27 @@ LDiag::~LDiag()
         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 )
 {
@@ -1467,76 +1489,6 @@ void LDiag::setDatenAlphaFeldStrength( int st )
     unlockZeichnung();
 }
 
-void LDiag::doMausEreignis( MausEreignis &me )
-{
-    bool nmakc = !me.verarbeitet;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        mausIn = 1;
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    me.mx -= pos.x;
-    me.my -= pos.y;
-    if( hatDatenStyle( DiagDaten::Style::Sichtbar ) && ( hatStyle( Style::HScroll ) || hatStyle( Style::VScroll ) ) )
-    {
-        if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-        {
-            if( me.id != ME_Betritt && me.id != ME_Leaves )
-            {
-                lockZeichnung();
-                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 );
-                unlockZeichnung();
-            }
-            me.verarbeitet = 1;
-        }
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x;
-    me.my += pos.y;
-}
-
 void LDiag::render( Bild &zRObj )
 {
     if( !hatDatenStyle( DiagDaten::Style::Sichtbar ) )

+ 3 - 3
Diagramm.h

@@ -519,6 +519,9 @@ namespace Framework
         Bild *vIntervallRB;
         Bild *hIntervallRB;
         int schriftGr;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor
@@ -562,9 +565,6 @@ namespace Framework
         // Setzt die FaStärkerbe des Farbübergangs des eigentlichen Diagramms (Farbübergang der Daten)
         //  st: Die Stärke
         __declspec( dllexport ) void setDatenAlphaFeldStrength( int st );
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Zeichnet das Objekt nach zRObj, falls es sichtbar ist
         //  zRObj: Das Bild, in welches gezeichnet werden soll
         __declspec( dllexport ) void render( Bild &zRObj ) override;

+ 309 - 348
Fenster.cpp

@@ -85,7 +85,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Links ] = 1;
-            MausEreignis me = { ME_PLinks, ME_PLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_PLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -93,7 +93,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Rechts ] = 1;
-            MausEreignis me = { ME_PRechts, ME_PLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_PRechts, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -101,7 +101,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Mitte ] = 1;
-            MausEreignis me = { ME_PMitte, ME_PMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_PMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -109,7 +109,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Links ] = 0;
-            MausEreignis me = { ME_RLinks, ME_RLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_RLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -117,7 +117,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Rechts ] = 0;
-            MausEreignis me = { ME_RRechts, ME_RRechts, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_RRechts, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -125,28 +125,28 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausStand[ M_Mitte ] = 0;
-            MausEreignis me = { ME_RMitte, ME_RMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_RMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
     case WM_LBUTTONDBLCLK: // Linksdoppelklick
         if( 1 )
         {
-            MausEreignis me = { ME_DKLinks, ME_DKLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_DKLinks, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
     case WM_RBUTTONDBLCLK: // Rechtsdoppelklick
         if( 1 )
         {
-            MausEreignis me = { ME_DKRechts, ME_DKRechts, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_DKRechts, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
     case WM_MBUTTONDBLCLK: // Mitteldoppelklick
         if( 1 )
         {
-            MausEreignis me = { ME_DKMitte, ME_DKMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_DKMitte, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -154,7 +154,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausTrack = 1;
-            MausEreignis me = { ME_Betritt, ME_Betritt, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_Betritt, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -162,7 +162,7 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
         if( 1 )
         {
             MausTrack = 1;
-            MausEreignis me = { ME_Leaves, ME_Leaves, (int)LOWORD( lparam ), (int)HIWORD( lparam ), (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0 };
+            MausEreignis me = { ME_Leaves, (int)LOWORD( lparam ), (int)HIWORD( lparam ), 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -183,21 +183,18 @@ LRESULT CALLBACK Framework::WindowProc( HWND hwnd, UINT message, WPARAM wparam,
                 TrackMouseEvent( &lptme );
                 MausTrack = 0;
             }
-            MausEreignis me = { ME_Bewegung, ME_Bewegung, mausPos.x, mausPos.y, mausPos.x, mausPos.y, 0 };
-            me.rmx = me.mx;
-            me.rmy = me.my;
+            MausEreignis me = { ME_Bewegung, mausPos.x, mausPos.y, 0, 1 };
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
     case WM_MOUSEWHEEL: // Maus scroll
         if( 1 )
         {
-            MausEreignis me = { 0, 0, mausPos.x, mausPos.y, mausPos.x, mausPos.y, 0 };
+            MausEreignis me = { 0, mausPos.x, mausPos.y, 0, 1 };
             if( (int)(short)HIWORD( wparam ) < 0 )
                 me.id = !getTastenStand( T_Shift ) ? ME_DScroll : ME_RScroll;
             else
                 me.id = !getTastenStand( T_Shift ) ? ME_UScroll : ME_LScroll;
-            me.rid = me.id;
             WFensterA.sendMausMessage( hwnd, me );
             break;
         }
@@ -1095,7 +1092,7 @@ Fenster::Fenster()
     mx( 0 ),
     my( 0 )
 {
-    style = 0;
+    style = Style::MEIgnoreVerarbeitet | Style::MEIgnoreSichtbar | Style::MEIgnoreParentInside | Style::MEIgnoreInside;
     this->setMausEreignis( _ret1ME );
     this->setTastaturEreignis( _ret1TE );
     min = Punkt( 0, 0 ), max = Punkt( 0, 0 );
@@ -1126,6 +1123,301 @@ Fenster::~Fenster()
         hScroll->release();
 }
 
+void Fenster::doMausEreignis( MausEreignis & me, bool userRet )
+{
+    if( !hatStyle( Style::Sichtbar ) || !me.insideParent || me.verarbeitet || me.mx < 0 || me.my < 0 || me.mx >= gr.x || me.my >= gr.y || !userRet )
+    {
+        bool insideParent = me.insideParent;
+        me.insideParent = 0;
+        int rbr = 0;
+        if( hatStyle( Style::Rahmen ) && rahmen )
+            rbr = rahmen->getRBreite();
+        int th = 0;
+        if( hatStyle( Style::Titel ) && titel )
+            th = titel->getHeight();
+        me.mx -= rbr;
+        me.my -= rbr + th;
+        if( hatStyle( Style::VScroll ) && vScroll )
+            me.my += vScroll->getScroll();
+        if( hatStyle( Style::HScroll ) && hScroll )
+            me.mx += hScroll->getScroll();
+        if( me.id != ME_Betritt && me.id != ME_Leaves )
+        {
+            for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
+                members->z( i )->doPublicMausEreignis( me );
+        }
+        me.mx += rbr;
+        me.my += rbr + th;
+        if( hatStyle( Style::VScroll ) && vScroll )
+            me.my -= vScroll->getScroll();
+        if( hatStyle( Style::HScroll ) && hScroll )
+            me.mx -= hScroll->getScroll();
+        me.insideParent = insideParent;
+        return;
+    }
+    bool mvtmp = me.verarbeitet;
+    if( hatStyleNicht( Style::Erlaubt ) )
+        me.verarbeitet = 1;
+    bool mpr = 0;
+    int rbr = 0;
+    if( hatStyle( Style::Rahmen ) && rahmen )
+        rbr = rahmen->getRBreite();
+    int th = 0;
+    if( hatStyle( Style::Titel ) && titel )
+        th = titel->getHeight();
+    bool hSc = hatStyle( Style::HScroll ) && hScroll;
+    bool vSc = hatStyle( Style::VScroll ) && vScroll;
+    if( me.id == ME_Bewegung && moving && getMausStand( M_Links ) )
+    {
+        if( hatStyle( Style::Beweglich ) || hatStyle( Style::HeightChangeable ) || hatStyle( Style::BreiteChangeable ) || hatStyle( Style::TitelHeightChangeable ) )
+        {
+            mpr = 1;
+            bool ret1 = 0;
+            bool mset = 0;
+            int schi = 0;
+            int scbr = 0;
+            if( hSc )
+            {
+                schi = 15;
+                scbr = 40;
+            }
+            if( vSc )
+            {
+                scbr += 15;
+                schi = 40;
+            }
+            bool minXb, maxXb, minYb, maxYb;
+            bool kMinXb, kMaxXb, kMinYb, kMaxYb;
+            minXb = hatStyle( Style::MinBr );
+            maxXb = hatStyle( Style::MaxBr );
+            minYb = hatStyle( Style::MinHi );
+            maxYb = hatStyle( Style::MaxHi );
+            kMinXb = hatStyle( Style::BodyMinBr );
+            kMaxXb = hatStyle( Style::BodyMaxBr );
+            kMinYb = hatStyle( Style::BodyMinHi );
+            kMaxYb = hatStyle( Style::BodyMaxHi );
+            int fMinBr = rbr * 2 + scbr;
+            if( minXb )
+                fMinBr = fMinBr < min.x ? min.x : fMinBr;
+            if( kMinXb )
+                fMinBr = fMinBr < ( rbr * 2 + kMin.x + scbr ) ? ( rbr * 2 + kMin.x + scbr ) : fMinBr;
+            int fMinHi = rbr * 2 + th + schi;
+            if( minYb )
+                fMinHi = fMinHi < min.y ? min.y : fMinHi;
+            if( kMinYb )
+                fMinHi = fMinHi < ( rbr * 2 + kMin.y + th + schi ) ? ( rbr * 2 + kMin.y + th + schi ) : fMinHi;
+            int fMaxBr = 0;
+            if( maxXb )
+                fMaxBr = max.x;
+            if( kMaxXb )
+                fMaxBr = fMaxBr < ( rbr * 2 + kMax.x + scbr ) ? ( rbr * 2 + kMax.x + scbr ) : fMaxBr;
+            int fMaxHi = 0;
+            if( maxYb )
+                fMaxHi = max.y;
+            if( kMaxYb )
+                fMaxHi = fMaxHi < ( rbr * 2 + kMax.y + th + schi ) ? ( rbr * 2 + kMax.y + th + schi ) : fMaxHi;
+            minXb |= kMinXb, maxXb |= kMaxXb, minYb |= kMinYb, maxYb |= kMaxYb;
+            if( hatStyle( Style::HeightChangeable ) )
+            {
+                if( ( moving | 0x1 ) == moving ) // top
+                {
+                    pos.y -= my - me.my;
+                    gr.y += my - me.my;
+                    if( gr.y < fMinHi )
+                    {
+                        pos.y += fMinHi - gr.y;
+                        gr.y = fMinHi;
+                    }
+                    else if( maxYb && gr.y > fMaxHi )
+                    {
+                        pos.y += gr.y - fMaxHi;
+                        gr.y = fMaxHi;
+                    }
+                    else if( vSc )
+                        vScroll->getScrollData()->anzeige = gr.y;
+                    rend = 1;
+                    ret1 = 1;
+                }
+                else if( ( moving | 0x2 ) == moving ) // bottom
+                {
+                    gr.y += me.my - my;
+                    if( gr.y < fMinHi )
+                        gr.y = fMinHi;
+                    else if( maxYb && gr.y > fMaxHi )
+                        gr.y = fMaxHi;
+                    else
+                    {
+                        mset = 1;
+                        if( vSc )
+                            vScroll->getScrollData()->anzeige = gr.y;
+                    }
+                    rend = 1;
+                    ret1 = 1;
+                }
+            }
+            if( hatStyle( Style::BreiteChangeable ) )
+            {
+                if( ( moving | 0x4 ) == moving ) // left
+                {
+                    pos.x -= mx - me.mx;
+                    gr.x += mx - me.mx;
+                    if( gr.x < fMinBr )
+                    {
+                        pos.x += fMinBr - gr.x;
+                        gr.x = fMinBr;
+                    }
+                    else if( maxXb && gr.x > fMaxBr )
+                    {
+                        pos.x += gr.x - fMaxBr;
+                        gr.x = fMaxBr;
+                    }
+                    else if( hSc )
+                        hScroll->getScrollData()->anzeige = gr.x;
+                    rend = 1;
+                    ret1 = 1;
+                }
+                else if( ( moving | 0x8 ) == moving ) // right
+                {
+                    gr.x += me.mx - mx;
+                    if( gr.x < rbr * 2 + fMinBr )
+                        gr.x = rbr * 2 + fMinBr;
+                    else if( maxXb && gr.x > fMaxBr )
+                        gr.x = fMaxBr;
+                    else
+                    {
+                        mset = 1;
+                        if( hSc )
+                            hScroll->getScrollData()->anzeige = gr.x;
+                    }
+                    rend = 1;
+                    ret1 = 1;
+                }
+            }
+            if( hatStyle( Style::TitelHeightChangeable ) && titel && ( moving | 0x10 ) == moving ) // titel height
+            {
+                int maxTh = gr.y - rbr * 2 - schi;
+                if( kMaxYb )
+                    maxTh = maxTh < ( gr.x - rbr * 2 - kMin.y ) ? maxTh : ( gr.x - rbr * 2 - kMin.y );
+                if( hatStyle( Style::Closable ) )
+                    maxTh = ( gr.x - th - 5 - rbr * 2 - me.my + my ) < 0 ? th : maxTh;
+                titel->setSize( titel->getBreite(), titel->getHeight() + me.my - my );
+                if( titel->getHeight() > maxTh )
+                    titel->setSize( titel->getBreite(), maxTh );
+                else if( titel->getHeight() < 5 )
+                    titel->setSize( titel->getBreite(), 5 );
+                else
+                    mset = 1;
+                rend = 1;
+                ret1 = 1;
+            }
+            if( ret1 )
+            {
+                if( mset )
+                    mx = me.mx, my = me.my;
+                me.verarbeitet = 1;
+            }
+            if( hatStyle( Style::Beweglich ) && ( moving | 0x20 ) == moving ) // move
+            {
+                pos.x += me.mx - mx;
+                pos.y += me.my - my;
+                rend = 1;
+                ret1 = 1;
+            }
+            if( ret1 )
+                me.verarbeitet = 1;
+        }
+    }
+    if( me.id == ME_RLinks )
+    {
+        if( closeKlick )
+            rend = 1;
+        closeKlick = 0, klick = 0;
+        moving = 0;
+        mx = -1, my = -1;
+    }
+    if( me.id == ME_Leaves )
+    {
+        if( closeKlick != 0 )
+            rend = 1;
+        closeKlick = 0, klick = 0;
+    }
+    if( !me.verarbeitet )
+    {
+        if( me.id == ME_PLinks )
+        {
+            klick = 1;
+            mx = me.mx, my = me.my;
+            if( me.mx >= 0 && me.mx < gr.x && me.my >= 0 && me.my < rbr + 5 )
+                moving |= 0x1;
+            if( me.mx >= 0 && me.mx < gr.x && me.my >= gr.y - ( rbr + 5 ) && me.my < gr.y )
+                moving |= 0x2;
+            if( me.mx >= 0 && me.mx < rbr + 5 && me.my >= 0 && me.my < gr.y )
+                moving |= 0x4;
+            if( me.mx >= gr.x - rbr - 5 && me.mx < gr.x && me.my >= 0 && me.my < gr.y )
+                moving |= 0x8;
+            if( titel && me.mx >= 0 && me.mx < gr.x && me.my >= titel->getHeight() && me.my < titel->getHeight() + 2 * ( rbr + 5 ) )
+                moving |= 0x10;
+            if( titel && me.mx >= 0 && me.mx < gr.x && me.my >= rbr + 5 && me.my < titel->getHeight() )
+                moving |= 0x20;
+        }
+        if( hatStyle( Style::Closable ) && me.my <= th + rbr && me.mx >= gr.x + rbr - th && me.my >= rbr && me.mx <= gr.x - rbr )
+        {
+            if( !closingMe || closingMe( closingMeParam, this, me ) )
+            {
+                if( me.id == ME_PLinks )
+                {
+                    closeKlick = 1;
+                    rend = 1;
+                }
+                if( !closeKlick && MausStand[ M_Links ] )
+                {
+                    closeKlick = 1;
+                    rend = 1;
+                }
+                me.verarbeitet = 1;
+            }
+        }
+        else if( closeKlick )
+        {
+            closeKlick = 0;
+            rend = 1;
+        }
+    }
+    if( members )
+    {
+        if( vSc )
+        {
+            vScroll->doMausMessage( gr.x - rbr - 16, rbr + th, 15, gr.y - rbr * 2 - th - 1, me );
+            if( hSc )
+                hScroll->doMausMessage( rbr, gr.y - rbr - 16, gr.x - rbr * 2 - 16, 15, me );
+        }
+        else
+            if( hSc )
+                hScroll->doMausMessage( rbr, gr.y - rbr - 16, gr.x - rbr * 2 - 1, 15, me );
+        me.mx -= rbr;
+        me.my -= rbr + th;
+        if( hatStyle( Style::VScroll ) && vScroll )
+            me.my += vScroll->getScroll();
+        if( hatStyle( Style::HScroll ) && hScroll )
+            me.mx += hScroll->getScroll();
+        if( me.id != ME_Betritt && me.id != ME_Leaves )
+        {
+            for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
+                members->z( i )->doPublicMausEreignis( me );
+        }
+        me.mx += rbr;
+        me.my += rbr + th;
+        if( hatStyle( Style::VScroll ) && vScroll )
+            me.my -= vScroll->getScroll();
+        if( hatStyle( Style::HScroll ) && hScroll )
+            me.mx -= hScroll->getScroll();
+    }
+    if( hatStyleNicht( Style::METransparenz ) )
+        me.verarbeitet = 1;
+    if( hatStyleNicht( Style::Erlaubt ) )
+        me.verarbeitet = mvtmp;
+}
+
 // nicht const 
 // -- Rahmen -- 
 void Fenster::setRahmenZ( Rahmen * ram ) // setzt den rahmen
@@ -1592,337 +1884,6 @@ bool Fenster::tick( double tickval ) // tick
     return Zeichnung::tick( tickval );
 }
 
-void Fenster::doMausEreignis( MausEreignis & me )
-{
-    bool nmakc = !me.verarbeitet;
-    if( me.verarbeitet || ( me.mx < pos.x || me.mx > pos.x + gr.x || me.my < pos.y || me.my > pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-    }
-    else if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    if( hatStyle( Style::Sichtbar ) )
-    {
-        bool mvtmp = me.verarbeitet;
-        if( !mak )
-            return;
-        if( hatStyleNicht( Style::Erlaubt ) )
-            me.verarbeitet = 1;
-        bool mpr = 0;
-        me.mx -= pos.x;
-        me.my -= pos.y;
-        int rbr = 0;
-        if( hatStyle( Style::Rahmen ) && rahmen )
-            rbr = rahmen->getRBreite();
-        int th = 0;
-        if( hatStyle( Style::Titel ) && titel )
-            th = titel->getHeight();
-        bool hSc = hatStyle( Style::HScroll ) && hScroll;
-        bool vSc = hatStyle( Style::VScroll ) && vScroll;
-        if( me.id == ME_Bewegung && moving && getMausStand( M_Links ) )
-        {
-            if( hatStyle( Style::Beweglich ) || hatStyle( Style::HeightChangeable ) || hatStyle( Style::BreiteChangeable ) || hatStyle( Style::TitelHeightChangeable ) )
-            {
-                if( mak( makParam, this, me ) )
-                {
-                    mpr = 1;
-                    bool ret1 = 0;
-                    bool mset = 0;
-                    int schi = 0;
-                    int scbr = 0;
-                    if( hSc )
-                    {
-                        schi = 15;
-                        scbr = 40;
-                    }
-                    if( vSc )
-                    {
-                        scbr += 15;
-                        schi = 40;
-                    }
-                    bool minXb, maxXb, minYb, maxYb;
-                    bool kMinXb, kMaxXb, kMinYb, kMaxYb;
-                    minXb = hatStyle( Style::MinBr );
-                    maxXb = hatStyle( Style::MaxBr );
-                    minYb = hatStyle( Style::MinHi );
-                    maxYb = hatStyle( Style::MaxHi );
-                    kMinXb = hatStyle( Style::BodyMinBr );
-                    kMaxXb = hatStyle( Style::BodyMaxBr );
-                    kMinYb = hatStyle( Style::BodyMinHi );
-                    kMaxYb = hatStyle( Style::BodyMaxHi );
-                    int fMinBr = rbr * 2 + scbr;
-                    if( minXb )
-                        fMinBr = fMinBr < min.x ? min.x : fMinBr;
-                    if( kMinXb )
-                        fMinBr = fMinBr < ( rbr * 2 + kMin.x + scbr ) ? ( rbr * 2 + kMin.x + scbr ) : fMinBr;
-                    int fMinHi = rbr * 2 + th + schi;
-                    if( minYb )
-                        fMinHi = fMinHi < min.y ? min.y : fMinHi;
-                    if( kMinYb )
-                        fMinHi = fMinHi < ( rbr * 2 + kMin.y + th + schi ) ? ( rbr * 2 + kMin.y + th + schi ) : fMinHi;
-                    int fMaxBr = 0;
-                    if( maxXb )
-                        fMaxBr = max.x;
-                    if( kMaxXb )
-                        fMaxBr = fMaxBr < ( rbr * 2 + kMax.x + scbr ) ? ( rbr * 2 + kMax.x + scbr ) : fMaxBr;
-                    int fMaxHi = 0;
-                    if( maxYb )
-                        fMaxHi = max.y;
-                    if( kMaxYb )
-                        fMaxHi = fMaxHi < ( rbr * 2 + kMax.y + th + schi ) ? ( rbr * 2 + kMax.y + th + schi ) : fMaxHi;
-                    minXb |= kMinXb, maxXb |= kMaxXb, minYb |= kMinYb, maxYb |= kMaxYb;
-                    if( hatStyle( Style::HeightChangeable ) )
-                    {
-                        if( ( moving | 0x1 ) == moving ) // top
-                        {
-                            pos.y -= my - me.my;
-                            gr.y += my - me.my;
-                            if( gr.y < fMinHi )
-                            {
-                                pos.y += fMinHi - gr.y;
-                                gr.y = fMinHi;
-                            }
-                            else if( maxYb && gr.y > fMaxHi )
-                            {
-                                pos.y += gr.y - fMaxHi;
-                                gr.y = fMaxHi;
-                            }
-                            else if( vSc )
-                                vScroll->getScrollData()->anzeige = gr.y;
-                            rend = 1;
-                            ret1 = 1;
-                        }
-                        else if( ( moving | 0x2 ) == moving ) // bottom
-                        {
-                            gr.y += me.my - my;
-                            if( gr.y < fMinHi )
-                                gr.y = fMinHi;
-                            else if( maxYb && gr.y > fMaxHi )
-                                gr.y = fMaxHi;
-                            else
-                            {
-                                mset = 1;
-                                if( vSc )
-                                    vScroll->getScrollData()->anzeige = gr.y;
-                            }
-                            rend = 1;
-                            ret1 = 1;
-                        }
-                    }
-                    if( hatStyle( Style::BreiteChangeable ) )
-                    {
-                        if( ( moving | 0x4 ) == moving ) // left
-                        {
-                            pos.x -= mx - me.mx;
-                            gr.x += mx - me.mx;
-                            if( gr.x < fMinBr )
-                            {
-                                pos.x += fMinBr - gr.x;
-                                gr.x = fMinBr;
-                            }
-                            else if( maxXb && gr.x > fMaxBr )
-                            {
-                                pos.x += gr.x - fMaxBr;
-                                gr.x = fMaxBr;
-                            }
-                            else if( hSc )
-                                hScroll->getScrollData()->anzeige = gr.x;
-                            rend = 1;
-                            ret1 = 1;
-                        }
-                        else if( ( moving | 0x8 ) == moving ) // right
-                        {
-                            gr.x += me.mx - mx;
-                            if( gr.x < rbr * 2 + fMinBr )
-                                gr.x = rbr * 2 + fMinBr;
-                            else if( maxXb && gr.x > fMaxBr )
-                                gr.x = fMaxBr;
-                            else
-                            {
-                                mset = 1;
-                                if( hSc )
-                                    hScroll->getScrollData()->anzeige = gr.x;
-                            }
-                            rend = 1;
-                            ret1 = 1;
-                        }
-                    }
-                    if( hatStyle( Style::TitelHeightChangeable ) && titel && ( moving | 0x10 ) == moving ) // titel height
-                    {
-                        int maxTh = gr.y - rbr * 2 - schi;
-                        if( kMaxYb )
-                            maxTh = maxTh < ( gr.x - rbr * 2 - kMin.y ) ? maxTh : ( gr.x - rbr * 2 - kMin.y );
-                        if( hatStyle( Style::Closable ) )
-                            maxTh = ( gr.x - th - 5 - rbr * 2 - me.my + my ) < 0 ? th : maxTh;
-                        titel->setSize( titel->getBreite(), titel->getHeight() + me.my - my );
-                        if( titel->getHeight() > maxTh )
-                            titel->setSize( titel->getBreite(), maxTh );
-                        else if( titel->getHeight() < 5 )
-                            titel->setSize( titel->getBreite(), 5 );
-                        else
-                            mset = 1;
-                        rend = 1;
-                        ret1 = 1;
-                    }
-                    if( ret1 )
-                    {
-                        if( mset )
-                            mx = me.mx, my = me.my;
-                        me.verarbeitet = 1;
-                    }
-                    if( hatStyle( Style::Beweglich ) && ( moving | 0x20 ) == moving ) // move
-                    {
-                        pos.x += me.mx - mx;
-                        pos.y += me.my - my;
-                        rend = 1;
-                        ret1 = 1;
-                    }
-                    if( ret1 )
-                        me.verarbeitet = 1;
-                }
-            }
-        }
-        bool inside = me.mx >= 0 && me.mx <= gr.x && me.my >= 0 && me.my <= gr.y;
-        if( mpr || me.verarbeitet || ( !inside || mak( makParam, this, me ) ) )
-        {
-            if( me.id == ME_RLinks )
-            {
-                if( closeKlick )
-                    rend = 1;
-                closeKlick = 0, klick = 0;
-                moving = 0;
-                mx = -1, my = -1;
-            }
-            if( me.id == ME_Leaves )
-            {
-                if( closeKlick != 0 )
-                    rend = 1;
-                closeKlick = 0, klick = 0;
-            }
-            if( !me.verarbeitet )
-            {
-                if( me.id == ME_PLinks )
-                {
-                    klick = 1;
-                    mx = me.mx, my = me.my;
-                    if( me.mx >= 0 && me.mx < gr.x && me.my >= 0 && me.my < rbr + 5 )
-                        moving |= 0x1;
-                    if( me.mx >= 0 && me.mx < gr.x && me.my >= gr.y - ( rbr + 5 ) && me.my < gr.y )
-                        moving |= 0x2;
-                    if( me.mx >= 0 && me.mx < rbr + 5 && me.my >= 0 && me.my < gr.y )
-                        moving |= 0x4;
-                    if( me.mx >= gr.x - rbr - 5 && me.mx < gr.x && me.my >= 0 && me.my < gr.y )
-                        moving |= 0x8;
-                    if( titel && me.mx >= 0 && me.mx < gr.x && me.my >= titel->getHeight() && me.my < titel->getHeight() + 2 * ( rbr + 5 ) )
-                        moving |= 0x10;
-                    if( titel && me.mx >= 0 && me.mx < gr.x && me.my >= rbr + 5 && me.my < titel->getHeight() )
-                        moving |= 0x20;
-                }
-                if( hatStyle( Style::Closable ) && me.my <= th + rbr && me.mx >= gr.x + rbr - th && me.my >= rbr && me.mx <= gr.x - rbr )
-                {
-                    if( !closingMe || closingMe( closingMeParam, this, me ) )
-                    {
-                        if( me.id == ME_PLinks )
-                        {
-                            closeKlick = 1;
-                            rend = 1;
-                        }
-                        if( !closeKlick && MausStand[ M_Links ] )
-                        {
-                            closeKlick = 1;
-                            rend = 1;
-                        }
-                        me.verarbeitet = 1;
-                    }
-                }
-                else if( closeKlick )
-                {
-                    closeKlick = 0;
-                    rend = 1;
-                }
-            }
-            if( members && me.id != ME_Betritt && me.id != ME_Leaves )
-            {
-                if( vSc )
-                {
-                    vScroll->doMausMessage( gr.x - rbr - 16, rbr + th, 15, gr.y - rbr * 2 - th - 1, me );
-                    if( hSc )
-                        hScroll->doMausMessage( rbr, gr.y - rbr - 16, gr.x - rbr * 2 - 16, 15, me );
-                }
-                else
-                    if( hSc )
-                        hScroll->doMausMessage( rbr, gr.y - rbr - 16, gr.x - rbr * 2 - 1, 15, me );
-                me.mx -= rbr;
-                me.my -= rbr + th;
-                if( hatStyle( Style::VScroll ) && vScroll )
-                    me.my += vScroll->getScroll();
-                if( hatStyle( Style::HScroll ) && hScroll )
-                    me.mx += hScroll->getScroll();
-                if( inside )
-                {
-                    for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
-                        members->z( i )->doMausEreignis( me );
-                }
-                else
-                {
-                    MausEreignis me2;
-                    me2.id = ME_Leaves;
-                    me2.rid = me.id;
-                    me2.mx = -1;
-                    me2.my = -1;
-                    me2.rmx = me.mx;
-                    me2.rmy = me.my;
-                    me2.verarbeitet = 1;
-                    for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
-                        members->z( i )->doMausEreignis( me2 );
-                }
-                me.mx += rbr;
-                me.my += rbr + th;
-                if( hatStyle( Style::VScroll ) && vScroll )
-                    me.my -= vScroll->getScroll();
-                if( hatStyle( Style::HScroll ) && hScroll )
-                    me.mx -= hScroll->getScroll();
-            }
-            if( inside && hatStyleNicht( Style::METransparenz ) )
-                me.verarbeitet = 1;
-        }
-        if( nmakc && me.verarbeitet && nMak )
-            me.verarbeitet = nMak( nmakParam, this, me );
-        me.mx += pos.x;
-        me.my += pos.y;
-        if( hatStyleNicht( Style::Erlaubt ) )
-            me.verarbeitet = mvtmp;
-    }
-    else if( members )
-    {
-        MausEreignis me;
-        me.verarbeitet = 1;
-        me.id = 0;
-        me.mx = -1000000;
-        me.my = -1000000;
-        for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
-            members->z( i )->doMausEreignis( me );
-    }
-}
-
 void Fenster::doTastaturEreignis( TastaturEreignis & te )
 {
     bool ntakc = !te.verarbeitet;

+ 4 - 4
Fenster.h

@@ -275,7 +275,7 @@ namespace Framework
             const static __int64 scroll = VScroll | HScroll; // Vereint die Flags VScroll, HScroll
             const static __int64 nichtfixiert = TitelHeightChangeable | HeightChangeable | BreiteChangeable | Beweglich; // Vereint die Flags TitelHöheÄnderbar, HöheÄnderbar, BreiteÄnderbar, Beweglich
 
-            const static __int64 normal = Sichtbar | Erlaubt | Rahmen | Titel | TitelBuffered | Closable | ClosingHBild | ClosingKlickBuffer | Beweglich; // Vereint die Flags Sichtbar, Erlaubt, Rahmen, Titel, TitelBuffered, Schließbar, SchließHBild, SchließKlickBuffer, Beweglich
+            const static __int64 normal = Sichtbar | Erlaubt | Rahmen | Titel | TitelBuffered | Closable | ClosingHBild | ClosingKlickBuffer | Beweglich | MEIgnoreVerarbeitet | MEIgnoreSichtbar | MEIgnoreParentInside | MEIgnoreInside; // Vereint die Flags Sichtbar, Erlaubt, Rahmen, Titel, TitelBuffered, Schließbar, SchließHBild, SchließKlickBuffer, Beweglich
         };
     private:
         MausAktion closingMe;
@@ -297,6 +297,9 @@ namespace Framework
         bool closeKlick, klick;
         int moving;
         int mx, my;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -471,9 +474,6 @@ namespace Framework
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst
         __declspec( dllexport ) bool tick( double tickval ) override;
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet Tastatur Nachrichten
         //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
         __declspec( dllexport ) void doTastaturEreignis( TastaturEreignis &te ) override;

+ 48 - 144
Knopf.cpp

@@ -45,6 +45,33 @@ Knopf::~Knopf()
         klickBild->release();
 }
 
+void Knopf::doMausEreignis( MausEreignis &me, bool userRet ) // Maus Ereignis
+{
+    if( hatStyleNicht( Style::Erlaubt ) || !userRet )
+        return;
+    if( me.id == ME_Betritt )
+    {
+        klickIndex = MausStand[ M_Links ];
+        if( klickIndex )
+            rend = 1;
+    }
+    if( me.id == ME_RLinks || me.id == ME_Leaves )
+    {
+        if( klickIndex )
+            rend = 1;
+        klickIndex = 0;
+    }
+    if( !me.verarbeitet )
+    {
+        if( me.id == ME_PLinks )
+        {
+            klickIndex = 1;
+            rend = 1;
+        }
+        me.verarbeitet = 1;
+    }
+}
+
 // nicht constant 
 void Knopf::setKlickFarbe( int fc ) // setzt die Klick Farbe
 {
@@ -100,82 +127,6 @@ void Knopf::setKBFarbe( int fc ) // setzt die Farbe des Klick Buffers
     rend = 1;
 }
 
-void Knopf::doMausEreignis( MausEreignis &me ) // Maus Ereignis
-{
-    bool nmakc = !me.verarbeitet;
-    if( hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Sichtbar ) )
-    {
-        mausIn = 0;
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves && !me.verarbeitet )
-    {
-        mausIn = 1;
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    ++ref;
-    me.mx -= pos.x, me.my -= pos.y;
-    if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-    {
-        if( me.id == ME_Betritt )
-        {
-            klickIndex = MausStand[ M_Links ];
-            if( klickIndex )
-                rend = 1;
-        }
-        if( me.id == ME_RLinks || me.id == ME_Leaves )
-        {
-            if( klickIndex )
-                rend = 1;
-            klickIndex = 0;
-        }
-        if( !me.verarbeitet )
-        {
-            if( me.id == ME_PLinks )
-            {
-                klickIndex = 1;
-                rend = 1;
-            }
-            me.verarbeitet = 1;
-        }
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x, me.my += pos.y;
-    release();
-}
-
 void Knopf::render( Bild &zRObj ) // zeichenet nach zRObj
 {
     if( !hatStyle( Style::Sichtbar ) )
@@ -359,6 +310,27 @@ KontrollKnopf::~KontrollKnopf()
         textRd->release();
 }
 
+void KontrollKnopf::doMausEreignis( MausEreignis &me, bool userRet ) // Nachrichten verarbeitung
+{
+    if( me.id == ME_Leaves || !userRet )
+        style &= ~Style::MausKlick;
+    if( hatStyleNicht( TextFeld::Style::Erlaubt ) || !userRet )
+        return;
+    if( !me.verarbeitet )
+    {
+        if( me.id == ME_Betritt && hatStyle( Style::MausKlick ) != MausStand[ M_Links ] )
+            setStyle( Style::MausKlick, MausStand[ M_Links ] );
+        if( !me.verarbeitet && me.id == ME_PLinks )
+            addStyle( Style::MausKlick );
+        if( me.id == ME_RLinks )
+        {
+            removeStyle( Style::MausKlick );
+            setStyle( Style::Selected, !hatStyle( Style::Selected ) );
+        }
+        me.verarbeitet = 1;
+    }
+}
+
 // nicht constant 
 void KontrollKnopf::setTextZ( Text *txt ) // setzt den Text
 {
@@ -567,74 +539,6 @@ void KontrollKnopf::loadData( const char *ltdb ) // l
     }
 }
 
-void KontrollKnopf::doMausEreignis( MausEreignis &me ) // Nachrichten verarbeitung
-{
-    bool nmakc = !me.verarbeitet;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        style &= ~Style::MausKlick;
-        if( mausIn )
-        {
-            mausIn = 0;
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves && !me.verarbeitet )
-    {
-        mausIn = 1;
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    if( hatStyleNicht( TextFeld::Style::Erlaubt ) || hatStyleNicht( TextFeld::Style::Sichtbar ) )
-    {
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    me.mx -= pos.x;
-    me.my -= pos.y;
-    if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-    {
-        if( !me.verarbeitet )
-        {
-            if( me.id == ME_Betritt && hatStyle( Style::MausKlick ) != MausStand[ M_Links ] )
-                setStyle( Style::MausKlick, MausStand[ M_Links ] );
-            if( !me.verarbeitet && me.id == ME_PLinks )
-                addStyle( Style::MausKlick );
-            if( me.id == ME_RLinks )
-            {
-                removeStyle( Style::MausKlick );
-                setStyle( Style::Selected, !hatStyle( Style::Selected ) );
-            }
-            me.verarbeitet = 1;
-        }
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x;
-    me.my += pos.y;
-}
-
 void KontrollKnopf::render( Bild &zRObj ) // zeichnet nach zRObj
 {
     if( !hatStyle( Style::Sichtbar ) )

+ 6 - 6
Knopf.h

@@ -36,6 +36,9 @@ namespace Framework
         Bild *klickBild;
         AlphaFeld *klickBuffer;
         int klickIndex;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -60,9 +63,6 @@ namespace Framework
         // Setzt die Farbe des Farbübergangs, der verwendet wird, wenn der Knopf gedrückt wird
         //  fc: Die Farbe im A8R8G8B8 Format
         __declspec( dllexport ) void setKBFarbe( int fc );
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Zeichnet das Objekt nach zRObj, falls es sichtbar ist
         //  zRObj: Das Bild, in welches gezeichnet werden soll
         __declspec( dllexport ) void render( Bild &zRObj ) override;
@@ -124,6 +124,9 @@ namespace Framework
         TextRenderer *textRd;
         int sF;
         int sGr;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -204,9 +207,6 @@ namespace Framework
         // Das Bild kasten.gif wird gezeichnet, wenn das Kästchen nicht ausgewählt ist. Das Bild skasten.gif wird gezeichnet, wenn das Kästchen ausgewählt wird
         //  ltdb: Der Pfad zur LTDB Datei
         __declspec( dllexport ) void loadData( const char *ltdb );
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Zeichnet das Objekt nach zRObj, falls es sichtbar ist
         //  zRObj: Das Bild, in welches gezeichnet werden soll
         __declspec( dllexport ) void render( Bild &zRObj ) override;

+ 100 - 144
Liste.cpp

@@ -62,6 +62,69 @@ AuswahlListe::~AuswahlListe()
         schrift->release();
 }
 
+void AuswahlListe::doMausEreignis( MausEreignis &me, bool userRet )
+{
+    if( !userRet || hatStyleNicht( Style::Erlaubt ) )
+        return;
+    if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+    {
+        int rbr = 0;
+        if( rahmen && 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;
+}
+
 // nicht constant 
 void AuswahlListe::update() // aktualisiert die Auswahl Liste
 {
@@ -111,7 +174,7 @@ void AuswahlListe::update() // aktualisiert die Auswahl Liste
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( Text *txt ) // fügt einen Eintrag hinzu
+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 );
@@ -131,7 +194,7 @@ void AuswahlListe::addEintrag( const char *txt )
     rend = 1;
 }
 
-void AuswahlListe::addEintragZ( TextFeld *tf )
+void AuswahlListe::addEintragZ( TextFeld * tf )
 {
     if( !tfListe )
         tfListe = new RCArray< TextFeld >();
@@ -142,7 +205,7 @@ void AuswahlListe::addEintragZ( TextFeld *tf )
     rend = 1;
 }
 
-void AuswahlListe::addEintrag( int pos, Text *txt ) // fügt einen Eintrag bei position pos ein
+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 );
@@ -162,7 +225,7 @@ void AuswahlListe::addEintrag( int pos, const char *txt )
     rend = 1;
 }
 
-void AuswahlListe::addEintragZ( int pos, TextFeld *tf )
+void AuswahlListe::addEintragZ( int pos, TextFeld * tf )
 {
     if( !tfListe )
         tfListe = new RCArray< TextFeld >();
@@ -173,7 +236,7 @@ void AuswahlListe::addEintragZ( int pos, TextFeld *tf )
     rend = 1;
 }
 
-void AuswahlListe::setEintrag( int pos, Text *txt ) // ändert den pos - ten Eintrag
+void AuswahlListe::setEintrag( int pos, Text * txt ) // ändert den pos - ten Eintrag
 {
     TextFeld *tf = 0;
     if( tfListe )
@@ -197,12 +260,12 @@ void AuswahlListe::setEintrag( int pos, Text *txt ) // 
 
 void AuswahlListe::setEintrag( int pos, unsigned char *txt )
 {
-    Text *tx = new Text( (const char*)txt );
+    Text *tx = new Text( (const char *)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 >();
@@ -238,7 +301,7 @@ void AuswahlListe::removeEintrag( int pos ) // l
     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();
@@ -270,7 +333,7 @@ void AuswahlListe::updateVScroll() // scrollt zur Curser Position oder nach Unte
     }
 }
 
-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();
@@ -294,7 +357,7 @@ void AuswahlListe::setALRFarbe( int fc ) // setzt die Farbe des Auswahl Rahmens
     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();
@@ -318,7 +381,7 @@ void AuswahlListe::setAAFFarbe( int fc ) // setzt die Farbe des Auswahl Hintergr
     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();
@@ -337,7 +400,7 @@ void AuswahlListe::setAHFarbe( int f ) // setzt einen Zeiger zur Auswahl Hinterg
     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();
@@ -345,7 +408,7 @@ void AuswahlListe::setAHBildZ( Bild *b ) // setzt einen Zeiger zum Hintergrund 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 >();
@@ -373,7 +436,7 @@ void AuswahlListe::setALRFarbe( int pos, int fc ) // setzt die Farbe des Auswahl
     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 >();
@@ -401,7 +464,7 @@ void AuswahlListe::setAAFFarbe( int pos, int fc ) // setzt die Farbe des Auswahl
     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 >();
@@ -424,7 +487,7 @@ void AuswahlListe::setAHFarbe( int pos, int f ) // setzt einen Zeiger zur Auswah
     rend = 1;
 }
 
-void AuswahlListe::setAHBildZ( int pos, Bild *b ) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
+void AuswahlListe::setAHBildZ( int pos, Bild * b ) // setzt einen Zeiger zum Hintergrund Bild (nur mit MultiStyled)
 {
     if( ahBildListe )
         ahBildListe = new RCArray< Bild >();
@@ -467,114 +530,7 @@ void AuswahlListe::removeMsStyle( int pos, __int64 style )
     rend = 1;
 }
 
-void AuswahlListe::doMausEreignis( MausEreignis &me )
-{
-    bool nmakc = !me.verarbeitet;
-    if( hatStyleNicht( Style::Sichtbar ) || hatStyleNicht( Style::Erlaubt ) )
-        return;
-    bool removeFokus = 0;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-        removeFokus = 1;
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-            removeStyle( Style::Fokus );
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    me.mx -= pos.x, me.my -= pos.y;
-    if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-            removeStyle( Style::Fokus );
-        if( !me.verarbeitet && hatStyleNicht( Style::Fokus ) && me.id == ME_RLinks )
-            addStyle( Style::Fokus );
-        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
-        {
-            int rbr = 0;
-            if( rahmen && 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;
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x, me.my += pos.y;
-}
-
-void AuswahlListe::doTastaturEreignis( TastaturEreignis &te )
+void AuswahlListe::doTastaturEreignis( TastaturEreignis & te )
 {
     bool ntakc = !te.verarbeitet;
     if( hatStyleNicht( Style::Fokus ) || !tak || te.verarbeitet )
@@ -636,7 +592,7 @@ void AuswahlListe::doTastaturEreignis( TastaturEreignis &te )
         delete this;
 }
 
-void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
+void AuswahlListe::render( Bild & zRObj ) // zeichnet nach zRObj
 {
     if( !hatStyle( Style::Sichtbar ) )
         return;
@@ -672,14 +628,14 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                 selected = hatMsStyle( i, Style::Selected );
             else
                 selected = auswahl == i;
-            AlphaFeld *tmpBuffer = 0;
+            AlphaFeld * tmpBuffer = 0;
             bool tmpB = 0;
             int tmpHFarbe = 0;
             bool tmpH = 0;
-            Bild *tmpHBild = 0;
+            Bild * tmpHBild = 0;
             bool tmpHB = 0;
             bool tmpHAlpha = 0;
-            Rahmen *tmpRahmen = 0;
+            Rahmen * tmpRahmen = 0;
             bool tmpR = 0;
             if( selected )
             {
@@ -688,7 +644,7 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                     if( hatStyle( Style::AuswahlBuffer ) && aBuffer )
                     {
                         tmpBuffer = tf->getAlphaFeld();
-                        tf->setAlphaFeldZ( (AlphaFeld*)aBuffer->getThis() );
+                        tf->setAlphaFeldZ( (AlphaFeld *)aBuffer->getThis() );
                         tmpB = tf->hatStyle( TextFeld::Style::Buffered );
                         tf->setStyle( TextFeld::Style::Buffered, hatStyle( Style::AuswahlBuffer ) );
                     }
@@ -714,7 +670,7 @@ void AuswahlListe::render( Bild &zRObj ) // zeichnet nach zRObj
                     if( hatStyle( Style::AuswahlRahmen ) && aRahmen )
                     {
                         tmpRahmen = tf->getRahmen();
-                        tf->setRahmenZ( (Rahmen*)aRahmen->getThis() );
+                        tf->setRahmenZ( (Rahmen *)aRahmen->getThis() );
                         tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
                         tf->setStyle( TextFeld::Style::Rahmen, hatStyle( Style::AuswahlRahmen ) );
                     }
@@ -876,7 +832,7 @@ int AuswahlListe::getAuswahl() const // gibt den ersten ausgew
     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
 {
     for( int i = 0; i < entries; ++i )
     {
@@ -893,9 +849,9 @@ TextFeld *AuswahlListe::getEintrag( int pos ) const // gibt den pos- ten Eintrag
 {
     if( !tfListe )
         return 0;
-    TextFeld *ret = (TextFeld*)tfListe->get( pos );
+    TextFeld *ret = (TextFeld *)tfListe->get( pos );
     if( ret )
-        return (TextFeld*)ret->getThis();
+        return (TextFeld *)ret->getThis();
     return 0;
 }
 
@@ -903,13 +859,13 @@ TextFeld *AuswahlListe::zEintrag( int pos ) const
 {
     if( !tfListe )
         return 0;
-    return (TextFeld*)tfListe->z( pos );
+    return (TextFeld *)tfListe->z( pos );
 }
 
 Rahmen *AuswahlListe::getARahmen() const // gibt den Auswahl Rahmen zurück (ohne MultiStyled)
 {
     if( aRahmen )
-        return (Rahmen*)aRahmen->getThis();
+        return (Rahmen *)aRahmen->getThis();
     return 0;
 }
 
@@ -938,7 +894,7 @@ Bild *AuswahlListe::zAHBild() const
 AlphaFeld *AuswahlListe::getABuffer() const // gibt den Auswahl Buffer zurück (ohne MultiStyled)
 {
     if( aBuffer )
-        return (AlphaFeld*)aBuffer->getThis();
+        return (AlphaFeld *)aBuffer->getThis();
     return 0;
 }
 
@@ -951,9 +907,9 @@ Rahmen *AuswahlListe::getARahmen( int pos ) const // gibt den Auswahl Rahmen zur
 {
     Rahmen *ret = 0;
     if( aRahmenListe )
-        ret = (Rahmen*)aRahmenListe->get( pos );
+        ret = (Rahmen *)aRahmenListe->get( pos );
     if( ret )
-        return (Rahmen*)ret->getThis();
+        return (Rahmen *)ret->getThis();
     return 0;
 }
 
@@ -961,7 +917,7 @@ Rahmen *AuswahlListe::zARahmen( int pos ) const
 {
     Rahmen *ret = 0;
     if( aRahmenListe )
-        ret = (Rahmen*)aRahmenListe->z( pos );
+        ret = (Rahmen *)aRahmenListe->z( pos );
     return ret;
 }
 
@@ -976,7 +932,7 @@ Bild *AuswahlListe::getAHBild( int pos ) const // gibt das Auswahl Hintergrund B
 {
     Bild *ret = 0;
     if( ahBildListe )
-        ret = (Bild*)ahBildListe->get( pos );
+        ret = (Bild *)ahBildListe->get( pos );
     if( ret )
         return ret->getThis();
     return 0;
@@ -986,7 +942,7 @@ Bild *AuswahlListe::zAHBild( int pos ) const
 {
     Bild *ret = 0;
     if( ahBildListe )
-        ret = (Bild*)ahBildListe->z( pos );
+        ret = (Bild *)ahBildListe->z( pos );
     return ret;
 }
 
@@ -994,9 +950,9 @@ AlphaFeld *AuswahlListe::getABuffer( int pos ) const // gibt den Auswahl Buffer
 {
     AlphaFeld *ret = 0;
     if( aBufferListe )
-        ret = (AlphaFeld*)aBufferListe->get( pos );
+        ret = (AlphaFeld *)aBufferListe->get( pos );
     if( ret )
-        return (AlphaFeld*)ret->getThis();
+        return (AlphaFeld *)ret->getThis();
     return 0;
 }
 
@@ -1004,7 +960,7 @@ AlphaFeld *AuswahlListe::zABuffer( int pos ) const
 {
     AlphaFeld *ret = 0;
     if( aBufferListe )
-        ret = (AlphaFeld*)aBufferListe->z( pos );
+        ret = (AlphaFeld *)aBufferListe->z( pos );
     return ret;
 }
 bool AuswahlListe::hatMsStyle( int pos, __int64 style ) const // prüft ob style vorhanden (mit MultiStyled)

+ 3 - 3
Liste.h

@@ -53,6 +53,9 @@ namespace Framework
         RCArray< AlphaFeld > *aBufferListe;
         RCArray< Rahmen > *aRahmenListe;
         Schrift *schrift;
+        // Verarbeitet Tastatur Nachrichten
+        //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -189,9 +192,6 @@ namespace Framework
         //  pos: Der Index des Eintrags
         //  style: Der Style, der entfernt werden soll
         __declspec( dllexport ) void removeMsStyle( int pos, __int64 style );
-        // Verarbeitet Tastatur Nachrichten
-        //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
         //  te: Das Ereignis
         __declspec( dllexport ) void doTastaturEreignis( TastaturEreignis &te ) override;

+ 50 - 89
M2DVorschau.cpp

@@ -34,105 +34,66 @@ M2DVorschau::~M2DVorschau()
         af->release();
 }
 
-// nicht constant
-void M2DVorschau::setModel2DZ( Model2D *mdl )
-{
-    if( this->mdl )
-        this->mdl->release();
-    this->mdl = mdl;
-    rend = 1;
-}
-
-void M2DVorschau::setModel2D( Model2DData *mdl )
-{
-    if( !this->mdl )
-        this->mdl = new Model2D();
-    this->mdl->setModel( mdl );
-    rend = 1;
-}
-
-void M2DVorschau::doMausEreignis( MausEreignis &me )
+void M2DVorschau::doMausEreignis( MausEreignis &me, bool userRet )
 {
-    if( hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Sichtbar ) )
-    {
-        mausIn = 0;
-        if( toolTip )
-            toolTip->setMausIn( 0 );
+    if( hatStyleNicht( Style::Erlaubt ) || !userRet )
         return;
-    }
-    if( me.verarbeitet || ( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves ) )
+    if( hatStyle( Style::UsrScale ) )
     {
-        if( mausIn )
-        {
-            mausIn = 0;
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-        }
-        return;
+        if( mdl && me.id == ME_UScroll )
+            mdl->addSize( 0.01f );
+        if( mdl && me.id == ME_DScroll )
+            mdl->addSize( -0.01f );
     }
-    if( !mausIn && me.id != ME_Leaves )
+    if( me.id == ME_RLinks || me.id == ME_RRechts || me.id == ME_Leaves )
     {
-        mausIn = 1;
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
+        mx = -1;
+        my = -1;
     }
-    me.mx -= pos.x, me.my -= pos.y;
-    if( mak && mak( makParam, this, me ) )
+    if( mdl && me.id == ME_Bewegung )
     {
-        if( hatStyle( Style::UsrScale ) )
-        {
-            if( mdl && me.id == ME_UScroll )
-                mdl->addSize( 0.01f );
-            if( mdl && me.id == ME_DScroll )
-                mdl->addSize( -0.01f );
-        }
-        if( me.id == ME_RLinks || me.id == ME_RRechts || me.id == ME_Leaves )
+        if( mx != -1 && my != -1 )
         {
-            mx = -1;
-            my = -1;
-        }
-        if( mdl && me.id == ME_Bewegung )
-        {
-            if( mx != -1 && my != -1 )
+            if( getMausStand( M_Links ) && hatStyle( Style::UsrMove ) )
+                mdl->setPosition( mdl->getPosition() + Punkt( me.mx - mx, me.my - my ) );
+            if( getMausStand( M_Rechts ) && hatStyle( Style::UsrRot ) )
             {
-                if( getMausStand( M_Links ) && hatStyle( Style::UsrMove ) )
-                    mdl->setPosition( mdl->getPosition() + Punkt( me.mx - mx, me.my - my ) );
-                if( getMausStand( M_Rechts ) && hatStyle( Style::UsrRot ) )
-                {
-                    if( me.mx > gr.x / 2 )
-                        mdl->addDrehung( 0.01f * (float)( me.my - my ) );
-                    else
-                        mdl->addDrehung( -0.01f * (float)( me.my - my ) );
-                    if( me.my > gr.y / 2 )
-                        mdl->addDrehung( -0.01f * (float)( me.mx - mx ) );
-                    else
-                        mdl->addDrehung( 0.01f * (float)( me.mx - mx ) );
-                }
-                mx = me.mx;
-                my = me.my;
+                if( me.mx > gr.x / 2 )
+                    mdl->addDrehung( 0.01f * (float)( me.my - my ) );
+                else
+                    mdl->addDrehung( -0.01f * (float)( me.my - my ) );
+                if( me.my > gr.y / 2 )
+                    mdl->addDrehung( -0.01f * (float)( me.mx - mx ) );
+                else
+                    mdl->addDrehung( 0.01f * (float)( me.mx - mx ) );
             }
-        }
-        if( me.id == ME_PLinks || me.id == ME_PRechts )
-        {
             mx = me.mx;
             my = me.my;
         }
-        if( nMak && me.verarbeitet )
-            me.verarbeitet = nMak( nmakParam, this, me );
     }
-    me.mx += pos.x, me.my += pos.y;
+    if( me.id == ME_PLinks || me.id == ME_PRechts )
+    {
+        mx = me.mx;
+        my = me.my;
+    }
+    me.verarbeitet = 1;
+}
+
+// nicht constant
+void M2DVorschau::setModel2DZ( Model2D * mdl )
+{
+    if( this->mdl )
+        this->mdl->release();
+    this->mdl = mdl;
+    rend = 1;
+}
+
+void M2DVorschau::setModel2D( Model2DData * mdl )
+{
+    if( !this->mdl )
+        this->mdl = new Model2D();
+    this->mdl->setModel( mdl );
+    rend = 1;
 }
 
 bool M2DVorschau::tick( double tv )
@@ -143,7 +104,7 @@ bool M2DVorschau::tick( double tv )
     return ZeichnungHintergrund::tick( tv );
 }
 
-void M2DVorschau::render( Bild &rb )
+void M2DVorschau::render( Bild & rb )
 {
     removeStyle( Style::VScroll | Style::HScroll );
     if( hatStyleNicht( Style::Sichtbar ) )
@@ -168,7 +129,7 @@ Model2D *M2DVorschau::zModel() const
 
 Model2D *M2DVorschau::getModel() const
 {
-    return mdl ? (Model2D*)mdl->getThis() : 0;
+    return mdl ? (Model2D *)mdl->getThis() : 0;
 }
 
 Zeichnung *M2DVorschau::dublizieren() const
@@ -177,9 +138,9 @@ Zeichnung *M2DVorschau::dublizieren() const
     if( mdl )
         ret->setModel2D( mdl->getModel() );
     if( rahmen )
-        ret->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
+        ret->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
     if( hintergrundFeld )
-        ret->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
+        ret->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
     ret->setHintergrundFarbe( bgF );
     return ret;
 }

+ 3 - 3
M2DVorschau.h

@@ -29,6 +29,9 @@ namespace Framework
         int bgF;
         int mx;
         int my;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor
@@ -41,9 +44,6 @@ namespace Framework
         // Setzt die Daten des Models, das angezeigt werden soll
         //  mdl: Die Daten
         __declspec( dllexport ) void setModel2D( Model2DData *mdl );
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Aktualisiert das Objekt. Wird vom Framework aufgerufen
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst

+ 2 - 6
MausEreignis.h

@@ -31,18 +31,14 @@ namespace Framework
     {
         // Art der Eingabe
         int id;
-        // die originale id des maus ereignisses
-        int rid;
         // X koordinate auf dem Bildschirm relativ zur Zeichnungposition
         int mx;
         // Y Koordinate auf dem Bildschirm relativ zur Zeichnungposition
         int my;
-        // X Koordinate auf dem Bildschirm zur linken oberen Ecke
-        int rmx;
-        // Y Koordinate auf dem Bildschirm zur linken oberen Ecke
-        int rmy;
         // Speichert, ob die Eingabe bereits verarbeitet wurde
         bool verarbeitet;
+        // Speichert, ob sich das mausereignis innerhalb des Objektes befindet, welches dieses Objekt beinhaltet
+        bool insideParent;
     };
 
     // Speichert eine bestimmte Mauseingabe des Nutzers

+ 7 - 12
Model2D.cpp

@@ -1137,18 +1137,6 @@ void Model2D::setFarbe( int f )
     rend = 1;
 }
 
-void Model2D::doMausEreignis( MausEreignis & me )
-{
-    if( !mak || me.verarbeitet || !istPunktInnen( Punkt( me.mx, me.my ) ) )
-        return;
-    me.mx -= pos.x;
-    me.my -= pos.y;
-    mak( makParam, this, me );
-    me.mx += pos.x;
-    me.my += pos.y;
-    me.verarbeitet = 1;
-}
-
 bool Model2D::tick( double tickVal )
 {
     return Zeichnung::tick( tickVal );
@@ -1263,6 +1251,13 @@ float Model2D::getSize() const
     return size;
 }
 
+// Gibt zurück, ob ein Punkt in dem Model enthalten ist
+//  p: Der Punkt
+bool Model2D::istPunktInnen( int x, int y ) const
+{
+    return istPunktInnen( Vertex( (float)x, (float)y ) );
+}
+
 bool Model2D::istPunktInnen( Vertex p ) const
 {
     if( !rData )

+ 3 - 3
Model2D.h

@@ -199,9 +199,6 @@ namespace Framework
         // Setzt die Farbe
         //  f: Die Farbe im A8R8G8B8 Format
         __declspec( dllexport ) void setFarbe( int f );
-        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
-        //  me: Das Ereignis
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet die Zeit, die seit dem letzten aufruf dieser Funktion vergangen ist
         //  tickVal: Die vergangene Zeit in Sekunden
         __declspec( dllexport ) bool tick( double tickVal ) override;
@@ -214,6 +211,9 @@ namespace Framework
         __declspec( dllexport ) float getSize() const;
         // Gibt zurück, ob ein Punkt in dem Model enthalten ist
         //  p: Der Punkt
+        __declspec( dllexport ) bool istPunktInnen( int x, int y ) const override;
+        // Gibt zurück, ob ein Punkt in dem Model enthalten ist
+        //  p: Der Punkt
         __declspec( dllexport ) bool istPunktInnen( Vertex p ) const;
         // Überprüft, ob eine Linie im Model enthalten ist
         //  a: Der startpunkt der Linie

+ 12 - 0
Scroll.cpp

@@ -156,6 +156,12 @@ VScrollBar::~VScrollBar()
 
 bool VScrollBar::doMausMessage( int x, int y, int br, int hi, MausEreignis &me )
 {
+    if( me.id == ME_Leaves )
+    {
+        mp = 0;
+        mx = -1;
+        my = -1;
+    }
     bool ret = me.mx >= x && me.mx <= x + br && me.my >= y && me.my <= y + hi;
     knopfdruck = 0;
     if( me.verarbeitet )
@@ -255,6 +261,12 @@ HScrollBar::~HScrollBar()
 // nicht constant
 bool HScrollBar::doMausMessage( int x, int y, int br, int hi, MausEreignis &me )
 {
+    if( me.id == ME_Leaves )
+    {
+        mp = 0;
+        mx = -1;
+        my = -1;
+    }
     bool ret = me.mx >= x && me.mx <= x + br && me.my >= y && me.my <= y + hi;
     knopfdruck = 0;
     if( me.verarbeitet )

+ 239 - 266
Tabelle.cpp

@@ -40,7 +40,7 @@ ObjTabelle::ObjTabelle()
     msaAf( new RCArray< RCArray< AlphaFeld > >() ),
     styles( new RCArray< Array< __int64 > >() )
 {
-    style = 0;
+    style = Style::MEIgnoreInside | Style::MEIgnoreParentInside | Style::MEIgnoreSichtbar | Style::MEIgnoreVerarbeitet;
 }
 
 // Destruktor 
@@ -76,6 +76,182 @@ ObjTabelle::~ObjTabelle()
         styles->release();
 }
 
+void ObjTabelle::doMausEreignis( MausEreignis &me, bool userRet ) // verarbeitet Nachrichten
+{
+    if( !hatStyle( Style::Sichtbar ) || !me.insideParent || me.verarbeitet || me.mx < 0 || me.my < 0 || me.mx >= gr.x || me.my >= gr.y || !userRet )
+    {
+        if( me.id == ME_PLinks )
+        {
+            klickSpalte = -1;
+            klickZeile = -1;
+        }
+        bool insideParent = me.insideParent;
+        me.insideParent = 0;
+        int rbr = 0;
+        if( hatStyle( Style::Rahmen ) && rahmen )
+            rbr = rahmen->getRBreite();
+        me.mx -= rbr;
+        me.my -= rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my += vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx += horizontalScrollBar->getScroll();
+        if( me.id != ME_Betritt && me.id != ME_Leaves )
+        {
+            for( int i = 0; i < zeilenAnzahl; ++i )
+            {
+                for( int j = 0; j < spaltenAnzahl; ++j )
+                {
+                    bool b = me.verarbeitet;
+                    Zeichnung *obj = zZeichnung( j, i );
+                    if( obj )
+                        obj->doPublicMausEreignis( me );
+                }
+            }
+        }
+        me.mx += rbr;
+        me.my += rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my -= vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx -= horizontalScrollBar->getScroll();
+        me.insideParent = insideParent;
+        return;
+    }
+    int tmx = me.mx;
+    int tmy = me.my;
+    bool aufScroll = 0;
+    if( vertikalScrollBar && hatStyle( Style::VScroll ) && me.mx > pos.x + gr.x - 15 )
+        aufScroll = 1;
+    if( horizontalScrollBar && hatStyle( Style::HScroll ) && me.my > pos.y + gr.y - 15 )
+        aufScroll = 1;
+    me.mx -= ( ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0 );
+    me.my -= ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0 );
+    lockZeichnung();
+    if( !me.verarbeitet && !aufScroll )
+    {
+        double ox = getMausSpalte( me.mx + ( ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0 ) );
+        double oy = getMausZeile( me.my + ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0 ) );
+        if( me.id == ME_RLinks )
+        {
+            klickSpalte = -1;
+            klickZeile = -1;
+            mSpalte = -1, mZeile = -1;
+        }
+        if( ( hatStyle( Style::SpaltenBreiteChangeable ) || hatStyle( Style::ZeilenHeightChangeable ) ) && klickSpalte < 0 && klickZeile < 0 )
+        {
+            if( hatStyle( Style::SpaltenBreiteChangeable ) )
+            {
+                if( me.id == ME_PLinks && ox != (int)ox )
+                {
+                    mSpalte = ox;
+                    mx = me.mx;
+                    rend = 1;
+                }
+                if( mSpalte > -1 )
+                {
+                    int br = getSpaltenBreite( (int)mSpalte ) + ( me.mx - mx );
+                    if( hatStyle( Style::SpaltenBreiteMax ) && br > getMaxSpaltenBreite( (int)mSpalte ) )
+                        br = getMaxSpaltenBreite( (int)mSpalte );
+                    if( hatStyle( Style::SpaltenBreiteMin ) && br < getMinSpaltenBreite( (int)mSpalte ) )
+                        br = getMinSpaltenBreite( (int)mSpalte );
+                    setSpaltenBreite( (int)mSpalte, br );
+                    mx = me.mx;
+                    rend = 1;
+                }
+            }
+            if( hatStyle( Style::ZeilenHeightChangeable ) )
+            {
+                if( me.id == ME_PLinks && oy != (int)oy )
+                {
+                    mZeile = oy;
+                    my = me.my;
+                    rend = 1;
+                }
+                if( mZeile > -1 )
+                {
+                    int hi = getZeilenHeight( (int)mZeile ) + ( me.my - my );
+                    if( hatStyle( Style::ZeilenHeightMax ) && hi > getMaxZeilenHeight( (int)mZeile ) )
+                        hi = getMaxZeilenHeight( (int)mZeile );
+                    if( hatStyle( Style::ZeilenHeightMin ) && hi < getMinZeilenHeight( (int)mZeile ) )
+                        hi = getMinZeilenHeight( (int)mZeile );
+                    setZeilenHeight( (int)mZeile, hi );
+                    my = me.my;
+                    rend = 1;
+                }
+            }
+        }
+        if( hatStyle( Style::SpaltenBeweglich ) && ox == (int)ox && mSpalte == -1 && mZeile == -1 )
+        {
+            if( klickSpalte >= 0 && klickSpalte < spaltenAnzahl && klickSpalte != ox && !oy && ox >= 0 )
+            {
+                setSpaltePosition( klickSpalte, (int)ox );
+                klickSpalte = (int)ox;
+                rend = 1;
+            }
+            if( me.id == ME_PLinks )
+            {
+                if( !oy && klickSpalte < 0 )
+                {
+                    klickSpalte = (int)ox;
+                    rend = 1;
+                }
+            }
+        }
+        if( hatStyle( Style::ZeilenBeweglich ) && oy == (int)oy && mSpalte == -1 && mZeile == -1 )
+        {
+            if( klickZeile >= 0 && klickZeile < zeilenAnzahl && klickZeile != oy && !ox && oy >= 0 )
+            {
+                setZeilePosition( klickZeile, (int)oy );
+                klickZeile = (int)oy;
+                rend = 1;
+            }
+            if( me.id == ME_PLinks )
+            {
+                if( !ox && klickZeile < 0 )
+                {
+                    klickZeile = (int)oy;
+                    rend = 1;
+                }
+            }
+        }
+    }
+    me.mx += ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0;
+    me.my += ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0;
+    bool vs = hatStyle( Style::VScroll ) && vertikalScrollBar;
+    bool hs = hatStyle( Style::HScroll ) && horizontalScrollBar;
+    int rbr = rahmen ? rahmen->getRBreite() : 0;
+    if( vs )
+    {
+        if( hs )
+            horizontalScrollBar->doMausMessage( rbr, gr.y - 15 - rbr, gr.x - 15 - rbr * 2, 15, me );
+        vertikalScrollBar->doMausMessage( gr.x - 15 - rbr, rbr, 15, gr.y - rbr * 2, me );
+    }
+    else if( hs )
+        horizontalScrollBar->doMausMessage( rbr, gr.y - 15 - rbr, gr.x - rbr * 2, 15, me );
+    if( aufScroll )
+        me.verarbeitet = 1;
+    if( me.id != ME_Betritt && me.id != ME_Leaves )
+    {
+        for( int i = 0; i < zeilenAnzahl; ++i )
+        {
+            for( int j = 0; j < spaltenAnzahl; ++j )
+            {
+                bool b = me.verarbeitet;
+                Zeichnung *obj = zZeichnung( j, i );
+                if( obj )
+                    obj->doPublicMausEreignis( me );
+                if( !b && me.verarbeitet && me.id == ME_PLinks )
+                    selected = Punkt( j, i );
+            }
+        }
+    }
+    unlockZeichnung();
+    me.verarbeitet = 1;
+    me.mx = tmx;
+    me.my = tmy;
+}
+
 // nicht constant 
 void ObjTabelle::addSpalte( const char *name ) // Spalte hinzufügen
 {
@@ -90,7 +266,7 @@ void ObjTabelle::addSpalte( const char *name ) // Spalte hinzuf
     unlockZeichnung();
 }
 
-void ObjTabelle::addSpalte( Text *name )
+void ObjTabelle::addSpalte( Text * name )
 {
     lockZeichnung();
     members->add( new RCArray< Zeichnung >(), spaltenAnzahl );
@@ -121,7 +297,7 @@ void ObjTabelle::addSpalte( int sNum, const char *name ) // Spalte bei sNum einf
     unlockZeichnung();
 }
 
-void ObjTabelle::addSpalte( int sNum, Text *name )
+void ObjTabelle::addSpalte( int sNum, Text * name )
 {
     if( sNum > spaltenAnzahl )
         return;
@@ -149,7 +325,7 @@ void ObjTabelle::addZeile( const char *name ) // Zeile Hinzuf
     unlockZeichnung();
 }
 
-void ObjTabelle::addZeile( Text *name )
+void ObjTabelle::addZeile( Text * name )
 {
     lockZeichnung();
     zeilenNamen->add( name, zeilenAnzahl );
@@ -184,7 +360,7 @@ void ObjTabelle::addZeile( int zNum, const char *name ) // Zeile bei zNum einf
     unlockZeichnung();
 }
 
-void ObjTabelle::addZeile( int zNum, Text *name )
+void ObjTabelle::addZeile( int zNum, Text * name )
 {
     if( zNum > zeilenAnzahl )
         return;
@@ -236,7 +412,7 @@ void ObjTabelle::removeSpalte( const char *name )
     removeSpalte( getSpaltenNummer( name ) );
 }
 
-void ObjTabelle::removeSpalte( Text *name )
+void ObjTabelle::removeSpalte( Text * name )
 {
     removeSpalte( getSpaltenNummer( name ) );
 }
@@ -271,7 +447,7 @@ void ObjTabelle::removeZeile( const char *name )
     removeZeile( getZeilenNummer( name ) );
 }
 
-void ObjTabelle::removeZeile( Text *name )
+void ObjTabelle::removeZeile( Text * name )
 {
     removeZeile( getZeilenNummer( name ) );
 }
@@ -281,7 +457,7 @@ void ObjTabelle::setSpaltePosition( const char *name, int pos ) // setzt die Pos
     setSpaltePosition( getSpaltenNummer( name ), pos );
 }
 
-void ObjTabelle::setSpaltePosition( Text *name, int pos )
+void ObjTabelle::setSpaltePosition( Text * name, int pos )
 {
     setSpaltePosition( getSpaltenNummer( name ), pos );
 }
@@ -320,7 +496,7 @@ void ObjTabelle::setZeilePosition( const char *name, int pos ) // setzt die Zeil
     setZeilePosition( getZeilenNummer( name ), pos );
 }
 
-void ObjTabelle::setZeilePosition( Text *name, int pos )
+void ObjTabelle::setZeilePosition( Text * name, int pos )
 {
     setZeilePosition( getZeilenNummer( name ), pos );
 }
@@ -371,7 +547,7 @@ void ObjTabelle::setZeilePosition( int zNum, int pos )
     unlockZeichnung();
 }
 
-void ObjTabelle::setZeichnungZ( int sNum, int zNum, Zeichnung *obj ) // setzt ein Zeichnung
+void ObjTabelle::setZeichnungZ( int sNum, int zNum, Zeichnung * obj ) // setzt ein Zeichnung
 {
     if( sNum >= spaltenAnzahl || zNum >= zeilenAnzahl )
         return;
@@ -383,12 +559,12 @@ void ObjTabelle::setZeichnungZ( int sNum, int zNum, Zeichnung *obj ) // setzt ei
     unlockZeichnung();
 }
 
-void ObjTabelle::setZeichnungZ( const char *spaltenName, const char *zeilenName, Zeichnung *zZeichnung )
+void ObjTabelle::setZeichnungZ( const char *spaltenName, const char *zeilenName, Zeichnung * zZeichnung )
 {
     setZeichnungZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), zZeichnung );
 }
 
-void ObjTabelle::setZeichnungZ( Text *spaltenName, Text *zeilenName, Zeichnung *zZeichnung )
+void ObjTabelle::setZeichnungZ( Text * spaltenName, Text * zeilenName, Zeichnung * zZeichnung )
 {
     setZeichnungZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), zZeichnung );
 }
@@ -408,7 +584,7 @@ void ObjTabelle::setSpaltenBreite( const char *name, int br )
     setSpaltenBreite( getSpaltenNummer( name ), br );
 }
 
-void ObjTabelle::setSpaltenBreite( Text *name, int br )
+void ObjTabelle::setSpaltenBreite( Text * name, int br )
 {
     setSpaltenBreite( getSpaltenNummer( name ), br );
 }
@@ -428,7 +604,7 @@ void ObjTabelle::setZeilenHeight( const char *name, int hi )
     setZeilenHeight( getZeilenNummer( name ), hi );
 }
 
-void ObjTabelle::setZeilenHeight( Text *name, int hi )
+void ObjTabelle::setZeilenHeight( Text * name, int hi )
 {
     setZeilenHeight( getZeilenNummer( name ), hi );
 }
@@ -448,7 +624,7 @@ void ObjTabelle::setMinSpaltenBreite( const char *name, int minBr )
     setMinSpaltenBreite( getSpaltenNummer( name ), minBr );
 }
 
-void ObjTabelle::setMinSpaltenBreite( Text *name, int minBr )
+void ObjTabelle::setMinSpaltenBreite( Text * name, int minBr )
 {
     setMinSpaltenBreite( getSpaltenNummer( name ), minBr );
 }
@@ -468,7 +644,7 @@ void ObjTabelle::setMaxSpaltenBreite( const char *name, int maxBr )
     setMaxSpaltenBreite( getSpaltenNummer( name ), maxBr );
 }
 
-void ObjTabelle::setMaxSpaltenBreite( Text *name, int maxBr )
+void ObjTabelle::setMaxSpaltenBreite( Text * name, int maxBr )
 {
     setMaxSpaltenBreite( getSpaltenNummer( name ), maxBr );
 }
@@ -488,7 +664,7 @@ void ObjTabelle::setMinZeilenHeight( const char *name, int minHi )
     setMinZeilenHeight( getZeilenNummer( name ), minHi );
 }
 
-void ObjTabelle::setMinZeilenHeight( Text *name, int minHi )
+void ObjTabelle::setMinZeilenHeight( Text * name, int minHi )
 {
     setMinZeilenHeight( getZeilenNummer( name ), minHi );
 }
@@ -508,7 +684,7 @@ void ObjTabelle::setMaxZeilenHeight( const char *name, int maxHi )
     setMaxZeilenHeight( getZeilenHeight( name ), maxHi );
 }
 
-void ObjTabelle::setMaxZeilenHeight( Text *name, int maxHi )
+void ObjTabelle::setMaxZeilenHeight( Text * name, int maxHi )
 {
     setMaxZeilenHeight( getZeilenHeight( name ), maxHi );
 }
@@ -529,7 +705,7 @@ void ObjTabelle::setAuswahl( const char *spaltenName, const char *zeilenName )
     setAuswahl( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-void ObjTabelle::setAuswahl( Text *spaltenName, Text *zeilenName )
+void ObjTabelle::setAuswahl( Text * spaltenName, Text * zeilenName )
 {
     setAuswahl( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
@@ -546,7 +722,7 @@ void ObjTabelle::setRasterBreite( int br ) // setzt die Breite des Rasters
     rend = 1;
 }
 
-void ObjTabelle::setARahmenZ( Rahmen *ram ) // setzt den auswahl Rahmen
+void ObjTabelle::setARahmenZ( Rahmen * ram ) // setzt den auswahl Rahmen
 {
     if( aRam )
         aRam->release();
@@ -570,7 +746,7 @@ void ObjTabelle::setARBreite( int br ) // setzt die auswahl Rahmen Breite
     rend = 1;
 }
 
-void ObjTabelle::setAAlphaFeldZ( AlphaFeld *af ) // setzt das auswahl AlphaFeld
+void ObjTabelle::setAAlphaFeldZ( AlphaFeld * af ) // setzt das auswahl AlphaFeld
 {
     if( aAf )
         aAf->release();
@@ -594,19 +770,19 @@ void ObjTabelle::setAAfStrength( int st ) // setzt die St
     rend = 1;
 }
 
-void ObjTabelle::setARahmenZ( int sNum, int zNum, Rahmen *ram ) // setzt den auswahl Rahmen
+void ObjTabelle::setARahmenZ( int sNum, int zNum, Rahmen * ram ) // setzt den auswahl Rahmen
 {
     if( msaRam->z( sNum ) )
         msaRam->z( sNum )->set( ram, zNum );
     rend = 1;
 }
 
-void ObjTabelle::setARahmenZ( const char *spaltenName, const char *zeilenName, Rahmen *ram )
+void ObjTabelle::setARahmenZ( const char *spaltenName, const char *zeilenName, Rahmen * ram )
 {
     setARahmenZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), ram );
 }
 
-void ObjTabelle::setARahmenZ( Text *spaltenName, Text *zeilenName, Rahmen *ram )
+void ObjTabelle::setARahmenZ( Text * spaltenName, Text * zeilenName, Rahmen * ram )
 {
     setARahmenZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), ram );
 }
@@ -631,7 +807,7 @@ void ObjTabelle::setARFarbe( const char *spaltenName, const char *zeilenName, in
     setARFarbe( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), f );
 }
 
-void ObjTabelle::setARFarbe( Text *spaltenName, Text *zeilenName, int f )
+void ObjTabelle::setARFarbe( Text * spaltenName, Text * zeilenName, int f )
 {
     setARFarbe( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), f );
 }
@@ -656,24 +832,24 @@ void ObjTabelle::setARBreite( const char *spaltenName, const char *zeilenName, i
     setARBreite( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), br );
 }
 
-void ObjTabelle::setARBreite( Text *spaltenName, Text *zeilenName, int br )
+void ObjTabelle::setARBreite( Text * spaltenName, Text * zeilenName, int br )
 {
     setARBreite( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), br );
 }
 
-void ObjTabelle::setAAlphaFeldZ( int sNum, int zNum, AlphaFeld *af ) // setzt das auswahl AlphaFeld
+void ObjTabelle::setAAlphaFeldZ( int sNum, int zNum, AlphaFeld * af ) // setzt das auswahl AlphaFeld
 {
     if( msaAf->z( sNum ) )
         msaAf->z( sNum )->set( af, zNum );
     rend = 1;
 }
 
-void ObjTabelle::setAAlphaFeldZ( const char *spaltenName, const char *zeilenName, AlphaFeld *af )
+void ObjTabelle::setAAlphaFeldZ( const char *spaltenName, const char *zeilenName, AlphaFeld * af )
 {
     setAAlphaFeldZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), af );
 }
 
-void ObjTabelle::setAAlphaFeldZ( Text *spaltenName, Text *zeilenName, AlphaFeld *af )
+void ObjTabelle::setAAlphaFeldZ( Text * spaltenName, Text * zeilenName, AlphaFeld * af )
 {
     setAAlphaFeldZ( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), af );
 }
@@ -698,7 +874,7 @@ void ObjTabelle::setAAfFarbe( const char *spaltenName, const char *zeilenName, i
     setAAfFarbe( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), f );
 }
 
-void ObjTabelle::setAAfFarbe( Text *spaltenName, Text *zeilenName, int f )
+void ObjTabelle::setAAfFarbe( Text * spaltenName, Text * zeilenName, int f )
 {
     setAAfFarbe( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), f );
 }
@@ -723,7 +899,7 @@ void ObjTabelle::setAAfStrength( const char *spaltenName, const char *zeilenName
     setAAfStrength( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), st );
 }
 
-void ObjTabelle::setAAfStrength( Text *spaltenName, Text *zeilenName, int st )
+void ObjTabelle::setAAfStrength( Text * spaltenName, Text * zeilenName, int st )
 {
     setAAfStrength( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), st );
 }
@@ -742,7 +918,7 @@ void ObjTabelle::addMsStyle( const char *spaltenName, const char *zeilenName, __
     addMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
 
-void ObjTabelle::addMsStyle( Text *spaltenName, Text *zeilenName, __int64 style )
+void ObjTabelle::addMsStyle( Text * spaltenName, Text * zeilenName, __int64 style )
 {
     addMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
@@ -761,7 +937,7 @@ void ObjTabelle::setMsStyle( const char *spaltenName, const char *zeilenName, __
     setMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
 
-void ObjTabelle::setMsStyle( Text *spaltenName, Text *zeilenName, __int64 style )
+void ObjTabelle::setMsStyle( Text * spaltenName, Text * zeilenName, __int64 style )
 {
     setMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
@@ -785,7 +961,7 @@ void ObjTabelle::setMsStyle( const char *spaltenName, const char *zeilenName, __
     setMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style, add_remove );
 }
 
-void ObjTabelle::setMsStyle( Text *spaltenName, Text *zeilenName, __int64 style, bool add_remove )
+void ObjTabelle::setMsStyle( Text * spaltenName, Text * zeilenName, __int64 style, bool add_remove )
 {
     setMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style, add_remove );
 }
@@ -804,7 +980,7 @@ void ObjTabelle::removeMsStyle( const char *spaltenName, const char *zeilenName,
     removeMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
 
-void ObjTabelle::removeMsStyle( Text *spaltenName, Text *zeilenName, __int64 style )
+void ObjTabelle::removeMsStyle( Text * spaltenName, Text * zeilenName, __int64 style )
 {
     removeMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
@@ -825,210 +1001,7 @@ bool ObjTabelle::tick( double tickVal ) // tick Message
     return ZeichnungHintergrund::tick( tickVal );
 }
 
-void ObjTabelle::doMausEreignis( MausEreignis &me ) // verarbeitet Nachrichten
-{
-    bool nmakc = !me.verarbeitet;
-    if( hatStyleNicht( Style::Sichtbar ) || hatStyleNicht( Style::Erlaubt ) )
-        return;
-    bool removeFokus = 0;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-        removeFokus = 1;
-    }
-    bool ausserhalb = !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves;
-    me.mx -= pos.x, me.my -= pos.y;
-    bool MakB = mak && ( me.verarbeitet || ausserhalb || mak( makParam, this, me ) );
-    me.mx += pos.x, me.my += pos.y;
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-        {
-            if( MakB )
-                removeStyle( Style::Fokus );
-        }
-    }
-    else if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    int tmx = me.mx;
-    int tmy = me.my;
-    bool aufScroll = 0;
-    if( !ausserhalb && vertikalScrollBar && hatStyle( Style::VScroll ) && me.mx > pos.x + gr.x - 15 )
-        aufScroll = 1;
-    if( !ausserhalb && horizontalScrollBar && hatStyle( Style::HScroll ) && me.my > pos.y + gr.y - 15 )
-        aufScroll = 1;
-    me.mx -= pos.x + ( ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0 );
-    me.my -= pos.y + ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0 );
-    if( MakB )
-    {
-        lockZeichnung();
-        if( removeFokus && me.id == ME_RLinks )
-        {
-            removeStyle( Style::Fokus );
-            klickSpalte = -1;
-            klickZeile = -1;
-        }
-        if( !me.verarbeitet && !ausserhalb && !aufScroll )
-        {
-            double ox = getMausSpalte( me.mx + ( ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0 ) );
-            double oy = getMausZeile( me.my + ( ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0 ) );
-            if( me.id == ME_RLinks )
-            {
-                addStyle( Style::Fokus );
-                klickSpalte = -1;
-                klickZeile = -1;
-                mSpalte = -1, mZeile = -1;
-            }
-            if( ( hatStyle( Style::SpaltenBreiteChangeable ) || hatStyle( Style::ZeilenHeightChangeable ) ) && klickSpalte < 0 && klickZeile < 0 )
-            {
-                if( hatStyle( Style::SpaltenBreiteChangeable ) )
-                {
-                    if( me.id == ME_PLinks && ox != (int)ox )
-                    {
-                        mSpalte = ox;
-                        mx = me.mx;
-                        rend = 1;
-                    }
-                    if( mSpalte > -1 )
-                    {
-                        int br = getSpaltenBreite( (int)mSpalte ) + ( me.mx - mx );
-                        if( hatStyle( Style::SpaltenBreiteMax ) && br > getMaxSpaltenBreite( (int)mSpalte ) )
-                            br = getMaxSpaltenBreite( (int)mSpalte );
-                        if( hatStyle( Style::SpaltenBreiteMin ) && br < getMinSpaltenBreite( (int)mSpalte ) )
-                            br = getMinSpaltenBreite( (int)mSpalte );
-                        setSpaltenBreite( (int)mSpalte, br );
-                        mx = me.mx;
-                        rend = 1;
-                    }
-                }
-                if( hatStyle( Style::ZeilenHeightChangeable ) )
-                {
-                    if( me.id == ME_PLinks && oy != (int)oy )
-                    {
-                        mZeile = oy;
-                        my = me.my;
-                        rend = 1;
-                    }
-                    if( mZeile > -1 )
-                    {
-                        int hi = getZeilenHeight( (int)mZeile ) + ( me.my - my );
-                        if( hatStyle( Style::ZeilenHeightMax ) && hi > getMaxZeilenHeight( (int)mZeile ) )
-                            hi = getMaxZeilenHeight( (int)mZeile );
-                        if( hatStyle( Style::ZeilenHeightMin ) && hi < getMinZeilenHeight( (int)mZeile ) )
-                            hi = getMinZeilenHeight( (int)mZeile );
-                        setZeilenHeight( (int)mZeile, hi );
-                        my = me.my;
-                        rend = 1;
-                    }
-                }
-            }
-            if( hatStyle( Style::SpaltenBeweglich ) && ox == (int)ox && mSpalte == -1 && mZeile == -1 )
-            {
-                if( klickSpalte >= 0 && klickSpalte < spaltenAnzahl && klickSpalte != ox && !oy && ox >= 0 )
-                {
-                    setSpaltePosition( klickSpalte, (int)ox );
-                    klickSpalte = (int)ox;
-                    rend = 1;
-                }
-                if( me.id == ME_PLinks )
-                {
-                    if( !oy && klickSpalte < 0 )
-                    {
-                        klickSpalte = (int)ox;
-                        rend = 1;
-                    }
-                }
-            }
-            if( hatStyle( Style::ZeilenBeweglich ) && oy == (int)oy && mSpalte == -1 && mZeile == -1 )
-            {
-                if( klickZeile >= 0 && klickZeile < zeilenAnzahl && klickZeile != oy && !ox && oy >= 0 )
-                {
-                    setZeilePosition( klickZeile, (int)oy );
-                    klickZeile = (int)oy;
-                    rend = 1;
-                }
-                if( me.id == ME_PLinks )
-                {
-                    if( !ox && klickZeile < 0 )
-                    {
-                        klickZeile = (int)oy;
-                        rend = 1;
-                    }
-                }
-            }
-        }
-        me.mx += ( horizontalScrollBar && hatStyle( Style::HScroll ) ) ? horizontalScrollBar->getScroll() : 0;
-        me.my += ( vertikalScrollBar && hatStyle( Style::VScroll ) ) ? vertikalScrollBar->getScroll() : 0;
-        if( me.id != ME_Betritt && me.id != ME_Leaves )
-        {
-            if( !ausserhalb )
-            {
-                bool vs = hatStyle( Style::VScroll ) && vertikalScrollBar;
-                bool hs = hatStyle( Style::HScroll ) && horizontalScrollBar;
-                int rbr = rahmen ? rahmen->getRBreite() : 0;
-                if( vs )
-                {
-                    if( hs )
-                        horizontalScrollBar->doMausMessage( rbr, gr.y - 15 - rbr, gr.x - 15 - rbr * 2, 15, me );
-                    vertikalScrollBar->doMausMessage( gr.x - 15 - rbr, rbr, 15, gr.y - rbr * 2, me );
-                }
-                else if( hs )
-                    horizontalScrollBar->doMausMessage( rbr, gr.y - 15 - rbr, gr.x - rbr * 2, 15, me );
-            }
-            unlockZeichnung();
-            if( aufScroll )
-                me.verarbeitet = 1;
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.rid = me.id;
-            me2.mx = -1;
-            me2.my = -1;
-            me2.rmx = me.mx;
-            me2.rmy = me.my;
-            me2.verarbeitet = 1;
-            for( int i = 0; i < zeilenAnzahl; ++i )
-            {
-                for( int j = 0; j < spaltenAnzahl; ++j )
-                {
-                    bool b = me.verarbeitet;
-                    Zeichnung *obj = zZeichnung( j, i );
-                    if( obj )
-                        obj->doMausEreignis( ausserhalb ? me2 : me );
-                    if( !b && me.verarbeitet && me.id == ME_PLinks )
-                        selected = Punkt( j, i );
-                }
-            }
-        }
-        else
-            unlockZeichnung();
-        if( me.mx >= 0 && me.mx <= gr.x && me.my >= 0 && me.my <= gr.y )
-            me.verarbeitet = 1;
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx = tmx;
-    me.my = tmy;
-}
-
-void ObjTabelle::doTastaturEreignis( TastaturEreignis &te )
+void ObjTabelle::doTastaturEreignis( TastaturEreignis & te )
 {
     bool ntakc = !te.verarbeitet;
     if( hatStyleNicht( Style::Fokus ) || hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Sichtbar ) )
@@ -1070,7 +1043,7 @@ void ObjTabelle::doTastaturEreignis( TastaturEreignis &te )
         te.verarbeitet = nTak( ntakParam, this, te );
 }
 
-void ObjTabelle::render( Bild &zRObj ) // zeichnet nach zRObj
+void ObjTabelle::render( Bild & zRObj ) // zeichnet nach zRObj
 {
     if( hatStyleNicht( Style::Sichtbar ) )
         return;
@@ -1176,7 +1149,7 @@ int ObjTabelle::getSpaltenNummer( const char *name ) const // gibt die Nummer de
     return -1;
 }
 
-int ObjTabelle::getSpaltenNummer( Text *name ) const
+int ObjTabelle::getSpaltenNummer( Text * name ) const
 {
     int ret = getSpaltenNummer( name->getText() );
     name->release();
@@ -1203,7 +1176,7 @@ int ObjTabelle::getZeilenNummer( const char *name ) const // gibt die Nummer der
     return -1;
 }
 
-int ObjTabelle::getZeilenNummer( Text *name ) const
+int ObjTabelle::getZeilenNummer( Text * name ) const
 {
     int ret = getZeilenNummer( name->getText() );
     name->release();
@@ -1220,7 +1193,7 @@ Text *ObjTabelle::zZeilenName( int num ) const
     return zeilenNamen->z( num );
 }
 
-Punkt ObjTabelle::getZeichnungPosition( Zeichnung *zObj ) const // gibt die Position eines Zeichnungs zurück
+Punkt ObjTabelle::getZeichnungPosition( Zeichnung * zObj ) const // gibt die Position eines Zeichnungs zurück
 {
     for( int x = 0; x < spaltenAnzahl; ++x )
     {
@@ -1248,7 +1221,7 @@ Zeichnung *ObjTabelle::zZeichnung( const char *spaltenName, const char *zeilenNa
     return zZeichnung( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-Zeichnung *ObjTabelle::zZeichnung( Text *spaltenName, Text *zeilenName ) const
+Zeichnung *ObjTabelle::zZeichnung( Text * spaltenName, Text * zeilenName ) const
 {
     return zZeichnung( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
@@ -1268,7 +1241,7 @@ Zeichnung *ObjTabelle::getZeichnung( const char *spaltenName, const char *zeilen
     return getZeichnung( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-Zeichnung *ObjTabelle::getZeichnung( Text *spaltenName, Text *zeilenName ) const
+Zeichnung *ObjTabelle::getZeichnung( Text * spaltenName, Text * zeilenName ) const
 {
     return getZeichnung( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
@@ -1283,7 +1256,7 @@ int ObjTabelle::getSpaltenBreite( const char *name ) const
     return getSpaltenBreite( getSpaltenNummer( name ) );
 }
 
-int ObjTabelle::getSpaltenBreite( Text *name ) const
+int ObjTabelle::getSpaltenBreite( Text * name ) const
 {
     return getSpaltenBreite( getSpaltenNummer( name ) );
 }
@@ -1298,7 +1271,7 @@ int ObjTabelle::getZeilenHeight( const char *name ) const
     return getZeilenHeight( getZeilenNummer( name ) );
 }
 
-int ObjTabelle::getZeilenHeight( Text *name ) const
+int ObjTabelle::getZeilenHeight( Text * name ) const
 {
     return getZeilenHeight( getZeilenNummer( name ) );
 }
@@ -1313,7 +1286,7 @@ int ObjTabelle::getMinSpaltenBreite( const char *name ) const
     return getMinSpaltenBreite( getSpaltenNummer( name ) );
 }
 
-int ObjTabelle::getMinSpaltenBreite( Text *name ) const
+int ObjTabelle::getMinSpaltenBreite( Text * name ) const
 {
     return getMinSpaltenBreite( getSpaltenNummer( name ) );
 }
@@ -1328,7 +1301,7 @@ int ObjTabelle::getMaxSpaltenBreite( const char *name ) const
     return getMaxSpaltenBreite( getSpaltenNummer( name ) );
 }
 
-int ObjTabelle::getMaxSpaltenBreite( Text *name ) const
+int ObjTabelle::getMaxSpaltenBreite( Text * name ) const
 {
     return getMaxSpaltenBreite( getSpaltenNummer( name ) );
 }
@@ -1343,7 +1316,7 @@ int ObjTabelle::getMinZeilenHeight( const char *name ) const
     return getMinZeilenHeight( getZeilenNummer( name ) );
 }
 
-int ObjTabelle::getMinZeilenHeight( Text *name ) const
+int ObjTabelle::getMinZeilenHeight( Text * name ) const
 {
     return getMinZeilenHeight( getZeilenNummer( name ) );
 }
@@ -1358,7 +1331,7 @@ int ObjTabelle::getMaxZeilenHeight( const char *name ) const
     return getMaxZeilenHeight( getZeilenNummer( name ) );
 }
 
-int ObjTabelle::getMaxZeilenHeight( Text *name ) const
+int ObjTabelle::getMaxZeilenHeight( Text * name ) const
 {
     return getMaxZeilenHeight( getZeilenNummer( name ) );
 }
@@ -1454,7 +1427,7 @@ int ObjTabelle::getRasterBreite() const // gibt die Breite des Rasters zur
 
 Rahmen *ObjTabelle::getARahmen() const // gibt den auswahl Rahmen zurück
 {
-    return aRam ? (Rahmen*)aRam->getThis() : 0;
+    return aRam ? (Rahmen *)aRam->getThis() : 0;
 }
 
 Rahmen *ObjTabelle::zARahmen() const
@@ -1464,7 +1437,7 @@ Rahmen *ObjTabelle::zARahmen() const
 
 AlphaFeld *ObjTabelle::getAAlphaFeld() const // gibt das auswahl AlphaFeld zurück
 {
-    return aAf ? (AlphaFeld*)aAf->getThis() : 0;
+    return aAf ? (AlphaFeld *)aAf->getThis() : 0;
 }
 
 AlphaFeld *ObjTabelle::zAAlphaFeld() const
@@ -1515,22 +1488,22 @@ AlphaFeld *ObjTabelle::zAAlphaFeld( const char *spaltenName, const char *zeilenN
     return zAAlphaFeld( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-Rahmen *ObjTabelle::getARahmen( Text *spaltenName, Text *zeilenName ) const // gibt den auswahl Rahmen zurück
+Rahmen *ObjTabelle::getARahmen( Text * spaltenName, Text * zeilenName ) const // gibt den auswahl Rahmen zurück
 {
     return getARahmen( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-Rahmen *ObjTabelle::zARahmen( Text *spaltenName, Text *zeilenName ) const
+Rahmen *ObjTabelle::zARahmen( Text * spaltenName, Text * zeilenName ) const
 {
     return zARahmen( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-AlphaFeld *ObjTabelle::getAAlphaFeld( Text *spaltenName, Text *zeilenName ) const // gibt das auswahl AlphaFeld zurück
+AlphaFeld *ObjTabelle::getAAlphaFeld( Text * spaltenName, Text * zeilenName ) const // gibt das auswahl AlphaFeld zurück
 {
     return getAAlphaFeld( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
 
-AlphaFeld *ObjTabelle::zAAlphaFeld( Text *spaltenName, Text *zeilenName ) const
+AlphaFeld *ObjTabelle::zAAlphaFeld( Text * spaltenName, Text * zeilenName ) const
 {
     return zAAlphaFeld( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ) );
 }
@@ -1557,12 +1530,12 @@ bool ObjTabelle::hatMsStyleNicht( const char *spaltenName, const char *zeilenNam
     return hatMsStyleNicht( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
 
-bool ObjTabelle::hatMsStyle( Text *spaltenName, Text *zeilenName, __int64 style ) const // prüft, ob style vorhanden ist
+bool ObjTabelle::hatMsStyle( Text * spaltenName, Text * zeilenName, __int64 style ) const // prüft, ob style vorhanden ist
 {
     return hatMsStyle( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
 
-bool ObjTabelle::hatMsStyleNicht( Text *spaltenName, Text *zeilenName, __int64 style ) const // prüft, ob style nicht vorhanden ist
+bool ObjTabelle::hatMsStyleNicht( Text * spaltenName, Text * zeilenName, __int64 style ) const // prüft, ob style nicht vorhanden ist
 {
     return hatMsStyleNicht( getSpaltenNummer( spaltenName ), getZeilenNummer( zeilenName ), style );
 }
@@ -1577,21 +1550,21 @@ Zeichnung *ObjTabelle::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
     obj->setMausEreignis( mak );
     obj->setTastaturEreignis( tak );
     if( toolTip )
-        obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
+        obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
     obj->setStyle( style );
     if( rahmen )
-        obj->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
+        obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
     obj->setHintergrundFarbe( hintergrundFarbe );
     if( hintergrundBild )
         obj->setHintergrundBild( hintergrundBild->getThis() );
     if( hintergrundFeld )
-        obj->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
+        obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
     obj->setRasterFarbe( rasterFarbe );
     obj->setRasterBreite( rasterBreite );
     if( aRam )
-        obj->setARahmenZ( (Rahmen*)aRam->dublizieren() );
+        obj->setARahmenZ( (Rahmen *)aRam->dublizieren() );
     if( aAf )
-        obj->setAAlphaFeldZ( (AlphaFeld*)aAf->dublizieren() );
+        obj->setAAlphaFeldZ( (AlphaFeld *)aAf->dublizieren() );
     for( int s = 0; s < spaltenAnzahl; ++s )
     {
         obj->addSpalte( spaltenNamen->get( s ) );
@@ -1618,9 +1591,9 @@ Zeichnung *ObjTabelle::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
             if( styles->z( s ) && styles->z( s )->hat( z ) )
                 obj->setMsStyle( s, z, styles->z( s )->get( z ) );
             if( msaRam->z( s ) && msaRam->z( s )->z( z ) )
-                obj->setARahmenZ( s, z, (Rahmen*)msaRam->z( s )->z( z )->dublizieren() );
+                obj->setARahmenZ( s, z, (Rahmen *)msaRam->z( s )->z( z )->dublizieren() );
             if( msaAf->z( s ) && msaAf->z( s )->z( z ) )
-                obj->setAAlphaFeldZ( s, z, (AlphaFeld*)msaAf->z( s )->z( z )->dublizieren() );
+                obj->setAAlphaFeldZ( s, z, (AlphaFeld *)msaAf->z( s )->z( z )->dublizieren() );
         }
     }
     obj->setAuswahl( selected.x, selected.y );

+ 4 - 4
Tabelle.h

@@ -36,7 +36,7 @@ namespace Framework
             const static __int64 beweglich = SpaltenBreiteChangeable | ZeilenHeightChangeable | SpaltenBeweglich | ZeilenBeweglich; // Vereint die Flags: SpaltenBreiteÄnderbar, ZeilenHöheÄnderbar, SpaltenBeweglich, ZeilenBeweglich
             const static __int64 min_max = SpaltenBreiteMax | SpaltenBreiteMin | ZeilenHeightMax | ZeilenHeightMax; // Vereint die Flags: SpaltenBreiteMax, SpaltenBreiteMin, ZeilenHöheMax, ZeilenHöheMax
             const static __int64 scroll = VScroll | HScroll; // Vereint die Flags: VScroll, HScroll
-            const static __int64 normal = Rahmen | Erlaubt | Sichtbar | AuswahlBuffer | AuswahlRahmen | Raster; // Vereint die Flags: Rahmen, Erlaubt, Sichtbar, SpaltenBeweglich, AuswahlBuffer, AuswahlRahmen, Raster
+            const static __int64 normal = Rahmen | Erlaubt | Sichtbar | AuswahlBuffer | AuswahlRahmen | Raster | MEIgnoreInside | MEIgnoreParentInside | MEIgnoreSichtbar | MEIgnoreVerarbeitet; // Vereint die Flags: Rahmen, Erlaubt, Sichtbar, SpaltenBeweglich, AuswahlBuffer, AuswahlRahmen, Raster
         };
     private:
         RCArray< RCArray< Zeichnung > > *members;
@@ -61,6 +61,9 @@ namespace Framework
         RCArray< RCArray< Rahmen > > *msaRam;
         RCArray< RCArray< AlphaFeld > > *msaAf;
         RCArray< Array< __int64 > > *styles;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -420,9 +423,6 @@ namespace Framework
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst
         __declspec( dllexport ) bool tick( double tickVal ) override;
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet Tastatur Nachrichten
         //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
         __declspec( dllexport ) void doTastaturEreignis( TastaturEreignis &te ) override;

+ 140 - 204
TextFeld.cpp

@@ -277,6 +277,146 @@ TextFeld::~TextFeld()
     tm->release();
 }
 
+void TextFeld::doMausEreignis( MausEreignis & me, bool userRet ) // Maus Ereignis
+{
+    if( !userRet )
+        return;
+    if( hatStyleNicht( Style::Erlaubt ) )
+    {
+        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 );
+            }
+            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
 {
     tm->resetIteration();
@@ -1060,210 +1200,6 @@ bool TextFeld::tick( double tickval ) // tick
     return ZeichnungHintergrund::tick( tickval );
 }
 
-void TextFeld::doMausEreignis( MausEreignis & me ) // Maus Ereignis
-{
-    bool nmakc = !me.verarbeitet;
-    if( hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Sichtbar ) )
-    {
-        me.mx -= pos.x, me.my -= pos.y;
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        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 )  )
-        {
-            if( mak && mak( makParam, this, me ) )
-            {
-                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 );
-                }
-                me.verarbeitet = 1;
-            }
-        }
-        me.mx += pos.x, me.my += pos.y;
-        mausKlick = 0;
-        return;
-    }
-    bool removeFokus = 0;
-    if( me.verarbeitet || !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) )
-    {
-        if( mausIn )
-        {
-            mausIn = 0;
-            if( toolTip )
-                toolTip->setMausIn( 0 );
-            MausEreignis me2;
-            me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
-            me2.verarbeitet = 0;
-            doMausEreignis( me2 );
-            return;
-        }
-        removeFokus = 1;
-    }
-    if( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-        {
-            me.mx -= pos.x, me.my -= pos.y;
-            if( hatStyle( Style::Fokus ) && mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-                removeStyle( Style::Fokus );
-            if( nmakc && me.verarbeitet && nMak )
-                me.verarbeitet = nMak( nmakParam, this, me );
-            me.mx += pos.x, me.my += pos.y;
-        }
-        if( toolTip )
-            toolTip->setMausIn( 0 );
-        return;
-    }
-    if( !mausIn && me.id != ME_Leaves )
-    {
-        mausIn = 1;
-        if( toolTip )
-            toolTip->setMausIn( 1 );
-        MausEreignis me2;
-        me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
-        me2.verarbeitet = 0;
-        doMausEreignis( me2 );
-    }
-    me.mx -= pos.x, me.my -= pos.y;
-    if( mak && ( me.verarbeitet || mak( makParam, this, me ) ) )
-    {
-        if( removeFokus && me.id == ME_RLinks )
-            removeStyle( Style::Fokus );
-        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 ) )
-                {
-                    if( nmakc && me.verarbeitet && nMak )
-                        me.verarbeitet = nMak( nmakParam, this, me );
-                    me.mx += pos.x, me.my += pos.y;
-                    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 ) )
-                {
-                    if( nmakc && me.verarbeitet && nMak )
-                        me.verarbeitet = nMak( nmakParam, this, me );
-                    me.mx += pos.x, me.my += pos.y;
-                    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;
-    }
-    if( nmakc && me.verarbeitet && nMak )
-        me.verarbeitet = nMak( nmakParam, this, me );
-    me.mx += pos.x, me.my += pos.y;
-}
-
 void TextFeld::doTastaturEreignis( TastaturEreignis & te )
 {
     bool ntakc = !te.verarbeitet;

+ 3 - 3
TextFeld.h

@@ -110,6 +110,9 @@ namespace Framework
 
         int getTextHeight() const;
         int getTextWidth() const;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor 
@@ -228,9 +231,6 @@ namespace Framework
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst
         __declspec( dllexport ) virtual bool tick( double tickval ) override;
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me ) override;
         // Verarbeitet Tastatur Nachrichten
         //  me: Das Ereignis, was durch die Tastatureingabe ausgelößt wurde
         __declspec( dllexport ) void doTastaturEreignis( TastaturEreignis &te ) override;

+ 72 - 23
ToolTip.cpp

@@ -6,6 +6,8 @@
 #include "MausEreignis.h"
 #include "Schrift.h"
 #include "Bildschirm.h"
+#include "Rahmen.h"
+#include "Scroll.h"
 
 using namespace Framework;
 
@@ -26,6 +28,7 @@ ToolTip::ToolTip( Bildschirm *zScreen )
     onShow( 0 ),
     onHide( 0 )
 {
+    style = Style::MEIgnoreInside | Style::MEIgnoreParentInside | Style::MEIgnoreSichtbar | Style::MEIgnoreVerarbeitet;
     members = new RCArray< Zeichnung >();
     bildschirm->addToolTip( (ToolTip*)this->getThis() );
 }
@@ -36,6 +39,72 @@ ToolTip::~ToolTip()
     members->release();
 }
 
+void ToolTip::doMausEreignis( MausEreignis &me, bool userRet )
+{
+    if( !hatStyle( Style::Sichtbar ) || !me.insideParent || me.verarbeitet || me.mx < 0 || me.my < 0 || me.mx >= gr.x || me.my >= gr.y || !userRet )
+    {
+        bool insideParent = me.insideParent;
+        me.insideParent = 0;
+        int rbr = 0;
+        if( hatStyle( Style::Rahmen ) && rahmen )
+            rbr = rahmen->getRBreite();
+        me.mx -= rbr;
+        me.my -= rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my += vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx += horizontalScrollBar->getScroll();
+        if( me.id != ME_Betritt && me.id != ME_Leaves )
+        {
+            for( int i = members->getEintragAnzahl() - 1; i >= 0; i-- )
+                members->z( i )->doPublicMausEreignis( me );
+        }
+        me.mx += rbr;
+        me.my += rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my -= vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx -= horizontalScrollBar->getScroll();
+        me.insideParent = insideParent;
+        return;
+    }
+    if( !sichtbar )
+        pos.x = me.mx, pos.y = me.my + 15;
+    mausIn2 = 1;
+    if( me.id == ME_Leaves )
+        mausIn2 = 0;
+    if( !mausIn && !mausIn2 )
+    {
+        if( onHide && sichtbar )
+            onHide( this );
+        sichtbar = 0;
+    }
+    if( sichtbar )
+    {
+        int rbr = 0;
+        if( hatStyle( Style::Rahmen ) && rahmen )
+            rbr = rahmen->getRBreite();
+        me.mx -= rbr;
+        me.my -= rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my += vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx += horizontalScrollBar->getScroll();
+        for( auto z = members->getIterator(); z; z++ )
+            z->doPublicMausEreignis( me );
+        me.mx += rbr;
+        me.my += rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my -= vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx -= horizontalScrollBar->getScroll();
+    }
+    if( sichtbar )
+        me.verarbeitet = 1;
+    if( alpha )
+        rend = 1;
+}
+
 // Fügt eine Zeichnung zum Tooltip hinzu
 //  m: die neue Zeichnung
 void ToolTip::addMember( Zeichnung *m )
@@ -172,29 +241,6 @@ bool ToolTip::tick( double tickVal )
     return ZeichnungHintergrund::tick( tickVal );
 }
 
-void ToolTip::doMausEreignis( MausEreignis &me )
-{
-    if( !sichtbar )
-        pos.x = me.mx, pos.y = me.my + 15;
-    mausIn2 = me.mx >= pos.x && me.my >= pos.y && me.mx <= pos.x + getBreite() && me.my <= pos.y + getHeight();
-    if( !mausIn && !mausIn2 )
-    {
-        if( onHide && sichtbar )
-            onHide( this );
-        sichtbar = 0;
-    }
-    me.mx -= pos.x;
-    me.my -= pos.y;
-    for( auto z = members->getIterator(); z; z++ )
-        z->doMausEreignis( me );
-    me.mx += pos.x;
-    me.my += pos.y;
-    if( mausIn2 && sichtbar )
-        me.verarbeitet = 1;
-    if( alpha )
-        rend = 1;
-}
-
 void ToolTip::render( Bild &zRObj )
 {
     if( alpha && ( zeichnen || mausIn2 ) )
@@ -219,6 +265,9 @@ void ToolTip::render( Bild &zRObj )
             zeichnen = 0;
             return;
         }
+        bool vSc = hatStyle( Style::VScroll ) && vertikalScrollBar;
+        bool hSc = hatStyle( Style::HScroll ) && horizontalScrollBar;
+        zRObj.addScrollOffset( hSc ? horizontalScrollBar->getScroll() : 0, vSc ? vertikalScrollBar->getScroll() : 0 );
         for( auto z = members->getIterator(); z; z++ )
             z->render( zRObj );
         zRObj.releaseDrawOptions();

+ 3 - 3
ToolTip.h

@@ -32,6 +32,9 @@ namespace Framework
         Bildschirm *bildschirm;
         std::function< void( ToolTip * ) > onShow;
         std::function< void( ToolTip * ) > onHide;
+        // Verarbeitet Maus Nachrichten
+        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
+        __declspec( dllexport ) void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Konstruktor
@@ -70,9 +73,6 @@ namespace Framework
         //  tickVal: Die Zeit in sekunden, die seit dem lezten Aufruf dieser Funktion vergangen ist
         //  return: 1, wenn sich etwas verändert hat und das Bild neu gezeichnet werden muss. 0 sonst
         __declspec( dllexport ) bool tick( double tickVal ) override;
-        // Verarbeitet Maus Nachrichten
-        //  me: Das Ereignis, was durch die Mauseingabe ausgelößt wurde
-        __declspec( dllexport ) void doMausEreignis( MausEreignis &me ) override;
         // Zeichnet den Tip nach zRObj, falls er sichtbar ist und das zugehörige Zeichnung ebenfalls gezeichnet wurde
         //  zRObj: Das Bild, in welches gezeichnet werden soll
         __declspec( dllexport ) void render( Bild &zRObj ) override;

+ 65 - 33
UIMLView.cpp

@@ -6,6 +6,9 @@
 #include "Fenster.h"
 #include "Schrift.h"
 #include "Bildschirm.h"
+#include "Rahmen.h"
+#include "Scroll.h"
+#include "Bild.h"
 
 using namespace Framework;
 
@@ -14,6 +17,7 @@ using namespace Framework;
 UIMLView::UIMLView()
     : ZeichnungHintergrund()
 {
+    style = Style::MEIgnoreInside | Style::MEIgnoreParentInside | Style::MEIgnoreSichtbar | Style::MEIgnoreVerarbeitet;
     members = new Trie< Zeichnung >();
     dom = 0;
     nextId = 0;
@@ -49,7 +53,47 @@ UIMLView::~UIMLView()
     members->release();
 }
 
-void UIMLView::parseTable( Iterator<XML::Element*> childs, ObjTabelle *table )
+// Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
+//  me: Das Ereignis
+void UIMLView::doMausEreignis( MausEreignis &me, bool userRet )
+{
+    if( dom )
+    {
+        bool insideParent = me.insideParent;
+        if( !hatStyle( Style::Sichtbar ) || !me.insideParent || me.verarbeitet || me.mx < 0 || me.my < 0 || me.mx >= gr.x || me.my >= gr.y || !userRet )
+            me.insideParent = 0;
+        int rbr = 0;
+        if( hatStyle( Style::Rahmen ) && rahmen )
+            rbr = rahmen->getRBreite();
+        me.mx -= rbr;
+        me.my -= rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my += vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx += horizontalScrollBar->getScroll();
+        if( dom )
+        {
+            for( auto i = dom->getChilds(); i; i++ )
+            { // TODO render elements backwards
+                Zeichnung *z = members->z( i->getAttributeValue( "id" ) );
+                if( z )
+                    z->doPublicMausEreignis( me );
+            }
+        }
+        me.mx += rbr;
+        me.my += rbr;
+        if( hatStyle( Style::VScroll ) && vertikalScrollBar )
+            me.my -= vertikalScrollBar->getScroll();
+        if( hatStyle( Style::HScroll ) && horizontalScrollBar )
+            me.mx -= horizontalScrollBar->getScroll();
+        if( !hatStyle( Style::Sichtbar ) || !me.insideParent || me.verarbeitet || me.mx < 0 || me.my < 0 || me.mx >= gr.x || me.my >= gr.y || !userRet )
+            me.insideParent = insideParent;
+        else
+            me.verarbeitet = 1;
+    }
+}
+
+void UIMLView::parseTable( Iterator<XML::Element *> childs, ObjTabelle * table )
 {
     for( auto i = childs; i; i++ )
     {
@@ -72,14 +116,14 @@ void UIMLView::parseTable( Iterator<XML::Element*> childs, ObjTabelle *table )
                 if( table->getSpaltenAnzahl() < c )
                     table->addSpalte( Text( c - 1 ) );
                 if( z )
-                    table->setZeichnungZ( (char*)Text( c - 1 ), (char*)line, z->getThis() );
+                    table->setZeichnungZ( (char *)Text( c - 1 ), (char *)line, z->getThis() );
                 c++;
             }
         }
     }
 }
 
-void UIMLView::parseFrame( Iterator<XML::Element*> childs, Fenster *frame )
+void UIMLView::parseFrame( Iterator<XML::Element *> childs, Fenster * frame )
 {
     for( auto i = childs; i; i++ )
     {
@@ -89,7 +133,7 @@ void UIMLView::parseFrame( Iterator<XML::Element*> childs, Fenster *frame )
     }
 }
 
-Zeichnung *UIMLView::parseElement( XML::Element *e )
+Zeichnung *UIMLView::parseElement( XML::Element * e )
 {
     Text id;
     if( e->hasAttribute( "id" ) )
@@ -233,7 +277,7 @@ Zeichnung *UIMLView::parseElement( XML::Element *e )
     return z;
 }
 
-void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
+void UIMLView::layout( XML::Element * e, int pWidth, int pHeight )
 {
     Text id = e->getAttributeValue( "id" );
     Zeichnung *z = members->z( id );
@@ -269,7 +313,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
                 XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", la );
                 for( auto i = ed.getIterator(); i; i++ )
                     layout( i, pWidth, pHeight );
-                Zeichnung *laz = members->z( la );
+                Zeichnung * laz = members->z( la );
                 if( laz )
                     x = laz->getX() + laz->getBreite();
             }
@@ -296,7 +340,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
                 XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ra );
                 for( auto i = ed.getIterator(); i; i++ )
                     layout( i, pWidth, pHeight );
-                Zeichnung *raz = members->z( ra );
+                Zeichnung * raz = members->z( ra );
                 if( raz )
                     x = raz->getX() - z->getBreite();
             }
@@ -323,7 +367,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
                 XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ta );
                 for( auto i = ed.getIterator(); i; i++ )
                     layout( i, pWidth, pHeight );
-                Zeichnung *taz = members->z( ta );
+                Zeichnung * taz = members->z( ta );
                 if( taz )
                     y = taz->getY() + taz->getHeight();
             }
@@ -350,7 +394,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
                 XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ba );
                 for( auto i = ed.getIterator(); i; i++ )
                     layout( i, pWidth, pHeight );
-                Zeichnung *baz = members->z( ba );
+                Zeichnung * baz = members->z( ba );
                 if( baz )
                     y = baz->getY() - z->getHeight();
             }
@@ -383,7 +427,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
         z->setPosition( x, y );
         if( e->getName().istGleich( "textarea" ) )
         {
-            ( (TextFeld*)z )->zTextRenderer()->textFormatieren( ( (TextFeld*)z )->zText(), z->getInnenBreite() );
+            ( (TextFeld *)z )->zTextRenderer()->textFormatieren( ( (TextFeld *)z )->zText(), z->getInnenBreite() );
         }
     }
     if( z )
@@ -398,7 +442,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
     {
         if( e->getName().istGleich( "table" ) )
         {
-            ObjTabelle *objT = (ObjTabelle*)z;
+            ObjTabelle *objT = (ObjTabelle *)z;
             if( objT->getZeilenAnzahl() > 0 )
             {
                 if( e->hasAttribute( "line-height" ) )
@@ -419,7 +463,7 @@ void UIMLView::layout( XML::Element *e, int pWidth, int pHeight )
 
 // setzt den inhalt der view
 //  uiml: Ein xml element gemät des ksg uiml standarts
-void UIMLView::setUIML( XML::Element *uiml )
+void UIMLView::setUIML( XML::Element * uiml )
 {
     if( dom )
         dom->release();
@@ -487,7 +531,7 @@ Text UIMLView::addMember( Text uiml, Text parentId )
                 Zeichnung *z = parseElement( e );
                 if( z )
                 {
-                    ( (Fenster*)members->z( parentId ) )->addMember( z->getThis() );
+                    ( (Fenster *)members->z( parentId ) )->addMember( z->getThis() );
                     ed2.getIterator()->addChild( e );
                 }
                 return e->getAttributeValue( "id" );
@@ -508,27 +552,9 @@ void UIMLView::removeMember( Text id )
     members->remove( id );
 }
 
-// Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
-//  me: Das Ereignis
-void UIMLView::doMausEreignis( MausEreignis &me )
-{
-    bool verarbeitet = me.verarbeitet;
-    ZeichnungHintergrund::doMausEreignis( me );
-    me.verarbeitet = verarbeitet;
-    if( dom )
-    {
-        for( auto i = dom->getChilds(); i; i++ )
-        { // TODO render elements backwards
-            Zeichnung *z = members->z( i->getAttributeValue( "id" ) );
-            if( z )
-                z->doMausEreignis( me );
-        }
-    }
-}
-
 // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
 //  te: Das Ereignis
-void UIMLView::doTastaturEreignis( TastaturEreignis &te )
+void UIMLView::doTastaturEreignis( TastaturEreignis & te )
 {
     bool verarbeitet = te.verarbeitet;
     ZeichnungHintergrund::doTastaturEreignis( te );
@@ -562,11 +588,16 @@ bool UIMLView::tick( double tickVal )
 }
 
 // Zeichnet den Hintergrund eines Zeichnunges nach rObj
-void UIMLView::render( Bild &rObj )
+void UIMLView::render( Bild & rObj )
 {
     ZeichnungHintergrund::render( rObj );
     if( dom )
     {
+        if( !rObj.setDrawOptions( pos.x + getRahmenBreite(), pos.y + getRahmenBreite(), gr.x + getRahmenBreite() * 2, gr.y + getRahmenBreite() * 2 ) )
+            return;
+        bool vSc = hatStyle( Style::VScroll ) && vertikalScrollBar;
+        bool hSc = hatStyle( Style::HScroll ) && horizontalScrollBar;
+        rObj.addScrollOffset( hSc ? horizontalScrollBar->getScroll() : 0, vSc ? vertikalScrollBar->getScroll() : 0 );
         for( int i = dom->getChildCount() - 1; i >= 0; i-- )
         { // TODO render elements backwards
             XML::Element *e = dom->zChild( i );
@@ -574,6 +605,7 @@ void UIMLView::render( Bild &rObj )
             if( z )
                 z->render( rObj );
         }
+        rObj.releaseDrawOptions();
     }
 }
 

+ 3 - 3
UIMLView.h

@@ -82,6 +82,9 @@ namespace Framework
         void parseFrame( Iterator<XML::Element*> childs, Fenster *frame );
         Zeichnung *parseElement( XML::Element *e );
         void layout( XML::Element *e, int pWidth, int pHeight );
+        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
+        //  me: Das Ereignis
+        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me, bool userRet ) override;
 
     public:
         // Erstellt eine UIML View
@@ -119,9 +122,6 @@ namespace Framework
         // Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
         //  id: die id der Zeichnung
         __declspec( dllexport ) Zeichnung *zZeichnung( Text id );
-        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
-        //  me: Das Ereignis
-        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me );
         // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
         //  te: Das Ereignis
         __declspec( dllexport ) virtual void doTastaturEreignis( TastaturEreignis &te );

+ 76 - 31
Zeichnung.cpp

@@ -45,6 +45,11 @@ Zeichnung::~Zeichnung()
         toolTip->release();
 }
 
+void Zeichnung::doMausEreignis( MausEreignis &me, bool userRet )
+{
+    me.verarbeitet = userRet;
+}
+
 // Übergibt einen Void Funktionspointer auf eine Aktion die einmalig vom Hauptthread ausgeführt werden soll. (Passiert nach dem Tick)
 void Zeichnung::postAction( std::function< void() > action )
 {
@@ -60,7 +65,7 @@ void Zeichnung::setRender()
 void Zeichnung::setToolTipText( const char *txt, Bildschirm *zScreen, Schrift *zSchrift )
 {
     if( !txt )
-        toolTip = (ToolTip*)toolTip->release();
+        toolTip = (ToolTip *)toolTip->release();
     else
     {
         if( !toolTip )
@@ -90,7 +95,7 @@ void Zeichnung::setNeedToolTipEvent( std::function< void( Zeichnung * ) > onNeed
 
 // legt den tooltip fest
 // tt: der tooltip
-void Zeichnung::setToolTipZ( ToolTip *tt )
+void Zeichnung::setToolTipZ( ToolTip * tt )
 {
     if( toolTip )
         toolTip->release();
@@ -149,9 +154,12 @@ void Zeichnung::setNTastaturEreignis( TastaturAktion ak ) // setzt das TastaturE
     nTak = ak;
 }
 
-void Zeichnung::doMausEreignis( MausEreignis &me ) // ruft Mak auf
+void Zeichnung::doPublicMausEreignis( MausEreignis & me ) // ruft Mak auf
 {
-    if( me.verarbeitet || ( !( me.mx >= pos.x && me.mx <= pos.x + gr.x && me.my >= pos.y && me.my <= pos.y + gr.y ) && me.id != ME_Leaves ) )
+    bool lock = hatStyle( Style::MELockZeichnung );
+    if( lock )
+        lockZeichnung();
+    if( !me.insideParent || me.verarbeitet || !istPunktInnen( me.mx, me.my ) )
     {
         if( mausIn )
         {
@@ -160,14 +168,26 @@ void Zeichnung::doMausEreignis( MausEreignis &me ) // ruft Mak auf
                 toolTip->setMausIn( 0 );
             MausEreignis me2;
             me2.id = ME_Leaves;
-            me2.mx = me.mx;
-            me2.my = me.my;
+            me2.mx = me.mx - pos.x;
+            me2.my = me.my - pos.y;
             me2.verarbeitet = 0;
-            doMausEreignis( me2 );
+            me2.insideParent = me.insideParent;
+            bool userRet = mak && mak( makParam, this, me2 );
+            doMausEreignis( me2, userRet );
         }
+    }
+    if( !istPunktInnen( me.mx, me.my ) && me.id == ME_PLinks )
+        removeStyle( Style::Fokus );
+    if( ( me.verarbeitet && hatStyleNicht( Style::MEIgnoreVerarbeitet ) ) || ( !istPunktInnen( me.mx, me.my ) && hatStyleNicht( Style::MEIgnoreInside ) ) ||
+        ( hatStyleNicht( Style::Sichtbar ) && hatStyleNicht( Style::MEIgnoreSichtbar ) ) )
+    {
+        if( lock )
+            unlockZeichnung();
         return;
     }
-    if( !mausIn && me.id != ME_Leaves )
+    if( istPunktInnen( me.mx, me.my ) && me.id == ME_PLinks )
+        addStyle( Style::Fokus );
+    if( me.insideParent && !mausIn && me.id != ME_Leaves )
     {
         mausIn = 1;
         if( toolTip )
@@ -176,20 +196,28 @@ void Zeichnung::doMausEreignis( MausEreignis &me ) // ruft Mak auf
             onNeedToolTip( this );
         MausEreignis me2;
         me2.id = ME_Betritt;
-        me2.mx = me.mx;
-        me2.my = me.my;
+        me2.mx = me.mx - pos.x;
+        me2.my = me.my - pos.y;
         me2.verarbeitet = 0;
-        doMausEreignis( me2 );
+        me2.insideParent = 1;
+        bool userRet = mak && mak( makParam, this, me2 );
+        doMausEreignis( me2, userRet );
     }
     me.mx -= pos.x, me.my -= pos.y;
-    if( mak )
-        me.verarbeitet |= mak( makParam, this, me );
-    if( nMak && me.verarbeitet )
-        me.verarbeitet = nMak( nmakParam, this, me );
+    if( me.insideParent || hatStyle( Style::MEIgnoreParentInside ) )
+    {
+        bool userRet = mak && mak( makParam, this, me );
+        bool vera = me.verarbeitet;
+        doMausEreignis( me, userRet );
+        if( nMak && me.verarbeitet && !vera )
+            me.verarbeitet = nMak( nmakParam, this, me );
+    }
     me.mx += pos.x, me.my += pos.y;
+    if( lock )
+        unlockZeichnung();
 }
 
-void Zeichnung::doTastaturEreignis( TastaturEreignis &te ) // ruft Tak auf
+void Zeichnung::doTastaturEreignis( TastaturEreignis & te ) // ruft Tak auf
 {
     if( te.verarbeitet )
         return;
@@ -199,7 +227,7 @@ void Zeichnung::doTastaturEreignis( TastaturEreignis &te ) // ruft Tak auf
         te.verarbeitet = nTak( ntakParam, this, te );
 }
 
-void Zeichnung::setPosition( const Punkt &pos ) // setzt die position
+void Zeichnung::setPosition( const Punkt & pos ) // setzt die position
 {
     lockZeichnung();
     if( this->pos != pos )
@@ -230,7 +258,7 @@ void Zeichnung::setY( int yPos )
     unlockZeichnung();
 }
 
-void Zeichnung::setSize( const Punkt &gr ) // setzt die Größe
+void Zeichnung::setSize( const Punkt & gr ) // setzt die Größe
 {
     lockZeichnung();
     if( this->gr != gr )
@@ -306,7 +334,7 @@ void Zeichnung::removeStyle( __int64 style )
     }
 }
 
-void Zeichnung::render( Bild &zRObj )
+void Zeichnung::render( Bild & zRObj )
 {
     if( toolTip && ( style | Style::Sichtbar ) == style )
         toolTip->setZeichnen();
@@ -365,9 +393,26 @@ int Zeichnung::getY() const // gibt Y zur
     return pos.y;
 }
 
+// Prüft, ob ein Punkt in diesem Objekt liegt
+//  p: der Punkt
+//  return: 1, wenn der punkt innen ist, 0 sonst
+bool Zeichnung::istPunktInnen( Punkt p ) const
+{
+    return istPunktInnen( p.x, p.y );
+}
+
+// Prüft, ob ein Punkt in diesem Objekt liegt
+//  x: die x koordinate des punktes
+//  y: die y koordinate des punktes
+//  return: 1, wenn der punkt innen ist, 0 sonst
+bool Zeichnung::istPunktInnen( int x, int y ) const
+{
+    return x >= pos.x && x <= pos.x + gr.x && y >= pos.y && y <= pos.y + gr.y;
+}
+
 ToolTip *Zeichnung::getToolTip() const // gibt den ToolTip Text
 {
-    return (ToolTip*)toolTip->getThis();
+    return (ToolTip *)toolTip->getThis();
 }
 
 ToolTip *Zeichnung::zToolTip() const
@@ -395,7 +440,7 @@ Zeichnung *Zeichnung::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
     obj->setMausEreignis( mak );
     obj->setTastaturEreignis( tak );
     if( toolTip )
-        obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
+        obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
     return obj;
 }
 
@@ -445,7 +490,7 @@ ZeichnungHintergrund::~ZeichnungHintergrund()
         vertikalScrollBar->release();
 }
 
-void ZeichnungHintergrund::setHintergrundBild( Bild *bild ) // setzt das Hintergrund Bild
+void ZeichnungHintergrund::setHintergrundBild( Bild * bild ) // setzt das Hintergrund Bild
 {
     if( !hintergrundBild )
         hintergrundBild = new Bild();
@@ -458,7 +503,7 @@ void ZeichnungHintergrund::setHintergrundBild( Bild *bild ) // setzt das Hinterg
     rend = 1;
 }
 
-void ZeichnungHintergrund::setHintergrundBildZ( Bild *bild ) // setzt einen Zeiger zum Hintergrund Bild
+void ZeichnungHintergrund::setHintergrundBildZ( Bild * bild ) // setzt einen Zeiger zum Hintergrund Bild
 {
     if( hintergrundBild != bild )
     {
@@ -478,7 +523,7 @@ void ZeichnungHintergrund::setHintergrundFarbe( int fc ) // setzt die Hintergrun
     }
 }
 
-void ZeichnungHintergrund::setAlphaFeldZ( AlphaFeld *buff ) // setzt einen Zeiger zum Hintergrund Buffer
+void ZeichnungHintergrund::setAlphaFeldZ( AlphaFeld * buff ) // setzt einen Zeiger zum Hintergrund Buffer
 {
     if( hintergrundFeld != buff )
     {
@@ -517,7 +562,7 @@ void ZeichnungHintergrund::setAlphaFeldFarbe( int fc ) // setzt die Farbe des Hi
     }
 }
 
-void ZeichnungHintergrund::setRahmenZ( Rahmen *ram ) // setzt einen Zeiger zum Rahmen
+void ZeichnungHintergrund::setRahmenZ( Rahmen * ram ) // setzt einen Zeiger zum Rahmen
 {
     if( rahmen != ram )
     {
@@ -651,7 +696,7 @@ bool ZeichnungHintergrund::tick( double tickVal )
     return Zeichnung::tick( tickVal );
 }
 
-void ZeichnungHintergrund::render( Bild &rObj )
+void ZeichnungHintergrund::render( Bild & rObj )
 {
     innenPosition.x = pos.x;
     innenPosition.y = pos.y;
@@ -785,7 +830,7 @@ AlphaFeld *ZeichnungHintergrund::getAlphaFeld() const // gibt getThir vom Hinter
 {
     if( !hintergrundFeld )
         return 0;
-    return (AlphaFeld*)hintergrundFeld->getThis();
+    return (AlphaFeld *)hintergrundFeld->getThis();
 }
 
 AlphaFeld *ZeichnungHintergrund::zAlphaFeld() const // gibt den Hintergrund Buffer zurück
@@ -809,7 +854,7 @@ Rahmen *ZeichnungHintergrund::getRahmen() const // gibt getThis des Rahmens zur
 {
     if( !rahmen )
         return 0;
-    return (Rahmen*)rahmen->getThis();
+    return (Rahmen *)rahmen->getThis();
 }
 
 Rahmen *ZeichnungHintergrund::zRahmen() const // gibt den Rahmen zurück
@@ -879,13 +924,13 @@ Zeichnung *ZeichnungHintergrund::dublizieren() const // Erzeugt eine Kopie des Z
     obj->setMausEreignis( mak );
     obj->setTastaturEreignis( tak );
     if( toolTip )
-        obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
+        obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
     obj->setStyle( style );
     obj->setHintergrundFarbe( hintergrundFarbe );
     if( hintergrundFeld )
-        obj->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
+        obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
     if( rahmen )
-        obj->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
+        obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
     if( hintergrundBild )
         obj->setHintergrundBild( hintergrundBild->getThis() );
     if( vertikalScrollBar )

+ 19 - 1
Zeichnung.h

@@ -32,6 +32,11 @@ namespace Framework
             const static __int64 Sichtbar = 0x00001; // Wenn dieser Style gesetzt ist, wird die Zeichnung beim Zeichnen angezeigt
             const static __int64 Erlaubt = 0x00002; // Wenn dieser Style gesetzt ist, kann der Benutzer mit der Zeichnung interagieren
             const static __int64 Fokus = 0x00004; // Wenn dieser Style gesetzt ist, werden die Tastatur Ereignisse von der Zeichnung verarbeitet
+            const static __int64 MEIgnoreSichtbar = 0x0800000000000000; // Wenn dieser Style gesetzt ist, werden Maus Ereignisse auch verarbeitet, wenn das Objekt nicht sichtbar ist
+            const static __int64 MELockZeichnung = 0x1000000000000000; // Wenn dieser Style gesetzt ist, lockt der Thread das Objekt während das Maus ereignis verarbeitet wird
+            const static __int64 MEIgnoreInside = 0x2000000000000000; // Wenn dieser Style gesetzt ist, werden maus ereignisse auch verarbeitet, wenn sie außerhalb der Zeichnung sind
+            const static __int64 MEIgnoreVerarbeitet = 0x4000000000000000; // Wenn dieser Style gesetzt ist, werden maus ereignisse auch verarbeitet, wenn verarbeitet des Mausereignisses 1 ist
+            const static __int64 MEIgnoreParentInside = 0x8000000000000000; // Wenn dieser Style gesetzt ist, werden maus ereignisse auch verarbeitet, wenn insideParent des Mausereignisses 0 ist
         };
     protected:
         Punkt pos;
@@ -53,6 +58,10 @@ namespace Framework
         std::function< void( Zeichnung * ) > onNeedToolTip;
         int ref;
 
+        // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
+        //  me: Das Ereignis
+        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me, bool userRet );
+
     public:
         // Konstruktor 
         __declspec( dllexport ) Zeichnung();
@@ -115,7 +124,7 @@ namespace Framework
         __declspec( dllexport ) void setNTastaturEreignis( TastaturAktion ak );
         // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
         //  me: Das Ereignis
-        __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me );
+        __declspec( dllexport ) virtual void doPublicMausEreignis( MausEreignis &me );
         // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
         //  te: Das Ereignis
         __declspec( dllexport ) virtual void doTastaturEreignis( TastaturEreignis &te );
@@ -178,6 +187,15 @@ namespace Framework
         __declspec( dllexport ) int getX() const;
         // Gibt die Y Position der Zeichnung in Pixeln zurück
         __declspec( dllexport ) int getY() const;
+        // Prüft, ob ein Punkt in diesem Objekt liegt
+        //  p: der Punkt
+        //  return: 1, wenn der punkt innen ist, 0 sonst
+        __declspec( dllexport ) virtual bool istPunktInnen( Punkt p ) const;
+        // Prüft, ob ein Punkt in diesem Objekt liegt
+        //  x: die x koordinate des punktes
+        //  y: die y koordinate des punktes
+        //  return: 1, wenn der punkt innen ist, 0 sonst
+        __declspec( dllexport ) virtual bool istPunktInnen( int x, int y ) const;
         // Gibt einen Zeiger auf das Tooltip Objekt zurück, walls es verwendet wird
         __declspec( dllexport ) ToolTip *getToolTip() const;
         // Gibt einen Zeiger auf das Tooltip Objekt ohne erhöhten Reference Counter zurück, walls es verwendet wird