public IndexedUIButton(int leftPoint, int topPoint, int panelWidth, int panelHeight, string textureAddress, Color colour, ClickMethod onClickMethod, float layer, bool transforms, int index) : base(leftPoint, topPoint, panelWidth, panelHeight, colour, layer, transforms) { texture = TextureManager.GetTexture(textureAddress); method = onClickMethod; Index = index; }
public UIIndexedButton(int leftPoint, int topPoint, int panelWidth, int panelHeight, string textureAddress, Color colour, ClickMethod onClickMethod, float layer, bool transforms, int x, int y) : base(leftPoint, topPoint, panelWidth, panelHeight, colour, layer, transforms) { texture = TextureManager.GetTexture(textureAddress); method = onClickMethod; this.x = x; this.y = y; }
public TextIndexedButton(int leftPoint, int topPoint, int panelWidth, int panelHeight, string textureAddress, ClickMethod onClickMethod, string fontAddress, string displayText, Color colour, float layer, bool transform, int x, int y) : base(leftPoint, topPoint, panelWidth, panelHeight, textureAddress, colour, onClickMethod, layer, transform, x, y) { font = TextureManager.GetFont(fontAddress); text = displayText; stringOffset = new Vector2(this.Bounds.Width * 0.5f, this.Bounds.Height * 0.5f); stringOrigin = font.MeasureString(displayText) * 0.5f; }
/// <summary> /// Set Mouse clicks send to which IntPtr. If not set will default use process's <see cref="Process.MainWindowHandle"/>. /// </summary> /// <param name="hWnd"></param> /// <returns>True if set success, but false if not valid</returns> public bool SetIntPtr(IntPtr hWnd, [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string caller = null) { if (hWnd == default(IntPtr) || hWnd == IntPtr.Zero) { logger.WritePrivateLog("Click IntPtr set FAILED as IntPtr is Zero or not valid!", lineNumber, caller); //Unable to set Ptr return(false); } ClickMethod = ClickMethod.WinAPI; logger.WritePrivateLog("Click IntPtr set SUCCESS with " + hWnd.ToInt32(), lineNumber, caller); ClickPtr = hWnd; return(true); }
// You're allowed to create a button that doesn't do anything. public Button(EDisplaySetting displaySetting, string title, ClickMethod onClickMethod) : this(displaySetting, title) { this.OnClick = onClickMethod; }
public void setMethod(ClickMethod c) { method = c; }