Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(ControlBase parent)
            : base(parent)
        {
            // Make sure that the tree control has only one root node.
            if (m_TreeControl == null && parent is TreeControl)
            {
                m_TreeControl = parent as TreeControl;
                m_Root        = true;
            }
            else
            {
                m_ToggleButton          = new TreeToggleButton(this);
                m_ToggleButton.Toggled += OnToggleButtonPress;

                m_Title = new TreeNodeLabel(this);
                m_Title.DoubleClicked += OnDoubleClickName;
                m_Title.Clicked       += OnClickName;
            }

            m_InnerPanel = new Layout.VerticalLayout(this);
            m_InnerPanel.Collapse(!m_Root, false);             // Root node is always expanded

            m_Selected   = false;
            m_Selectable = true;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Properties"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Properties(ControlBase parent)
            : base(parent)
        {
            m_SplitterBar          = new SplitterBar(this);
            m_SplitterBar.Width    = 3;
            m_SplitterBar.Cursor   = Cursor.SizeWE;
            m_SplitterBar.Dragged += OnSplitterMoved;
            m_SplitterBar.ShouldDrawBackground = false;

            m_LabelWidth = DefaultLabelWidth;

            m_InnerPanel = new Layout.VerticalLayout(this);
        }
Exemple #3
0
        public ToolWindow(ControlBase parent)
            : base(parent)
        {
            Gwen.Control.Layout.VerticalLayout layout = new Gwen.Control.Layout.VerticalLayout(this);
            layout.HorizontalAlignment = HorizontalAlignment.Left;

            Control.Button button;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a ToolBar";
            button.Clicked += OpenToolBar;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a tool window";
            button.Clicked += OpenToolWindow;
        }
Exemple #4
0
        public Window(ControlBase parent)
            : base(parent)
        {
            m_Rand = new Random();

            Gwen.Control.Layout.VerticalLayout layout = new Gwen.Control.Layout.VerticalLayout(this);
            layout.HorizontalAlignment = HorizontalAlignment.Left;

            Control.Button button;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a Window";
            button.Clicked += OpenWindow;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a Window (with menu)";
            button.Clicked += OpenWindowWithMenuAndStatusBar;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a Window (auto size)";
            button.Clicked += OpenWindowAutoSizing;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a Window (modal)";
            button.Clicked += OpenWindowModal;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a MessageBox";
            button.Clicked += OpenMsgbox;

            button          = new Control.Button(layout);
            button.Margin   = Margin.Five;
            button.Text     = "Open a Long MessageBox";
            button.Clicked += OpenLongMsgbox;

            m_WindowCount = 0;
        }