public static void SetColor(ushort ccolor, Curses.Color color) { SetColor(ccolor, color.R, color.G, color.B); }
public override void ProcessMouse(Curses.MouseEvent ev) { if ((ev.ButtonState & Curses.Event.Button1Clicked) != 0){ Container.SetFocus (this); Container.Redraw (); if (Clicked != null) Clicked (this, EventArgs.Empty); } }
/// <summary> /// Gives widgets a chance to process the given /// mouse event. /// </summary> /// <remarks> /// Widgets can inspect the value of /// ev.ButtonState to determine if this is a /// message they are interested in (typically /// ev.ButtonState & Curses.Event.Button1Clicked). /// </remarks> public virtual void ProcessMouse(Curses.MouseEvent ev) { }
public override void ProcessMouse(Curses.MouseEvent ev) { if ((ev.ButtonState & Curses.Event.Button1Clicked) == 0) return; ev.X -= x; ev.Y -= y; if (ev.Y < 0) return; if (ev.Y+top >= items) return; selected = ev.Y - top; SelectedChanged (); Redraw (); }
public override void ProcessMouse(Curses.MouseEvent ev) { if ((ev.ButtonState & Curses.Event.Button1Clicked) == 0) return; Container.SetFocus (this); // We could also set the cursor position. point = first + (ev.X - x); if (point > text.Length) point = text.Length; if (point < first) point = 0; Container.Redraw (); Container.PositionCursor (); }
public override void ProcessMouse(Curses.MouseEvent ev) { int bx, by; GetBase (out bx, out by); ev.X -= x; ev.Y -= y; foreach (Widget w in widgets){ int wx = w.x + bx; int wy = w.y + by; if ((ev.X < wx) || (ev.X > (wx + w.w))) continue; if ((ev.Y < wy) || (ev.Y > (wy + w.h))) continue; ev.X -= bx; ev.Y -= by; w.ProcessMouse (ev); return; } }