[commit] r2304 - trunk/GME/CSGUI
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Tue Aug 27 09:21:00 CDT 2013
Author: ksmyth
Date: Tue Aug 27 09:21:00 2013
New Revision: 2304
Log:
Welcome Screen: o triggers Open, n triggers New
Modified:
trunk/GME/CSGUI/WelcomeScreen.cs
Modified: trunk/GME/CSGUI/WelcomeScreen.cs
==============================================================================
--- trunk/GME/CSGUI/WelcomeScreen.cs Tue Aug 27 09:20:42 2013 (r2303)
+++ trunk/GME/CSGUI/WelcomeScreen.cs Tue Aug 27 09:21:00 2013 (r2304)
@@ -1,111 +1,121 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Runtime.InteropServices;
-
-namespace CSGUI
-{
-
- [ComVisible(false)]
- public partial class WelcomeScreen : Form
- {
-
- public string SelectedProject;
- public WelcomeScreen()
- {
- InitializeComponent();
- this.FormBorderStyle = FormBorderStyle.FixedSingle;
- }
- protected override bool ProcessMnemonic(char charCode)
- {
- if (charCode >= '1' && charCode < '1' + recents.Count)
- {
- this.SelectedProject = recents[charCode - '1'];
- Close();
- return true;
- }
- return false;
- }
-
- protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
- {
- if (keyData == Keys.Escape)
- this.Close();
- return base.ProcessCmdKey(ref msg, keyData);
- }
-
- List<string> recents;
- internal void ShowDialog(IWin32Window windowWrapper, List<string> recents)
- {
- this.recents = recents;
- int y = 20;
- foreach (string recent_ in recents)
- {
- string recent = recent_;
- LinkLabel recentLink = new System.Windows.Forms.LinkLabel();
- recentLink.Text = recent;
- recentLink.Location = new Point(7, y);
- recentLink.AutoSize = false;
- recentLink.AutoEllipsis = true;
- recentLink.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- recentLink.Size = new Size(grpRecents.Size.Width - 14, 20);
- recentLink.LinkClicked += delegate(object sender, LinkLabelLinkClickedEventArgs args)
- {
- this.SelectedProject = recent;
- this.Close();
- };
- grpRecents.Controls.Add(recentLink);
- y += 23;
- }
-
- this.btnOpen.Click += new EventHandler(delegate(object o, EventArgs args)
- {
- OpenFileDialog openFileDialog1 = new OpenFileDialog();
- //openFileDialog1.InitialDirectory =
- openFileDialog1.Filter = "GME project files (*.mga,*.xme,*.mgx)|*.mga; *.xme; *.mgx|MGA files|*.mga|GME XML files|*.xme; *.xml|All files (*.*)|*.*";
- openFileDialog1.RestoreDirectory = true;
- openFileDialog1.CheckFileExists = true;
-
- if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- this.SelectedProject = openFileDialog1.FileName;
- this.Close();
- }
- });
- this.btnNew.Click += new EventHandler(delegate(object o, EventArgs args)
- {
- this.SelectedProject = WelcomeScreenExp.sCREATE_SENTINEL;
- this.Close();
- });
- this.StartPosition = FormStartPosition.CenterParent;
- this.ShowInTaskbar = false;
- this.DragDrop += new DragEventHandler(delegate(object o, DragEventArgs de)
- {
- if (de.Data.GetDataPresent(DataFormats.FileDrop))
- {
- SelectedProject = (de.Data.GetData(DataFormats.FileDrop) as string[])[0];
- this.Close();
- }
- });
- this.DragEnter += new DragEventHandler(delegate(object o, DragEventArgs e)
- {
- if (e.Data.GetDataPresent(DataFormats.FileDrop))
- {
- string filename = (e.Data.GetData(DataFormats.FileDrop) as string[])[0];
- if (filename.EndsWith(".mga") || filename.EndsWith(".xme"))
- {
- e.Effect = DragDropEffects.Copy;
- return;
- }
- }
- e.Effect = DragDropEffects.None;
-
- });
- ShowDialog(windowWrapper);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+
+namespace CSGUI
+{
+
+ [ComVisible(false)]
+ public partial class WelcomeScreen : Form
+ {
+
+ public string SelectedProject;
+ public WelcomeScreen()
+ {
+ InitializeComponent();
+ this.FormBorderStyle = FormBorderStyle.FixedSingle;
+ }
+ protected override bool ProcessMnemonic(char charCode)
+ {
+ if (charCode >= '1' && charCode < '1' + recents.Count)
+ {
+ this.SelectedProject = recents[charCode - '1'];
+ Close();
+ return true;
+ }
+ if (charCode == 'o')
+ {
+ this.btnOpen.PerformClick();
+ return true;
+ }
+ if (charCode == 'n')
+ {
+ this.btnNew.PerformClick();
+ return true;
+ }
+ return false;
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if (keyData == Keys.Escape)
+ this.Close();
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ List<string> recents;
+ internal void ShowDialog(IWin32Window windowWrapper, List<string> recents)
+ {
+ this.recents = recents;
+ int y = 20;
+ foreach (string recent_ in recents)
+ {
+ string recent = recent_;
+ LinkLabel recentLink = new System.Windows.Forms.LinkLabel();
+ recentLink.Text = recent;
+ recentLink.Location = new Point(7, y);
+ recentLink.AutoSize = false;
+ recentLink.AutoEllipsis = true;
+ recentLink.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ recentLink.Size = new Size(grpRecents.Size.Width - 14, 20);
+ recentLink.LinkClicked += delegate(object sender, LinkLabelLinkClickedEventArgs args)
+ {
+ this.SelectedProject = recent;
+ this.Close();
+ };
+ grpRecents.Controls.Add(recentLink);
+ y += 23;
+ }
+
+ this.btnOpen.Click += new EventHandler(delegate(object o, EventArgs args)
+ {
+ OpenFileDialog openFileDialog1 = new OpenFileDialog();
+ //openFileDialog1.InitialDirectory =
+ openFileDialog1.Filter = "GME project files (*.mga,*.xme,*.mgx)|*.mga; *.xme; *.mgx|MGA files|*.mga|GME XML files|*.xme; *.xml|All files (*.*)|*.*";
+ openFileDialog1.RestoreDirectory = true;
+ openFileDialog1.CheckFileExists = true;
+
+ if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
+ {
+ this.SelectedProject = openFileDialog1.FileName;
+ this.Close();
+ }
+ });
+ this.btnNew.Click += new EventHandler(delegate(object o, EventArgs args)
+ {
+ this.SelectedProject = WelcomeScreenExp.sCREATE_SENTINEL;
+ this.Close();
+ });
+ this.StartPosition = FormStartPosition.CenterParent;
+ this.ShowInTaskbar = false;
+ this.DragDrop += new DragEventHandler(delegate(object o, DragEventArgs de)
+ {
+ if (de.Data.GetDataPresent(DataFormats.FileDrop))
+ {
+ SelectedProject = (de.Data.GetData(DataFormats.FileDrop) as string[])[0];
+ this.Close();
+ }
+ });
+ this.DragEnter += new DragEventHandler(delegate(object o, DragEventArgs e)
+ {
+ if (e.Data.GetDataPresent(DataFormats.FileDrop))
+ {
+ string filename = (e.Data.GetData(DataFormats.FileDrop) as string[])[0];
+ if (filename.EndsWith(".mga") || filename.EndsWith(".xme"))
+ {
+ e.Effect = DragDropEffects.Copy;
+ return;
+ }
+ }
+ e.Effect = DragDropEffects.None;
+
+ });
+ ShowDialog(windowWrapper);
+ }
+ }
+}
More information about the gme-commit
mailing list