Exemple #1
0
 public ConnectionHelper(StartupForm stup, PresenterModel model, ControlEventQueue dispatcher)
 {
     this.m_StartupForm = stup;
     this.m_TabControl  = this.m_StartupForm.m_TabControl;
     this.m_Model       = model;
     this.m_EventQueue  = dispatcher;
 }
        /// <summary>
        /// Constructs a properties form and hooks it into the model
        /// </summary>
        public StartupForm(PresenterModel model, ControlEventQueue dispatcher)
        {
            if (Screen.PrimaryScreen.Bounds.Height < 650) {
                //Alternate compact layout to work on netbooks or tablets with few vertical pixels
                short_mode = true;
                this.GroupBoxSpace = 10;
            }

            // Setup the display of the form
            this.SuspendLayout();
            this.m_Model = model;
            this.m_EventQueue = dispatcher;
            this.AutoScaleBaseSize = new Size(5, 13);
            if (short_mode) {
                this.ClientSize = new Size(640, 360);
            }
            else {
                this.ClientSize = new Size(640, 480);
            }
            this.FormBorderStyle = FormBorderStyle.Sizable;//FixedDialog;
            this.Font = Model.Viewer.ViewerStateModel.FormFont;
            this.AutoScroll = true;
            this.Name = "StartupForm";
            this.Text = Strings.StartupFormText;
            this.MinimizeBox = false;
            this.MaximizeBox = false;

            // Add the child controls

            this.AddConnection();
            if (short_mode) {
                this.m_RoleGroup = new RoleGroup(new Point(this.GroupBoxLeft, this.GroupBoxSpace), new Size(240, 83), this.m_Model, this, true);
            }
            else {
                this.m_RoleGroup = new RoleGroup(new Point(this.GroupBoxLeft, this.GroupBoxSpace), new Size(240, 110), this.m_Model, this, false);
            }
            this.m_RoleGroup.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.Controls.Add(this.m_RoleGroup);

            //Tab control stuff
            this.m_UDPPanel = new UDPPanel();

            if (short_mode) {
                this.m_TabControl = new StartupTabControl(new Size(560, 150),
                    new Point(this.GroupBoxLeft, 15), 0, this, this.m_Model, this.m_EventQueue);
            }
            else {
                this.m_TabControl = new StartupTabControl(new Size(560, 200),
                    new Point(this.GroupBoxLeft, 15), 0, this, this.m_Model, this.m_EventQueue);

            }
            this.m_TabGroupBox = new GroupBox();
            this.m_TabGroupBox.FlatStyle = FlatStyle.System;
            this.m_TabGroupBox.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.m_TabGroupBox.Size = new Size(this.m_TabControl.Size.Width + 2 * this.GroupBoxLeft,
                this.m_TabControl.Size.Height + 2 * this.GroupBoxSpace);
            this.m_TabGroupBox.Location = new Point(this.GroupBoxLeft, this.m_RoleGroup.Bottom + this.GroupBoxSpace);
            this.Controls.Add(this.m_TabGroupBox);

            this.m_TabGroupBox.Controls.Add(this.m_TabControl);
            //end tab control stuff

            //Begin StartJoinButton stuff
            this.m_StartJoinButton = new StartJoinButton2(this.m_Model, this, short_mode);
            this.m_StartJoinButton.Location = new Point(this.GroupBoxLeft, this.GroupBoxSpace + 4);

            this.m_ButtonGroupBox = new GroupBox();
            this.m_ButtonGroupBox.FlatStyle = FlatStyle.System;
            this.m_ButtonGroupBox.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.m_ButtonGroupBox.Size = new Size(this.m_StartJoinButton.Size.Width + 2 * this.GroupBoxLeft,
                this.m_StartJoinButton.Size.Height + 2 * this.GroupBoxSpace);
            this.m_ButtonGroupBox.Location = new Point(this.GroupBoxLeft,
                this.m_TabGroupBox.Bottom + this.GroupBoxSpace);
            this.Controls.Add(this.m_ButtonGroupBox);

            this.m_ButtonGroupBox.Controls.Add(this.m_StartJoinButton);
            //End StartJoinButton stuff

            this.m_EnableExternalMonitorCheckbox = new EnableExternalMonitorCheckbox(
                new Point(300, ((this.m_RoleGroup.Top + this.m_RoleGroup.Bottom) / 2) - 20),
                new Size(300, 50), m_Model, this.m_EventQueue, this);
            this.Controls.Add(this.m_EnableExternalMonitorCheckbox);

            this.m_HelpButton = new Cp3HelpButton();
            this.m_HelpButton.Font = Model.Viewer.ViewerStateModel.StringFont1;
            this.m_HelpButton.Location = new Point((this.m_StartJoinButton.Right + this.Width) / 2,
                (this.m_ButtonGroupBox.Top +this.m_ButtonGroupBox.Bottom)/2 -10);
            this.Controls.Add(this.m_HelpButton);

            this.m_StartJoinButton.HandleEnabled();//Can't call this until after other things are created. (ie until after AddConnection is called)

            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.OnRoleChanged));
            this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
            this.FormClosing += new FormClosingEventHandler(StartupForm_FormClosing);
            this.ResumeLayout();
        }
Exemple #3
0
        /// <summary>
        /// Constructs a properties form and hooks it into the model
        /// </summary>
        public StartupForm(PresenterModel model, ControlEventQueue dispatcher)
        {
            if (Screen.PrimaryScreen.Bounds.Height < 650)
            {
                //Alternate compact layout to work on netbooks or tablets with few vertical pixels
                short_mode         = true;
                this.GroupBoxSpace = 10;
            }

            // Setup the display of the form
            this.SuspendLayout();
            this.m_Model           = model;
            this.m_EventQueue      = dispatcher;
            this.AutoScaleBaseSize = new Size(5, 13);
            if (short_mode)
            {
                this.ClientSize = new Size(640, 360);
            }
            else
            {
                this.ClientSize = new Size(640, 480);
            }
            this.FormBorderStyle = FormBorderStyle.Sizable;//FixedDialog;
            this.Font            = Model.Viewer.ViewerStateModel.FormFont;
            this.AutoScroll      = true;
            this.Name            = "StartupForm";
            this.Text            = Strings.StartupFormText;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;

            // Add the child controls

            this.AddConnection();
            if (short_mode)
            {
                this.m_RoleGroup = new RoleGroup(new Point(this.GroupBoxLeft, this.GroupBoxSpace), new Size(240, 83), this.m_Model, this, true);
            }
            else
            {
                this.m_RoleGroup = new RoleGroup(new Point(this.GroupBoxLeft, this.GroupBoxSpace), new Size(240, 110), this.m_Model, this, false);
            }
            this.m_RoleGroup.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.Controls.Add(this.m_RoleGroup);


            //Tab control stuff
            this.m_UDPPanel = new UDPPanel();

            if (short_mode)
            {
                this.m_TabControl = new StartupTabControl(new Size(560, 150),
                                                          new Point(this.GroupBoxLeft, 15), 0, this, this.m_Model, this.m_EventQueue);
            }
            else
            {
                this.m_TabControl = new StartupTabControl(new Size(560, 200),
                                                          new Point(this.GroupBoxLeft, 15), 0, this, this.m_Model, this.m_EventQueue);
            }
            this.m_TabGroupBox           = new GroupBox();
            this.m_TabGroupBox.FlatStyle = FlatStyle.System;
            this.m_TabGroupBox.Font      = Model.Viewer.ViewerStateModel.StringFont;
            this.m_TabGroupBox.Size      = new Size(this.m_TabControl.Size.Width + 2 * this.GroupBoxLeft,
                                                    this.m_TabControl.Size.Height + 2 * this.GroupBoxSpace);
            this.m_TabGroupBox.Location = new Point(this.GroupBoxLeft, this.m_RoleGroup.Bottom + this.GroupBoxSpace);
            this.Controls.Add(this.m_TabGroupBox);

            this.m_TabGroupBox.Controls.Add(this.m_TabControl);
            //end tab control stuff

            //Begin StartJoinButton stuff
            this.m_StartJoinButton          = new StartJoinButton2(this.m_Model, this, short_mode);
            this.m_StartJoinButton.Location = new Point(this.GroupBoxLeft, this.GroupBoxSpace + 4);

            this.m_ButtonGroupBox           = new GroupBox();
            this.m_ButtonGroupBox.FlatStyle = FlatStyle.System;
            this.m_ButtonGroupBox.Font      = Model.Viewer.ViewerStateModel.StringFont;
            this.m_ButtonGroupBox.Size      = new Size(this.m_StartJoinButton.Size.Width + 2 * this.GroupBoxLeft,
                                                       this.m_StartJoinButton.Size.Height + 2 * this.GroupBoxSpace);
            this.m_ButtonGroupBox.Location = new Point(this.GroupBoxLeft,
                                                       this.m_TabGroupBox.Bottom + this.GroupBoxSpace);
            this.Controls.Add(this.m_ButtonGroupBox);

            this.m_ButtonGroupBox.Controls.Add(this.m_StartJoinButton);
            //End StartJoinButton stuff


            this.m_EnableExternalMonitorCheckbox = new EnableExternalMonitorCheckbox(
                new Point(300, ((this.m_RoleGroup.Top + this.m_RoleGroup.Bottom) / 2) - 20),
                new Size(300, 50), m_Model, this.m_EventQueue, this);
            this.Controls.Add(this.m_EnableExternalMonitorCheckbox);

            this.m_HelpButton          = new Cp3HelpButton();
            this.m_HelpButton.Font     = Model.Viewer.ViewerStateModel.StringFont1;
            this.m_HelpButton.Location = new Point((this.m_StartJoinButton.Right + this.Width) / 2,
                                                   (this.m_ButtonGroupBox.Top + this.m_ButtonGroupBox.Bottom) / 2 - 10);
            this.Controls.Add(this.m_HelpButton);

            this.m_StartJoinButton.HandleEnabled();//Can't call this until after other things are created. (ie until after AddConnection is called)

            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.OnRoleChanged));
            this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
            this.FormClosing += new FormClosingEventHandler(StartupForm_FormClosing);
            this.ResumeLayout();
        }
 public ConnectionHelper(StartupForm stup, PresenterModel model, ControlEventQueue dispatcher)
 {
     this.m_StartupForm = stup;
     this.m_TabControl = this.m_StartupForm.m_TabControl;
     this.m_Model = model;
     this.m_EventQueue = dispatcher;
 }