Exemplo n.º 1
0
        public MainForm(string[] args)
        {
            InitializeComponent();

            // Define the controller for the application
            m_Controller = new EditingController(this);

            string regkey = @"Software\Backsight\Editor\MRU";
            m_MruMenu = new MruStripMenuInline(mnuFile, mnuFileRecent, new MruStripMenu.ClickedHandler(OnMruFile), regkey, 10);

            // Hide property panel unless it's requested
            vSplitContainer.Panel2Collapsed = true;

            // Hide command panel unless a command is running
            hSplitContainer.Panel2Collapsed = true;

            // Can't seem to specify shortcut keys involving the "Enter" key at design time
            // ...leads to error starting up (something about invalid enum values)
            //mnuEditRepeat.ShortcutKeys = Keys.Enter;
            //mnuEditRecall.ShortcutKeys = Keys.Alt | Keys.Enter;

            // All user interface actions should be handled via the UserActionList technique.
            // Those that deal with map navigation get routed to the map control, the rest
            // will get routed to methods in this class.

            m_Actions = new UserActionList();
        }
Exemplo n.º 2
0
        public MainForm()
        {
            // Define the controller for the application
            m_Controller = new ViewController(this);

            InitializeComponent();

            // All user interface actions should be handled via the UserActionList technique.
            // Those that deal with map navigation get routed to the map control, the rest
            // will get routed to methods in this class.

            m_Actions = new UserActionList();

            // File menu...
            AddAction(fileOpenMenuItem, IsFileOpenEnabled, FileOpen);
            AddAction(fileExitMenuItem, IsFileExitEnabled, FileExit);

            // View menu...
            AddAction(mnuViewAutoSelect, null, AutoSelect);
            AddAction(DisplayToolId.Overview, new ToolStripItem[] { mnuViewOverview, ctxViewOverview });
            AddAction(DisplayToolId.ZoomIn, new ToolStripItem[] { mnuViewZoomIn, ctxViewZoomIn });
            AddAction(DisplayToolId.ZoomOut, new ToolStripItem[] { mnuViewZoomOut, ctxViewZoomOut });
            AddAction(DisplayToolId.ZoomRectangle, new ToolStripItem[] { mnuViewZoomRectangle, ctxViewZoomRectangle });
            AddAction(DisplayToolId.DrawScale, new ToolStripItem[] { mnuViewDrawScale, ctxViewDrawScale });
            AddAction(DisplayToolId.Magnify, new ToolStripItem[] { mnuViewMagnify, ctxViewMagnify });
            AddAction(DisplayToolId.NewCentre, new ToolStripItem[] { mnuViewNewCenter, ctxViewNewCenter });
            AddAction(DisplayToolId.Pan, new ToolStripItem[] { mnuViewPan, ctxViewPan });
            AddAction(DisplayToolId.Previous, new ToolStripItem[] { mnuViewPrevious, ctxViewPrevious });
            AddAction(DisplayToolId.Next, new ToolStripItem[] { mnuViewNext, ctxViewNext });
            AddAction(mnuViewStatusBar, IsViewStatusBarEnabled, ViewStatusBar);

            // Update UI in idle time
            Application.Idle += OnIdle;
        }