///<summary> /// Constructor for the <see cref="ButtonGroupControlManager"/> ///</summary> ///<param name="buttonGroupControl"></param> ///<param name="controlFactory"></param> public ButtonGroupControlManager(IButtonGroupControl buttonGroupControl, IControlFactory controlFactory) { _buttonGroupControl = buttonGroupControl; _layoutManager = new FlowLayoutManager(_buttonGroupControl, controlFactory); _layoutManager.Alignment = FlowLayoutManager.Alignments.Right; _controlFactory = controlFactory; IButton sampleBtn = _controlFactory.CreateButton(); _buttonGroupControl.Height = sampleBtn.Height + 10; _buttonGroupControl.MinimumSize = new Size(sampleBtn.Width, sampleBtn.Height + 10); }
public void TestManagedControl() { //---------------Set up test pack------------------- IControlHabanero managedControl = GetControlFactory().CreateControl(); //---------------Execute Test ---------------------- FlowLayoutManager manager = new FlowLayoutManager(managedControl, null); //---------------Test Result ----------------------- Assert.AreSame(managedControl, manager.ManagedControl); //---------------Tear Down ------------------------- }
/// <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> /// 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); }
//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; }
private void CreateFilterButtons(IPanel filterButtonPanel) { const int buttonHeight = 20; const int buttonWidth = 50; //45; FilterButton = CreateFilterButton(buttonWidth, buttonHeight); ClearButton = CreateClearButton(buttonWidth, buttonHeight); this._buttonLayoutManager = new FlowLayoutManager(filterButtonPanel, _controlFactory); this._buttonLayoutManager.AddControl(FilterButton); this._buttonLayoutManager.AddControl(ClearButton); }
protected static FlowLayoutManager CreateFlowLayoutManager(IControlHabanero managedControl) { FlowLayoutManager manager = new FlowLayoutManager(managedControl, null); manager.HorizontalGapSize = _STD_GAP; manager.VerticalGapSize = _STD_GAP; return manager; }