Exemple #1
0
        /// <summary>
        /// Set the form up first time it is run
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            //The point is to emulate an OS, so make the window full screen
            WindowState = FormWindowState.Maximized;

            //Shift keyboard focus to the background
            Canvas.Root.DefaultInputManager.KeyboardFocus = Canvas.Camera.ToPickPath();

            //Set up event listeners
            Canvas.ZoomEventHandler.AcceptsEvent = delegate(PInputEventArgs e) { return(e.PickedNode is PCamera && e.IsMouseEvent && AcceptsMouseButton(MouseButtons.Right, e.Button)); };
            Canvas.PanEventHandler.AcceptsEvent  = delegate(PInputEventArgs e) { return(e.PickedNode is PCamera && e.IsMouseEvent && AcceptsMouseButton(MouseButtons.Left, e.Button)); };

            CommandHandler = new ShowInterfaceHandler(Canvas.Camera, new CommandInterface(Canvas.Camera));
            Canvas.Camera.AddInputEventListener(CommandHandler);

            FindHandler = new ShowInterfaceHandler(Canvas.Camera, new FindInterface(this));
            Canvas.Camera.AddInputEventListener(FindHandler);

            DocHandler = new DocCreateHandler(Canvas);
            Canvas.AddInputEventListener(DocHandler);

            //Generate sample documents
            GenerateDocs();
        }
Exemple #2
0
        /// <summary>
        /// Set the form up first time it is run
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            //The point is to emulate an OS, so make the window full screen
            WindowState = FormWindowState.Maximized;

            //Shift keyboard focus to the background
            Canvas.Root.DefaultInputManager.KeyboardFocus = Canvas.Camera.ToPickPath();

            //Set up event listeners
            Canvas.ZoomEventHandler.AcceptsEvent = delegate(PInputEventArgs e) { return e.PickedNode is PCamera && e.IsMouseEvent && AcceptsMouseButton(MouseButtons.Right, e.Button); };
            Canvas.PanEventHandler.AcceptsEvent = delegate(PInputEventArgs e) { return e.PickedNode is PCamera && e.IsMouseEvent && AcceptsMouseButton(MouseButtons.Left, e.Button); };

            CommandHandler = new ShowInterfaceHandler(Canvas.Camera, new CommandInterface(Canvas.Camera));
            Canvas.Camera.AddInputEventListener(CommandHandler);

            FindHandler = new ShowInterfaceHandler(Canvas.Camera, new FindInterface(this));
            Canvas.Camera.AddInputEventListener(FindHandler);

            DocHandler = new DocCreateHandler(Canvas);
            Canvas.AddInputEventListener(DocHandler);

            //Generate sample documents
            GenerateDocs();
        }