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

C# Control.ControlBase类代码示例

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

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



ControlBase类属于Gwen.Control命名空间,在下文中一共展示了ControlBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ColorSlider

 /// <summary>
 /// Initializes a new instance of the <see cref="ColorSlider"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorSlider(ControlBase parent)
     : base(parent)
 {
     SetSize(32, 128);
     MouseInputEnabled = true;
     m_Depressed = false;
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:ColorSlider.cs


示例2: RadioButton

 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public RadioButton(ControlBase parent)
     : base(parent)
 {
     SetSize(15, 15);
     MouseInputEnabled = true;
     IsTabable = false;
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:RadioButton.cs


示例3: Add

 public static void Add(ControlBase control, Animation animation)
 {
     animation.m_Control = control;
     if (!m_Animations.ContainsKey(control))
         m_Animations[control] = new List<Animation>();
     m_Animations[control].Add(animation);
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:7,代码来源:Animation.cs


示例4: CrossSplitter

        /// <summary>
        /// Initializes a new instance of the <see cref="CrossSplitter"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CrossSplitter(ControlBase parent)
            : base(parent)
        {
            m_Sections = new ControlBase[4];

            m_VSplitter = new SplitterBar(this);
            m_VSplitter.SetPosition(0, 128);
            m_VSplitter.Dragged += OnVerticalMoved;
            m_VSplitter.Cursor = Cursors.SizeNS;

            m_HSplitter = new SplitterBar(this);
            m_HSplitter.SetPosition(128, 0);
            m_HSplitter.Dragged += OnHorizontalMoved;
            m_HSplitter.Cursor = Cursors.SizeWE;

            m_CSplitter = new SplitterBar(this);
            m_CSplitter.SetPosition(128, 128);
            m_CSplitter.Dragged += OnCenterMoved;
            m_CSplitter.Cursor = Cursors.SizeAll;

            m_HVal = 0.5f;
            m_VVal = 0.5f;

            SetPanel(0, null);
            SetPanel(1, null);
            SetPanel(2, null);
            SetPanel(3, null);

            SplitterSize = 5;
            SplittersVisible = false;

            m_ZoomedSection = -1;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:37,代码来源:CrossSplitter.cs


示例5: CheckBox

 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CheckBox(ControlBase parent)
     : base(parent)
 {
     SetSize(15, 15);
     //m_Checked = true; // [omeg] why?!
     //Toggle();
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:CheckBox.cs


示例6: OpenMsgbox

        void OpenMsgbox(ControlBase control)
        {
            MessageBox window = new MessageBox(GetCanvas(), String.Format("Window {0}   MessageBox window = new MessageBox(GetCanvas(), String.Format(  MessageBox window = new MessageBox(GetCanvas(), String.Format(", m_WindowCount));
            window.SetPosition(rand.Next(700), rand.Next(400));

            m_WindowCount++;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:7,代码来源:Window.cs


示例7: MenuStrip

 /// <summary>
 /// Initializes a new instance of the <see cref="MenuStrip"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public MenuStrip(ControlBase parent)
     : base(parent)
 {
     SetBounds(0, 0, 200, 22);
     Dock = Pos.Top;
     m_InnerPanel.Padding = new Padding(5, 0, 0, 0);
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:MenuStrip.cs


示例8: AlignLeft

        /// <summary>
        /// Moves the control to the left of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignLeft(ControlBase control)
        {
            ControlBase parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Padding.Left, control.Y);
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:Align.cs


示例9: Disable

 /// <summary>
 /// Disables tooltip display for the specified control.
 /// </summary>
 /// <param name="control">Target control.</param>
 public static void Disable(ControlBase control)
 {
     if (g_ToolTip == control)
     {
         g_ToolTip = null;
     }
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:ToolTip.cs


示例10: CategoryButton

        internal bool m_Alt; // for alternate coloring

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CategoryButton(ControlBase parent) : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:13,代码来源:CategoryButton.cs


示例11: NumericUpDown

        /// <summary>
        /// Initializes a new instance of the <see cref="NumericUpDown"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public NumericUpDown(ControlBase parent)
            : base(parent)
        {
            SetSize(100, 20);

            m_Splitter = new Splitter(this);
            m_Splitter.Dock = Pos.Right;
            m_Splitter.SetSize(13, 13);

            m_Up = new UpDownButton_Up(m_Splitter);
            m_Up.Clicked += OnButtonUp;
            m_Up.IsTabable = false;
            m_Splitter.SetPanel(0, m_Up, false);

            m_Down = new UpDownButton_Down(m_Splitter);
            m_Down.Clicked += OnButtonDown;
            m_Down.IsTabable = false;
            m_Down.Padding = new Padding(0, 1, 1, 0);
            m_Splitter.SetPanel(1, m_Down, false);

            m_Max = 100;
            m_Min = 0;
            m_Value = 0f;
            Text = "0";
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:29,代码来源:NumericUpDown.cs


示例12: Enable

        /// <summary>
        /// Enables tooltip display for the specified control.
        /// </summary>
        /// <param name="control">Target control.</param>
        public static void Enable(ControlBase control)
        {
            if (null == control.ToolTip)
                return;

            g_ToolTip = control;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:ToolTip.cs


示例13: ScrollControl

        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(ControlBase parent)
            : base(parent)
        {
            MouseInputEnabled = false;

            m_VerticalScrollBar = new VerticalScrollBar(this);
            m_VerticalScrollBar.Dock = Pos.Right;
            m_VerticalScrollBar.BarMoved += VBarMoved;
            m_CanScrollV = true;
            m_VerticalScrollBar.NudgeAmount = 30;

            m_HorizontalScrollBar = new HorizontalScrollBar(this);
            m_HorizontalScrollBar.Dock = Pos.Bottom;
            m_HorizontalScrollBar.BarMoved += HBarMoved;
            m_CanScrollH = true;
            m_HorizontalScrollBar.NudgeAmount = 30;

            m_InnerPanel = new ControlBase(this);
            m_InnerPanel.SetPosition(0, 0);
            m_InnerPanel.Margin = Margin.Five;
            m_InnerPanel.SendToBack();
            m_InnerPanel.MouseInputEnabled = false;

            m_AutoHideBars = false;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:29,代码来源:ScrollControl.cs


示例14: CenterVertically

        /// <summary>
        /// Centers the control vertically inside its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void CenterVertically(ControlBase control)
        {
            ControlBase parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(control.X, (parent.Height - control.Height) / 2);
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:11,代码来源:Align.cs


示例15: RadioButton

        public RadioButton(ControlBase parent)
            : base(parent)
        {
            Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this, "Sample radio group");
            rbg.SetPosition(10, 10);

            rbg.AddOption("Option 1");
            rbg.AddOption("Option 2");
            rbg.AddOption("Option 3");
            rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
            //rbg.SizeToContents(); // it's auto

            rbg.SelectionChanged += OnChange;

            Control.LabeledRadioButton rb1 = new LabeledRadioButton(this);
            rb1.Text = "Option 1";
            rb1.SetPosition(300, 10);

            Control.LabeledRadioButton rb2 = new LabeledRadioButton(this);
            rb2.Text = "Option 2222222222222222222222222222222222";
            rb2.SetPosition(300, 30);

            Control.LabeledRadioButton rb3 = new LabeledRadioButton(this);
            rb3.Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631";
            rb3.SetPosition(300, 50);

            //this.DrawDebugOutlines = true;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:28,代码来源:RadioButton.cs


示例16: CheckBox

        public CheckBox(ControlBase parent)
            : base(parent)
        {

            Control.CheckBox check = new Control.CheckBox(this);
            check.SetPosition(10, 10);
            check.Checked += OnChecked;
            check.UnChecked += OnUnchecked;
            check.CheckChanged += OnCheckChanged;

            Control.LabeledCheckBox labeled = new Control.LabeledCheckBox(this);
            labeled.Text = "Labeled CheckBox";
            labeled.Checked += OnChecked;
            labeled.UnChecked += OnUnchecked;
            labeled.CheckChanged += OnCheckChanged;
            Align.PlaceDownLeft(labeled, check, 10);

            Control.LabeledCheckBox labeled2 = new Control.LabeledCheckBox(this);
            labeled2.Text = "I'm autosized";
            labeled2.SizeToChildren();
            Align.PlaceDownLeft(labeled2, labeled, 10);

            Control.CheckBox check2 = new Control.CheckBox(this);
            check2.IsDisabled = true;
            Align.PlaceDownLeft(check2, labeled2, 20);
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:26,代码来源:CheckBox.cs


示例17: TabControl

        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(ControlBase parent)
            : base(parent)
        {
            m_Scroll = new ScrollBarButton[2];
            m_ScrollOffset = 0;

            m_TabStrip = new TabStrip(this);
            m_TabStrip.StripPosition = Pos.Top;

            // Make this some special control?
            m_Scroll[0] = new ScrollBarButton(this);
            m_Scroll[0].SetDirectionLeft();
            m_Scroll[0].Clicked += ScrollPressedLeft;
            m_Scroll[0].SetSize(14, 16);

            m_Scroll[1] = new ScrollBarButton(this);
            m_Scroll[1].SetDirectionRight();
            m_Scroll[1].Clicked += ScrollPressedRight;
            m_Scroll[1].SetSize(14, 16);

            m_InnerPanel = new TabControlInner(this);
            m_InnerPanel.Dock = Pos.Fill;
            m_InnerPanel.SendToBack();

            IsTabable = false;
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:30,代码来源:TabControl.cs


示例18: DrawButton

        public override void DrawButton(ControlBase control, bool depressed, bool hovered, bool disabled)
        {
            int w = control.Width;
            int h = control.Height;

            DrawButton(w, h, depressed, hovered);
        }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:7,代码来源:SimpleSkin.cs


示例19: TreeNodeLabel

 /// <summary>
 /// Initializes a new instance of the <see cref="TreeNodeLabel"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public TreeNodeLabel(ControlBase parent)
     : base(parent)
 {
     Alignment = Pos.Left | Pos.CenterV;
     ShouldDrawBackground = false;
     Height = 16;
     TextPadding = new Padding(3, 0, 3, 0);
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:12,代码来源:TreeNodeLabel.cs


示例20: Modal

 /// <summary>
 /// Initializes a new instance of the <see cref="Modal"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Modal(ControlBase parent)
     : base(parent)
 {
     KeyboardInputEnabled = true;
     MouseInputEnabled = true;
     ShouldDrawBackground = true;
     SetBounds(0, 0, GetCanvas().Width, GetCanvas().Height);
 }
开发者ID:WardBenjamin,项目名称:gwen-dotnet,代码行数:12,代码来源:Modal.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Control.GUIControl类代码示例发布时间:2022-05-26
下一篇:
C# Control.Base类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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