AddControl() public method

Adds a control to the layout
public AddControl ( IControlHabanero control ) : IControlHabanero
control IControlHabanero The control to add
return IControlHabanero
Esempio n. 1
0
 /// <summary>
 /// Creates the panel on the form
 /// </summary>
 /// <returns>Returns the panel created</returns>
 public IPanel createControlPanel()
 {
     IPanel panel = _controlFactory.CreatePanel();
     ILabel label = _controlFactory.CreateLabel(_message, false);
     FlowLayoutManager flowLayoutManager = new FlowLayoutManager(panel, _controlFactory);
     flowLayoutManager.AddControl(label);
     flowLayoutManager.AddControl(_dateTimePicker);
     panel.Height = _dateTimePicker.Height + label.Height;
     panel.Width = _controlFactory.CreateLabel(_message, true).PreferredWidth + 20;
     return panel;
 }
Esempio n. 2
0
        /// <summary>
        /// Creates the panel on the form
        /// </summary>
        /// <returns>Returns the panel created</returns>
        public IPanel createControlPanel()
        {
            IPanel            panel             = _controlFactory.CreatePanel();
            ILabel            label             = _controlFactory.CreateLabel(_message, false);
            FlowLayoutManager flowLayoutManager = new FlowLayoutManager(panel, _controlFactory);

            flowLayoutManager.AddControl(label);
            flowLayoutManager.AddControl(_dateTimePicker);
            panel.Height = _dateTimePicker.Height + label.Height;
            panel.Width  = _controlFactory.CreateLabel(_message, true).PreferredWidth + 20;
            return(panel);
        }
        ///<summary>
        /// Adds a button with te button name and text equal to buttonName.
        ///</summary>
        ///<param name="buttonName"></param>
        ///<returns></returns>
        public IButton AddButton(string buttonName)
        {
            IButton button = _controlFactory.CreateButton();

            button.Name = buttonName;
            button.Text = buttonName;
            _layoutManager.AddControl(button);
            _buttonGroupControl.Controls.Add(button);
            return(button);
        }
        //public int CountOfFilterControls()
        //{
        //    return 
        //}

        private void CreateFilterButtons(IPanel filterButtonPanel)
        {
            const int buttonHeight = 20;
            const int buttonWidth = 45;
            _filterButton = CreateFilterButton(buttonWidth, buttonHeight);
            _clearButton = CreateClearButton(buttonWidth, buttonHeight);

            FlowLayoutManager layoutManager = new FlowLayoutManager(filterButtonPanel, _controlFactory);
            layoutManager.AddControl(_filterButton);
            layoutManager.AddControl(_clearButton);
        }
        private IPanel CreateButtonPanel()
        {
            IPanel buttonPanel = _controlFactory.CreatePanel();
            const int buttonWidth = 75;
            const int buttonHeight = 38;
            var buttonSize = new Size(buttonWidth, buttonHeight);
            FlowLayoutManager layoutManager = new FlowLayoutManager(buttonPanel, _controlFactory);
            layoutManager.Alignment = FlowLayoutManager.Alignments.Right;

            CancelButton = _controlFactory.CreateButton("Cancel");
            CancelButton.Click += this.CancelButton_Click;
            CancelButton.Size = new Size(75, 38);
            CancelButton.TabIndex = 3;
            layoutManager.AddControl(CancelButton);

            FinishButton = _controlFactory.CreateButton("Finish");
            FinishButton.Click += this.FinishButton_Click;
            FinishButton.Size = buttonSize;
            FinishButton.TabIndex = 2;
            layoutManager.AddControl(FinishButton);

            NextButton = _controlFactory.CreateButton("Next");
            NextButton.Click += this.NextButton_Click;
            NextButton.Size = new Size(75, 38);
            NextButton.TabIndex = 1;
            layoutManager.AddControl(NextButton);

            PreviousButton = _controlFactory.CreateButton("Previous");
            PreviousButton.Click += this.PreviousButton_Click;
            PreviousButton.Size = new Size(75, 38);
            PreviousButton.TabIndex = 0;
            layoutManager.AddControl(PreviousButton);


            return buttonPanel;
        }