Example #1
0
        public void ShowAGroupOf3x3Items_OutterGroupIsHorizontal()
        {
            LayoutGroup outterGroup = new LayoutGroup(false, Styles.DefaultGroupStyle);
            LayoutGroup innerGroup0 = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutGroup innerGroup1 = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutGroup innerGroup2 = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutEntry item        = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 50
            };

            innerGroup0.Add(item.Clone());
            innerGroup0.Add(item.Clone());
            innerGroup0.Add(item.Clone());
            innerGroup1.Add(item.Clone());
            innerGroup1.Add(item.Clone());
            innerGroup1.Add(item.Clone());
            innerGroup2.Add(item.Clone());
            innerGroup2.Add(item.Clone());
            innerGroup2.Add(item.Clone());
            outterGroup.Add(innerGroup0);
            outterGroup.Add(innerGroup1);
            outterGroup.Add(innerGroup2);

            outterGroup.CalcWidth();
            outterGroup.CalcHeight();
            outterGroup.SetX(0);
            outterGroup.SetY(0);

            outterGroup.ShowResult();
        }
Example #2
0
        private void addViews(LayoutPanel pan1, CameraContainer activecam)
        {
            DockLayoutManager doc = new DockLayoutManager();

            pan1.Content = doc;
            LayoutGroup gr2 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal
            };

            doc.LayoutRoot = gr2;
            LayoutPanel settings = new LayoutPanel();

            settings.Content = activecam.settings;
            gr2.Add(settings);
            LayoutPanel prev = new LayoutPanel();

            prev.Content = activecam.preview;
            gr2.Add(prev);
            LayoutPanel hist = new LayoutPanel();

            hist.Content = activecam.hist;
            gr2.Add(hist);
            pan1.Caption = activecam.Name;   //panel contains preview
        }
Example #3
0
        void Create12CamView()
        {
            Groups.Clear();
            Groups.Orientation = Orientation.Horizontal;
            LayoutGroup top = new LayoutGroup()
            {
                ShowCaption = true, Caption = "camera1"
            };
            LayoutPanel pan1 = new LayoutPanel();

            top.Add(pan1);
            Groups.Add(top);
            List <CameraContainer> activecams = cams.Where(c => c.bActive == true).ToList();
            LayoutGroup            side       = new LayoutGroup()
            {
                Orientation = Orientation.Vertical
            };

            Groups.Add(side);
            LayoutGroup side2 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, ShowCaption = true, Caption = "DropTarget1"
            };

            side2.Add(new LayoutPanel());
            side.Add(side2);
            LayoutGroup side3 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, ShowCaption = true, Caption = "DropTarget2"
            };

            side3.Add(new LayoutPanel());
            side.Add(side3);
        }
Example #4
0
        public void ShowA3LayerGroup()
        {
            LayoutGroup group1 = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutGroup group2 = new LayoutGroup(false, Styles.DefaultGroupStyle);
            LayoutGroup group3 = new LayoutGroup(false, Styles.DefaultGroupStyle);
            LayoutGroup group4 = new LayoutGroup(false, Styles.DefaultGroupStyle);
            LayoutGroup group5 = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutEntry item1  = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 50
            };
            LayoutEntry item2 = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 80
            };
            LayoutEntry item3 = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 80, ContentHeight = 50
            };
            LayoutEntry item4 = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 400, ContentHeight = 50
            };

            group1.Add(group2);
            group1.Add(group3);
            group1.Add(group4);

            group2.Add(item1.Clone());
            group2.Add(item2.Clone());
            group2.Add(item3.Clone());

            group3.Add(item1.Clone());
            group3.Add(group5);
            group3.Add(item1.Clone());

            group4.Add(item4.Clone());

            group5.Add(item1.Clone());
            group5.Add(item2.Clone());
            group5.Add(item1.Clone());

            group1.CalcWidth();
            group1.CalcHeight();
            group1.SetX(0);
            group1.SetY(0);

            group1.ShowResult();
        }
Example #5
0
        DocumentPanel CreateNoteDocument(Note note)
        {
            DocumentPanel document = new DocumentPanel();

            document.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            document.VerticalScrollBarVisibility   = ScrollBarVisibility.Disabled;
            document.AllowFloat = false;
            document.AllowMove  = false;
            document.Name       = note.Caption;
            document.Caption    = note.Caption;

            Note.SetNote(document, note);
            LayoutGroup tabs = new LayoutGroup();

            tabs.Caption          = "Pages";
            tabs.ShowCaption      = true;
            tabs.GroupBorderStyle = GroupBorderStyle.Tabbed;
            tabs.CaptionLocation  = CaptionLocation.Bottom;
            tabs.AddRange(CreateNotePages(note));
            tabs.Add(CreateNewItemPage());
            LayoutGroup group = new LayoutGroup();

            group.Add(tabs);
            document.Content = group;
            return(document);
        }
Example #6
0
        public void LayoutControllerRequestLayoutParentNotNUll()
        {
            tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll START");

            var testingTarget = new LayoutController(Window.Instance);

            Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
            Assert.IsInstanceOf <LayoutController>(testingTarget, "Should be an instance of LayoutController type.");

            using (LayoutGroup group = new LayoutGroup())
            {
                using (LayoutItem layoutItem = new LayoutItem())
                {
                    group.Add(layoutItem);
                    try
                    {
                        testingTarget.RequestLayout(layoutItem);
                    }
                    catch (Exception e)
                    {
                        tlog.Debug(tag, e.Message.ToString());
                        Assert.Fail("Caught Exception : Failed!");
                    }
                }
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll END (OK)");
        }
Example #7
0
        void Create4CamView()
        {
            Groups.Clear();
            Groups.Orientation = Orientation.Vertical;
            LayoutGroup top = new LayoutGroup()
            {
            };

            Groups.Add(top);
            LayoutGroup topleft = new LayoutGroup()
            {
                ShowCaption = true, Caption = "camera1"
            };

            topleft.Add(new LayoutPanel());
            top.Add(topleft);
            LayoutGroup topRight = new LayoutGroup()
            {
                ShowCaption = true, Caption = "camera2"
            };

            topRight.Add(new LayoutPanel());
            top.Add(topRight);


            LayoutGroup bottom = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal
            };

            Groups.Add(bottom);
            LayoutGroup side2 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, ShowCaption = true
            };

            side2.Add(new LayoutPanel());
            bottom.Add(side2);
            LayoutGroup side3 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, ShowCaption = true, Caption = "DropTarget2"
            };

            side3.Add(new LayoutPanel());
            bottom.Add(side3);
            //         setDropstargets(activecams,4);
        }
Example #8
0
        public void ShowAVerticalGroupOf3Items()
        {
            LayoutGroup group = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutEntry item  = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 50
            };

            group.Add(item.Clone());
            group.Add(item.Clone());
            group.Add(item.Clone());

            group.CalcWidth();
            group.CalcHeight();
            group.SetX(0);
            group.SetY(0);

            group.ShowResult();
        }
Example #9
0
        public void TheSizeOfAVerticalGroupThatContainsMultipleEntriesIsCorrectlyCalculated()
        {
            LayoutGroup group = new LayoutGroup(true, Styles.DefaultGroupStyle);

            LayoutEntry[] items =
            {
                new LayoutEntry(Styles.DefaultEntryStyle)
                {
                    ContentWidth = 10, ContentHeight = 20
                },
                new LayoutEntry(Styles.DefaultEntryStyle)
                {
                    ContentWidth = 20, ContentHeight = 30
                },
                new LayoutEntry(Styles.DefaultEntryStyle)
                {
                    ContentWidth = 30, ContentHeight = 40
                },
                new LayoutEntry(Styles.DefaultEntryStyle)
                {
                    ContentWidth = 40, ContentHeight = 50
                },
                new LayoutEntry(Styles.DefaultEntryStyle)
                {
                    ContentWidth = 50, ContentHeight = 60
                },
            };
            foreach (var item in items)
            {
                group.Add(item);
            }

            group.CalcWidth();
            group.CalcHeight();

            var expectedWidth  = 0d;
            var expectedHeight = 0d;

            foreach (var item in items)
            {
                expectedWidth   = Math.Max(expectedWidth, item.Rect.Width);
                expectedHeight += item.Rect.Height + group.Style.CellingSpacingVertical;
            }
            expectedHeight -= group.Style.CellingSpacingVertical;
            expectedWidth  += group.Style.PaddingHorizontal + group.Style.BorderHorizontal;
            expectedHeight += group.Style.PaddingVertical + group.Style.BorderVertical;
            Assert.Equal(expectedWidth, group.Rect.Width);
            Assert.Equal(expectedHeight, group.Rect.Height);
        }
Example #10
0
        void Create2View(Orientation or, bool DropTarget)
        {
            Groups.Clear();
            Groups.Orientation = or;
            LayoutGroup Group1 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, Name = "Groups"
            };

            Groups.Add(Group1);
            LayoutPanel pan1 = new LayoutPanel();

            Group1.Add(pan1);

            LayoutGroup Group2 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal
            };

            Groups.Add(Group2);
            LayoutPanel pan2 = new LayoutPanel();

            Group1.Add(pan2);
        }
Example #11
0
        public void TheSizeOfAVerticalGroupThatContainsASingleEntryIsCorrectlyCalculated()
        {
            LayoutGroup group = new LayoutGroup(true, Styles.DefaultGroupStyle);
            LayoutEntry item  = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 50
            };

            group.Add(item);

            group.CalcWidth();
            group.CalcHeight();

            Assert.Equal(item.Rect.Width + group.Style.PaddingHorizontal + group.Style.BorderHorizontal, group.Rect.Width);
            Assert.Equal(item.Rect.Height + group.Style.PaddingVertical + group.Style.BorderVertical, group.Rect.Height);
        }
Example #12
0
        public void ShowAHorizontalGroupOf1Item()
        {
            LayoutGroup group = new LayoutGroup(false, Styles.DefaultGroupStyle);
            LayoutEntry item  = new LayoutEntry(Styles.DefaultEntryStyle)
            {
                ContentWidth = 50, ContentHeight = 50
            };

            group.Add(item);

            group.CalcWidth();
            group.CalcHeight();
            group.SetX(0);
            group.SetY(0);

            group.ShowResult();
        }
Example #13
0
        void CreateSingleView()
        {
            Groups = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, Name = "Groups"
            };
            docMan.LayoutRoot = Groups;
            LayoutGroup Group1 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal, Name = "Groups"
            };

            Groups.Add(Group1);
            LayoutPanel pan1 = new LayoutPanel();

            Group1.Add(pan1);
            //Group1.AllowDrop = true;
            //Group1.Drop += TargetPanel_Drop;
        }