예제 #1
0
		public FullsizeContainer(Widget widget)
			: base()
		{
			if (widget == null) {
				throw new ArgumentException("widget");
			}

			Widget = widget;
		}
예제 #2
0
		public static int Draw(Widget widget, string str, int x, int y, out int endx, out int endy)
		{
			return Draw(widget, str, x, y, widget.Width - x, widget.Height - y, out endx, out endy);
		}
예제 #3
0
파일: App.cs 프로젝트: txdv/meetcurses
 public static void DrawV(Widget widget, int x, int y, int height, ColorPair color)
 {
     Curses.attron(color.Attribute);
     DrawV(widget, x, y, height);
     Curses.attron(ColorPair.From(-1, -1).Attribute);
 }
예제 #4
0
파일: App.cs 프로젝트: txdv/meetcurses
 public static void DrawH(Widget widget, int x, int y, int width, ColorPair color)
 {
     Curses.attron(color.Attribute);
     DrawH(widget, x, y, width);
     Curses.attron(ColorPair.From(-1, -1).Attribute);
 }
예제 #5
0
파일: gui.cs 프로젝트: mono/mono-curses
 /// <summary>
 ///   Focuses the specified widget in this container.
 /// </summary>
 /// <remarks>
 ///   Focuses the specified widge, taking the focus
 ///   away from any previously focused widgets.   This
 ///   method only works if the widget specified
 ///   supports being focused.
 /// </remarks>
 public void SetFocus(Widget w)
 {
     if (!w.CanFocus)
         return;
     if (focused == w)
         return;
     if (focused != null)
         focused.HasFocus = false;
     focused = w;
     focused.HasFocus = true;
     Container wc = w as Container;
     if (wc != null)
         wc.EnsureFocus ();
     focused.PositionCursor ();
 }
예제 #6
0
파일: gui.cs 프로젝트: mono/mono-curses
        /// <summary>
        ///   Focuses the previous widget.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public bool FocusPrev()
        {
            if (focused == null){
                FocusLast ();
                return true;
            }
            int focused_idx = -1;
            for (int i = widgets.Count; i > 0; ){
                i--;
                Widget w = (Widget)widgets [i];

                if (w.HasFocus){
                    Container c = w as Container;
                    if (c != null){
                        if (c.FocusPrev ())
                            return true;
                    }
                    focused_idx = i;
                    continue;
                }
                if (w.CanFocus && focused_idx != -1){
                    focused.HasFocus = false;

                    Container c = w as Container;
                    if (c != null && c.CanFocus){
                        c.FocusLast ();
                    }
                    SetFocus (w);
                    return true;
                }
            }
            if (focused != null){
                focused.HasFocus = false;
                focused = null;
            }
            return false;
        }
예제 #7
0
		public int Fill(Widget widget, char ch, int x, int y, int w, int h)
		{
			return Fill(widget, String, ch, x, y, w, h);
		}
예제 #8
0
		public int Fill(Widget widget, char ch, int x, int y)
		{
			return Fill(widget, String, ch, x, y, widget.Width - x, widget.Height - y);
		}
예제 #9
0
		public static int Fill(Widget widget, string str, char ch, int x, int y)
		{
			return Fill(widget, str, ch, x, y, widget.Width - x, widget.Height - y);
		}
예제 #10
0
		public int Draw(Widget widget)
		{
			return Draw(widget, String);
		}
예제 #11
0
		public static int Fill(Widget widget, string str, int x, int y)
		{
			return Fill(widget, str, ' ', x, y);
		}
예제 #12
0
		public static int Fill(Widget widget, string str, char ch)
		{
			return Fill(widget, str, ch, 0, 0);
		}
예제 #13
0
		public static int Fill(Widget widget, string str)
		{
			return Fill(widget, str, ' ', 0, 0);
		}
예제 #14
0
		public static int Draw(Widget widget, string str, int x, int y, int w, int h, out int endx, out int endy)
		{
			int xi = 0, yi = 0;
			int length = Each(str, delegate (char ch) {
				widget.Set(xi + x, yi + y, ch);

				xi++;
				if (xi >= w) {
					xi = 0;
					yi++;
					if (yi >= h) {
						return false;
					}
				}
				return true;
			});
			endx = xi + x;
			endy = yi + y;
			return length;
		}
예제 #15
0
		public static int Draw(Widget widget, string str, int x, int y, int w, int h)
		{
			int endx, endy;
			return Draw(widget, str, x, y, w, h, out endx, out endy);
		}
예제 #16
0
		public int Fill(Widget widget, char ch)
		{
			return Fill(widget, ch, 0, 0);
		}
예제 #17
0
		public int Fill(Widget widget, int x, int y)
		{
			return Fill(widget, ' ', x, y);
		}
예제 #18
0
		public static int Fill(Widget widget, string str, int x, int y, int w, int h)
		{
			return Fill(widget, str, ' ', x, y, w, h);
		}
예제 #19
0
		public int Fill(Widget widget, int x, int y, int w, int h)
		{
			return Fill(widget, ' ', x, y, w, h);
		}
예제 #20
0
		public static int Fill(Widget widget, string str, char ch, int x, int y, int w, int h)
		{
			int endx, endy;
			int length = Draw(widget, str, x, y, w, h, out endx, out endy);
			widget.Fill(ch, x, y, w, h, endx, endy);
			return length;
		}
예제 #21
0
파일: gui.cs 프로젝트: mono/mono-curses
 /// <summary>
 ///   Adds a widget to this container.
 /// </summary>
 /// <remarks>
 /// </remarks>
 public virtual void Add(Widget w)
 {
     widgets.Add (w);
     w.Container = this;
     if (w.CanFocus)
         this.CanFocus = true;
 }
예제 #22
0
		public int Draw(Widget widget, out int endx, out int endy)
		{
			return Draw(widget, String, out endx, out endy);
		}
예제 #23
0
파일: gui.cs 프로젝트: mono/mono-curses
        /// <summary>
        ///   Removes a widget from this container.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public virtual void Remove(Widget w)
        {
            if (w == null)
                return;

            widgets.Remove (w);
            w.Container = null;

            if (widgets.Count < 1)
                this.CanFocus = false;
        }
예제 #24
0
		public int Draw(Widget widget, int x, int y)
		{
			return Draw(widget, String, x, y);
		}
예제 #25
0
파일: gui.cs 프로젝트: mono/mono-curses
 public override void Add(Widget w)
 {
     base.Add (w);
 }
예제 #26
0
		public int Draw(Widget widget, int x, int y, int w, int h)
		{
			return Draw(widget, String, x, y, w, h);
		}
예제 #27
0
파일: App.cs 프로젝트: txdv/meetcurses
 public static void DrawH(Widget widget, int x, int y, int width)
 {
     for (int i = 0; i < width; i++) {
         widget.Set(x + i, y, ACS.HLINE);
     }
 }
예제 #28
0
		public int Draw(Widget widget, int x, int y, int w, int h, out int endx, out int endy)
		{
			return Draw(widget, String, x, y, w, h, out endx, out endy);
		}
예제 #29
0
파일: App.cs 프로젝트: txdv/meetcurses
 public static void DrawV(Widget widget, int x, int y, int height)
 {
     for (int i = 0; i < height; i++) {
         widget.Set(x, y + i, ACS.VLINE);
     }
 }
예제 #30
0
		public int Fill(Widget widget)
		{
			return Fill(widget, ' ');
		}