Exemplo n.º 1
0
        private void AddPages()
        {
            pnlButtons.Controls.Clear();

            int nextLeft = 0;

            for (int i = 0; i < m_PrefPages.Count; i++)
            {
                IPreferencePanel page = m_PrefPages[i] as IPreferencePanel;
                if (page != null)
                {
                    // Button
                    PreferencePanelButtton ppb = new PreferencePanelButtton(page);
                    ppb.Click += new EventHandler(preferencePanelButton_Click);

                    ppb.Left  = nextLeft;
                    nextLeft += ppb.Width;

                    pnlButtons.Controls.Add(ppb);
                    m_PrefsButtons.Add(ppb);

                    // Page
                    page.Location = new Point(14, this.pnlButtons.Bottom + 14);
                    page.Visible  = false;
                    this.Controls.Add((UserControl)page);
                }
            }
        }
Exemplo n.º 2
0
 private void LoadPage(PreferencePanelButtton _button)
 {
     foreach (IPreferencePanel prefPanel in m_PrefPages)
     {
         prefPanel.Visible = (prefPanel == _button.PreferencePanel);
     }
 }
Exemplo n.º 3
0
        private void LoadPage(PreferencePanelButtton button)
        {
            for (int i = 0; i < pages.Count; i++)
            {
                if (button.PreferencePanel == pages[i])
                {
                    PreferencesManager.GeneralPreferences.PreferencePage = i;
                }

                pages[i].Visible = (pages[i] == button.PreferencePanel);
            }
        }
Exemplo n.º 4
0
        private void preferencePanelButton_Click(object sender, EventArgs e)
        {
            // A preference page button has been clicked.
            // Activate the button and load the page.
            PreferencePanelButtton selectedButton = sender as PreferencePanelButtton;

            if (selectedButton != null)
            {
                foreach (PreferencePanelButtton pageButton in m_PrefsButtons)
                {
                    pageButton.SetSelected(pageButton == selectedButton);
                }

                LoadPage(selectedButton);
            }
        }