示例#1
0
        void DoPaint()
        {
            int               i;
            TBaseWorkShape    WP;
            TBaseShape        BS;
            TListForPaintItem ItemPaint;

            if (f_RefreshFon)
            {
                RepaintFon(f_X_offsSum, f_Y_offsSum);
            }
            else
            {
                CopyFon();
            }


            if ((f_ListForPaint.Count == 0) && (f_RefreshFon ||
                                                (f_CurrentCommand != 0)))
            {
                f_InvalidateList.Clear();
                WP = g_PainterList.First();
                while (WP != null)
                {
                    f_InvalidateList.AddWorkShape(WP);
                    if ((WP == f_LineCutting.WorkShape) && (f_WSMovingCount == 0))
                    {
                        continue;
                    }
                    ApplyAttributeForWorkShape(WP);
                    WP.Paint(f_Canvas);
                    WP = g_PainterList.Next();
                }
            }

            if ((f_ListForPaint.Count == 0) && (!f_RefreshFon && (f_CurrentCommand == 0)))
            {
                for (i = 0; i <= f_InvalidateList.Count - 1; i++)
                {
                    WP = (TBaseWorkShape)f_InvalidateList.Items[i];
                    if ((WP == f_LineCutting.WorkShape) && (f_WSMovingCount == 0))
                    {
                        continue;
                    }
                    ApplyAttributeForWorkShape(WP);
                    WP.Paint(f_Canvas);
                }
            }

            if (f_ListForPaint.Count > 0)
            {
                for (i = 0; i <= f_ListForPaint.Count - 1; i++)
                {
                    ItemPaint = (TListForPaintItem)f_ListForPaint.Items[i];
                    switch (ItemPaint.Type)
                    {
                    case 0:
                        BS = (TBaseShape)ItemPaint.ClassPoint;
                        BS.Paint(f_Canvas);
                        break;

                    case 1:
                        WP = (TBaseWorkShape)ItemPaint.ClassPoint;
                        ApplyAttributeForWorkShape(WP);
                        if ((WP == f_LineCutting.WorkShape) && (f_WSMovingCount == 0))
                        {
                            continue;
                        }
                        WP.Paint(f_Canvas);
                        break;
                    }
                }
                f_ListForPaint.Clear();
            }
            PaintAlternateList();
            f_RefreshFon     = false;//f_Srolling;
            f_CurrentCommand = 0;
        }