Ejemplo n.º 1
0
		/// <summary>
		/// Create the form
		/// </summary>
		public NoteApp()
		{
			// Adding a menu for the application
			System.Windows.Forms.MainMenu menu = new MainMenu();
			menu.MenuItems.Add("File", new MenuItem[] 
				{
					new MenuItem("New", new EventHandler(File_New), Shortcut.CtrlN),
					new MenuItem("Open...", new EventHandler(File_Open), Shortcut.CtrlO),
					new MenuItem("Import...", new EventHandler(File_Import)),
					new MenuItem("-"),
					new MenuItem("Save", new EventHandler(File_Save), Shortcut.CtrlS),
					new MenuItem("Save as...", new EventHandler(File_SaveAs)),
					new MenuItem("-"),
					new MenuItem("Print...", new EventHandler(File_Print), Shortcut.CtrlP),
					new MenuItem("Print Preview 1", new EventHandler(File_PrintPreview1)),
					new MenuItem("Print Preview 2", new EventHandler(File_PrintPreview2)),
					new MenuItem("-"),
					new MenuItem("Exit", new EventHandler(File_Exit))
				});
			menu.MenuItems.Add("Edit", new MenuItem[] 
				{
					new MenuItem("Undo", new EventHandler(Edit_Undo), Shortcut.CtrlZ),
					new MenuItem("Redo", new EventHandler(Edit_Redo), Shortcut.CtrlY),
					new MenuItem("-"),
					new MenuItem("Cut", new EventHandler(Edit_Cut), Shortcut.CtrlX),
					new MenuItem("Copy", new EventHandler(Edit_Copy), Shortcut.CtrlC),
					new MenuItem("Copy as Text...", new EventHandler(Edit_CopyAsText)),
					new MenuItem("Paste", new EventHandler(Edit_Paste), Shortcut.CtrlV),
					new MenuItem("Delete", new EventHandler(Edit_Delete), Shortcut.Del),
					new MenuItem("-"),
					new MenuItem("Find...", new EventHandler(Edit_Find), Shortcut.CtrlF),
					new MenuItem("Find Next", new EventHandler(Edit_FindNext), Shortcut.F3),
					new MenuItem("-"),
					new MenuItem("Format Ink...", new EventHandler(Edit_FormatInk))
				});
			menu.MenuItems[1].Popup += new EventHandler(EditMenu_Popup);
			menu.MenuItems.Add("Paper", new MenuItem[] 
				{
					new MenuItem("Blank", new EventHandler(Paper_Blank)),
					new MenuItem("-"),
					new MenuItem("Narrow", new EventHandler(Paper_Narrow)),
					new MenuItem("College", new EventHandler(Paper_College)),
					new MenuItem("Standard", new EventHandler(Paper_Standard)),
					new MenuItem("Wide", new EventHandler(Paper_Wide)),
					new MenuItem("-"),
					new MenuItem("Small Grid", new EventHandler(Paper_SmallGrid)),
					new MenuItem("Grid", new EventHandler(Paper_Grid))
				});
			menu.MenuItems.Add("Help", new MenuItem[] 
				{
					new MenuItem("About Agilix InfiNotes...", new EventHandler(Help_About))
				});

			// Create a NoteBox and assign to the form
			fNoteBox = new Agilix.Ink.Note.NoteBox();
			fNoteBox.Dock = DockStyle.Fill;
			fNoteBox.Document.Stationery = Stationery.CreateStockStationeryWithTitle(StationeryStockType.Standard, 19050);

			// Set some default form variables
			this.Icon = new Icon(typeof(NoteApp), "App.ico");
			this.Menu = menu;
			this.Controls.Add(fNoteBox);
			this.Width = 735;
			this.Height = 700;
			this.Text = TITLE;
			this.Load += new EventHandler(Application_Load);
			this.Closing += new System.ComponentModel.CancelEventHandler(Application_Closing);

			NewFileName();
			fNoteBox.Modified = false;
		}
Ejemplo n.º 2
0
        /// <summary>
        /// Create the form
        /// </summary>
        public NoteApp()
        {
            // Adding a menu for the application
            System.Windows.Forms.MainMenu menu = new MainMenu();
            menu.MenuItems.Add("File", new MenuItem[]
            {
                new MenuItem("New", new EventHandler(File_New), Shortcut.CtrlN),
                new MenuItem("Open...", new EventHandler(File_Open), Shortcut.CtrlO),
                new MenuItem("Import...", new EventHandler(File_Import)),
                new MenuItem("-"),
                new MenuItem("Save", new EventHandler(File_Save), Shortcut.CtrlS),
                new MenuItem("Save as...", new EventHandler(File_SaveAs)),
                new MenuItem("-"),
                new MenuItem("Print...", new EventHandler(File_Print), Shortcut.CtrlP),
                new MenuItem("Print Preview 1", new EventHandler(File_PrintPreview1)),
                new MenuItem("Print Preview 2", new EventHandler(File_PrintPreview2)),
                new MenuItem("-"),
                new MenuItem("Exit", new EventHandler(File_Exit))
            });
            menu.MenuItems.Add("Edit", new MenuItem[]
            {
                new MenuItem("Undo", new EventHandler(Edit_Undo), Shortcut.CtrlZ),
                new MenuItem("Redo", new EventHandler(Edit_Redo), Shortcut.CtrlY),
                new MenuItem("-"),
                new MenuItem("Cut", new EventHandler(Edit_Cut), Shortcut.CtrlX),
                new MenuItem("Copy", new EventHandler(Edit_Copy), Shortcut.CtrlC),
                new MenuItem("Copy as Text...", new EventHandler(Edit_CopyAsText)),
                new MenuItem("Paste", new EventHandler(Edit_Paste), Shortcut.CtrlV),
                new MenuItem("Delete", new EventHandler(Edit_Delete), Shortcut.Del),
                new MenuItem("-"),
                new MenuItem("Find...", new EventHandler(Edit_Find), Shortcut.CtrlF),
                new MenuItem("Find Next", new EventHandler(Edit_FindNext), Shortcut.F3),
                new MenuItem("-"),
                new MenuItem("Format Ink...", new EventHandler(Edit_FormatInk))
            });
            menu.MenuItems[1].Popup += new EventHandler(EditMenu_Popup);
            menu.MenuItems.Add("Paper", new MenuItem[]
            {
                new MenuItem("Blank", new EventHandler(Paper_Blank)),
                new MenuItem("-"),
                new MenuItem("Narrow", new EventHandler(Paper_Narrow)),
                new MenuItem("College", new EventHandler(Paper_College)),
                new MenuItem("Standard", new EventHandler(Paper_Standard)),
                new MenuItem("Wide", new EventHandler(Paper_Wide)),
                new MenuItem("-"),
                new MenuItem("Small Grid", new EventHandler(Paper_SmallGrid)),
                new MenuItem("Grid", new EventHandler(Paper_Grid))
            });
            menu.MenuItems.Add("Help", new MenuItem[]
            {
                new MenuItem("About Agilix InfiNotes...", new EventHandler(Help_About))
            });

            // Create a NoteBox and assign to the form
            fNoteBox      = new Agilix.Ink.Note.NoteBox();
            fNoteBox.Dock = DockStyle.Fill;
            fNoteBox.Document.Stationery = Stationery.CreateStockStationeryWithTitle(StationeryStockType.Standard, 19050);

            // Set some default form variables
            this.Icon = new Icon(typeof(NoteApp), "App.ico");
            this.Menu = menu;
            this.Controls.Add(fNoteBox);
            this.Width    = 735;
            this.Height   = 700;
            this.Text     = TITLE;
            this.Load    += new EventHandler(Application_Load);
            this.Closing += new System.ComponentModel.CancelEventHandler(Application_Closing);

            NewFileName();
            fNoteBox.Modified = false;
        }