Наследование: System.Windows.Forms.UserControl
Пример #1
0
 private void addScreenToMenu(ContextMenuStrip mnuStrip, ScreenBase screen, string title)
 {
     ToolStripMenuItem m = new ToolStripMenuItem(title);
     m.Tag = screen;
     m.Click += new EventHandler(mnuMoveItemScreen_Click);
     mnuStrip.Items.Add(m);
 }
Пример #2
0
        private void showScreen(ScreenBase screen)
        {
            //set the active usercontrol
            UserControl src = (UserControl)_currScreen;

            UserControl uc = screen as UserControl;
            if (uc != null)
            {
                //copy the properties
                uc.Location = src.Location;
                uc.Size = src.Size;
                uc.Anchor = src.Anchor;

                this.Controls.Add(uc);
                lblScreenMessage.Text = screen.TitleMessage();

                uc.Visible = true;
                uc.BringToFront();
                _currScreen = screen;
            }

            //remove any other screens
            UserControl c;
            for (int i = this.Controls.Count - 1; i >= 0; i--)
            {
                c = this.Controls[i] as UserControl;
                if ((uc == null || c != uc) && c is ScreenBase)
                    this.Controls.Remove(c);
            }

            btnMoveNext.Enabled = (_currScreen is ModsScreen || _currScreen is TrackSelectScreen || _currScreenIdx < _screens.Count - 1);
            btnMoveBack.Enabled = (_currScreen is TrackSelectScreen || _currScreenIdx > 0);
            btnMove.Enabled = (_currScreen is TrackEditScreen || _currScreen is NotesEditScreen || _currScreen is ProgressScreen);

            if (_currScreen != null)
            {
                _currScreen.Construct(_core.Project);
                _currScreen.Open();
            }

            Application.DoEvents();
        }
Пример #3
0
        private void btnMoveNext_Click(object sender, EventArgs e)
        {
            if (_currScreen == null)
                return;

            //prevent next bein pressed while already processing
            if (_processing)
                return;
            try
            {
                _processing = true;

                if (_currScreen.Close(false))
                {

                    if (_currScreen is ProjectScreen)
                    {
                        //create and init plugin screens
                        _modsScreen = (ScreenBase)(new ModsScreen());
                        _modsScreen.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                        _modsScreen.Construct(_core.Project);

                        showScreen(_modsScreen);
                    }
                    else if (_currScreen is ModsScreen)
                    {
                        //create and init plugin screens
                        _trackSelect = (ScreenBase)(new TrackSelectScreen());
                        _trackSelect.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                        _trackSelect.Construct(_core.Project);

                        showScreen(_trackSelect);
                    }
                    else if (_currScreen is TrackSelectScreen)
                    {
                        ScreenBase sb;
                        foreach (ProjectSong song in _core.Project.EditSongs)
                        {
                            sb = new TrackEditScreen();
                            sb.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                            sb.Construct(_core.Project);
                            ((TrackEditScreen)sb).SetSong(song);
                            sb.Tag = song;
                            _screens.Add(sb);

                            sb = new NotesEditScreen();
                            sb.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                            sb.Construct(_core.Project);
                            ((NotesEditScreen)sb).SetSong(song);
                            sb.Tag = song;
                            _screens.Add(sb);
                        }

                        _progressScreen = new ProgressScreen();
                        _progressScreen.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                        //not happy about this...
                        ((ProgressScreen)_progressScreen).AutoStartOnOpen = ((TrackSelectScreen)_trackSelect).AutoStartOnOpen;
                        _screens.Add(_progressScreen);

                        if (_screens.Count != 0)
                        {
                            //extractSongFiles();

                            _currScreenIdx = 0; //active...
                            showScreen(_screens[_currScreenIdx]);
                            btnMoveBack.Visible = true;
                        }
                    }
                    else
                    {
                        _currScreenIdx++;

                        if (_currScreenIdx < _screens.Count)
                            showScreen(_screens[_currScreenIdx]);
                        else
                        {
                            _currScreen = null;
                            showScreen(null);
                        }
                    }
                }
            }
            finally
            {
                _processing = false;
            }
        }
Пример #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (_exitApp)
            {
                this.Close();
            }
            else
            {
                this.Text = string.Format("{0} - v{1} / v{2}", TheGhostCore.AppName, TheGhostCore.AppVersion, TheGhostCore.CoreVersion);

                btnMoveBack.Enabled = false;
                btnMove.Enabled = false;
                _currScreen = (ScreenBase)projectScreen;
                projectScreen.PluginManager = _core.PluginManager;
                lblScreenMessage.Text = _currScreen.TitleMessage();
                ((UserControl)_currScreen).Visible = true;
                _currScreen.Construct(_core.Project);
                _currScreen.Open();
            }
        }
Пример #5
0
        private void btnMoveBack_Click(object sender, EventArgs e)
        {
            if (_currScreen == null)
                return;

            //prevent back bein pressed while already processing
            if (_processing)
                return;
            try
            {
                _processing = true;

                if (_currScreen is TrackSelectScreen)
                {
                    //create and init plugin screens
                    _modsScreen = (ScreenBase)(new ModsScreen());
                    _modsScreen.ScreenBusy += new ScreenBusyEventHandler(screen_ScreenBusy);
                    _modsScreen.Construct(_core.Project);

                    showScreen(_modsScreen);
                }
                else if (_currScreenIdx > 0)
                {
                    if (_currScreen.Close(false))
                    {
                        _currScreenIdx--;

                        if (_currScreenIdx < _screens.Count)
                            showScreen(_screens[_currScreenIdx]);
                        else
                        {
                            _currScreen = null;
                            showScreen(null);
                        }
                    }
                }
            }
            finally
            {
                _processing = false;
            }
        }