Base control class.
상속: IDisposable
예제 #1
0
파일: CheckBox.cs 프로젝트: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CheckBox(Control parent)
     : base(parent)
 {
     SetSize(15, 15);
     //m_Checked = true; // [omeg] why?!
     //Toggle();
 }
예제 #2
0
파일: MenuStrip.cs 프로젝트: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="MenuStrip"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public MenuStrip(Control parent)
     : base(parent)
 {
     SetBounds(0, 0, 200, 22);
     Dock = Pos.Top;
     m_InnerPanel.Padding = new Padding(5, 0, 0, 0);
 }
예제 #3
0
 //private bool m_DrawCheckers;
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorDisplay"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorDisplay(Control parent)
     : base(parent)
 {
     SetSize(32, 32);
     m_Color = new Color(255, 0, 0, 255);
     //m_DrawCheckers = true;
 }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NumericUpDown"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public NumericUpDown(Control 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";
        }
예제 #5
0
파일: Control.cs 프로젝트: chartly/flood
        /// <summary>
        /// Initializes a new instance of the <see cref="Control"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Control(Control parent)
        {
            m_Children = new List<Control>();
            m_Accelerators = new Dictionary<string, GwenEventHandler>();

            Parent = parent;

            m_Hidden = false;
            m_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;
        }
예제 #6
0
파일: ToolTip.cs 프로젝트: tritao/flood
 /// <summary>
 /// Disables tooltip display for the specified control.
 /// </summary>
 /// <param name="control">Target control.</param>
 public static void Disable(Control control)
 {
     if (g_ToolTip == control)
     {
         g_ToolTip = null;
     }
 }
예제 #7
0
파일: ToolTip.cs 프로젝트: tritao/flood
        /// <summary>
        /// Enables tooltip display for the specified control.
        /// </summary>
        /// <param name="control">Target control.</param>
        public static void Enable(Control control)
        {
            if (null == control.ToolTip)
                return;

            g_ToolTip = control;
        }
예제 #8
0
 //private bool m_DrawCheckers;
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorDisplay"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorDisplay(Control parent)
     : base(parent)
 {
     SetSize(32, 32);
     m_Color = Color.FromArgb(255, 255, 0, 0);
     //m_DrawCheckers = true;
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorSlider"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorSlider(Control parent)
     : base(parent)
 {
     SetSize(32, 128);
     MouseInputEnabled = true;
     m_Depressed = false;
 }
예제 #10
0
        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(Control parent)
            : base(parent)
        {
            m_Sections = new Control[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;
        }
예제 #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(Control 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;
        }
예제 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(Control 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 Control(this);
            m_InnerPanel.SetPosition(0, 0);
            m_InnerPanel.Margin = Margin.Five;
            m_InnerPanel.SendToBack();
            m_InnerPanel.MouseInputEnabled = false;

            m_AutoHideBars = false;
        }
예제 #13
0
파일: TextView.cs 프로젝트: chartly/flood
 public TextView(Control parent, TextDocument textDocument)
     : base(parent)
 {
     Dock = Pos.Fill;
     TextLayer = new TextLayer(this, textDocument);
     CarretLayer = new CarretLayer(this);
 }
예제 #14
0
파일: RadioButton.cs 프로젝트: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public RadioButton(Control parent)
     : base(parent)
 {
     SetSize(15, 15);
     MouseInputEnabled = true;
     IsTabable = false;
 }
예제 #15
0
파일: Animation.cs 프로젝트: tritao/flood
 public static void Add(Control control, Animation animation)
 {
     animation.m_Control = control;
     if (!m_Animations.ContainsKey(control))
         m_Animations[control] = new List<Animation>();
     m_Animations[control].Add(animation);
 }
예제 #16
0
파일: Align.cs 프로젝트: tritao/flood
        /// <summary>
        /// Moves the control to the right of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignRight(Control control)
        {
            Control parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Width - control.Width - parent.Padding.Right, control.Y);
        }
예제 #17
0
파일: Align.cs 프로젝트: tritao/flood
        /// <summary>
        /// Centers the control horizontally inside its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void CenterHorizontally(Control control)
        {
            Control parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Padding.Left + (((parent.Width - parent.Padding.Left - parent.Padding.Right) - control.Width) / 2), control.Y);
        }
예제 #18
0
파일: Align.cs 프로젝트: tritao/flood
        /// <summary>
        /// Moves the control to the left of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignLeft(Control control)
        {
            Control parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Padding.Left, control.Y);
        }
예제 #19
0
파일: Align.cs 프로젝트: tritao/flood
        /// <summary>
        /// Moves the control to the bottom of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignBottom(Control control)
        {
            Control parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(control.X, parent.Height - control.Height);
        }
예제 #20
0
파일: Button.cs 프로젝트: tritao/flood
 /// <summary>
 /// Control constructor.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Button(Control parent)
     : base(parent)
 {
     SetSize(100, 20);
     MouseInputEnabled = true;
     Alignment = Pos.Center;
     TextPadding = new Padding(3, 3, 3, 3);
 }
예제 #21
0
파일: PaneGroup.cs 프로젝트: tritao/flood
        public PaneGroup(Control parent)
            : base(parent)
        {
            if(PaneManager.FocusedPaneGroup==null)
                PaneManager.FocusedPaneGroup = this;

            AllowReorder = true;
        }
예제 #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeNodeLabel"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public TreeNodeLabel(Control parent)
     : base(parent)
 {
     Alignment = Pos.Left | Pos.CenterV;
     ShouldDrawBackground = false;
     Height = 16;
     TextPadding = new Padding(3, 0, 3, 0);
 }
예제 #23
0
        internal bool m_Alt; // for alternate coloring

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CategoryButton(Control parent)
            : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
예제 #24
0
파일: Animation.cs 프로젝트: tritao/flood
 public static void Cancel(Control control)
 {
     if (m_Animations.ContainsKey(control))
     {
         m_Animations[control].Clear();
         m_Animations.Remove(control);
     }
 }
예제 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CheckBox(Control parent)
     : base(parent)
 {
     AutoSizeToContents = false;
     SetSize(15, 15);
     //m_Checked = true; // [omeg] why?!
     //Toggle();
 }
예제 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryHeaderButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CategoryHeaderButton(Control parent)
     : base(parent)
 {
     ShouldDrawBackground = false;
     IsToggle = true;
     Alignment = Pos.Center;
     TextPadding = new Padding(3, 0, 3, 0);
 }
예제 #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonGroup"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 /// <param name="label">Label for the outlining GroupBox.</param>
 public RadioButtonGroup(Control parent, String label)
     : base(parent)
 {
     IsTabable = false;
     KeyboardInputEnabled = true;
     Text = label;
     AutoSizeToContents = true;
 }
예제 #28
0
파일: Modal.cs 프로젝트: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="Modal"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Modal(Control parent)
     : base(parent)
 {
     KeyboardInputEnabled = true;
     MouseInputEnabled = true;
     ShouldDrawBackground = true;
     SetBounds(0, 0, GetCanvas().Width, GetCanvas().Height);
 }
예제 #29
0
파일: ColorPicker.cs 프로젝트: tritao/flood
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorPicker"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ColorPicker(Control parent)
            : base(parent)
        {
            MouseInputEnabled = true;

            SetSize(256, 150);
            CreateControls();
            SelectedColor = Color.FromArgb(255, 50, 60, 70);
        }
예제 #30
0
파일: ImagePanel.cs 프로젝트: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagePanel"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ImagePanel(Control parent)
     : base(parent)
 {
     m_uv = new float[4];
     m_Texture = new Texture(Skin.Renderer);
     SetUV(0, 0, 1, 1);
     MouseInputEnabled = false;
     m_DrawColor = Color.White;
 }