コード例 #1
0
ファイル: GlobalOptionsDialog.cs プロジェクト: xxftapv/RDCMan
        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);
        }
コード例 #2
0
        public RemoteDesktopTabPage(TabbedSettingsDialog dialog, RemoteDesktopSettings settings)
            : base(dialog, settings)
        {
            int tabIndex = 0;
            int rowIndex = 0;

            CreateInheritanceControl(ref rowIndex, ref tabIndex);
            ValueComboBox <int> previousGroupBox = FormTools.AddLabeledValueDropDown(this, "Color Depth", settings.ColorDepth, ref rowIndex, ref tabIndex, (int v) => v.ToString(), new int[5]
            {
                8,
                15,
                16,
                24,
                32
            });
            RadioButton value = new RdcRadioButton
            {
                Setting = settings.DesktopSizeSameAsClientAreaSize,
                Size    = new Size(140, 24),
                Text    = "&Same as client area"
            };
            RadioButton value2 = new RdcRadioButton
            {
                Setting = settings.DesktopSizeFullScreen,
                Size    = new Size(140, 24),
                Text    = "&Full screen"
            };

            _rdsCustomRadio      = new RadioButton();
            _rdsCustomButton     = new Button();
            _rdsCustomRadio.Size = new Size(72, 24);
            _rdsCustomRadio.Text = "&Custom";
            _rdsSizeGroup        = new GroupBox();
            _rdsSizeGroup.Controls.AddRange(FormTools.NewSizeRadios());
            _rdsSizeGroup.Controls.Add(value);
            _rdsSizeGroup.Controls.Add(value2);
            _rdsSizeGroup.Controls.Add(_rdsCustomRadio);
            _rdsSizeGroup.Text = "Remote Desktop Size";
            FormTools.LayoutGroupBox(_rdsSizeGroup, 2, previousGroupBox);
            _rdsCustomButton.Location = new Point(_rdsCustomRadio.Right + 10, _rdsCustomRadio.Location.Y);
            _rdsCustomButton.TabIndex = _rdsCustomRadio.TabIndex + 1;
            _rdsCustomButton.Click   += CustomSizeClick;
            _rdsCustomButton.Text     = Program.TheForm.GetClientSize().ToFormattedString();
            _rdsSizeGroup.Controls.Add(_rdsCustomButton);
            base.Controls.Add(_rdsSizeGroup);
        }
コード例 #3
0
ファイル: GlobalOptionsDialog.cs プロジェクト: xxftapv/RDCMan
        private TabPage CreateServerTreePage()
        {
            int      rowIndex = 0;
            int      tabIndex = 0;
            TabPage  tabPage  = NewTabPage("群组树");
            GroupBox groupBox = new GroupBox();

            groupBox.Text = "服务器树";
            GroupBox groupBox2 = groupBox;

            FormTools.AddCheckBox(groupBox2, "单击以选中将焦点移到远程客户端", Program.Preferences.Settings.FocusOnClick, 0, ref rowIndex, ref tabIndex);
            FormTools.AddCheckBox(groupBox2, "树控件处于非活动状态时使节点变暗", Program.Preferences.Settings.DimNodesWhenInactive, 0, ref rowIndex, ref tabIndex);
            _treeLocationCombo = FormTools.AddLabeledValueDropDown(groupBox2, "位置", ref rowIndex, ref tabIndex, (DockStyle v) => v.ToString(), new DockStyle[2]
            {
                DockStyle.Left,
                DockStyle.Right
            });
            _treeVisibilityCombo = FormTools.AddLabeledValueDropDown(groupBox2, "可见方式", ref rowIndex, ref tabIndex, (ControlVisibility v) => v.ToString(), new ControlVisibility[3]
            {
                ControlVisibility.Dock,
                ControlVisibility.AutoHide,
                ControlVisibility.Hide
            });
            Label label = FormTools.NewLabel("弹出延迟:", 0, rowIndex++);

            label.Left += 24;
            label.Size  = new Size(80, label.Height);
            NumericTextBox serverTreeAutoHidePopUpDelay = new NumericTextBox(0, 1000, "自动隐藏弹出延迟时间必须为0到1000毫秒")
            {
                Enabled  = false,
                Location = new Point(label.Right, label.Top),
                Size     = new Size(40, 24),
                Setting  = Program.Preferences.Settings.ServerTreeAutoHidePopUpDelay,
                TabStop  = true,
                TabIndex = tabIndex++
            };

            _treeVisibilityCombo.SelectedIndexChanged += delegate
            {
                serverTreeAutoHidePopUpDelay.Enabled = (_treeVisibilityCombo.SelectedValue == ControlVisibility.AutoHide);
            };
            groupBox2.AddControlsAndSizeGroup(label);
            Label label2 = new Label();

            label2.Location = new Point(serverTreeAutoHidePopUpDelay.Right + 3, label.Top);
            label2.Size     = new Size(80, 24);
            label2.Text     = "毫秒(s)";
            Label label3 = label2;

            groupBox2.Controls.Add(serverTreeAutoHidePopUpDelay, label3);
            groupBox2.SizeAndLocate(null);
            _virtualGroupsGroup = new GroupBox
            {
                Text = "虚拟群组"
            };
            foreach (IBuiltInVirtualGroup item in Program.BuiltInVirtualGroups.Where((IBuiltInVirtualGroup group) => group.IsVisibilityConfigurable))
            {
                _virtualGroupsGroup.Controls.Add(new CheckBox
                {
                    Size = new Size(112, 24),
                    Tag  = item,
                    Text = item.Text
                });
            }
            FormTools.LayoutGroupBox(_virtualGroupsGroup, 2, groupBox2);
            rowIndex = 0;
            tabIndex = 0;
            GroupBox groupBox3 = new GroupBox();

            FormTools.AddLabeledValueDropDown(groupBox3, "组排序方式", Program.Preferences.Settings.GroupSortOrder, ref rowIndex, ref tabIndex, Helpers.SortOrderToString, new SortOrder[2]
            {
                SortOrder.ByName,
                SortOrder.None
            });
            FormTools.AddLabeledEnumDropDown(groupBox3, "服务器排序方式", Program.Preferences.Settings.ServerSortOrder, ref rowIndex, ref tabIndex, Helpers.SortOrderToString);
            groupBox3.Text = "排序方式";
            FormTools.LayoutGroupBox(groupBox3, 2, _virtualGroupsGroup);
            tabPage.Controls.Add(groupBox2, groupBox3, _virtualGroupsGroup);
            return(tabPage);
        }