Esempio n. 1
0
        public void draw(DrawContext con)
        {
            float breite = con.getBreite();

            #region höhen und tabs punktieren
            for (int i = 0; i < hohh.Length; i++)
            {
                hohh[i] += con.y;
            }
            for (int i = 0; i < tabb.Length; i++)
            {
                tabb[i] += con.x;
            }
            #endregion
            DrawContext con2 = con.createChild(tabb, hohh, con.x, con.y, con.zeit);//con.rahmenArt, con.variante,
            #region DEBUG
            #if DEBUG_CSTRING
            {
                for (int i = 0; i < hohh.Length; i++)
                {
                    con.DrawLine(Pens.Red, con.x, hohh[i], con.x + breite, hohh[i]);
                }
                for (int i = 0; i < tabb.Length; i++)
                {
                    con.DrawLine(Pens.Red, tabb[i], hohh.First(), tabb[i], hohh.Last());
                }
            }
            #endif
            #endregion
            {
                float niveau = 0;
                IEnumerator<IDrawable> en = list.GetEnumerator();
                while (en.MoveNext())
                {
                    if (en.Current.getBenutzteBreite(con2.getBreite()) + con2.x > tabb[con2.i + 1 + en.Current.getTabs()] + 1)
                    {
                        con2.y += niveau;
                        niveau = 0;// Diese zeile fehlte! (Bug entdeckt: 06.06.2014)
                        con2.x = tabb[con2.i];
                    }
                    en.Current.draw(con2);
                    niveau = Math.Max(niveau, en.Current.getHeight(con2.getBreite()));
                    con2.x += en.Current.getBenutzteBreite(con2.getBreite());
                    if (en.Current.getTabs() > 0)
                    {
                        niveau = 0;
                        con2.i += en.Current.getTabs();
                        con2.x = tabb[con2.i];
                        con2.y = hohh[con2.j];
                    }
                    if (en.Current.neueZeile())
                    {
                        niveau = 0;
                        con2.i = 0;
                        con2.j++;
                        con2.y = con2.hohh[con2.j];
                        con2.x = con2.tabb[con2.i];
                    }
                }
            }
        }
Esempio n. 2
0
 public void draw(DrawContext con)
 {
     this.r.X = con.x;
     this.r.Y = con.y;
     float tatHohe = getHeight(con.getBreite());
     float tatBreite = getBenutzteBreite(con.getBreite());
     if (back != null)
         con.FillRectangle(r, back);
     if (rand != null)
         con.DrawRectangle(r, rand);
     switch (art % 4)
     {
         case 0:
             con.DrawString(s, font.getFont(), b, con.x, con.y, r.Height);
             break;
         case 1:
             con.DrawString(s, font.getFontBold(), b, con.x, con.y, r.Height);
             break;
         case 2:
             con.DrawString(s, font.getFontItalic(), b, con.x, con.y, r.Height);
             break;
         case 3:
             con.DrawString(s, font.getFontBoldAndItalic(), b, con.x, con.y, r.Height);
             break;
     }
     if ((art & 4) != 0)
     {
         con.DrawRand(con.x, con.y + tatHohe, con.x + tatBreite, con.y + tatHohe);
     }
     if ((art & 8) != 0)
     {
         con.DrawRand(con.x, con.y + tatHohe / 2, con.x + tatBreite, con.y + tatHohe / 2);
     }
     if ((art & 16) != 0)
     {
         con.DrawRand(con.x, con.y, con.x + tatBreite, con.y);
     }
     if ((art & 32) != 0)
     {
         con.DrawRand(con.x, con.y, con.x + tatBreite, con.y);
         con.DrawRand(con.x, con.y, con.x, con.y + tatHohe);
         con.DrawRand(con.x + tatBreite, con.y, con.x + tatBreite, con.y + tatHohe);
         con.DrawRand(con.x, con.y + tatHohe, con.x + tatBreite, con.y + tatHohe);
     }
     #if DEBUG_CSTRING
     con.DrawDebugRectangle(r);
     //con.DrawDebugUnit(con.x, con.y, con.x + tatBreite, con.y);
     //con.DrawDebugUnit(con.x, con.y, con.x, con.y + tatHohe);
     //con.DrawDebugUnit(con.x + tatBreite, con.y, con.x + tatBreite, con.y + tatHohe);
     //con.DrawDebugUnit(con.x, con.y + tatHohe, con.x + tatBreite, con.y + tatHohe);
     #endif
 }