Beispiel #1
0
    static void Main()
    {
        // Standard Init sequence
        Curses.initscr();
        Curses.cbreak();
        Curses.noecho();

        // Recommended
        Curses.nonl();

        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addch('ó');
        Curses.addstr("acción");
        Curses.refresh();
        Curses.getch();

        Curses.Window.Standard.intrflush(false);
        Curses.Window.Standard.keypad(true);

        // Shutdown
        Curses.endwin();
    }
Beispiel #2
0
        void IListProvider.Render(int line, int col, int width, int item)
        {
            TorrentManager tm = torrent_list.GetSelected();
            string         name;

            if (tm == null)
            {
                name = "";
            }
            else
            {
                name = tm.Torrent.Files [item].Path;
            }

            string s = String.Format("{0}. {1}", item, name);

            if (s.Length > width)
            {
                s = s.Substring(0, width);
                Curses.addstr(s);
            }
            else
            {
                Curses.addstr(s);
                for (int i = s.Length; i < width; i++)
                {
                    Curses.addch(' ');
                }
            }
        }
Beispiel #3
0
		public void DrawItem (int nth, bool is_selected)
		{
			char ch;
			
			if (nth >= listing.Count)
				throw new Exception ("overflow");

			is_selected = HasFocus && is_selected;
				
			Move (y + (nth-top) + 1, x + 1);
			
			Listing.FileNode node = listing [nth];
			int color;

			if (node == null)
				throw new Exception (String.Format ("Problem fetching item {0}", nth));

			if (node.Info.IsDirectory){
				color = is_selected ? ColorFocus : ColorDir;
				ch = '/';
			} else {
				color = is_selected ? ColorFocus : ColorNormal;
				ch = ' ';
			}
			if (node.Marked)
				color = is_selected ? ColorHotFocus : ColorHotNormal;

			Curses.attrset (color);
			for (int i = 0; i < node.Nested; i++)
				Curses.addstr ("  ");
			Curses.addch (ch);
			Curses.addstr (node.Name);
		}
Beispiel #4
0
 void DrawStatus()
 {
     Move(y, x);
     Curses.attrset(Container.ContainerColorFocus);
     for (int i = 0; i < w; i++)
     {
         Curses.addch(' ');
     }
     Move(y, x);
     Curses.addstr("File: FOOBAR");
 }
Beispiel #5
0
        public override void Redraw()
        {
            int x = 0;
            int y = Application.Lines - 1;

            Move(y, 0);

            for (int i = 0; i < labels.Length; i++)
            {
                Curses.attrset(Application.ColorBasic);
                Curses.addstr(i == 0 ? "1" : String.Format(" {0}", i + 1));
                Curses.attrset(ColorFocus);
                Curses.addstr("{0,-6}", labels [i]);
            }
        }
        public void Render(int line, int col, int width, int item)
        {
            string        record = "";
            List <string> l      = (List <string>)items[item];

            foreach (string column in l)
            {
                if (column.Length > MAX_CHARS_PER_COLUMN)
                {
                    record = record + column.Substring(0, MAX_CHARS_PER_COLUMN) + "... ";
                }
                else
                {
                    record = record + column + " ";
                }
            }
            Curses.addstr(record);
        }
Beispiel #7
0
        void IListProvider.Render(int line, int col, int width, int item)
        {
            string s = $"{item} This is item {item}";

            if (s.Length > width)
            {
                s = s.Substring(0, width);
                Curses.addstr(s);
            }
            else
            {
                Curses.addstr(s);
                for (int i = s.Length; i < width; i++)
                {
                    Curses.addch(' ');
                }
            }
        }
Beispiel #8
0
        public override void Redraw()
        {
            Curses.attrset(ColorNormal);

            int i = 0;
            int l;
            int n = head > tail ? head - tail : (head + messages.Length) - tail;

            for (l = h - 1; l >= 0 && n-- > 0; l--)
            {
                int item = head - 1 - i;
                if (item < 0)
                {
                    item = messages.Length + item;
                }

                Move(y + l, x);

                int sl = messages [item].Length;
                if (sl < w)
                {
                    Curses.addstr(messages [item]);
                    for (int fi = 0; fi < w - sl; fi++)
                    {
                        Curses.addch(' ');
                    }
                }
                else
                {
                    Curses.addstr(messages [item].Substring(0, sl));
                }
                i++;
            }

            for (; l >= 0; l--)
            {
                Move(y + l, x);
                for (i = 0; i < w; i++)
                {
                    Curses.addch(' ');
                }
            }
        }
Beispiel #9
0
        void IListProvider.Render(int line, int col, int width, int item)
        {
            TorrentManager manager = items [item];
            string         name    = manager.Torrent.Name;

            string s = String.Format("[{0,3:N0}%] {1}", manager.Progress, name);

            if (s.Length > width)
            {
                s = s.Substring(0, width);
                Curses.addstr(s);
            }
            else
            {
                Curses.addstr(s);
                for (int i = s.Length; i < width; i++)
                {
                    Curses.addch(' ');
                }
            }
        }
 public void Render(int line, int col, int width, int item)
 {
     Curses.addstr(items[item]);
 }