예제 #1
0
        public void SetDockItemPositions(Point[] DesiredPositions)
        {
            if (DesiredPositions == null)
            {
                return;
            }

            for (int i = 0; i < DesiredPositions.Length; i++)
            {
                BaseDockObjects.DockItemObject tempDockItem = (BaseDockObjects.DockItemObject)MainDockObjects[i];
                tempDockItem.Location = new Point(DesiredPositions[i].X, DesiredPositions[i].Y);
            }
        }
예제 #2
0
 public void CloseLevel(String Level)
 {
     for (int i = 0; i < MainDockObjects.Count; i++)
     {
         BaseDockObjects.DockItemObject tempDockItem = (BaseDockObjects.DockItemObject)MainDockObjects[i];
         if (tempDockItem.DockItemSectionName.StartsWith(Level))
         {
             tempDockItem.Close();
             MainDockObjects.RemoveAt(i);
             i--;
         }
     }
 }
예제 #3
0
        public void ShowLevel(String Level)
        {
            if (CurrentLevelShown != null)
            {
                CloseLevel(CurrentLevelShown);
            }
            CurrentLevelShown = Level;
            ChangeCentreImage(Level);

            String[]  AllSectionNames = DockItemSettings.GetSectionNames();
            ArrayList NewDockItems    = new ArrayList();

            for (int i = 0; i < AllSectionNames.Length; i++)
            {
                if (AllSectionNames[i].StartsWith(Level) && AllSectionNames[i].Substring(Level.Length, AllSectionNames[i].Length - Level.Length).Contains("-") == false)
                {
                    //Console.WriteLine("name: " + AllSectionNames[i]);
                    BaseDockObjects.DockItemObject NewDockItem = CreateDockItem(AllSectionNames[i], null);
                    NewDockItems.Add(NewDockItem);
                }
            }

            NewDockItemSizes = new Size[NewDockItems.Count];

            for (int i = 0; i < NewDockItems.Count; i++)
            {
                BaseDockObjects.DockItemObject tempDockItem = (BaseDockObjects.DockItemObject)NewDockItems[i];
                NewDockItemSizes[i] = tempDockItem.ObjectSize;
            }

            //Size tempBackgroundObjectSize = BackgroundObject.ObjectSize;
            //tempBackgroundObjectSize = new Size(NewDockItems.Count * DockSettings.DockItemSize.DefaultWidth / 2, NewDockItems.Count * DockSettings.DockItemSize.DefaultWidth / 2);
            //BackgroundObject.Hide();
            //BackgroundObject.SuspendLayout();
            //BackgroundObject.Location = new Point(SystemInformation.VirtualScreen.Right / 2 - tempBackgroundObjectSize.Width / 2,
            //    SystemInformation.VirtualScreen.Bottom / 2 - tempBackgroundObjectSize.Height / 2);
            //BackgroundObject.ResumeLayout();

            //BackgroundObject.DrawBitmapManaged(tempBackgroundObjectSize.Width, tempBackgroundObjectSize.Height, false, 0, 0, false, 0, 0, 0, 0);
            //BackgroundObject.Show();

            CalculatedPoints = CalculateDockItemPositions(NewDockItemSizes);

            for (int i = 0; i < NewDockItems.Count; i++)
            {
                BaseDockObjects.DockItemObject tempDockItem = (BaseDockObjects.DockItemObject)NewDockItems[i];
                tempDockItem.DrawBitmapManaged(NewDockItemSizes[i].Width, NewDockItemSizes[i].Height, true, CalculatedPoints[i].X, CalculatedPoints[i].Y, false, 0, 0, 0, 0, false, 0);
            }
        }
예제 #4
0
        public BaseDockObjects.DockItemObject CreateDockItem(String SectionName, String Path)
        {
            Size tempSize = new Size(DockSettings.DockItemSize.DefaultWidth, DockSettings.DockItemSize.DefaultHeight);

            BaseDockObjects.DockItemObject NewDockItem = new BaseDockObjects.DockItemObject(this, LanguageWords, DockSettings, DockItemSettings, SectionName, tempSize, Path);
            NewDockItem.Owner = CentreObject;

            //Size tempBackgroundObjectSize = BackgroundObject.ObjectSize;
            //NewDockItem.Location = new Point(BackgroundObject.Location.X + tempBackgroundObjectSize.Width / 2 - tempSize.Width / 2,
            //  BackgroundObject.Location.Y + tempBackgroundObjectSize.Height / 2 - tempSize.Height / 2);
            //NewDockItem.DrawBitmapManaged(tempSize.Width, tempSize.Height, false, 0, 0, 0, 0);

            MainDockObjects.Add(NewDockItem);
            return(NewDockItem);
        }
예제 #5
0
        public void RemoveDockItem(BaseDockObjects.DockItemObject ItemToRemove)
        {
            String ItemToRemoveSectionHeader = @ItemToRemove.DockItemSectionName + @"-";

            CloseLevel(@ItemToRemoveSectionHeader);
            MainDockObjects.Remove(ItemToRemove);
            ItemToRemove.Close();

            String[] AllSectionNames = DockItemSettings.GetSectionNames();

            for (int i = 0; i < AllSectionNames.Length; i++)
            {
                if (AllSectionNames[i].StartsWith(ItemToRemoveSectionHeader) &&
                    AllSectionNames[i].Substring(ItemToRemoveSectionHeader.Length, AllSectionNames[i].Length - ItemToRemoveSectionHeader.Length).Contains("-") == false)
                {
                    DockItemSettings.RemoveSection(AllSectionNames[i]);
                }
            }

            DockItemSettings.RemoveSection(ItemToRemoveSectionHeader.Substring(0, ItemToRemoveSectionHeader.Length - 1));

            ShowLevel(CurrentLevelShown);
        }
예제 #6
0
 public void ChildMoved(BaseDockObjects.DockItemObject ChildObject)
 {
 }