• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IControlHabanero类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IControlHabanero的典型用法代码示例。如果您正苦于以下问题:C# IControlHabanero类的具体用法?C# IControlHabanero怎么用?C# IControlHabanero使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IControlHabanero类属于命名空间,在下文中一共展示了IControlHabanero类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:38,代码来源:BorderLayoutManagerWin.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:GridLayoutManager.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:ListComboBoxMapper.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestReadOnlyGridControlVWG.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:FlowLayoutManager.cs


示例6: SetManagedControl

 private void SetManagedControl(IControlHabanero managedControl)
 {
     _managedControl = managedControl;
     if (managedControl == null)
         return;
     _managedControl.Resize += this.ManagedControlResizeHandler;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:LayoutManager.cs


示例7: AddControlToForm

 private static Form AddControlToForm(IControlHabanero parentControl)
 {
     Form frm = new Form();
     frm.Controls.Clear();
     frm.Controls.Add((Control)parentControl);
     return frm;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestCheckBoxMapperWin.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestMenuBuilderVWG.cs


示例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>();
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:15,代码来源:PanelFactoryInfo.cs


示例10: AddControlToForm

        protected override IFormHabanero AddControlToForm(IControlHabanero cntrl)
        {
            FormVWG form = (FormVWG)GetControlFactory().CreateForm();
            Form formVWG = form;
            formVWG.Controls.Add((Control)cntrl);

            return GetControlledLifetimeFor(form);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestEditableGridControlVWG.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestReadOnlyGridControlWin.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:15,代码来源:ControlMapperStrategyWin.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:OKCancelDialogFactoryVWG.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:FlowLayoutManager.cs


示例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;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:29,代码来源:TestEditableGridControlWin.cs


示例16: GetUniqueControlNameWithin

 /// <summary>
 /// Determines a unique name for the control within the context of the controls that already exist in the <paramref name="containerControl"/>.
 /// </summary>
 /// <param name="containerControl">The control within which the supplied <paramref name="name"/> should be unique.</param>
 /// <param name="name">The name to be altered for uniqueness.</param>
 /// <returns>A unique name.</returns>
 public string GetUniqueControlNameWithin(IControlHabanero containerControl, string name)
 {
     var uniqueName = name;
     var index = 0;
     if (containerControl == null) return uniqueName;
     var siblingControls = containerControl.Controls.OfType<IControlHabanero>().ToList();
     while (siblingControls.Any(ctl => ctl.Name == uniqueName))
     {
         index++;
         uniqueName = string.Format("{0}_{1}", name, index);
     }
     return uniqueName;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:19,代码来源:ControlNamingStrategy.cs


示例17: 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;
     this.ManagedControl.Controls.Clear();
     foreach (IControlHabanero controlHabanero in _controls)
     {
         if (controlHabanero != null)
         {
             this.ManagedControl.Controls.Add(controlHabanero);
         }
     }
     return control;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:21,代码来源:BorderLayoutManagerVWG.cs


示例18: LayoutManager

 /// <summary>
 /// Constructor to initialise a new layout manager
 /// </summary>
 /// <param name="managedControl">The control to manage</param>
 /// <param name="controlFactory">control factory used to create any child controls</param>
 protected LayoutManager(IControlHabanero managedControl, IControlFactory controlFactory)
 {
     if (managedControl == null)
     {
         throw new LayoutManagerException("You cannot initialise the layout manager with a null control");
     }
     if (managedControl.Controls == null)
     {
         throw new LayoutManagerException("You cannot initialise the layout manager with a control that has a null controls collection");
     }
     if (managedControl.Controls.Count > 0)
     {
         throw new LayoutManagerException("You cannot initialise the layout manager with a control that already contains controls");
     }
     this.ObserveGlobalUIHints();
     _controlFactory = controlFactory;
     SetManagedControl(managedControl);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:23,代码来源:LayoutManager.cs


示例19: CreateOKCancelForm

 /// <summary>
 /// Creates a form containing OK and Cancel buttons
 /// </summary>
 /// <param name="nestedControl">The control to place above the buttons</param>
 /// <param name="formTitle">The title shown on the form</param>
 /// <returns>Returns the created form</returns>
 public IFormHabanero CreateOKCancelForm(IControlHabanero nestedControl, string formTitle)
 {
     IOKCancelPanel mainPanel = CreateOKCancelPanel(nestedControl);
     IFormHabanero form = _controlFactory.CreateForm();
     form.Text = formTitle;
     form.ClientSize = mainPanel.Size;
     mainPanel.Dock = DockStyle.Fill;
     form.Controls.Add(mainPanel);
     mainPanel.OKButton.Click += delegate
     {
         OkButton_ClickHandler(form);
     };
     mainPanel.CancelButton.Click += delegate
     {
         CancelButton_ClickHandler(form);
     };
     return form;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:24,代码来源:OKCancelDialogFactoryVWG.cs


示例20: AssertControlDockedInForm

 protected override void AssertControlDockedInForm(IControlHabanero control, IFormHabanero form)
 {
     System.Windows.Forms.Form winForm = (System.Windows.Forms.Form)form;
     Assert.LessOrEqual(1, winForm.MdiChildren.Length);
     bool found = false;
     foreach (System.Windows.Forms.Form childForm in winForm.MdiChildren)
     {
         Assert.AreEqual(1, childForm.Controls.Count);
         System.Windows.Forms.Control childFormControl = childForm.Controls[0];
         if (childFormControl == control)
         {
             found = true;
             //Assert.AreSame(childForm, winForm.ActiveMdiChild,
             //               "Control found in MDI children, but not the current docked form");
             break;
         }
     }
     Assert.IsTrue(found, "Form was not found");
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:19,代码来源:TestMenuBuilderWin.cs



注:本文中的IControlHabanero类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IController类代码示例发布时间:2022-05-24
下一篇:
C# IControlFactory类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap