Inheritance: Eto.Forms.TextControl
示例#1
0
        void Init()
        {
            //_textBoxUrl
            _textBoxUrl = new TextBox();

            //_buttonReadFile
            _buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") };
            _buttonReadFile.Click += _buttonReadFile_Click;

            //_buttonSaveFile
            _buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")};
            _buttonSaveFile.Click += _buttonSaveFile_Click;

            //_textAreaBody
            _textAreaBody = new TextArea();

            var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
            layout.BeginVertical();
            layout.BeginHorizontal();
            layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false);
            layout.AddCentered(_buttonReadFile, horizontalCenter: false);
            layout.AddCentered(_buttonSaveFile, horizontalCenter: false);
            layout.EndBeginHorizontal();
            layout.EndVertical();

            layout.AddRow(_textAreaBody);

            Content = layout;
        }
示例#2
0
        void Init()
        {
	        _tbxShellData = new TextArea {Size = new Size(-1, 200)};
            _tbxMsg = new TextBox();
	        _btnShowMsgInStatus = new Button {Text = "Show Msg In Status", Width = 150};
            _btnShowMsgInStatus.Click+=btn_showMsgInStatus_Click;
			_btnShowMessageBox = new Button { Text = "Show Msg In Message", Width = 150 };
            _btnShowMessageBox.Click+=btn_showMessageBox_Click;
			_btnCreateNewTabPage = new Button { Text = "Create New TabPage", Width = 150 };
            _btnCreateNewTabPage.Click+=btn_createNewTabPage_Click;

			// Test
	        var btnTest = new Button {Text = "Test", Width = 150};
			btnTest.Click += btnTest_Click;

	        var layout = new DynamicLayout {Padding = new Padding(10, 10), Size = new Size(10, 10)};
            layout.AddRow(new Label() { Text = "ShellData"});
			layout.AddRow(_tbxShellData);
			layout.AddSeparateRow(new Label() { Text = "Msg", VerticalAlign = VerticalAlign.Middle }, _tbxMsg, null);
	        layout.AddAutoSized(_btnShowMsgInStatus);
	        layout.AddAutoSized(_btnShowMessageBox);
	        layout.AddAutoSized(_btnCreateNewTabPage);
			layout.AddAutoSized(btnTest);
			layout.Add(null);

            this.Content = layout;
        }
示例#3
0
		Control TitleBox()
		{
			var control = new TextArea { Size = new Size(300, -1) };
			var binding = new ObjectBinding<MessageBoxSection, string>(this, r => r.MessageBoxText, (r, val) => r.MessageBoxText = val);
			control.TextBinding.Bind(binding);
			return control;
		}
示例#4
0
		void Init()
		{
			_comboBoxServices = new ComboBox();
			_comboBoxServices.SelectedIndexChanged += _comboBoxServices_SelectedIndexChanged;

			_textAreaInfo = new TextArea{Size=new Size(-1,200)};
			_textAreaInfo.Enabled = false;
			_textAreaResult = new TextArea();
			_textAreaResult.Text = "If you wanna call one service, you can do like this:\n" +
									"dynamic ToBase64 = PluginServiceProvider.GetService(\"ToBase64\");\n" +
									"var result = ToBase64(new PluginParameter(\"str\", \"Test\"));\n" +
									"//result=\"VGVzdA==\"";
			_textAreaResult.Enabled = false;

			var layout = new DynamicLayout {Padding = new Padding(10, 10)};

			layout.AddSeparateRow(
				new Label {Text = "The Registered Services", VerticalAlign = VerticalAlign.Middle},
				_comboBoxServices);
			layout.AddSeparateRow(_textAreaInfo);
			layout.AddSeparateRow(_textAreaResult);

			Content = layout;
			Title = "Developer Tool";
			Size = new Size(400, 400);
		}
示例#5
0
		Control ShowSelectedText (TextArea text)
		{
			var control = new Button { Text = "Show selected text" };
			control.Click += (sender, e) => {
				MessageBox.Show (this, string.Format ("Selected Text: {0}", text.SelectedText));
			};
			return control;
		}
示例#6
0
		Control SelectAll(TextArea text)
		{
			var control = new Button { Text = "Select All" };
			control.Click += (sender, e) => {
				text.SelectAll();
				text.Focus();
			};
			return control;
		}
示例#7
0
		Control ReplaceSelected(TextArea textArea)
		{
			var control = new Button { Text = "Replace selected text" };
			control.Click += (sender, e) => {
				textArea.SelectedText = "Some inserted text!";
				textArea.Focus();
			};
			return control;
		}
示例#8
0
		public static Control TextAreaOptions2(TextArea text)
		{
			return new StackLayout
			{
				Orientation = Orientation.Horizontal,
				Spacing = 5,
				Items = { null, SetAlignment(text), SetCaretButton(text), ChangeColorButton(text), null }
			};
		}
示例#9
0
		public static Control TextAreaOptions(TextArea text)
		{
			return new StackLayout
			{
				Orientation = Orientation.Horizontal,
				Spacing = 5,
				Items = { null, ShowSelectedText(text), SetSelectedText(text), ReplaceSelected(text), SelectAll(text), null }
			};
		}
示例#10
0
		Control SetCaret(TextArea textArea)
		{
			var control = new Button { Text = "Set Caret" };
			control.Click += (sender, e) => {
				textArea.CaretIndex = textArea.Text.Length / 2;
				textArea.Focus();
			};
			return control;
		}
示例#11
0
		Control NoWrap ()
		{
			var control = new TextArea{ 
				Text = "Some very long text that should not wrap. Some very long text that should not wrap. Some very long text that should not wrap. Some very long text that should not wrap." + Environment.NewLine + "Second Line",
				Size = new Size (100, 50),
				Wrap = false
			};
			LogEvents (control);
			return control;
		}
示例#12
0
        public HiSumDisplay()
        {
            // sets the client (inner) size of the window for your content
            ClientSize = new Eto.Drawing.Size(600, 400);

            Title = "HiSum";
            TreeGridView view = new TreeGridView(){Height = 500};

            view.Columns.Add(new GridColumn() { HeaderText = "Summary", DataCell = new TextBoxCell(0), AutoSize = true, Resizable = true, Editable = false });
            var textbox = new TextBox() {Width = 1000};
            var button = new Button(){Text = "Go", Width = 15};
            var label = new Label() {Width = 100};
            var tbResult = new TextArea() {Width = 1000};

            button.Click += (sender, e) =>
            {
                Reader reader = new Reader();
                List<int> top100 = reader.GetTop100();
                List<FullStory> fullStories = new List<FullStory>();
                foreach (int storyID in top100.Take(30))
                {
                    FullStory fullStory = reader.GetStoryFull(storyID);
                    fullStories.Add(fullStory);
                }
                TreeGridItemCollection data = GetTree(fullStories);
                view.DataStore = data;
            };
            Content = new TableLayout
            {
                Spacing = new Size(5, 5), // space between each cell
                Padding = new Padding(10, 10, 10, 10), // space around the table's sides
                Rows = {
                    new TableRow(
                        new Label{Text = "Input URL from Hacker News: ",Width=200},
                        textbox,
                        button,
                        label
                    ),
                    new TableRow(
                        null,
                        tbResult,
                        null,
                        null
                        ),
                    new TableRow(
                        new Label(),
                        view
                    ),

                    // by default, the last row & column will get scaled. This adds a row at the end to take the extra space of the form.
                    // otherwise, the above row will get scaled and stretch the TextBox/ComboBox/CheckBox to fill the remaining height.
                    new TableRow { ScaleHeight = true }
                }
            };
        }
示例#13
0
		Control SetAlignment(TextArea text)
		{
			var control = new EnumDropDown<HorizontalAlign>();
			control.SelectedValueBinding.Bind(text, t => t.HorizontalAlign);
			return new TableLayout
			{
				Padding = Padding.Empty,
				Spacing = new Size(5, 5),
				Rows = { new TableRow(new Label { Text = "Alignment", VerticalAlign = VerticalAlign.Middle }, control) }
			};
		}
示例#14
0
		Control SetSelectedText(TextArea textArea)
		{
			var control = new Button { Text = "Set selected text" };
			control.Click += (sender, e) => {
				var text = textArea.Text;
				// select the last half of the text
				textArea.Selection = new Range(text.Length / 2, text.Length / 2 + 1);
				textArea.Focus();
			};
			return control;
		}
示例#15
0
        void Init()
        {
            //_textAreaWelcome
	        _textAreaWelcome = new TextArea() {Size = new Size(418, 277), Text = AltStrRes.Disclaimer};
	        _textAreaWelcome.Wrap = true;
	        _textAreaWelcome.Enabled = false;

            //_checkBoxNoDisplay
			_checkBoxNoDisplay = new CheckBox() { Text = AltStrRes.DontDisplayAgain};

            //_buttonNo
			_buttonNo = new Button() { Text = AltStrRes.No};
            _buttonNo.Click += delegate
            {
                if (_checkBoxNoDisplay.Checked == true)
                {
                    _setting.IsShowDisclaimer = false;

                    //保存Setting到xml
					InitWorker.SaveSettingToXml(AppEnvironment.AppPath, _setting);
                    //重新初始化GlobalSetting
					InitWorker.InitGlobalSetting(AppEnvironment.AppPath);
                }
				//Application.Instance.Quit();
				Environment.Exit(0);
            };

            //_buttonYes
	        _buttonYes = new Button() {Text = AltStrRes.Yes};
            _buttonYes.Click += delegate
            {
                if (_checkBoxNoDisplay.Checked == true)
                {
                    _setting.IsShowDisclaimer = false;
                    //保存Setting到xml
					InitWorker.SaveSettingToXml(AppEnvironment.AppPath, _setting);
                    //重新初始化GlobalSetting
					InitWorker.InitGlobalSetting(AppEnvironment.AppPath);
                }
                Close();
            };

            var layout = new DynamicLayout();
            layout.AddRow(_textAreaWelcome);
            layout.AddSeparateRow(_checkBoxNoDisplay,null, _buttonNo, _buttonYes);
            layout.AddRow(null);

            Content = layout;
            Size = new Size(460,370);
			Icon = Icons.AltmanIcon;
			ShowInTaskbar = true;
            Title = AltStrRes.Welcome;
        }
示例#16
0
		public static Control TextAreaOptions4(TextArea text)
		{
			return new StackLayout
			{
				Orientation = Orientation.Horizontal,
				Spacing = 5,
				Items =
				{
					null,
					TextReplacementsDropDown(text),
					null
				}
				};
		}
示例#17
0
		Control Default()
		{
			var text = new TextArea { Text = "Some Text" };
			LogEvents(text);

			var layout = new DynamicLayout();

			layout.Add(text);
			layout.BeginVertical(Padding.Empty, Size.Empty);
			layout.AddRow(null, ShowSelectedText(text), SetSelectedText(text), ReplaceSelected(text), SelectAll(text), SetCaret(text), null);
			layout.EndVertical();

			return layout;
		}
示例#18
0
		Control Default()
		{
			var text = new TextArea { Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." };
			LogEvents(text);

			return new TableLayout
			{
				Rows =
				{
					TableLayout.Horizontal(null, ShowSelectedText(text), SetSelectedText(text), ReplaceSelected(text), SelectAll(text), null).With(r => r.Padding = Padding.Empty),
					TableLayout.Horizontal(null, SetAlignment(text), SetCaretButton(text), ChangeColorButton(text), null).With(r => r.Padding = Padding.Empty),
					TableLayout.Horizontal(null, EnabledCheckBox(text), ReadOnlyCheckBox(text), AcceptsTabCheckBox(text), AcceptsReturnCheckBox(text), WrapCheckBox(text), null).With(r => r.Padding = Padding.Empty),
					text
				}
			};
		}
示例#19
0
        private Control GetDataControl(string value, bool multiline = false)
        {
            TextControl ctl;

            if (multiline) {
                var txt = new TextArea { ReadOnly = true };
                txt.Wrap = true;
                ctl = txt;
            } else {
                var txt = new TextBox { ReadOnly = true };
                ctl = txt;
            }

            ctl.Text = value;

            return ctl;
        }
示例#20
0
        public MainForm()
        {
            if (ToolPath == null)
            {
                MessageBox.Show("Não foi possível localizar a ferramenta SanUSB");
                Application.Instance.Quit();
            }

            XamlReader.Load(this);
            //Loads image from path
            FindChild<ImageView>("logoImage").Image =
                (Image)new ImageConverter().ConvertFromString("Images/logo-full.png");
            
            //Set properties and DataContext
            textArea = FindChild<TextArea>("txtLog");
            DataContext = viewModel = new ViewModel();
        }
示例#21
0
		Control Default()
		{
			var text = new TextArea { Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." };
			LogEvents(text);

			return new TableLayout
			{
				Padding = new Padding(10),
				Spacing = new Size(5, 5),
				Rows =
				{
					TextAreaOptions(text),
					TextAreaOptions2(text),
					TextAreaOptions3(text),
					text
				}
			};
		}
示例#22
0
		void Init()
		{
			_textAreaInput = new TextArea();
			_textAreaInput.Font = new Font(FontFamilies.Monospace, 10);

		    _dropDownServices = new DropDown {Width = 200};
			_dropDownServices.SelectedIndexChanged += DropDownServicesSelectedIndexChanged;

			_radioButtonEncode = new RadioButton {Text = "Encode"};
			_radioButtonEncode.CheckedChanged += _radioButtonEncode_CheckedChanged;
			_radioButtonDecode = new RadioButton(_radioButtonEncode) {Text = "Decode"};

			_buttonRun = new Button { Text = "Run" };
			_buttonRun.Click += _buttonRun_Click;

			_textAreaOutput = new TextArea();
			_textAreaOutput.Font = new Font(FontFamilies.Monospace, 10);

			var inputLayout = new DynamicLayout {Padding = new Padding(5, 5, 5, 0), Spacing = new Size(5, 5)};
			inputLayout.AddSeparateRow(_textAreaInput);

			var outputLayout = new DynamicLayout {Padding = new Padding(5, 5), Spacing = new Size(5, 5)};
			outputLayout.BeginVertical();
			outputLayout.BeginHorizontal();
			outputLayout.AddCentered(_radioButtonEncode, horizontalCenter: false);
			outputLayout.AddCentered(_radioButtonDecode, horizontalCenter: false);
			outputLayout.Add(null);
			outputLayout.AddCentered(_dropDownServices, horizontalCenter: false);
			outputLayout.AddCentered(_buttonRun, horizontalCenter: false);
			outputLayout.EndHorizontal();
			outputLayout.EndVertical();
			outputLayout.AddSeparateRow(_textAreaOutput);

			var layout = new Splitter
			{
				Panel1 = inputLayout,
				Panel2 = outputLayout,
				Orientation = SplitterOrientation.Vertical,
				Position = 130
			};

			Content = layout;
		}
示例#23
0
		public static Control TextAreaOptions3(TextArea text)
		{
			return new StackLayout
			{
				Orientation = Orientation.Horizontal,
				Spacing = 5,
				Items =
				{
					null,
					EnabledCheckBox(text),
					ReadOnlyCheckBox(text),
					AcceptsTabCheckBox(text),
					AcceptsReturnCheckBox(text),
					WrapCheckBox(text),
					SpellCheckCheckBox(text),
					null
				}
			};
		}
示例#24
0
        public NoteView(string dir)
        {
            directory = dir;
            notes = new List<Note>();

            ListBox = new ListBox { Style = "ListNative" };
            TextArea = new TextArea { Style = "TextConsole" };

            var updatingNote = false;

            TextArea.TextChanged += delegate
            {
                if (ListBox.SelectedIndex < 0)
                    return;
                var note = notes[ListBox.SelectedIndex];
                bool changed = note.Changed;
                note.Content = TextArea.Text;
                if (changed != note.Changed)
                    ListBox.Invalidate();
            };

            TextArea.SelectionChanged += delegate
            {
                if (ListBox.SelectedIndex < 0 || updatingNote)
                    return;
                notes[ListBox.SelectedIndex].Selection = TextArea.Selection;
            };

            ListBox.SelectedIndexChanged += delegate
            {
                if (ListBox.SelectedIndex < 0)
                    return;
                var note = notes[ListBox.SelectedIndex];
                updatingNote = true;
                TextArea.Text = note.Content;
                TextArea.Selection = note.Selection;
                TextArea.Focus();
                updatingNote = false;
            };
        }
示例#25
0
		public DynamicFocusSection()
		{
			var content = new Panel();
			var focusControlCheckBox = new CheckBox { Text = "Focus Control", Checked = true };

			var addContentButton = new Button { Text = "Add Control" };

			var count = 0;
			addContentButton.Click += (sender, e) =>
			{
				Control control;
				switch((count++) % 9)
				{
					case 0: control = new TextBox(); break;
					case 1: control = new TextArea(); break;
					case 2: control = new CheckBox { Text = "A Check Box" }; break;
					case 3: control = new RadioButton { Text = "A Radio Button" }; break;
					case 4: control = new DropDown { Items = { "Item 1", "Item 2", "Item 3" } }; break;
					case 5: control = new DateTimePicker(); break;
					case 6: control = new ColorPicker(); break;
					case 7: control = new PasswordBox(); break;
					case 8: control = new ListBox { Items = { "Item 1", "Item 2", "Item 3" } }; break;
					case 9: control = new PasswordBox(); break;
					default: throw new InvalidOperationException();
				}
				if (focusControlCheckBox.Checked ?? false)
					control.Focus();
				content.Content = new TableLayout(
					null,
					new Label { Text = string.Format("Control: {0}", control.GetType().Name) },
					new TableRow(control),
					null
				);
			};

			Content = new TableLayout(
				new TableLayout(new TableRow(null, addContentButton, focusControlCheckBox, null)),
				content
				);
		}
示例#26
0
        void Init()
        {
            //page1
            var page1 = new DynamicLayout();
            _gridViewInstalled = new GridView();
            _gridViewInstalled.ColumnHeaderClick += _gridViewInstalled_ColumnHeaderClick;
            _gridViewInstalled.Columns.Add(new GridColumn()
            {
                DataCell = new CheckBoxCell("Checked"),
                HeaderText = StrRes.GetString("StrChecked","Checked"),
                Editable = true
            });
            _gridViewInstalled.Columns.Add(new GridColumn()
            {
                ID = "Name",
                DataCell = new TextBoxCell("Name"),
                HeaderText = StrRes.GetString("StrName", "Name"),
                Sortable = true,
                AutoSize = false,
                Width = 150
            });
            _gridViewInstalled.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("Author"),
                HeaderText = StrRes.GetString("StrAuthor","Author"),
                AutoSize = false,
                Width = 100
            });
            _gridViewInstalled.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("InstalledVersion"),
                HeaderText = StrRes.GetString("StrInstalledVersion","InstalledVersion"),
                AutoSize = false,
                Width = 150
            });
            _gridViewInstalled.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("FileName"),
                HeaderText = StrRes.GetString("StrFileName","FileName"),
                AutoSize = false,
                Width = 150
            });
            _gridViewInstalled.SelectionChanged += _gridViewInstalled_SelectionChanged;
            _textAreatInstalledDes = new TextArea();
            _buttonRemove = new Button {Text = StrRes.GetString("StrRemove","Remove")};
            _buttonRemove.Click += _buttonRemove_Click;
            page1.Add(_gridViewInstalled, true, true);
            page1.Add(_textAreatInstalledDes, true, false);
            page1.AddSeparateRow(null, _buttonRemove);

            //page2
            var page2 = new DynamicLayout();
            _gridViewAvailable = new GridView();
            _gridViewAvailable.ColumnHeaderClick += _gridViewAvailable_ColumnHeaderClick;
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                DataCell = new CheckBoxCell("Checked"),
                HeaderText = StrRes.GetString("StrChecked","Checked"),
                Editable = true
            });
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                ID = "Name",
                DataCell = new TextBoxCell("Name"),
                HeaderText = StrRes.GetString("StrName","Name"),
                Sortable = true,
                AutoSize = false,
                Width = 150
            });
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("Author"),
                HeaderText = StrRes.GetString("StrAuthor","Author"),
                AutoSize = false,
                Width = 100
            });
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("AvailableVersion"),
                HeaderText = StrRes.GetString("StrAvailableVersion","AvailableVersion"),
                AutoSize = false,
                Width = 150
            });
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("RequiredVersion"),
                HeaderText = StrRes.GetString("StrRequiredVersion","RequiredVersion"),
                AutoSize = false,
                Width = 150
            });
            _gridViewAvailable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("CanInstall"),
                HeaderText = StrRes.GetString("StrCanInstall","CanInstall"),
                AutoSize = false,
                Width = 100
            });
            _gridViewAvailable.SelectionChanged += _gridViewAvailable_SelectionChanged;
            _textAreatAvailableDes = new TextArea();
            _buttonRefresh = new Button {Text = StrRes.GetString("StrRefresh","Refresh")};
            _buttonRefresh.Click += _buttonRefresh_Click;
            _buttonInstall = new Button {Text = StrRes.GetString("StrInstall","Install")};
            _buttonInstall.Click += _buttonInstall_Click;
            page2.Add(_gridViewAvailable, true, true);
            page2.Add(_textAreatAvailableDes, true, false);
            page2.AddSeparateRow(null, _buttonRefresh, _buttonInstall);

            //page3
            var page3 = new DynamicLayout();
            _gridViewUpdatable = new GridView();
            _gridViewUpdatable.ColumnHeaderClick += _gridViewUpdatable_ColumnHeaderClick;
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                DataCell = new CheckBoxCell("Checked"),
                HeaderText = StrRes.GetString("StrChecked","Checked"),
                Editable = true
            });
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                ID = "Name",
                DataCell = new TextBoxCell("Name"),
                HeaderText = StrRes.GetString("StrName","Name"),
                Sortable = true,
                AutoSize = false,
                Width = 150
            });
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("Author"),
                HeaderText = StrRes.GetString("StrAuthor","Author"),
                AutoSize = false,
                Width = 100
            });
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("InstalledVersion"),
                HeaderText = StrRes.GetString("StrInstalledVersion","InstalledVersion"),
                AutoSize = false,
                Width = 150
            });
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("AvailableVersion"),
                HeaderText = StrRes.GetString("StrAvailableVersion","AvailableVersion"),
                AutoSize = false,
                Width = 150
            });
            _gridViewUpdatable.Columns.Add(new GridColumn()
            {
                DataCell = new TextBoxCell("CanUpdate"),
                HeaderText = StrRes.GetString("StrCanUpdate","CanUpdate"),
                AutoSize = false,
                Width = 100
            });
            _gridViewUpdatable.SelectionChanged += _gridViewUpdatable_SelectionChanged;
            _textAreatUpdatesDes = new TextArea();
            _buttonUpdate = new Button {Text = StrRes.GetString("StrUpdate","Update")};
            _buttonUpdate.Click += _buttonUpdate_Click;
            page3.Add(_gridViewUpdatable, true, true);
            page3.Add(_textAreatUpdatesDes, true, false);
            page3.AddSeparateRow(null, _buttonUpdate);

            //_tabPageInstalled
            _tabPageInstalled = new TabPage {Text = StrRes.GetString("StrInstalled","Installed")};
            _tabPageInstalled.Content = page1;

            //_tabPageAvailable
            _tabPageAvailable = new TabPage {Text = StrRes.GetString("StrAvailable","Available")};
            _tabPageAvailable.Content = page2;

            //_tabPageUpdatable
            _tabPageUpdatable = new TabPage {Text = StrRes.GetString("StrUpdatable","Updatable")};
            _tabPageUpdatable.Content = page3;

            //_tabControl
            _tabControl = new TabControl();
            _tabControl.Pages.Add(_tabPageInstalled);
            _tabControl.Pages.Add(_tabPageAvailable);
            _tabControl.Pages.Add(_tabPageUpdatable);
            _tabControl.SelectedIndexChanged += _tabControl_SelectedIndexChanged;

            //_buttonSetting
            _buttonSetting = new Button {Text = StrRes.GetString("StrSetting","Setting")};
            _buttonSetting.Click += _buttonSetting_Click;

            //_buttonClose
            _buttonClose = new Button {Text = StrRes.GetString("StrClose","Close")};
            _buttonClose.Click += _buttonClose_Click;

            //_labelMsg
            _labelMsg = new Label
            {
                TextColor = Colors.Red,
                Text =
                    StrRes.GetString("StrYourOperationWillTakeEffectWhenTheProgramStartNextTime",
                        "Your operation will take effect when the program start next time.")
            };
            _labelMsg.Visible = false;

            var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
            layout.Add(_tabControl, true, true);
            layout.AddSeparateRow(_buttonSetting, _labelMsg, null, _buttonClose);

            Content = layout;
            Size = new Size(610, 430);
            Title = "PluginManager";
            Icon = Application.Instance.MainForm.Icon;
        }
示例#27
0
		Control TextAreaControl()
		{
			var control = new TextArea { Text = "TextArea Control" };
			LogEvents(control);
			return control;
		}
示例#28
0
			/// <summary>
			/// Raises the caret index changed event.
			/// </summary>
			public void OnCaretIndexChanged(TextArea widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnCaretIndexChanged(e));
			}
示例#29
0
			/// <summary>
			/// Raises the selection changed event.
			/// </summary>
			public void OnSelectionChanged(TextArea widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnSelectionChanged(e));
			}
示例#30
-1
		void Init()
		{
			//_textBoxUrl
			_textBoxUrl = new TextBox();

			//_buttonReadFile
			_buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") };
			_buttonReadFile.Click += _buttonReadFile_Click;

			//_buttonSaveFile
			_buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")};
			_buttonSaveFile.Click += _buttonSaveFile_Click;

			//_textAreaBody
			_textAreaBody = new TextArea();
            //rightMenu_Body
            var rightMenuBody = new ContextMenu();
		    var findCommand = new Command
		    {
		        MenuText = StrRes.GetString("StrFind", "Find"),
		        Shortcut = Keys.F | Application.Instance.CommonModifier
		    };
            findCommand.Executed += findCommand_Executed;
            rightMenuBody.Items.Add(findCommand);

			var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false);
			layout.AddCentered(_buttonReadFile, horizontalCenter: false);
			layout.AddCentered(_buttonSaveFile, horizontalCenter: false);
			layout.EndBeginHorizontal();
			layout.EndVertical();

            layout.AddRow(_textAreaBody);

            // bug in gtk2
            layout.ContextMenu = rightMenuBody;
            layout.MouseUp += (sender, e) =>
            {
                if (e.Buttons == MouseButtons.Alternate)
                {
                    layout.ContextMenu.Show(_textAreaBody);
                }
            };

			Content = layout;
		}