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

C# Control.Base类代码示例

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

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



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

示例1: CheckBox

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


示例2: ColorSlider

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


示例3: TabControl

        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(Base 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:esdrubal,项目名称:guieditor,代码行数:30,代码来源:TabControl.cs


示例4: Enable

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

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


示例5: Initialize

        public void Initialize()
        {
            WindowControl rightpanel = new WindowControl(MainCanvas.Instance);
            rightpanel.Dock = Gwen.Pos.Right;
            rightpanel.Width = (GraphicsManager.WindowWidth / 2) - 20;
            rightpanel.IsClosable = false;
            rightpanel.DisableResizing();

            Base dummy = new Base(MainCanvas.Instance);
            dummy.Dock = Gwen.Pos.Fill;

            bottompanel = new WindowControl(dummy);
            bottompanel.Dock = Gwen.Pos.Bottom;
            bottompanel.Height = (GraphicsManager.WindowHeight / 2) - 20;
            bottompanel.IsClosable = false;
            bottompanel.DisableResizing();

            Gameview = new Camera3D();
            Gameview.Layer = 1;
            Gameview.FieldOfView = 60;
            Gameview.EnableViewport(10, 10, GraphicsManager.WindowWidth / 2, GraphicsManager.WindowHeight / 2);
            Gameview.OnRender += GameRender;

            if (GameInfo.Me.IsServer) {
                ScriptManager.Initialize();
                foreach (var p in GameInfo.Players.Values){
                    InitializePlayer(p);
                }
            }
        }
开发者ID:CloneDeath,项目名称:Xanatos,代码行数:30,代码来源:Game.cs


示例6: OpenMsgbox

		void OpenMsgbox(Base control, EventArgs args)
        {
            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:jcsnider,项目名称:GWEN.Net-Unity,代码行数:7,代码来源:Window.cs


示例7: TreeNode

        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(Base parent)
            : base(parent)
        {
            m_ToggleButton = new TreeToggleButton(this);
            m_ToggleButton.SetBounds(0, 0, 15, 15);
            m_ToggleButton.Toggled += OnToggleButtonPress;

            m_Title = new TreeNodeLabel(this);
            m_Title.Dock = Pos.Top;
            m_Title.Margin = new Margin(16, 0, 0, 0);
            m_Title.DoubleClicked += OnDoubleClickName;
            m_Title.Clicked += OnClickName;

            m_InnerPanel = new Base(this);
            m_InnerPanel.Dock = Pos.Top;
            m_InnerPanel.Height = 100;
            m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
            m_InnerPanel.Hide();

            IsRoot = parent is TreeControl;
            m_Selected = false;
            IsSelectable = true;

            Dock = Pos.Top;
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:29,代码来源:TreeNode.cs


示例8: RadioButton

        public RadioButton(Base 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:esdrubal,项目名称:guieditor,代码行数:28,代码来源:RadioButton.cs


示例9: ImagePanel

        public ImagePanel(Base parent)
            : base(parent)
        {
            /* Normal */
            {
                Control.ImagePanel img = new Control.ImagePanel(this);
                img.ImageName = "gwen.png";
                img.SetPosition(10, 10);
				img.SetSize(100, 100);
            }

            /* Missing */
            {
                Control.ImagePanel img = new Control.ImagePanel(this);
                img.ImageName = "missingimage.png";
                img.SetPosition(120, 10);
				img.SetSize(100, 100);
            }

			/* Clicked */
			{
				Control.ImagePanel img = new Control.ImagePanel(this);
				img.ImageName = "gwen.png";
				img.SetPosition(10, 120);
				img.SetSize(100, 100);
				img.Clicked += Image_Clicked;
			}
        }
开发者ID:LawlietRyuuzaki,项目名称:gwen-dotnet,代码行数:28,代码来源:ImagePanel.cs


示例10: OnMouseButton

        public static bool OnMouseButton(Base hoveredControl, int x, int y, bool down)
        {
            if (!down)
            {
                m_LastPressedControl = null;

                // Not carrying anything, allow normal actions
                if (CurrentPackage == null)
                    return false;

                // We were carrying something, drop it.
                OnDrop(x, y);
                return true;
            }

            if (hoveredControl == null)
                return false;
            if (!hoveredControl.DragAndDrop_Draggable())
                return false;

            // Store the last clicked on control. Don't do anything yet,
            // we'll check it in OnMouseMoved, and if it moves further than
            // x pixels with the mouse down, we'll start to drag.
            m_LastPressedPos = new Point(x, y);
            m_LastPressedControl = hoveredControl;

            return false;
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:28,代码来源:DragAndDrop.cs


示例11: OnMouseMoved

        public static void OnMouseMoved(Base hoveredControl, int x, int y)
        {
            // Always keep these up to date, they're used to draw the dragged control.
            m_MouseX = x;
            m_MouseY = y;

            // If we're not carrying anything, then check to see if we should
            // pick up from a control that we're holding down. If not, then forget it.
            if (CurrentPackage == null && !ShouldStartDraggingControl(x, y))
                return;

            // Swap to this new hovered control and notify them of the change.
            UpdateHoveredControl(hoveredControl, x, y);

            if (HoveredControl == null)
                return;

            // Update the hovered control every mouse move, so it can show where
            // the dropped control will land etc..
            HoveredControl.DragAndDrop_Hover(CurrentPackage, x, y);

            // Override the cursor - since it might have been set my underlying controls
            // Ideally this would show the 'being dragged' control. TODO
            Platform.Neutral.SetCursor(Cursors.Default);

            hoveredControl.Redraw();
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:27,代码来源:DragAndDrop.cs


示例12: TextBox

        /// <summary>
        /// Initializes a new instance of the <see cref="TextBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TextBox(Base parent)
            : base(parent)
        {
            AutoSizeToContents = false;
            SetSize(200, 20);

            MouseInputEnabled = true;
            KeyboardInputEnabled = true;

            Alignment = Pos.Left | Pos.CenterV;
            TextPadding = new Padding(4, 2, 4, 2);

            m_CursorPos = 0;
            m_CursorEnd = 0;
            m_SelectAll = false;

            TextColor = Color.FromArgb(255, 50, 50, 50); // TODO: From Skin

            IsTabable = true;

            AddAccelerator("Ctrl + C", OnCopy);
            AddAccelerator("Ctrl + X", OnCut);
            AddAccelerator("Ctrl + V", OnPaste);
            AddAccelerator("Ctrl + A", OnSelectAll);
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:29,代码来源:TextBox.cs


示例13: CrossSplitter

        private int m_ZoomedSection; // 0-3

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CrossSplitter"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CrossSplitter(Base parent)
            : base(parent)
        {
            m_Sections = new Base[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:Sprunth,项目名称:gwen-dotnet,代码行数:43,代码来源:CrossSplitter.cs


示例14: MenuStrip

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


示例15: Add

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


示例16: ColorDisplay

 //private bool m_DrawCheckers;
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorDisplay"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorDisplay(Base parent)
     : base(parent)
 {
     SetSize(32, 32);
     m_Color = Color.FromArgb(255, 255, 0, 0);
     //m_DrawCheckers = true;
 }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:12,代码来源:ColorDisplay.cs


示例17: CheckBox

        public CheckBox(Base 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:LawlietRyuuzaki,项目名称:gwen-dotnet,代码行数:26,代码来源:CheckBox.cs


示例18: 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(Base parent) : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
开发者ID:LawlietRyuuzaki,项目名称:gwen-dotnet,代码行数:13,代码来源:CategoryButton.cs


示例19: Base

        /// <summary>
        /// Initializes a new instance of the <see cref="Base"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Base(Base parent = null)
        {
            m_Children = new List<Base>();
            m_Accelerators = new Dictionary<string, GwenEventHandler>();

            Parent = parent;

            m_Hidden = false;
            Bounds = new Rectangle(0, 0, 10, 10);
            m_Padding = Padding.Zero;
            m_Margin = Margin.Zero;

            RestrictToParent = false;

            MouseInputEnabled = true;
            KeyboardInputEnabled = false;

            Invalidate();
            Cursor = Cursors.Default;
            //ToolTip = null;
            IsTabable = false;
            ShouldDrawBackground = true;
            m_Disabled = false;
            m_CacheTextureDirty = true;
            m_CacheToTexture = false;

            BoundsOutlineColor = Color.Red;
            MarginOutlineColor = Color.Green;
            PaddingOutlineColor = Color.Blue;

            m_UserData = new UserData();
        }
开发者ID:akumetsuv,项目名称:flood,代码行数:36,代码来源:Base.cs


示例20: NumericUpDown

        /// <summary>
        /// Initializes a new instance of the <see cref="NumericUpDown"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public NumericUpDown(Base 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:esdrubal,项目名称:guieditor,代码行数:29,代码来源:NumericUpDown.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Control.ControlBase类代码示例发布时间:2022-05-26
下一篇:
C# DLMS.GXDLMSSettings类代码示例发布时间: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