Beispiel #1
0
        internal static ControlBase XmlElementHandler(Xml.Parser parser, Type type, ControlBase parent)
        {
            ListBoxRow element = new ListBoxRow(parent);

            parser.ParseAttributes(element);
            if (parser.MoveToContent())
            {
                int colIndex = 1;
                foreach (string elementName in parser.NextElement())
                {
                    if (elementName == "Column")
                    {
                        if (parser.MoveToContent())
                        {
                            ControlBase column = parser.ParseElement(element);
                            element.SetCellContents(colIndex++, column, true);
                        }
                        else
                        {
                            string colText = parser.GetAttribute("Text");
                            element.SetCellText(colIndex++, colText != null ? colText : String.Empty);
                        }
                    }
                }
            }
            return(element);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <returns>Newly created control.</returns>
        public TableRow AddRow(String label, String name)
        {
            ListBoxRow row = new ListBoxRow(this);

            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name = name;

            row.Selected += OnRowSelected;

            m_Table.SizeToContents(Width);

            return(row);
        }
Beispiel #3
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <param name="UserData">User data for newly created row</param>
        /// <returns>Newly created control.</returns>
        public ListBoxRow AddRow(string label, string name, Object UserData)
        {
            ListBoxRow row = new ListBoxRow(this);

            table.AddRow(row);

            row.SetCellText(0, label);
            row.Name     = name;
            row.UserData = UserData;

            row.Selected += onRowSelected;

            table.SizeToContents(Width);

            return(row);
        }
Beispiel #4
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <param name="UserData">User data for newly created row</param>
        /// <returns>Newly created control.</returns>
        public ListBoxRow AddRow(string label, string name, Object UserData)
        {
            ListBoxRow row = new ListBoxRow(this);

            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name     = name;
            row.UserData = UserData;

            row.Selected      += OnRowSelected;
            row.DoubleClicked += OnRowDoubleClicked;

            Invalidate();

            return(row);
        }
Beispiel #5
0
        internal static ControlBase XmlElementHandler(Xml.Parser parser, Type type, ControlBase parent)
        {
            ListBoxRow element = new ListBoxRow(parent);
            ListBox    listBox = parent as ListBox;

            if (listBox != null)
            {
                element.ColumnCount = listBox.ColumnCount;
            }
            else
            {
                throw new System.Xml.XmlException("Unknown parent for ListBox Row.");
            }
            parser.ParseAttributes(element);
            if (parser.MoveToContent())
            {
                int colIndex = 1;
                foreach (string elementName in parser.NextElement())
                {
                    if (elementName == "Column")
                    {
                        if (parser.MoveToContent())
                        {
                            ControlBase column = parser.ParseElement(element);
                            element.SetCellContents(colIndex++, column);
                        }
                        else
                        {
                            string colText = parser.GetAttribute("Text");
                            element.SetCellText(colIndex++, colText != null ? colText : String.Empty);
                        }
                    }
                }
            }
            return(element);
        }
Beispiel #6
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <param name="UserData">User data for newly created row</param>
        /// <returns>Newly created control.</returns>
        public ListBoxRow AddRow(string label, string name, Object UserData)
        {
            ListBoxRow row = new ListBoxRow(this);
            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name = name;
            row.UserData = UserData;

            row.Selected += OnRowSelected;

            m_Table.SizeToContents(Width);

            return row;
        }
Beispiel #7
0
        /// <summary>
        /// Adds a new row.
        /// </summary>
        /// <param name="label">Row text.</param>
        /// <param name="name">Internal control name.</param>
        /// <returns>Newly created control.</returns>
        public TableRow AddRow(String label, String name)
        {
            ListBoxRow row = new ListBoxRow(this);
            m_Table.AddRow(row);

            row.SetCellText(0, label);
            row.Name = name;

            row.Selected += OnRowSelected;

            m_Table.SizeToContents(Width);

            return row;
        }