Text data entry widget
The Entry widget provides Emacs-like editing functionality, and mouse support.
Наследование: Widget
Пример #1
0
        static void RunQueryNow(object sender, EventArgs e)
        {
            var d = new Dialog(100, 100, "Run Query");

            d.Add(new Label(0, 0, "Query Options:"));
            var start = new Mono.Terminal.Entry(12, 0, 25, null);

            d.Add(start);

            _container.Add(d);
        }
Пример #2
0
Файл: mc.cs Проект: txdv/mc
        void SetupGUI()
        {
            left = Panel.Create (this, "left", 4);
            right = Panel.Create (this, "right", 4);
            bar = new ButtonBar (bar_labels);
            menu = new MenuBar (mc_menu);
            prompt = new Label (0, Application.Lines-2, "bash$ ") {
                Color = Application.ColorBasic
            };
            entry = new Entry (prompt.Text.Length, Application.Lines-2, Application.Cols - prompt.Text.Length, "") {
                Color = Application.ColorBasic,
                CanFocus = false,
            };

            bar.Action += delegate (int n) {
                switch (n) {
                case 5:
                    CurrentPanel.Copy (OtherPanel.CurrentPath);
                    break;

                case 9:
                    menu.Activate (0);
                    break;

                case 10:
                    var r = MessageBox.Query (56, 7, "Midnight Commander NG", "Do you really want to quit?", "Yes", "No");
                    if (r == 0)
                        Running = false;
                    break;

                default:
                    break;
                }
            };

            Add (left);
            Add (right);
            Add (bar);
            Add (menu);
            Add (prompt);
            Add (entry);

            SetFocus (left);
        }
Пример #3
0
Файл: mc.cs Проект: arg/mc
        void SetupGUI()
        {
            var height = Application.Lines - 4;

            left = Panel.Create (this, "left", 4);
            right = Panel.Create (this, "right", 4);
            bar = new ButtonBar (bar_labels);
            menu = new MenuBar (mc_menu);
            prompt = new Label (0, Application.Lines-2, "bash$ acción ") {
                Color = Application.ColorBasic
            };
            entry = new Entry (prompt.Text.Length, Application.Lines-2, Application.Cols - prompt.Text.Length, "") {
                Color = Application.ColorBasic,
                CanFocus = false,
            };

            bar.Action += delegate (int n){
                switch (n){
                case 3:
                    var selected = CurrentPanel.SelectedNode;
                    if (selected is Listing.DirNode)
                        CurrentPanel.ChangeDir (selected as Listing.DirNode);
                    else {
                        Stream stream;
                        try {
                            stream = File.OpenRead (CurrentPanel.SelectedPath);
                        } catch (IOException ioe) {
                            Message.Error (ioe, "Could not open file", CurrentPanel.SelectedPath);
                            return;
                        }
                        FullView.Show (stream);

                        stream.Dispose ();
                    }
                    break;
                case 5:
                    CurrentPanel.Copy (OtherPanel.CurrentPath);
                    break;

                case 9:
                    menu.Activate (0);
                    break;

                case 10:
                    var r = MessageBox.Query (56, 7, "Midnight Commander NG", "Do you really want to quit?", "Yes", "No");
                    if (r == 0)
                        Running = false;
                    break;

                default:
                    break;
                }
            };

            Add (left);
            Add (right);
            Add (bar);
            Add (menu);
            Add (prompt);
            Add (entry);

            SetFocus (left);
        }