public CurationForm()
 {
     flashpointPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
     InitializeComponent();
     treeView.AllowDrop              = true;
     treeView.DragEnter             += TreeView_DragEnter;
     treeView.DragDrop              += TreeView_DragDrop;
     logoPictureBox.Paint           += LogoPictureBox_Paint;
     logoPictureBox.DragEnter       += LogoPictureBox_DragEnter;
     logoPictureBox.AllowDrop        = true;
     logoPictureBox.DragDrop        += LogoPictureBox_DragDrop;
     screenshotPictureBox.Paint     += ScreenshotPictureBox_Paint;
     screenshotPictureBox.DragEnter += ScreenshotPictureBox_DragEnter;
     screenshotPictureBox.AllowDrop  = true;
     screenshotPictureBox.DragDrop  += ScreenshotPictureBox_DragDrop;
     profileComboBox.Items.AddRange(ProfileEditorForm.LoadProfiles());
     genreComboBox.Items.AddRange(Curation.Genres);
     genreComboBox.SelectedIndex = 0;
     playModeComboBox.Items.AddRange(Curation.Modes);
     playModeComboBox.SelectedIndex = 0;
     statusComboBox.Items.AddRange(Curation.Statuses);
     statusComboBox.SelectedIndex = 0;
     treeView.MouseDown          += TreeView_MouseDown;
     treeView.AfterExpand        += TreeView_AfterExpand;
     treeView.AfterCollapse      += TreeView_AfterCollapse;
     Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
 }
        private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ProfileEditorForm(flashpointPath).ShowDialog();

            // Reload profiles
            profileComboBox.Items.Clear();
            profileComboBox.Items.AddRange(ProfileEditorForm.LoadProfiles());
        }
Пример #3
0
        public CurationForm()
        {
            flashpointPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            InitializeComponent();
            treeView.AllowDrop              = true;
            treeView.DragEnter             += TreeView_DragEnter;
            treeView.DragDrop              += TreeView_DragDrop;
            logoPictureBox.Paint           += LogoPictureBox_Paint;
            logoPictureBox.DragEnter       += LogoPictureBox_DragEnter;
            logoPictureBox.AllowDrop        = true;
            logoPictureBox.DragDrop        += LogoPictureBox_DragDrop;
            screenshotPictureBox.Paint     += ScreenshotPictureBox_Paint;
            screenshotPictureBox.DragEnter += ScreenshotPictureBox_DragEnter;
            screenshotPictureBox.AllowDrop  = true;
            screenshotPictureBox.DragDrop  += ScreenshotPictureBox_DragDrop;
            profileComboBox.Items.AddRange(ProfileEditorForm.LoadProfiles());
            genreComboBox.Items.AddRange(Curation.Genres);
            playModeComboBox.Items.AddRange(Curation.Modes);
            statusComboBox.Items.AddRange(Curation.Statuses);
            treeView.MouseDown     += TreeView_MouseDown;
            treeView.AfterExpand   += TreeView_AfterExpand;
            treeView.AfterCollapse += TreeView_AfterCollapse;
            Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            SetImage SetL  = SetLogo;
            SetImage SetSS = SetScreenshot;

            //Create instructions and Browse/Capture/Remove/Crop buttons for logo PictureBox
            Label logoinstructions = new Label();

            logoinstructions.TextAlign = ContentAlignment.MiddleCenter;
            logoinstructions.AutoSize  = true;
            logoinstructions.Text      = "Drag and drop an image here, or...";
            logoPictureBox.Controls.Add(logoinstructions);
            logoinstructions.Location = new Point((logoPictureBox.Width / 2) - (logoinstructions.Width / 2), (logoPictureBox.Height / 2) - (logoinstructions.Height / 2) - 15);

            Button logocapturebutton = new Button();

            logocapturebutton.Text = "Capture";
            logoPictureBox.Controls.Add(logocapturebutton);
            logocapturebutton.Click   += (sender, e) => { CaptureWindow(SetL); };
            logocapturebutton.Location = new Point((logoPictureBox.Width / 2) - logocapturebutton.Width - 5, (logoPictureBox.Height / 2) - (logocapturebutton.Height / 2) + 10);

            Button logobrowsebutton = new Button();

            logobrowsebutton.Text = "Browse...";
            logoPictureBox.Controls.Add(logobrowsebutton);
            logobrowsebutton.Click   += (sender, e) => { BrowseForImage(SetL); };
            logobrowsebutton.Location = new Point((logoPictureBox.Width / 2) + 5, (logoPictureBox.Height / 2) - (logobrowsebutton.Height / 2) + 10);

            Button logoremovebutton = new Button();

            logoremovebutton.Text      = "X";
            logoremovebutton.Name      = "logoremovebutton";
            logoremovebutton.Visible   = false;
            logoremovebutton.Width     = 26;
            logoremovebutton.BackColor = Color.PaleVioletRed;
            logoremovebutton.ForeColor = Color.White;
            logoremovebutton.Font      = new Font(logoremovebutton.Font, FontStyle.Bold);
            logoPictureBox.Controls.Add(logoremovebutton);
            logoremovebutton.Click   += (sender, e) => { SetLogo(null); };
            logoremovebutton.Location = new Point(logoPictureBox.Width - logoremovebutton.Width - 5, 5);

            //Button logocropbutton = new Button();
            //logocropbutton.Text = "Crop";
            //logocropbutton.Name = "logocropbutton";
            //logocropbutton.Visible = false;
            //logoPictureBox.Controls.Add(logocropbutton);
            //logocropbutton.Location = new Point((logoPictureBox.Width / 2) - (logocropbutton.Width / 2), logoPictureBox.Height - logocropbutton.Height - 8);

            //Create instructions and Browse/Capture/Remove buttons for screenshot PictureBox
            Label screenshotinstructions = new Label();

            screenshotinstructions.TextAlign = ContentAlignment.MiddleCenter;
            screenshotinstructions.AutoSize  = true;
            screenshotinstructions.Text      = "Drag and drop an image here, or...";
            screenshotPictureBox.Controls.Add(screenshotinstructions);
            screenshotinstructions.Location = new Point((screenshotPictureBox.Width / 2) - (screenshotinstructions.Width / 2), (screenshotPictureBox.Height / 2) - (screenshotinstructions.Height / 2) - 15);

            Button screenshotcapturebutton = new Button();

            screenshotcapturebutton.Text = "Capture";
            screenshotPictureBox.Controls.Add(screenshotcapturebutton);
            screenshotcapturebutton.Click   += (sender, e) => { CaptureWindow(SetSS); };
            screenshotcapturebutton.Location = new Point((screenshotPictureBox.Width / 2) - screenshotcapturebutton.Width - 5, (screenshotPictureBox.Height / 2) - (screenshotcapturebutton.Height / 2) + 10);

            Button screenshotbrowsebutton = new Button();

            screenshotbrowsebutton.Text = "Browse...";
            screenshotPictureBox.Controls.Add(screenshotbrowsebutton);
            screenshotbrowsebutton.Click   += (sender, e) => { BrowseForImage(SetSS); };
            screenshotbrowsebutton.Location = new Point((screenshotPictureBox.Width / 2) + 5, (screenshotPictureBox.Height / 2) - (screenshotbrowsebutton.Height / 2) + 10);

            Button screenshotremovebutton = new Button();

            screenshotremovebutton.Text      = "X";
            screenshotremovebutton.Name      = "screenshotremovebutton";
            screenshotremovebutton.Visible   = false;
            screenshotremovebutton.Width     = 26;
            screenshotremovebutton.BackColor = Color.PaleVioletRed;
            screenshotremovebutton.ForeColor = Color.White;
            screenshotremovebutton.Font      = new Font(screenshotremovebutton.Font, FontStyle.Bold);
            screenshotPictureBox.Controls.Add(screenshotremovebutton);
            screenshotremovebutton.Click   += (sender, e) => { SetScreenshot(null); };
            screenshotremovebutton.Location = new Point(screenshotPictureBox.Width - screenshotremovebutton.Width - 5, 5);

            //Create swap button
            Button swapbutton = new Button();

            swapbutton.Text    = "<- Swap ->";
            swapbutton.Visible = false;
            swapbutton.Name    = "swapbutton";
            this.Controls.Add(swapbutton);
            swapbutton.Click   += (sender, e) => { SwapPictures(); };
            swapbutton.Location = new Point(tableLayoutPanel2.Location.X + (tableLayoutPanel2.Width / 2) - (swapbutton.Width / 2), tableLayoutPanel2.Location.Y + tableLayoutPanel2.Height - 10);
            swapbutton.BringToFront();
        }