private TabPage CreateFullScreenPage() { int rowIndex = 0; int tabIndex = 0; TabPage tabPage = NewTabPage("全屏"); _connectionBarEnabledCheckBox = FormTools.NewCheckBox("显示全屏工具栏", 0, rowIndex++, tabIndex++); _connectionBarEnabledCheckBox.CheckedChanged += ConnectionBarEnabledCheckedChanged; _connectionBarAutoHiddenCheckBox = FormTools.NewCheckBox("自动隐藏工具栏", 0, rowIndex++, tabIndex++); _connectionBarAutoHiddenCheckBox.Location = new Point(_connectionBarEnabledCheckBox.Left + 24, _connectionBarAutoHiddenCheckBox.Top); FormTools.AddCheckBox(tabPage, "全屏窗口始终位于顶部", Program.Preferences.Settings.FullScreenWindowIsTopMost, 0, ref rowIndex, ref tabIndex); if (RdpClient.SupportsMonitorSpanning) { FormTools.AddCheckBox(tabPage, "必要时使用多个显示器", Program.Preferences.Settings.UseMultipleMonitors, 0, ref rowIndex, ref tabIndex); } if (RdpClient.SupportsPanning) { _enablePanningCheckBox = FormTools.NewCheckBox("使用平移代替滚动条", 0, rowIndex++, tabIndex++); _enablePanningCheckBox.Setting = Program.Preferences.Settings.EnablePanning; _enablePanningCheckBox.CheckedChanged += EnablePanningCheckedChanged; Label label = FormTools.NewLabel("平移速度", 0, rowIndex); label.Size = new Size(116, 20); label.Location = new Point(_enablePanningCheckBox.Left + 24, label.Top); _panningAccelerationUpDown = new RdcNumericUpDown(); _panningAccelerationUpDown.Location = FormTools.NewLocation(1, rowIndex++); _panningAccelerationUpDown.Minimum = 1m; _panningAccelerationUpDown.Maximum = 9m; _panningAccelerationUpDown.Size = new Size(40, 20); _panningAccelerationUpDown.TabIndex = tabIndex++; _panningAccelerationUpDown.Setting = Program.Preferences.Settings.PanningAcceleration; tabPage.Controls.Add(_enablePanningCheckBox, label, _panningAccelerationUpDown); } tabPage.Controls.Add(_connectionBarEnabledCheckBox, _connectionBarAutoHiddenCheckBox); return(tabPage); }
private TabPage CreateClientAreaPage() { _casCustomButton = new Button(); _casCustomRadio = new RadioButton(); _thumbnailPercentageRadio = new RadioButton(); _thumbnailPixelsRadio = new RadioButton(); _thumbnailPixelsButton = new Button(); TabPage tabPage = NewTabPage("客户区"); _casSizeGroup = new GroupBox { Text = "客户区大小" }; _casSizeGroup.Controls.AddRange(FormTools.NewSizeRadios()); _casCustomRadio.Size = new Size(72, 24); _casCustomRadio.Text = "自定义"; _casSizeGroup.Controls.Add(_casCustomRadio); FormTools.LayoutGroupBox(_casSizeGroup, 2, null, 1, 1); RdcCheckBox rdcCheckBox = new RdcCheckBox(); rdcCheckBox.Size = new Size(480, 24); rdcCheckBox.Text = "锁定窗口大小"; rdcCheckBox.Location = FormTools.NewLocation(0, 0); rdcCheckBox.TabIndex = 0; rdcCheckBox.TabStop = true; rdcCheckBox.Setting = Program.Preferences.Settings.LockWindowSize; RdcCheckBox value = rdcCheckBox; _casSizeGroup.Controls.Add(value); _casCustomButton.Location = new Point(_casCustomRadio.Right + 10, _casCustomRadio.Location.Y); _casCustomButton.TabIndex = _casCustomRadio.TabIndex + 1; _casCustomButton.Click += CustomSizeClick; _casSizeGroup.Controls.Add(_casCustomButton); GroupBox groupBox = new GroupBox(); groupBox.Size = new Size(512, 72); groupBox.Text = "缩略图单位大小"; GroupBox groupBox2 = groupBox; groupBox2.Controls.Add(_thumbnailPixelsRadio, _thumbnailPercentageRadio); _thumbnailPixelsRadio.Size = new Size(80, 24); _thumbnailPixelsRadio.Text = "像素"; _thumbnailPercentageRadio.Size = new Size(88, 24); _thumbnailPercentageRadio.Text = "百分比"; _thumbnailPercentageRadio.CheckedChanged += ThumbnailPercentageRadioCheckedChanged; FormTools.LayoutGroupBox(groupBox2, 1, _casSizeGroup); int num = Math.Max(_thumbnailPixelsRadio.Right, _thumbnailPercentageRadio.Right); _thumbnailPixelsButton.Location = new Point(num + 10, _thumbnailPixelsRadio.Location.Y); _thumbnailPixelsButton.TabIndex = _thumbnailPercentageRadio.TabIndex + 1; _thumbnailPixelsButton.Click += CustomSizeClick; _thumbnailPercentageTextBox = new NumericTextBox(1, 100, "百分比必须介于1到100之间(含1和100)"); _thumbnailPercentageTextBox.Enabled = false; _thumbnailPercentageTextBox.Location = new Point(num + 11, _thumbnailPercentageRadio.Location.Y + 2); _thumbnailPercentageTextBox.Size = new Size(72, 20); _thumbnailPercentageTextBox.TabIndex = _thumbnailPercentageRadio.TabIndex + 1; groupBox2.Controls.Add(_thumbnailPixelsButton, _thumbnailPercentageTextBox); tabPage.Controls.Add(_casSizeGroup, groupBox2); return(tabPage); }
protected void Create(out int rowIndex, out int tabIndex) { tabIndex = 0; rowIndex = 0; CreateInheritanceControl(ref rowIndex, ref tabIndex); Label label = FormTools.NewLabel("ËõÂÔͼ±ÈÀý:", 0, rowIndex); label.Size = new Size(140, 20); RdcNumericUpDown rdcNumericUpDown = new RdcNumericUpDown(); rdcNumericUpDown.Location = FormTools.NewLocation(1, rowIndex++); rdcNumericUpDown.Location = new Point(rdcNumericUpDown.Location.X, rdcNumericUpDown.Location.Y + 2); rdcNumericUpDown.Minimum = 1m; rdcNumericUpDown.Maximum = 9m; TSettingsGroup settings = base.Settings; rdcNumericUpDown.Setting = settings.ThumbnailScale; rdcNumericUpDown.Size = new Size(40, 20); rdcNumericUpDown.TabIndex = tabIndex++; RdcCheckBox rdcCheckBox = FormTools.NewCheckBox("Ëõ·ÅÍ£¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++); TSettingsGroup settings2 = base.Settings; rdcCheckBox.Setting = settings2.SmartSizeDockedWindow; RdcCheckBox rdcCheckBox2 = FormTools.NewCheckBox("Ëõ·Åδͣ¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++); TSettingsGroup settings3 = base.Settings; rdcCheckBox2.Setting = settings3.SmartSizeUndockedWindow; base.Controls.Add(label, rdcNumericUpDown, rdcCheckBox, rdcCheckBox2); }
public static RdcCheckBox NewCheckBox(string text, int colIndex, int rowIndex, int tabIndex, int width) { RdcCheckBox rdcCheckBox = new RdcCheckBox(); rdcCheckBox.Location = NewLocation(colIndex, rowIndex); rdcCheckBox.Size = new Size(width, 20); rdcCheckBox.TabIndex = tabIndex; rdcCheckBox.Text = text; return(rdcCheckBox); }
public static RdcCheckBox AddCheckBox(Control parent, string text, BoolSetting setting, int colIndex, ref int rowIndex, ref int tabIndex) { RdcCheckBox rdcCheckBox = new RdcCheckBox(); rdcCheckBox.Setting = setting; rdcCheckBox.Location = NewLocation(colIndex, rowIndex++); rdcCheckBox.Size = new Size(340, 20); rdcCheckBox.TabIndex = tabIndex++; rdcCheckBox.Text = text; RdcCheckBox rdcCheckBox2 = rdcCheckBox; parent.Controls.Add(rdcCheckBox2); return(rdcCheckBox2); }
private TabPage CreateGeneralPage() { int rowIndex = 0; int tabIndex = 0; TabPage tabPage = NewTabPage("常规"); FormTools.AddCheckBox(tabPage, "隐藏主菜单,直到按ALT键", Program.Preferences.Settings.HideMainMenu, 0, ref rowIndex, ref tabIndex); RdcCheckBox autoSaveCheckBox = FormTools.AddCheckBox(tabPage, "自动保存间隔:", Program.Preferences.Settings.AutoSaveFiles, 0, ref rowIndex, ref tabIndex); autoSaveCheckBox.Size = new Size(120, 24); NumericTextBox autoSaveInterval = new NumericTextBox(0, 60, "自动保存间隔必须为0到60分钟") { Location = new Point(autoSaveCheckBox.Right + 1, autoSaveCheckBox.Top + 2), Size = new Size(20, 24), TabIndex = tabIndex++, TabStop = true, Enabled = false }; autoSaveInterval.Setting = Program.Preferences.Settings.AutoSaveInterval; autoSaveCheckBox.CheckedChanged += delegate { autoSaveInterval.Enabled = autoSaveCheckBox.Checked; }; Label label = new Label(); label.Location = new Point(autoSaveInterval.Right + 3, autoSaveCheckBox.Top + 4); label.Size = new Size(60, 24); label.Text = "分钟(s)"; Label label2 = label; RdcCheckBox rdcCheckBox = FormTools.AddCheckBox(tabPage, "启动时提示重新连接连接的服务器", Program.Preferences.Settings.ReconnectOnStartup, 0, ref rowIndex, ref tabIndex); Button button = new Button(); button.Location = new Point(8, rdcCheckBox.Bottom + 8); button.TabIndex = tabIndex++; button.Text = "默认群组设置..."; button.Width = 140; Button button2 = button; button2.Click += delegate { DefaultSettingsGroup.Instance.DoPropertiesDialog(); }; tabPage.Controls.Add(autoSaveCheckBox, autoSaveInterval, label2, button2); return(tabPage); }
public ServerPropertiesTabPage(TabbedSettingsDialog dialog, ServerSettings settings) : base(dialog, settings, "Server Settings") { int tabIndex = 0; int rowIndex = 0; _serverNameTextBox = FormTools.AddLabeledTextBox(this, "&Server name:", base.Settings.ServerName, ref rowIndex, ref tabIndex); _serverNameTextBox.Enabled = true; _serverNameTextBox.TextChanged += ServerNameChanged; _serverNameTextBox.Validate = ValidateServerName; _vmConsoleConnectCheckBox = FormTools.NewCheckBox("&VM console connect", 0, rowIndex, tabIndex++, 140); _vmConsoleConnectCheckBox.CheckedChanged += VMConsoleConnectCheckBox_CheckedChanged; _vmIdLabel = new Label { Location = FormTools.NewLocation(1, rowIndex++), Size = new Size(30, 20), Text = "&id:", TextAlign = ContentAlignment.MiddleLeft, Visible = false }; _vmIdTextBox = new RdcTextBox { Location = new Point(_vmIdLabel.Right, _vmIdLabel.Top), Setting = base.Settings.VirtualMachineId, Size = new Size(340 - _vmIdLabel.Width, 20), TabIndex = tabIndex++, Visible = false }; _displayNameTextBox = FormTools.AddLabeledTextBox(this, "&Display name:", base.Settings.DisplayName, ref rowIndex, ref tabIndex); _displayNameTextBox.Enabled = true; _displayNameTextBox.TextChanged += DisplayNameChanged; _displayNameTextBox.Validate = ValidateDisplayName; _displayNameUserCreated = !base.Settings.ServerName.Value.Equals(base.Settings.DisplayName.Value); AddParentCombo(ref rowIndex, ref tabIndex); AddComment(ref rowIndex, ref tabIndex).Setting = base.Settings.Comment; base.Controls.Add(_vmConsoleConnectCheckBox, _vmIdLabel, _vmIdTextBox); base.FocusControl = _serverNameTextBox; }
public GroupDisplaySettingsTabPage(TabbedSettingsDialog dialog, GroupDisplaySettings settings) : base(dialog, settings) { Create(out int rowIndex, out int tabIndex); _previewCheckBox = FormTools.AddCheckBox(this, "ÒÔËõÂÔͼԤÀÀ»á»°", settings.SessionThumbnailPreview, 0, ref rowIndex, ref tabIndex); _interactionCheckBox = FormTools.AddCheckBox(this, "ÔÊÐíËõÂÔͼ»á»°½»»¥", settings.AllowThumbnailSessionInteraction, 0, ref rowIndex, ref tabIndex); _interactionCheckBox.Location = new Point(_previewCheckBox.Left + 24, _interactionCheckBox.Top); RdcCheckBox previewCheckBox = _previewCheckBox; EventHandler value = delegate { PreviewCheckBoxChanged(); }; previewCheckBox.CheckedChanged += value; if (base.InheritanceControl != null) { base.InheritanceControl.EnabledChanged += delegate { PreviewCheckBoxChanged(); }; } FormTools.AddCheckBox(this, "ÏÔʾ¶Ï¿ªµÄËõÂÔͼ", settings.ShowDisconnectedThumbnails, 0, ref rowIndex, ref tabIndex); }