Exemplo n.º 1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (e.Button == System.Windows.Forms.MouseButtons.Left && ismousedown == true && mouseover != null)
            {
                if (mouseover.Movable)
                {
                    if (Vertical)
                    {
                        mouseover.z = (ydist / -2 + e.Y / yline) * -1;
                    }
                    else
                    {
                        mouseover.x = xdist / -2 + e.X / xline;
                        mouseover.y = (ydist / -2 + e.Y / yline) * -1;
                    }

                    if (mouseover.x < xdist / -2.0f) { mouseover.x = xdist / -2.0f; }
                    if (mouseover.x > xdist / 2.0f) { mouseover.x = xdist / 2.0f; }
                    if (mouseover.y < ydist / -2.0f) { mouseover.y = ydist / -2.0f; }
                    if (mouseover.y > ydist / 2.0f) { mouseover.y = ydist / 2.0f; }

                    if (UpdateOffsets != null)
                        UpdateOffsets(mouseover.interf, mouseover.x, mouseover.y, mouseover.z,mouseover);

                    this.Invalidate();
                }

                return;
            }

            mouseover = null;

            foreach (icon ico in icons)
            {
                if (e.X > ico.bounds.Left && e.X < ico.bounds.Right
                    && e.Y > ico.bounds.Top && e.Y < ico.bounds.Bottom)
                {
                    mouseover = ico;
                }
            }
        }
Exemplo n.º 2
0
 public static void write(this icon icon, int size = defaultButtonSize) => write(icon.GetIcon(), size);
Exemplo n.º 3
0
			public icon(icon old)
			{
				image = old.image;
			}
Exemplo n.º 4
0
 public static bool ClickUnFocus(this icon icon, Msg text, int size = pegi.defaultButtonSize) => pegi.ClickUnFocus(icon.GetIcon(), text.Get(), size);
Exemplo n.º 5
0
 new DependencyIconSet(
     icon: KnownMonikers.NuGetNoColor,
Exemplo n.º 6
0
 public static void write(this icon icon, string toolTip, int size = defaultButtonSize) => write(icon.GetIcon(), toolTip, size);
Exemplo n.º 7
0
 public static bool Click(this icon icon, Msg text) => icon.ClickUnFocus(text.Get());
 new DependencyIconSet(
     icon: KnownMonikers.Reference,
Exemplo n.º 9
0
 new DependencyIconSet(
     icon: KnownMonikers.SDK,
Exemplo n.º 10
0
 new DependencyIconSet(
     icon: KnownMonikers.Framework,
Exemplo n.º 11
0
 new DependencyIconSet(
     icon: KnownMonikers.CodeInformation,
Exemplo n.º 12
0
        public static bool fullWindowDocumentationClickOpen(this string text, string toolTip = "", int buttonSize = 20, icon clickIcon = icon.Question)
        {
            bool gotHeadline = false;

            if (toolTip.IsNullOrEmpty())
            {
                toolTip = Msg.ToolTip.GetDescription();
            }
            else
            {
                gotHeadline = true;
            }

            if (fullWindowDocumentationClickOpen(toolTip, buttonSize, clickIcon))
            {
                PopUpService.popUpText   = text;
                PopUpService.popUpHeader = gotHeadline ? toolTip : "";
                PopUpService.InitiatePopUp();
                return(true);
            }

            return(false);
        }
Exemplo n.º 13
0
 public static icon BgColor(this icon icn, Color col)
 {
     SetBgColor(col);
     return(icn);
 }
Exemplo n.º 14
0
        //private static List<Color> _previousGuiColors = new List<Color>();

        private static icon GUIColor(this icon icn, Color col)
        {
            SetGUIColor(col);
            return(icn);
        }
Exemplo n.º 15
0
 public static void nl(this icon icon, string hint, int size = defaultButtonSize)
 {
     icon.write(hint, size);
     nl();
 }
Exemplo n.º 16
0
 public static bool foldout(this icon ico, ref bool state) => ico.GetIcon().foldout(ref state);
Exemplo n.º 17
0
 ShowWithButtons(text, instructionText, buttons, detail, icon, cancelable, expandedLabel);
Exemplo n.º 18
0
 public static bool foldout(this icon ico, string text, ref bool state) => ico.GetIcon().foldout(text, ref state);
Exemplo n.º 19
0
 public static void write(this icon icon, string toolTip, int width, int height) => write(icon.GetIcon(), toolTip, width, height);
Exemplo n.º 20
0
 public static bool foldout(this icon ico, string text, ref int selected, int current) => ico.GetIcon().foldout(text, ref selected, current);
Exemplo n.º 21
0
 public static bool Click(this icon icon, Msg text, ref bool changed) => icon.ClickUnFocus(text.Get()).changes(ref changed);
Exemplo n.º 22
0
 public static bool enter <T>(this icon ico, ref int enteredOne, T currentEnum) where T : struct
 => ico.enter(ref enteredOne, Convert.ToInt32(currentEnum), currentEnum.ToString());
Exemplo n.º 23
0
 public static bool ClickUnFocus(this icon icon, Msg text, int width, int height) => pegi.ClickUnFocus(icon.GetIcon(), text.Get(), width, height);
Exemplo n.º 24
0
        public static string GetText(this icon msg)
        {
            var lt = msg.Get();

            return(lt != null?lt.ToString() : msg.ToString());
        }
Exemplo n.º 25
0
 new DependencyIconSet(
     icon: ManagedImageMonikers.NuGetGrey,
Exemplo n.º 26
0
        public static string GetDescription(this icon msg)
        {
            var lt = msg.Get();

            return(lt != null ? lt.details : msg.ToString());
        }
Exemplo n.º 27
0
    public static void LoadFile(string file, string name)
    {
        //load the bitmap
        Bitmap load = null;
        try { load = new Bitmap(file); }
        catch { return; }

        //bitmap widthxheight must be the same
        if (load.Width != load.Height) {
            load.Dispose();
            return;
        }

        //get the current icon instance associated with the name
        //so we can add a new bitmap size to it.
        icon ico = getIcoInst(name);
        if (ico != null) {
            lock (p_SyncLock) {
                //make sure that the bitmap size is not in use.
                for (int c = 0; c < ico.bitmaps.Length; c++) {
                    if (ico.bitmaps[c].Size.Width == load.Size.Width) {
                        load.Dispose();
                        return;
                    }
                }

                //add it
                Array.Resize(ref ico.bitmaps, ico.bitmaps.Length + 1);
                ico.bitmaps[ico.bitmaps.Length - 1] = load;
            }
            return;
        }

        //add a new icon definition since there isnt one
        //which does by the specified name
        ico = new icon {
            name = name,
            bitmaps = new Bitmap[] { load }
        };
        lock (p_SyncLock) {
            Array.Resize(ref p_Icons, p_Icons.Length + 1);
            p_Icons[p_Icons.Length - 1] = ico;
        }
    }
Exemplo n.º 28
0
 public static string F(this icon msg, Msg other) => "{0} {1}".F(msg.GetText(), other.GetText());
Exemplo n.º 29
0
			public qnx(OldUnityXml.qnx old)
			{
				env = new env(old.env);

				author = old.author;
				authorId = old.authorId;
				id = old.id;
				filename = old.filename;
				name = old.name;
				description = old.description;
				publisher = old.publisher;
				versionNumber = old.versionNumber;

				int assetCount = 5, splashAssetCount = old.splashScreens.images != null ? old.splashScreens.images.Length : 0;
				assets = new asset[assetCount + splashAssetCount];
				assets[0] = new asset(old.icon.image, old.icon.image);
				assets[1] = new asset("Data", null);
				assets[2] = new asset("lib", null);
				assets[3] = new asset("SLAwards.bundle", "scoreloop/SLAwards.bundle");
				assets[4] = new asset("Release", null);
				for (int i = 0; i != splashAssetCount; ++i)
				{
					assets[assetCount+i] = new asset(old.splashScreens.images[i], old.splashScreens.images[i]);
				}

				icon = new icon(old.icon);
				splashScreens = new splashScreens(old.splashScreens);
				initialWindow = new initialWindow(old.initialWindow);
				configuration = new configuration(old);

				category = old.category;
				permissions = new permission[old.actions.Length];
				for (int i = 0; i != permissions.Length; ++i)
				{
					permissions[i] = new permission(old.actions[i]);
				}
			}
Exemplo n.º 30
0
 public static string F(this Msg msg, icon other) => "{0} {1}".F(msg.GetText(), other.GetText());
Exemplo n.º 31
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                ismousedown = true;

                foreach (icon ico in icons)
                {
                    if (e.X > ico.bounds.Left && e.X < ico.bounds.Right
                        && e.Y > ico.bounds.Top && e.Y < ico.bounds.Bottom)
                    {
                        mouseover = ico;
                    }

                }
            }
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                // context menu
            }
        }
Exemplo n.º 32
0
 public static void nl(this icon icon, int size = defaultButtonSize)
 {
     icon.write(size);
     nl();
 }