Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        override public bool doEvent(object caller, MouseButtonEventArgs e)
        {
            if (!e.ButtonPressed)
            {
                return(true);
            }

            DisplayIcon box = boxChecked ? DisplaySettings.checkChecked : DisplaySettings.checkUnchecked;
            Rectangle   hit = new Rectangle(new Point(0, (Caption.Height - box.Height) / 2), box.Dimensions);

            if (e.X < hit.X || e.X > hit.Y + hit.Width ||
                e.Y < hit.Y || e.Y > hit.Y + hit.Height)
            {
                return(true);
            }

            boxChecked = !boxChecked;

            if (callbackHandler != null)
            {
                callbackHandler(boxChecked);
            }

            return(true);
        }
Exemplo n.º 3
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++;
                    }
                }
            }
        }
Exemplo n.º 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Icon != null ? Icon.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DisplayLabel.GetHashCode();
         hashCode = (hashCode * 397) ^ LabelStacked.GetHashCode();
         hashCode = (hashCode * 397) ^ DisplayIcon.GetHashCode();
         hashCode = (hashCode * 397) ^ IconStacked.GetHashCode();
         hashCode = (hashCode * 397) ^ Required.GetHashCode();
         hashCode = (hashCode * 397) ^ IsStart.GetHashCode();
         hashCode = (hashCode * 397) ^ (Value != null ? Value.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ NotVisible.GetHashCode();
         hashCode = (hashCode * 397) ^ NotEnabled.GetHashCode();
         hashCode = (hashCode * 397) ^ (ErrorMsg != null ? ErrorMsg.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 5
0
        private static void LoadDefaults()
        {
            atomBackground       = Color.FromArgb(255, 255, 255);
            atomBackgroundDimmed = Color.FromArgb(200, 200, 200);
            atomForeground       = Color.FromArgb(0, 0, 0);
            atomHighlight        = Color.FromArgb(200, 200, 255);
            bodyBlured           = Color.FromArgb(0, 102, 155);
            bodyFocused          = Color.FromArgb(0, 150, 255);
            captionColor         = Color.FromArgb(0, 0, 0);
            desktopColor         = Color.FromArgb(151, 149, 128);
            focused           = Color.FromArgb(255, 210, 57);
            lableColor        = Color.FromArgb(0, 0, 0);
            menuBackground    = Color.FromArgb(255, 255, 255);
            menuForeground    = Color.FromArgb(0, 0, 0);
            selectedColor     = Color.FromArgb(255, 210, 57);
            titleBlured       = Color.FromArgb(255, 210, 57);
            titleFocused      = Color.FromArgb(255, 231, 0);
            bodyBorderBlured  = Color.FromArgb(0, 0, 0);
            bodyBorderFocused = Color.FromArgb(255, 255, 255);

            lableFont      = new SdlDotNet.Graphics.Font(@"freesans.ttf", 12);
            fixedPointFont = new SdlDotNet.Graphics.Font(@"VeraMoBd.ttf", 12);
            captionFont    = lableFont;

            desktopAlignment = Alignment.CENTER;
            desktopImage     = new Surface(Images.desktop);

            Surface icons = new Surface(Images.alerts);

            popupIcon = new DisplayIcon(icons, new Point(64, 48));

            closeIcon    = new DisplayIcon(icons, new Point(0, 0));
            minimizeIcon = new DisplayIcon(icons, new Point(0, 16));
            defaultIcon  = new DisplayIcon(icons, new Point(64, 32));

            binaryIcon = new DisplayIcon(icons, new Point(96, 32));
            folderIcon = new DisplayIcon(icons, new Point(112, 32));

            topLeftGlyph     = new DisplayIcon(icons, new Point(96, 0));
            topRightGlyph    = new DisplayIcon(icons, new Point(108, 0));
            bottomLeftGlyph  = new DisplayIcon(icons, new Point(96, 16));
            bottomRightGlyph = new DisplayIcon(icons, new Point(108, 16));

            scrollUp     = new DisplayIcon(icons, new Point(48, 0));
            scrollDown   = new DisplayIcon(icons, new Point(48, 16));
            scrollLeft   = new DisplayIcon(icons, new Point(64, 0));
            scrollRight  = new DisplayIcon(icons, new Point(64, 16));
            scrollMarker = new DisplayIcon(icons, new Point(80, 0));

            radioDeselected = new DisplayIcon(icons, new Point(16, 0));
            radioSelected   = new DisplayIcon(icons, new Point(16, 16));
            checkUnchecked  = new DisplayIcon(icons, new Point(32, 0));
            checkChecked    = new DisplayIcon(icons, new Point(32, 16));

            spinnerArrows = new DisplayIcon(icons, new Rectangle(80, 16, 10, 16));

            checkMatrix   = new DisplayIcon(icons, new Point(112, 48));
            uncheckMatrix = new DisplayIcon(icons, new Point(96, 48));

            HPos  = new DisplayIcon(icons, new Point(32, 112));
            BLPos = new DisplayIcon(icons, new Point(48, 112));
            P0Pos = new DisplayIcon(icons, new Point(64, 112));
            M0Pos = new DisplayIcon(icons, new Point(80, 112));
            P1Pos = new DisplayIcon(icons, new Point(96, 112));
            M1Pos = new DisplayIcon(icons, new Point(112, 112));

            defaultCaption = new DisplayCaption("Unnamed", defaultIcon);
        }