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; } } }
public static void write(this icon icon, int size = defaultButtonSize) => write(icon.GetIcon(), size);
public icon(icon old) { image = old.image; }
public static bool ClickUnFocus(this icon icon, Msg text, int size = pegi.defaultButtonSize) => pegi.ClickUnFocus(icon.GetIcon(), text.Get(), size);
new DependencyIconSet( icon: KnownMonikers.NuGetNoColor,
public static void write(this icon icon, string toolTip, int size = defaultButtonSize) => write(icon.GetIcon(), toolTip, size);
public static bool Click(this icon icon, Msg text) => icon.ClickUnFocus(text.Get());
new DependencyIconSet( icon: KnownMonikers.Reference,
new DependencyIconSet( icon: KnownMonikers.SDK,
new DependencyIconSet( icon: KnownMonikers.Framework,
new DependencyIconSet( icon: KnownMonikers.CodeInformation,
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); }
public static icon BgColor(this icon icn, Color col) { SetBgColor(col); return(icn); }
//private static List<Color> _previousGuiColors = new List<Color>(); private static icon GUIColor(this icon icn, Color col) { SetGUIColor(col); return(icn); }
public static void nl(this icon icon, string hint, int size = defaultButtonSize) { icon.write(hint, size); nl(); }
public static bool foldout(this icon ico, ref bool state) => ico.GetIcon().foldout(ref state);
ShowWithButtons(text, instructionText, buttons, detail, icon, cancelable, expandedLabel);
public static bool foldout(this icon ico, string text, ref bool state) => ico.GetIcon().foldout(text, ref state);
public static void write(this icon icon, string toolTip, int width, int height) => write(icon.GetIcon(), toolTip, width, height);
public static bool foldout(this icon ico, string text, ref int selected, int current) => ico.GetIcon().foldout(text, ref selected, current);
public static bool Click(this icon icon, Msg text, ref bool changed) => icon.ClickUnFocus(text.Get()).changes(ref changed);
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());
public static bool ClickUnFocus(this icon icon, Msg text, int width, int height) => pegi.ClickUnFocus(icon.GetIcon(), text.Get(), width, height);
public static string GetText(this icon msg) { var lt = msg.Get(); return(lt != null?lt.ToString() : msg.ToString()); }
new DependencyIconSet( icon: ManagedImageMonikers.NuGetGrey,
public static string GetDescription(this icon msg) { var lt = msg.Get(); return(lt != null ? lt.details : msg.ToString()); }
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; } }
public static string F(this icon msg, Msg other) => "{0} {1}".F(msg.GetText(), other.GetText());
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]); } }
public static string F(this Msg msg, icon other) => "{0} {1}".F(msg.GetText(), other.GetText());
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 } }
public static void nl(this icon icon, int size = defaultButtonSize) { icon.write(size); nl(); }