Esempio n. 1
0
        public void AddSubPage(BaseCfgPanel page)
        {
            string title = Translator.Translate(page.Title);

            page.Dock = DockStyle.Fill;

            OPMTabPage tp = new OPMTabPage(title, page);
            tp.Dock = DockStyle.Fill;
            tp.ImageIndex = tabSubPages.ImageList.Images.Count;
            tp.Tag = page.Title;
            tp.Name = page.Name;

            tabSubPages.ImageList.Images.Add(page.Image);
            tabSubPages.TabPages.Add(tp);

            page.ModifiedActive -= new EventHandler(OnModifiedActive);
            page.ModifiedActive += new EventHandler(OnModifiedActive);
        }
         void AddonSettingsPanel_HandleCreated(object sender, EventArgs e)
         {
             tabAddons.TabPages.Clear();
             tabAddons.ImageList.Images.Clear();

             if (InitAddonCfg != null)
             {
                 foreach (Delegate dlg in InitAddonCfg.GetInvocationList())
                 {
                     InitAddonCfgHandler callDlg = dlg as InitAddonCfgHandler;
                     if (callDlg != null)
                     {
                         BaseCfgPanel pageContents = callDlg();
                         if (pageContents != null)
                         {
                             string title = Translator.Translate(pageContents.Title);

                             pageContents.Dock = DockStyle.Fill;

                             OPMTabPage tp = new OPMTabPage(title, pageContents);
                             tp.Dock = DockStyle.Fill;
                             tp.ImageIndex = tabAddons.ImageList.Images.Count;
                             tp.Tag = pageContents.Title;

                             tabAddons.ImageList.Images.Add(pageContents.Image);
                             tabAddons.TabPages.Add(tp);

                             pageContents.ModifiedActive -= new EventHandler(OnModifiedActive);
                             pageContents.ModifiedActive += new EventHandler(OnModifiedActive);
                         }
                     }
                 }

                 if (tabAddons.TabPages.Count > 1)
                 {
                     tabAddons.SelectedIndex = 0;
                 }
             }
         }
Esempio n. 3
0
        public void OnUpdateMediaScreens()
        {
            // playlist -------------------
            MediaScreen mediaScreen = MediaScreen.Playlist;
            bool show = ((ProTONEConfig.ShowMediaScreens & mediaScreen) == mediaScreen);
            TabPage tp = GetPageContainingControl(PlaylistScreen);

            if (show == false && tp != null)
                TabPages.Remove(tp);
            else if (show == true && tp == null)
            {
                int idx = FindIndexForInsert(PlaylistScreen);

                OPMTabPage otp = new OPMTabPage("TXT_PLAYLIST", this.PlaylistScreen);
                otp.BackColor = Color.Red;

                if (idx >= TabPages.Count)
                    TabPages.Add(otp);
                else
                    TabPages.Insert(idx, otp);
            }
            
            // track info -------------------
            mediaScreen = MediaScreen.TrackInfo;
            show = ((ProTONEConfig.ShowMediaScreens & mediaScreen) == mediaScreen);
            tp = GetPageContainingControl(TrackInfoScreen);

            if (show == false && tp != null)
                TabPages.Remove(tp);
            else if (show == true && tp == null)
            {
                int idx = FindIndexForInsert(TrackInfoScreen);

                OPMTabPage otp = new OPMTabPage("TXT_TRACKINFO", this.TrackInfoScreen);
                if (idx >= TabPages.Count)
                    TabPages.Add(otp);
                else
                    base.TabPages.Insert(idx, otp);
            }

            // signal analisys -------------------
            mediaScreen = MediaScreen.SignalAnalisys;
            show = ((ProTONEConfig.ShowMediaScreens & mediaScreen) == mediaScreen);
            tp = GetPageContainingControl(SignalAnalysisScreen);

            if (show == false && tp != null)
                TabPages.Remove(tp);
            else if (show == true && tp == null)
            {
                int idx = FindIndexForInsert(SignalAnalysisScreen);

                OPMTabPage otp = new OPMTabPage("TXT_SIGNALANALYSIS", this.SignalAnalysisScreen);
                if (idx >= TabPages.Count)
                    TabPages.Add(otp);
                else
                    base.TabPages.Insert(idx, otp);
            }

            // bookmarks -------------------
            mediaScreen = MediaScreen.BookmarkInfo;
            show = ((ProTONEConfig.ShowMediaScreens & mediaScreen) == mediaScreen);
            tp = GetPageContainingControl(BookmarkScreen);

            if (show == false && tp != null)
                TabPages.Remove(tp);
            else if (show == true && tp == null)
            {
                int idx = FindIndexForInsert(BookmarkScreen);

                OPMTabPage otp = new OPMTabPage("TXT_BOOKMARKS", this.BookmarkScreen);
                if (idx >= TabPages.Count)
                    TabPages.Add(otp);
                else
                    base.TabPages.Insert(idx, otp);
            }

            Translator.TranslateControl(this, DesignMode);
        }
Esempio n. 4
0
        protected bool AddPanel(BaseCfgPanel panel, bool condition, bool alignRight)
        {
            if (condition)
            {
                if (panel != null)
                {
                    string title = Translator.Translate(panel.Title);
                    if (!tabOptions.TabPages.ContainsKey(title))
                    {
                        panel.Dock = DockStyle.Fill;
                        OPMTabPage tp = new OPMTabPage(title, panel);
                        tp.ImageIndex = tabOptions.ImageList.Images.Count;
                        tabOptions.ImageList.Images.Add(panel.Image);

                        tabOptions.TabPages.Add(tp);
                        return true;
                    }
                }
            }

            return false;
        }