Ejemplo n.º 1
0
 public override void Display(HistoryEntry current, HistoryList history)
 {
     foreach (UserControlContainerResizable r in uccrlist)
     {
         UserControlCommonBase uc = (UserControlCommonBase)r.control;
         uc.Display(current, history);
     }
 }
Ejemplo n.º 2
0
        private UserControlContainerResizable CreatePanel(UserControlCommonBase uccb, Point pos, Size size)
        {
            UserControlContainerResizable uccr = new UserControlContainerResizable();

            uccr.Init(uccb);
            uccr.ResizeStart        += ResizeStart;
            uccr.ResizeEnd          += ResizeEnd;
            uccr.BorderColor         = discoveryForm.theme.GridBorderLines;
            uccr.SelectedBorderColor = discoveryForm.theme.TextBlockHighlightColor;

            uccrlist.Add(uccr);

            int numopenedinside = uccrlist.Count(x => x.GetType().Equals(uccb.GetType()));    // how many others are there?

            int dnum = 1050 + displaynumber * 100 + numopenedinside;

            //System.Diagnostics.Debug.WriteLine("  Create " + uccb.GetType().Name + " " + dnum + " Assign THC " + ucursor_inuse.GetHashCode() );

            panelPlayfield.Controls.Add(uccr);

            uccb.Init(discoveryForm, ucursor_inuse, dnum);
            uccb.LoadLayout();

            uccr.Font = discoveryForm.theme.GetFont;        // Important. Apply font autoscaling to the user control
                                                            // ApplyToForm does not apply the font to the actual UC, only
                                                            // specific children controls.  The TabControl in the discoveryform ends up autoscaling most stuff
                                                            // the children directly attached to the discoveryform are not autoscaled

            discoveryForm.theme.ApplyToControls(uccr, discoveryForm.theme.GetFont);

            uccr.Location = pos;
            uccr.Size     = size;

            uccb.Display(discoveryForm.TravelControl.GetTravelHistoryCurrent, discoveryForm.history);

            if (uccb is UserControlTravelGrid)
            {
                (uccb as UserControlTravelGrid).ExtraIcons(true, false);
            }
            if (uccb is UserControlJournalGrid)
            {
                (uccb as UserControlJournalGrid).ExtraIcons(true, false);
            }

            return(uccr);
        }