コード例 #1
0
        override public void paint(SdlDotNet.Graphics.Surface surface, bool focused, Point offset)
        {
            Point p = offset;

            Caption.SizeWithIcon = false;

            DisplayIcon box = boxChecked ? DisplaySettings.checkChecked : DisplaySettings.checkUnchecked;

            if (Caption.Height > box.Height)
            {
                p.Y += (Caption.Height - box.Height) / 2;

                box.Blit(surface, p);

                p.X += box.Width + Compound.Padding;
                p.Y  = offset.Y;

                Caption.Blit(surface, p);
            }
            else
            {
                box.Blit(surface, p);

                p.X += box.Width + Compound.Padding;
                p.Y += (box.Height - Caption.Height) / 2;

                Caption.Blit(surface, p);
            }
        }
コード例 #2
0
        public override void paint(SdlDotNet.Graphics.Surface surface, bool focused, Point offset)
        {
            Point p = offset;

            foreach (Atom a in docked)
            {
                DisplayCaption dc;
                if (a == null)
                {
                    dc = DisplaySettings.defaultCaption;
                }
                else
                {
                    dc = a.Caption;
                    dc.UseDefaultIcon = true;
                }

                if (selectedAtom != a)
                {
                    DisplayIcon i = dc.Icon;

                    p.Y = (Height - i.Height) / 2 + offset.Y;
                    i.Blit(surface, p);

                    p.X += i.Width + Compound.Padding;
                }
                else
                {
                    Rectangle oldClipper = surface.ClipRectangle;
                    Rectangle newClipper = new Rectangle(p, new Size(decompressedSize, dc.Height));

                    newClipper.Intersect(oldClipper);
                    surface.ClipRectangle = newClipper;

                    p.Y = (Height - dc.Height) / 2 + offset.Y;
                    dc.Blit(surface, p);

                    surface.ClipRectangle = oldClipper;
                    p.X += decompressedSize + Compound.Padding;

                    if (decompressedSize < dc.Width)
                    {
                        decompressedSize++;
                    }
                }
            }
        }