public seemsForm() { InitializeComponent(); ToolStripManager.RenderMode = ToolStripManagerRenderMode.Professional; this.Load += seems_Load; this.Resize += seems_Resize; this.LocationChanged += seems_LocationChanged; seemsRegistryKey = Registry.CurrentUser.OpenSubKey( seemsRegistryLocation ); if( seemsRegistryKey != null ) seemsRegistryKey.Close(); recentFilesMenu = new MruStripMenu( recentFilesFileMenuItem, new MruStripMenu.ClickedHandler( recentFilesFileMenuItem_Click ), seemsRegistryLocation + "\\Recent File List", true ); browseToFileDialog = new OpenDataSourceDialog(); browseToFileDialog.InitialDirectory = "C:\\"; DockPanelManager.RenderMode = DockPanelRenderMode.VisualStyles; manager = new Manager(dockPanel); Manager.GraphFormGotFocus += new GraphFormGotFocusHandler(Manager_GraphFormGotFocus); Manager.LoadDataSourceProgress += new LoadDataSourceProgressEventHandler(Manager_LoadDataSourceProgress); }
public MainEditor() { //Initialize the WinForm InitializeComponent(); KeyPreview = true; _mruMenu = new MruStripMenu(mruList, OnMruClickedHandler, _mruRegKey + "\\MRU", 6); _loadedWorldspaceProject = null; // Register a handler for WorldspaceProjectLoaded that sets the Window's title. WorldspaceProjectLoaded += OnWorldSpaceProjectLoaded; glControl.KeyDown += HandleEventKeyDown; glControl.KeyUp += HandleEventKeyUp; glControl.MouseDown += HandleEventMouseDown; glControl.MouseMove += HandleEventMouseMove; glControl.MouseUp += HandleEventMouseUp; glControl.Resize += Display.Internal_EventResize; glControl.Load += (sender, args) => { // Hook Application Idle to force rendering while no events are happening. Application.Idle += HandleApplicationIdle; Console.WriteLine("glContro loaded!"); // Initialize our core once the glControl has been created as initalization // requires a glContext. _editorCore = new EditorCore(); }; // Hook the glControl's Paint function (which is called every frame thanks to above) glControl.Paint += (sender, args) => RenderFrame(); }
public seems( string[] args ) { InitializeComponent(); this.Load += seems_Load; this.Resize += seems_Resize; this.LocationChanged += seems_LocationChanged; seemsRegistryKey = Registry.CurrentUser.OpenSubKey( seemsRegistryLocation ); if( seemsRegistryKey != null ) seemsRegistryKey.Close(); recentFilesMenu = new MruStripMenu( recentFilesFileMenuItem, new MruStripMenu.ClickedHandler( recentFilesFileMenuItem_Click ), seemsRegistryLocation + "\\Recent File List", true ); dockPanel.DocumentStyle = DigitalRune.Windows.Docking.DocumentStyle.DockingMdi; browseToFileDialog = new OpenFileDialog(); browseToFileDialog.Filter = "Any spectra format (*.mzML;*.mzData;*.mzXML;*.xml;*.raw;*.wiff;*.mgf;*.dta;fid;*.baf;*.yep)|*.mzML;*.mzData;*.mzXML;*.xml;*.raw;*.wiff;*.mgf;*.dta;fid;*.baf;*.yep|" + "mzML (*.mzML;*.xml)|*.mzML;*.xml|" + "mzData (*.mzData;*.xml)|*.mzData;*.xml|" + "mzXML (*.mzXML;*.xml)|*.mzXML;*.xml|" + "RAW (*.RAW)|*.raw|" + "WIFF (*.WIFF)|*.wiff|" + "Bruker (fid;*.baf;*.yep)|fid;*.baf;*.yep|" + "MGF (*.mgf)|*.mgf|" + "DTA (*.dta)|*.dta"; browseToFileDialog.FilterIndex = 0; browseToFileDialog.InitialDirectory = "C:\\"; manager = new Manager(this); if( args.Length > 0 ) { this.BringToFront(); this.Focus(); this.Activate(); this.Show(); Application.DoEvents(); try { openFile( args[0] ); if( args.Length > 1 ) { try { //browserForm.ElementNumberComboBox.SelectedIndex = Convert.ToInt32( args[1] ); } catch { } } } catch( Exception ex ) { string message = ex.Message; if( ex.InnerException != null ) message += "\n\nAdditional information: " + ex.InnerException.Message; MessageBox.Show( message, "Error recovering from crash", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0, false ); } } }
/// <summary> /// Ctor /// </summary> public MainForm() { InitializeComponent(); //Init Scintilla Component m_scintillaCtrl = new Scintilla(); m_scintillaCtrl.Parent = panelTextEditor; m_scintillaCtrl.Dock = DockStyle.Fill; m_scintillaCtrl.Margins[0].Width = 16; m_scintillaCtrl.TabWidth = 2; // Configuring the default style with properties // we have common to every lexer style saves time. m_scintillaCtrl.StyleResetDefault(); m_scintillaCtrl.Styles[Style.Default].Font = "Consolas"; m_scintillaCtrl.Styles[Style.Default].Size = 10; m_scintillaCtrl.Styles[Style.Default].BackColor = Color.FromArgb(219, 227, 227); m_scintillaCtrl.StyleClearAll(); // Configure the lexer styles m_scintillaCtrl.Styles[Style.Cpp.Default].ForeColor = Color.Silver; m_scintillaCtrl.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green m_scintillaCtrl.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green m_scintillaCtrl.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray m_scintillaCtrl.Styles[Style.Cpp.Number].ForeColor = Color.Olive; m_scintillaCtrl.Styles[Style.Cpp.Word].ForeColor = Color.Blue; m_scintillaCtrl.Styles[Style.Cpp.Word2].ForeColor = Color.Blue; m_scintillaCtrl.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red m_scintillaCtrl.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red m_scintillaCtrl.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red m_scintillaCtrl.Styles[Style.Cpp.StringEol].BackColor = Color.Pink; m_scintillaCtrl.Styles[Style.Cpp.Operator].ForeColor = Color.Purple; m_scintillaCtrl.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon; m_scintillaCtrl.Lexer = Lexer.Cpp; //Create keywords for HLSL StringBuilder sb = new StringBuilder(); var map = new EnumMap<ShaderToken>(); map.Load("HLSLKeywords.map"); foreach (var kw in map) { var str = kw.Key + " "; if (str[0] == ':') str = str.Substring(1); sb.Append(str); } m_scintillaCtrl.SetKeywords(0, sb.ToString()); //MRU mruMenu = new MruStripMenuInline(fileToolStripMenuItem, recentFilesToolStripMenuItem, new MruStripMenu.ClickedHandler(OnMruFile), mruRegKey + "\\MRU", 16); mruMenu.LoadFromRegistry(); }