本文整理汇总了C#中IControlFactory.CreatePanel方法的典型用法代码示例。如果您正苦于以下问题:C# IControlFactory.CreatePanel方法的具体用法?C# IControlFactory.CreatePanel怎么用?C# IControlFactory.CreatePanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IControlFactory
的用法示例。
在下文中一共展示了IControlFactory.CreatePanel方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterControlVWG
///<summary>
///</summary>
///<param name="controlFactory"></param>
public FilterControlVWG(IControlFactory controlFactory)
{
this.Height = 50;
_controlFactory = controlFactory;
_groupBox = _controlFactory.CreateGroupBox();
//_groupBox.Anchor = AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom;
//_groupBox.Top = 0;
//_groupBox.Left = 0;
//_groupBox.Width = this.Width;
//_groupBox.Height = this.Height;
//this.Controls.Add((Control) _groupBox);
_controlFactory.CreateBorderLayoutManager(this).AddControl(_groupBox, BorderLayoutManager.Position.Centre);
_groupBox.Text = "Filter the Grid";
BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(_groupBox);
layoutManager.BorderSize = 20;
IPanel filterButtonPanel = controlFactory.CreatePanel();
filterButtonPanel.Height = 50;
filterButtonPanel.Width = 110;
CreateFilterButtons(filterButtonPanel);
layoutManager.AddControl(filterButtonPanel, BorderLayoutManager.Position.West);
_filterPanel = controlFactory.CreatePanel();
_filterPanel.Width = this.Width;
layoutManager.AddControl(_filterPanel, BorderLayoutManager.Position.Centre);
_filterControlManager = new FilterControlManager(controlFactory, new FlowLayoutManager(_filterPanel, controlFactory));
}
示例2: HelpAboutBoxManager
///<summary>
/// Constructor for the <see cref="HelpAboutBoxManager"/>
///</summary>
///<param name="controlFactory"></param>
///<param name="formHabanero"></param>
///<param name="programName"></param>
///<param name="producedForName"></param>
///<param name="producedByName"></param>
///<param name="versionNumber"></param>
public HelpAboutBoxManager(IControlFactory controlFactory, IFormHabanero formHabanero, string programName, string producedForName, string producedByName, string versionNumber)
{
_FormHabanero = formHabanero;
_mainPanel = controlFactory.CreatePanel();
GridLayoutManager mainPanelManager = new GridLayoutManager(_mainPanel, controlFactory);
mainPanelManager.SetGridSize(4, 2);
mainPanelManager.FixAllRowsBasedOnContents();
mainPanelManager.FixColumnBasedOnContents(0);
mainPanelManager.FixColumnBasedOnContents(1);
mainPanelManager.AddControl(controlFactory.CreateLabel("Programme Name:", false));
mainPanelManager.AddControl(controlFactory.CreateLabel(programName, false));
mainPanelManager.AddControl(controlFactory.CreateLabel("Produced For:", false));
mainPanelManager.AddControl(controlFactory.CreateLabel(producedForName, false));
mainPanelManager.AddControl(controlFactory.CreateLabel("Produced By:", false));
mainPanelManager.AddControl(controlFactory.CreateLabel(producedByName, false));
mainPanelManager.AddControl(controlFactory.CreateLabel("Version:", false));
mainPanelManager.AddControl(controlFactory.CreateLabel(versionNumber, false));
IButtonGroupControl buttons = controlFactory.CreateButtonGroupControl();
buttons.AddButton("OK", new EventHandler(OKButtonClickHandler));
BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(formHabanero);
manager.AddControl(_mainPanel, BorderLayoutManager.Position.Centre);
manager.AddControl(buttons, BorderLayoutManager.Position.South);
formHabanero.Width = 300;
formHabanero.Height = 200;
formHabanero.Text = "About";
}
示例3: MainTitleIconControlWin
/// <summary>
/// Constructs a <see cref="MainTitleIconControlWin"/>
/// </summary>
public MainTitleIconControlWin(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_controlFactory = controlFactory;
_panel = _controlFactory.CreatePanel();
((PanelWin)_panel).BackgroundImage = CollapsiblePanelResource.headergradient;
_panel.BackColor = Color.Transparent;
_panel.Dock = Habanero.Faces.Base.DockStyle.Top;
_panel.Height = 23;
_icon = _controlFactory.CreateLabel();
((LabelWin)_icon).BackgroundImage = CollapsiblePanelResource.headergradient;
_icon.BackColor = Color.Transparent;
((LabelWin)_icon).BackgroundImageLayout = ImageLayout.Center;
_icon.Dock = Habanero.Faces.Base.DockStyle.Left;
_icon.Size = new Size(20, 20);
_title = _controlFactory.CreateLabel();
_title.Dock = Habanero.Faces.Base.DockStyle.Fill;
_title.BackColor = Color.Transparent;
_title.TextAlign = ContentAlignment.MiddleLeft;
_title.ForeColor = Color.White;
_panel.Controls.Add(_title);
_panel.Controls.Add(_icon);
_panel.MaximumSize = new Size(2000, 23);
this.Dock = DockStyleWin.GetDockStyle(DockStyle.Top);
this.Controls.Add((PanelWin)_panel);
this.Height = 23;
}
示例4: CollapsiblePanelManager
///<summary>
/// Constructor for <see cref="CollapsiblePanelManager"/>
///</summary>
///<param name="collapsiblePanel"></param>
///<param name="controlFactory"></param>
public CollapsiblePanelManager(ICollapsiblePanel collapsiblePanel, IControlFactory controlFactory)
{
_controlFactory = controlFactory;
_collapsiblePanel = collapsiblePanel;
_collapseButton = _controlFactory.CreateButtonCollapsibleStyle();
_collapseButton.Click += delegate { Collapsed = !Collapsed; };
_pinLabel = controlFactory.CreateLabelPinOffStyle();
_pinLabel.Click += delegate { Pinned = !Pinned; };
IPanel buttonPanel = _controlFactory.CreatePanel();
BorderLayoutManager buttonLayoutManager =
_controlFactory.CreateBorderLayoutManager(buttonPanel);
buttonPanel.Height = _collapseButton.Height;
buttonLayoutManager.AddControl(_collapseButton, BorderLayoutManager.Position.Centre);
buttonLayoutManager.AddControl(_pinLabel, BorderLayoutManager.Position.East);
_layoutManager = _controlFactory.CreateBorderLayoutManager(collapsiblePanel);
_layoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.North);
_collapseButton.BackColor = System.Drawing.Color.Transparent;
_collapseButton.ForeColor = System.Drawing.Color.Transparent;
}
示例5: MainTitleIconControlVWG
/// <summary>
/// Constructs a <see cref="MainTitleIconControlVWG"/>
/// </summary>
public MainTitleIconControlVWG(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_controlFactory = controlFactory;
_panel = _controlFactory.CreatePanel();
((PanelVWG)_panel).BackgroundImage = @"Images.headergradient.png";
_panel.BackColor = Color.Transparent;
_panel.Dock = Habanero.Faces.Base.DockStyle.Top;
_panel.Height = 23;
this.Size = new Size(_panel.Width,_panel.Height);
_icon = _controlFactory.CreateLabel();
((LabelVWG)_icon).BackgroundImage = "";
_icon.BackColor = Color.Transparent;
((LabelVWG)_icon).BackgroundImageLayout = ImageLayout.Center;
_icon.Dock = Habanero.Faces.Base.DockStyle.Left;
_icon.Size = new Size(20, 20);
_title = _controlFactory.CreateLabel();
_title.Font = new Font("Verdana", 10);
_title.Dock = Habanero.Faces.Base.DockStyle.Fill;
_title.BackColor = Color.Transparent;
_title.TextAlign = ContentAlignment.MiddleLeft;
_title.ForeColor = Color.White;
_panel.Controls.Add(_title);
_panel.Controls.Add(_icon);
this.Dock = DockStyleVWG.GetDockStyle(DockStyle.Top);
this.Controls.Add((PanelVWG)_panel);
this.Height = 23;
}
示例6: CreateColoredPanel
private static IPanel CreateColoredPanel(IControlFactory controlFactory, string labelPrefix)
{
System.Windows.Forms.Panel panel = (System.Windows.Forms.Panel)controlFactory.CreatePanel();
ILabel label = controlFactory.CreateLabel(labelPrefix);
label.Height = 15;
label.BackColor = Color.White;
panel.Controls.Add((System.Windows.Forms.Control)label);
panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel.BackColor = Color.FromArgb(TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255));
return (IPanel)panel;
}
示例7: FilterControlWin
///<summary>
/// Constructor for <see cref="FilterControlWin"/>
///</summary>
///<param name="controlFactory"></param>
public FilterControlWin(IControlFactory controlFactory)
{
Height = 50;
_controlFactory = controlFactory;
FilterGroupBox = _controlFactory.CreateGroupBox();
// _groupBox = _controlFactory.CreatePanel();
_controlFactory.CreateBorderLayoutManager(this).AddControl(FilterGroupBox, BorderLayoutManager.Position.Centre);
FilterGroupBox.Text = "Filter the Grid";
BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(FilterGroupBox);
layoutManager.BorderSize = 20;
_filterButtonPanel = controlFactory.CreatePanel();
_filterButtonPanel.Height = 50;
_filterButtonPanel.Width = 120; //110;
_filterButtonPanel.Visible = false;
CreateFilterButtons(_filterButtonPanel);
_controlPanel = controlFactory.CreatePanel();
_controlPanel.Width = Width;
this.EnsureButtonsFit();
this._filterButtonPanel.Resize += (sender, e) => { this.EnsureButtonsFit(); };
layoutManager.AddControl(_controlPanel, BorderLayoutManager.Position.Centre);
layoutManager.AddControl(_filterButtonPanel, BorderLayoutManager.Position.East);
Height = 50;
this._controlPanel.Resize += (sender, e) =>
{
this.Height = this._controlPanel.Height + layoutManager.BorderSize;
if ((this.FilterGroupBox.Height - layoutManager.BorderSize) < this.Height)
{
this.FilterGroupBox.Height = this.Height;
}
};
_filterControlManager = new FilterControlManager(controlFactory,
new FlowLayoutManager(_controlPanel, controlFactory));
}
示例8: CreateColoredPanel
private static IPanel CreateColoredPanel(IControlFactory controlFactory, string labelPrefix)
{
System.Windows.Forms.Panel panel = (System.Windows.Forms.Panel)controlFactory.CreatePanel();
ILabel label = controlFactory.CreateLabel(labelPrefix + "Left-Click to grow, Right-Click to shrink.");
label.Height = 15;
label.BackColor = Color.White;
panel.Controls.Add((System.Windows.Forms.Control)label);
panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel.MouseDown += (sender, e) =>
{
if (e.Button == System.Windows.Forms.MouseButtons.Left) panel.Height += 5;
if (e.Button == System.Windows.Forms.MouseButtons.Right) panel.Height -= 5;
};
panel.BackColor = Color.FromArgb(TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255));
return (IPanel)panel;
}
示例9: WizardControlWin
/// <summary>
/// Initialises the WizardControl with the IWizardController. No logic is performed other than storing the wizard controller.
/// </summary>
/// <param name="wizardController"></param>
/// <param name="controlFactory">The control factory that this control will use to create a button</param>
public WizardControlWin(IWizardController wizardController, IControlFactory controlFactory)
{
if (wizardController == null) throw new ArgumentNullException("wizardController");
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_wizardController = wizardController;
ControlFactory = controlFactory;
_wizardControlManager = new WizardControlManager(this);
var buttonPanel = CreateButtonPanel();
_wizardStepPanel = ControlFactory.CreatePanel();
BorderLayoutManagerWin borderLayoutManager = new BorderLayoutManagerWin(this, ControlFactory);
borderLayoutManager.AddControl(_wizardStepPanel, BorderLayoutManager.Position.Centre);
borderLayoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.South);
}
示例10: OKCancelPanelVWG
public OKCancelPanelVWG(IControlFactory controlFactory)
{
//_controlFactory = controlFactory;
//// create content panel
//_contentPanel = _controlFactory.CreatePanel();
//_contentPanel.Dock = DockStyle.Fill;
//this.Controls.Add((Control)_contentPanel);
//// create buttons
//IButtonGroupControl buttonGroupControl = _controlFactory.CreateButtonGroupControl();
//buttonGroupControl.Dock = DockStyle.Bottom;
//_okButton = buttonGroupControl.AddButton("OK");
//_okButton.NotifyDefault(true);
//_cancelButton = buttonGroupControl.AddButton("Cancel");
//this.Controls.Add((Control)buttonGroupControl);
_controlFactory = controlFactory;
// create content panel
_contentPanel = _controlFactory.CreatePanel();
// create buttons
_buttonGroupControl = _controlFactory.CreateButtonGroupControl();
_cancelButton = _buttonGroupControl.AddButton("Cancel");
_okButton = _buttonGroupControl.AddButton("OK");
_okButton.NotifyDefault(true);
BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(this);
layoutManager.AddControl(_contentPanel, BorderLayoutManager.Position.Centre);
layoutManager.AddControl(_buttonGroupControl, BorderLayoutManager.Position.South);
}
示例11: OKCancelPanelWin
public OKCancelPanelWin(IControlFactory controlFactory)
{
_controlFactory = controlFactory;
// create content panel
_contentPanel = _controlFactory.CreatePanel();
// create buttons
_buttonGroupControl = _controlFactory.CreateButtonGroupControl();
_cancelButton = ButtonGroupControl.AddButton("Cancel");
_okButton = ButtonGroupControl.AddButton("OK");
_okButton.NotifyDefault(true);
BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(this);
layoutManager.AddControl(_contentPanel, BorderLayoutManager.Position.Centre);
layoutManager.AddControl(ButtonGroupControl, BorderLayoutManager.Position.South);
}