Beispiel #1
0
        private TableItem GetGroupTableItem(TableItems groups, PointF local, ref float currentHeight)
        {
            //Check the groups and each rows collection inside groups
            foreach (TableGroup tableGroup in groups)
            {
                if (local.Y >= currentHeight && local.Y <= currentHeight + GroupHeight)
                {
                    return(tableGroup);
                }
                currentHeight += GroupHeight;

                if (tableGroup.Expanded)
                {
                    TableItem item = GetGroupTableItem(tableGroup.Groups, local, ref currentHeight);
                    if (item != null)
                    {
                        return(item);
                    }

                    foreach (TableRow tableRow in tableGroup.Rows)
                    {
                        if (local.Y >= currentHeight && local.Y <= currentHeight + GroupHeight)
                        {
                            return(tableRow);
                        }
                        currentHeight += RowHeight;
                    }
                }
            }
            return(null);
        }
Beispiel #2
0
 //Copy all rows from source to target via clone
 public static void CopyRows(TableItems source, TableItems target)
 {
     foreach (TableRow row in source)
     {
         target.Add((TableRow)row.Clone());
     }
 }
Beispiel #3
0
 //Copy all rows from source to target via clone
 public static void CopyGroups(TableItems source, TableItems target)
 {
     foreach (TableGroup group in source)
     {
         target.Add((TableGroup)group.Clone());
     }
 }
		public TableGroup(TableGroup prototype): base(prototype)
		{
			mExpanded = prototype.Expanded;
			Rows = new TableItems(typeof(TableRow));
			Groups = new TableItems(typeof(TableGroup));
			Table.CopyRows(prototype.Rows,Rows);
			Table.CopyGroups(prototype.Groups, Groups);
		}
 public TableGroup(TableGroup prototype) : base(prototype)
 {
     mExpanded = prototype.Expanded;
     Rows      = new TableItems(typeof(TableRow));
     Groups    = new TableItems(typeof(TableGroup));
     Table.CopyRows(prototype.Rows, Rows);
     Table.CopyGroups(prototype.Groups, Groups);
 }
Beispiel #6
0
        private void RenderTableRows(Graphics graphics, IRender render, TableItems rows, ref float iHeight)
        {
            foreach (TableRow tableRow in rows)
            {
                tableRow.SuspendEvents = true;

                tableRow.SetRectangle(new RectangleF(0, iHeight, Width, RowHeight));
                tableRow.Render(graphics, render);
                iHeight += RowHeight;

                tableRow.SuspendEvents = false;
            }
        }
Beispiel #7
0
        private TableGroup GetTableGroupExpander(TableItems groups, PointF local)
        {
            foreach (TableGroup group in groups)
            {
                RectangleF expander = new RectangleF(group.Indent + 4, group.Rectangle.Top + 4, 11, 11);
                if (expander.Contains(local))
                {
                    return(group);
                }

                //Sub groups
                TableGroup result = GetTableGroupExpander(group.Groups, local);
                if (result != null)
                {
                    return(result);
                }
            }

            return(null);
        }
Beispiel #8
0
        //Constructors
        public Table()
        {
            SuspendEvents = true;

            Groups           = new TableItems(typeof(TableGroup));
            Rows             = new TableItems(typeof(TableRow));
            HeadingHeight    = 40;
            Heading          = "Heading";
            SubHeading       = "Sub Heading";
            GroupHeight      = 20;
            RowHeight        = 20;
            Indent           = 16;
            ExpandedSize     = Size;
            ContractedSize   = new SizeF(Size.Width, CalculateHeight());
            Expanded         = true;
            DrawExpand       = false;
            Forecolor        = Color.Black;
            GradientColor    = SystemColors.Control;
            DrawSelectedItem = true;

            SuspendEvents = false;
        }
Beispiel #9
0
		//Constructors
		public Table()
		{
			SuspendEvents = true;
			
			Groups = new TableItems(typeof(TableGroup));
			Rows = new TableItems(typeof(TableRow));
			HeadingHeight = 40;
			Heading = "Heading";
			SubHeading = "Sub Heading";
			GroupHeight = 20;
			RowHeight = 20;
			Indent = 16;
			ExpandedSize = Size;
			ContractedSize = new SizeF(Size.Width,CalculateHeight());
			Expanded = true;
			DrawExpand = false;
			Forecolor = Color.Black;
			GradientColor = SystemColors.Control;
			DrawSelectedItem = true;

			SuspendEvents = false;
		}
Beispiel #10
0
        private void RenderTableGroups(Graphics graphics, IRender render, TableItems groups, ref float iHeight)
        {
            foreach (TableGroup tableGroup in groups)
            {
                tableGroup.SuspendEvents = true;

                tableGroup.SetRectangle(new RectangleF(0, iHeight, Width, GroupHeight));
                tableGroup.Render(graphics, render);
                iHeight += GroupHeight;

                tableGroup.SuspendEvents = false;

                //Render groups and rows recursively
                if (tableGroup.Groups.Count > 0 && tableGroup.Expanded)
                {
                    RenderTableGroups(graphics, render, tableGroup.Groups, ref iHeight);
                }
                if (tableGroup.Rows.Count > 0 && tableGroup.Expanded)
                {
                    RenderTableRows(graphics, render, tableGroup.Rows, ref iHeight);
                }
            }
        }
Beispiel #11
0
		public Table(Table prototype): base(prototype)
		{
			mHeadingHeight = prototype.HeadingHeight;
			mHeading = prototype.Heading;
			mSubHeading = prototype.SubHeading;
			mGroupHeight = prototype.GroupHeight;
			mRowHeight = prototype.RowHeight;
			mRowIndent = prototype.Indent;
			mExpanded = prototype.Expanded;
			mDrawExpand = prototype.DrawExpand;
			mForecolor = prototype.Forecolor;
			GradientColor = prototype.GradientColor;
			mDrawSelectedItem = prototype.DrawSelectedItem;
			mFont = prototype.Font;

			ContractedSize = prototype.ContractedSize;
			ExpandedSize = prototype.ExpandedSize;
			
			Groups = new TableItems(typeof(TableGroup));
			Rows = new TableItems(typeof(TableRow));

			Table.CopyGroups(prototype.Groups,Groups);
			Table.CopyRows(prototype.Rows,Rows);
		}
Beispiel #12
0
        public Table(Table prototype) : base(prototype)
        {
            mHeadingHeight    = prototype.HeadingHeight;
            mHeading          = prototype.Heading;
            mSubHeading       = prototype.SubHeading;
            mGroupHeight      = prototype.GroupHeight;
            mRowHeight        = prototype.RowHeight;
            mRowIndent        = prototype.Indent;
            mExpanded         = prototype.Expanded;
            mDrawExpand       = prototype.DrawExpand;
            mForecolor        = prototype.Forecolor;
            GradientColor     = prototype.GradientColor;
            mDrawSelectedItem = prototype.DrawSelectedItem;
            mFont             = prototype.Font;

            ContractedSize = prototype.ContractedSize;
            ExpandedSize   = prototype.ExpandedSize;

            Groups = new TableItems(typeof(TableGroup));
            Rows   = new TableItems(typeof(TableRow));

            Table.CopyGroups(prototype.Groups, Groups);
            Table.CopyRows(prototype.Rows, Rows);
        }
Beispiel #13
0
		private void RenderTableGroups(Graphics graphics, IRender render, TableItems groups,ref float iHeight)
		{
			foreach (TableGroup tableGroup in groups)
			{
				tableGroup.SuspendEvents = true;

				tableGroup.SetRectangle(new RectangleF(0, iHeight, Width, GroupHeight));
				tableGroup.Render(graphics,render);
				iHeight+=GroupHeight;

				tableGroup.SuspendEvents = false;

				//Render groups and rows recursively
				if (tableGroup.Groups.Count > 0 && tableGroup.Expanded) RenderTableGroups(graphics, render, tableGroup.Groups, ref iHeight);
				if (tableGroup.Rows.Count > 0 && tableGroup.Expanded) RenderTableRows(graphics, render, tableGroup.Rows, ref iHeight);
			}
		}
Beispiel #14
0
		//Copy all rows from source to target via clone
		public static void CopyGroups(TableItems source,TableItems target)
		{
			foreach (TableGroup group in source)
			{
				target.Add((TableGroup) group.Clone());
			}
		}
Beispiel #15
0
		//Copy all rows from source to target via clone
		public static void CopyRows(TableItems source,TableItems target)
		{
			foreach (TableRow row in source)
			{
				target.Add((TableRow) row.Clone());
			}
		}
		//Constructors
		public TableGroup()
		{
			Expanded = true;
			Rows = new TableItems(typeof(TableRow));
			Groups = new TableItems(typeof(TableGroup));
		}
Beispiel #17
0
		private TableItem GetGroupTableItem(TableItems groups, PointF local, ref float currentHeight)
		{
			//Check the groups and each rows collection inside groups
			foreach (TableGroup tableGroup in groups)
			{
				if (local.Y >= currentHeight && local.Y <= currentHeight + GroupHeight) return tableGroup;
				currentHeight += GroupHeight;

				if (tableGroup.Expanded)
				{
					TableItem item = GetGroupTableItem(tableGroup.Groups, local, ref currentHeight);
					if (item != null) return item;

					foreach (TableRow tableRow in tableGroup.Rows)
					{
						if (local.Y >= currentHeight && local.Y <= currentHeight + GroupHeight) return tableRow;
						currentHeight += RowHeight;
					}
				}
			}
			return null;
		}
Beispiel #18
0
		private void RenderTableRows(Graphics graphics, IRender render,TableItems rows,ref float iHeight)
		{
			foreach (TableRow tableRow in rows)
			{
				tableRow.SuspendEvents = true;

				tableRow.SetRectangle(new RectangleF(0,iHeight,Width,RowHeight));
				tableRow.Render(graphics,render);
				iHeight+=RowHeight;

				tableRow.SuspendEvents = false;
			}
		}
Beispiel #19
0
		private TableGroup GetTableGroupExpander(TableItems groups, PointF local)
		{
			foreach (TableGroup group in groups)
			{
				RectangleF expander = new RectangleF(group.Indent + 4, group.Rectangle.Top + 4, 11, 11);
				if (expander.Contains(local)) return group;

				//Sub groups
				TableGroup result = GetTableGroupExpander(group.Groups, local);
				if (result != null) return result;
			}

			return null;
		}
 //Constructors
 public TableGroup()
 {
     Expanded = true;
     Rows     = new TableItems(typeof(TableRow));
     Groups   = new TableItems(typeof(TableGroup));
 }