Esempio n. 1
0
        private TabPage CreateExperiencePage()
        {
            TabPage tabPage  = NewTabPage("体验");
            int     rowIndex = 0;
            int     tabIndex = 0;

            _bandwidthComboBox = FormTools.AddLabeledValueDropDown(tabPage, "&S连接速度", ref rowIndex, ref tabIndex, (BandwidthItem v) => v.Text, _bandwidthItems);
            _bandwidthComboBox.SelectedIndexChanged += BandwidthCombo_ControlChanged;
            Label label = FormTools.NewLabel("允许以下:", 0, rowIndex);

            _desktopBackgroundCheckBox = FormTools.NewCheckBox("桌面背景", 1, rowIndex++, tabIndex++);
            _desktopBackgroundCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _fontSmoothingCheckBox = FormTools.NewCheckBox("字体平滑", 1, rowIndex++, tabIndex++);
            _fontSmoothingCheckBox.CheckedChanged      += PerfCheckBox_CheckedChanged;
            _desktopCompositionCheckBox                 = FormTools.NewCheckBox("桌面布置", 1, rowIndex++, tabIndex++);
            _desktopCompositionCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _windowDragCheckBox = FormTools.NewCheckBox("拖动时显示窗口内容", 1, rowIndex++, tabIndex++);
            _windowDragCheckBox.CheckedChanged    += PerfCheckBox_CheckedChanged;
            _menuAnimationCheckBox                 = FormTools.NewCheckBox("菜单和窗口动画", 1, rowIndex++, tabIndex++);
            _menuAnimationCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            _themesCheckBox = FormTools.NewCheckBox("主题", 1, rowIndex++, tabIndex++);
            _themesCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged;
            tabPage.Controls.Add(label, _desktopBackgroundCheckBox, _fontSmoothingCheckBox, _desktopCompositionCheckBox, _windowDragCheckBox, _menuAnimationCheckBox, _themesCheckBox);
            return(tabPage);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public void AddControlsToParent(Control parent, LogonCredentialsDialogOptions options, ref int rowIndex, ref int tabIndex)
 {
     if ((options & LogonCredentialsDialogOptions.ShowProfiles) != 0)
     {
         ProfileComboBox = FormTools.AddLabeledValueDropDown <CredentialsProfile>(parent, "配置:", ref rowIndex, ref tabIndex, null, null);
         ProfileComboBox.SelectedIndexChanged += OnProfileChanged;
         ProfileComboBox.VisibleChanged       += OnProfileVisible;
         _saveProfileButton = new Button
         {
             TabIndex = tabIndex++,
             Text     = "保存"
         };
         _saveProfileButton.Location = new Point(ProfileComboBox.Right - _saveProfileButton.Width, ProfileComboBox.Location.Y - 1);
         _saveProfileButton.Click   += SaveProfileButton_Click;
         parent.Controls.Add(_saveProfileButton);
         ProfileComboBox.Width -= _saveProfileButton.Width;
     }
     UserNameTextBox              = FormTools.AddLabeledTextBox(parent, "用户名:", ref rowIndex, ref tabIndex);
     UserNameTextBox.TextChanged += OnUserNameChanged;
     PasswordTextBox              = FormTools.AddLabeledTextBox(parent, "密码:", ref rowIndex, ref tabIndex);
     PasswordTextBox.PasswordChar = '●';
     PasswordTextBox.TextChanged += OnPasswordChanged;
     DomainTextBox = FormTools.AddLabeledTextBox(parent, "域:", ref rowIndex, ref tabIndex);
 }
Esempio n. 4
0
 protected void AddParentCombo(ref int rowIndex, ref int tabIndex)
 {
     _parentComboBox = FormTools.AddLabeledValueDropDown <GroupBase>(this, "¸¸×é:", ref rowIndex, ref tabIndex, null, null);
     _parentComboBox.SelectedIndexChanged += ParentGroupChangedHandler;
 }
Esempio n. 5
0
        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);
        }