本文整理汇总了C#中IControlHabanero类的典型用法代码示例。如果您正苦于以下问题:C# IControlHabanero类的具体用法?C# IControlHabanero怎么用?C# IControlHabanero使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IControlHabanero类属于命名空间,在下文中一共展示了IControlHabanero类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddControl
/// <summary>
/// Add a control to the layout
/// </summary>
/// <param name="control">The control to add</param>
/// /// <param name="pos">The position at which to add the control</param>
/// <param name="includeSplitter">True to include a splitter between the controls</param>
/// <returns>Returns the control added</returns>
public override IControlHabanero AddControl(IControlHabanero control, Position pos, bool includeSplitter)
{
SetupDockOfControl(control, pos);
_controls[(int)pos] = control;
_splitters[(int)pos] = includeSplitter;
this.ManagedControl.Controls.Clear();
//this.ManagedControl.Width = 100;
//this.ManagedControl.Height = 100;
for (int i = 0; i < _controls.Length; i++)
{
IControlHabanero habaneroControl = _controls[i];
if (habaneroControl != null)
{
if (_splitters[i])
{
ISplitter splt = _controlFactory.CreateSplitter();
Color newBackColor =
Color.FromArgb(Math.Min(splt.BackColor.R - 30, 255), Math.Min(splt.BackColor.G - 30, 255),
Math.Min(splt.BackColor.B - 30, 255));
splt.BackColor = newBackColor;
if (_controls[i].Dock != Base.DockStyle.Fill)
splt.Dock = _controls[i].Dock;
ManagedControl.Controls.Add(splt);
}
this.ManagedControl.Controls.Add(habaneroControl);
}
}
return control;
}
示例2: GridLayoutManager
/// <summary>
/// Constructor to initialise a new grid layout
/// </summary>
/// <param name="managedControl">The control to manage</param>
/// <param name="controlFactory">The control factory used to create any controls</param>
public GridLayoutManager(IControlHabanero managedControl, IControlFactory controlFactory)
: base(managedControl, controlFactory)
{
_controls = new List<IControlHabanero>();
_controlInfoTable = new Hashtable();
this.SetGridSize(2, 2);
}
示例3: ListComboBoxMapper
///<summary>
/// Constructor form <see cref="ListComboBoxMapper"/>
///</summary>
///<param name="ctl"></param>
///<param name="propName"></param>
///<param name="isReadOnly"></param>
///<param name="factory"></param>
public ListComboBoxMapper(IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory)
: base(ctl, propName, isReadOnly, factory)
{
_comboBox = (IComboBox)ctl;
_mapperStrategy = factory.CreateListComboBoxMapperStrategy();
_mapperStrategy.AddItemSelectedEventHandler(this);
}
示例4: AddControlToForm
protected override void AddControlToForm(IControlHabanero control, int formHeight)
{
Gizmox.WebGUI.Forms.Form frm = new Gizmox.WebGUI.Forms.Form();
frm.Controls.Add((Gizmox.WebGUI.Forms.Control)control);
frm.Height = formHeight;
frm.Visible = true;
}
示例5: FlowLayoutManager
/// <summary>
/// Constructor to initialise a new manager
/// </summary>
/// <param name="managedControl">The control to manage e.g. a Panel</param>
/// <param name="controlFactory">The factory which generates controls</param>
public FlowLayoutManager(IControlHabanero managedControl, IControlFactory controlFactory)
: base(managedControl, controlFactory)
{
_controls = new List<IControlHabanero>();
_newLinePositions = new ArrayList(3);
_gluePositions = new ArrayList(5);
}
示例6: SetManagedControl
private void SetManagedControl(IControlHabanero managedControl)
{
_managedControl = managedControl;
if (managedControl == null)
return;
_managedControl.Resize += this.ManagedControlResizeHandler;
}
示例7: AddControlToForm
private static Form AddControlToForm(IControlHabanero parentControl)
{
Form frm = new Form();
frm.Controls.Clear();
frm.Controls.Add((Control)parentControl);
return frm;
}
示例8: AssertControlDockedInForm
protected override void AssertControlDockedInForm(IControlHabanero control, IFormHabanero form)
{
Assert.AreEqual(1, form.Controls.Count, "No container control found in form");
IControlHabanero contentControl = form.Controls[0];
Assert.AreEqual(1, contentControl.Controls.Count);
Assert.AreSame(control, contentControl.Controls[0]);
Assert.AreEqual(DockStyle.Fill, control.Dock);
}
示例9: PanelFactoryInfo
/// <summary>
/// Constructor to initialise a new instance of the class
/// </summary>
/// <param name="panel">The panel control being managed</param>
/// <param name="mappers">The control mappers collection</param>
/// <param name="uiDefName">The UI definition name to use</param>
/// <param name="firstControlToFocus">The first control to focus on</param>
public PanelFactoryInfo(IPanel panel, IControlMapperCollection mappers, string uiDefName, IControlHabanero firstControlToFocus)
{
_panel = panel;
_mappers = mappers;
_firstControlToFocus = firstControlToFocus;
_uiDefName = uiDefName;
_formGrids = new Dictionary<string, IEditableGridControl>();
}
示例10: AddControlToForm
protected override IFormHabanero AddControlToForm(IControlHabanero cntrl)
{
FormVWG form = (FormVWG)GetControlFactory().CreateForm();
Form formVWG = form;
formVWG.Controls.Add((Control)cntrl);
return GetControlledLifetimeFor(form);
}
示例11: AddControlToForm
protected override void AddControlToForm(IControlHabanero control, int formHeight)
{
System.Windows.Forms.Form frmLocal = new System.Windows.Forms.Form();
DisposeOnTearDown(frmLocal);
frmLocal.Controls.Add((System.Windows.Forms.Control)control);
frmLocal.Height = formHeight;
frmLocal.Visible = true;
}
示例12: AddKeyPressEventHandler
/// <summary>
/// Handles the default key press behaviours on a control.
/// This is typically used to change the handling of the enter key (such as having
/// the enter key cause focus to move to the next control).
/// </summary>
/// <param name="control">The control whose events will be handled</param>
public void AddKeyPressEventHandler(IControlHabanero control)
{
if (control == null) throw new ArgumentNullException("control");
_control = control.GetControl();
if (_control == null) return;
_control.KeyUp += CtlKeyUpHandler;
_control.KeyDown += CtlKeyDownHandler;
_control.KeyPress += CtlKeyPressHandler;
}
示例13: CreateOKCancelPanel
/// <summary>
/// Creates a panel containing OK and Cancel buttons
/// </summary>
/// <param name="nestedControl">The control to place above the buttons</param>
/// <returns>Returns the created panel</returns>
public IOKCancelPanel CreateOKCancelPanel(IControlHabanero nestedControl)
{
OKCancelPanelVWG mainPanel = new OKCancelPanelVWG(_controlFactory);
mainPanel.Width = nestedControl.Width;
mainPanel.Height = nestedControl.Height + mainPanel.ButtonGroupControl.Height;
mainPanel.ContentPanel.Controls.Add(nestedControl);
nestedControl.Dock = DockStyle.Fill;
return mainPanel;
}
示例14: AddControl
/// <summary>
/// Adds a control to the layout
/// </summary>
/// <param name="control">The control to add</param>
/// <returns>Returns the control once it has been added</returns>
public override IControlHabanero AddControl(IControlHabanero control)
{
_controls.Add(control);
RefreshControlPositions();
control.VisibleChanged += ControlVisibleChangedHandler;
control.Resize += ControlResizedHandler;
this.ManagedControl.Controls.Add(control);
return control;
}
示例15: AddControlToForm
//protected override IGridBase CreateGridBaseStub()
//{
// GridBaseWinStub gridBase = new GridBaseWinStub();
// System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
// frm.Controls.Add(gridBase);
// return gridBase;
//}
//private static System.Windows.Forms.DataGridViewCell GetCell(int rowIndex, string propName,
// IGridBase gridBase)
//{
// System.Windows.Forms.DataGridView dgv = (System.Windows.Forms.DataGridView) gridBase;
// System.Windows.Forms.DataGridViewRow row = dgv.Rows[rowIndex];
// return row.Cells[propName];
//}
//protected override void AddControlToForm(IGridBase gridBase)
//{
// throw new NotImplementedException();
//}
protected override IFormHabanero AddControlToForm(IControlHabanero cntrl)
{
//System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
//frm.Controls.Add((System.Windows.Forms.Control)cntrl);
IFormHabanero frm = GetControlFactory().CreateForm();
frm.Controls.Add(cntrl);
return frm;
}