示例#1
0
        internal MiniPadForm(PPTcontrol inputController)
        {
            InitializeComponent();

            pptController = inputController;


            minioverlay = new InkOverlay(this.Handle);

            ClearAppGestures(minioverlay);
            minioverlay.CollectionMode = CollectionMode.InkAndGesture;
            minioverlay.Gesture       += new InkCollectorGestureEventHandler(mo_Gesture);
            minioverlay.SystemGesture += new InkCollectorSystemGestureEventHandler(mo_SystemGesture);

            // make it recognize EVERYTHING
            minioverlay.SetGestureStatus(ApplicationGesture.AllGestures, true);

            //list of gestures
            // arrow x4, check, chevronx4 , circle, curlique

            minioverlay.Enabled = true;

            minipenpanel          = new PenInputPanel(xInput);
            minipenpanel.AutoShow = true;
        }// end miniPadForm constructor
示例#2
0
        }         // end OnAddinsUpdate method

        /// <summary>
        ///      Implements the OnStartupComplete method of the IDTExtensibility2 interface.
        ///      Receives notification that the host application has completed loading.
        /// </summary>
        /// <param term='custom'>
        ///      Array of parameters that are host application specific.
        /// </param>
        /// <seealso class='IDTExtensibility2' />
        public void OnStartupComplete(ref System.Array custom)
        {
            System.Windows.Forms.MessageBox.Show("Welcome to PowerPoint");

            pptController = new PPTcontrol(applicationObject);

            CommandBars oCommandBars;
            CommandBar  oStandardBar;

            oCommandBars = (CommandBars)applicationObject.GetType().InvokeMember("CommandBars", BindingFlags.GetProperty,
                                                                                 null, applicationObject, null);

            oStandardBar = oCommandBars["Standard"];

            // tutorial says this block is for "in case the button was not deleted, use the exiting one"
            try
            {
                ActivationButton = (CommandBarButton)oStandardBar.Controls["PowerPoint MiniPad"];
                // This exception seems to get thrown an awful lot
                // Seems like bad practice, but I'm still not entirely sure what it's being used for
            }
            catch (Exception)
            {
                // System.Windows.Forms.MessageBox.Show("An exception was thrown making the button.");

                object omissing = System.Reflection.Missing.Value;
                ActivationButton = (CommandBarButton)oStandardBar.Controls.Add(1, omissing, omissing, omissing, omissing);

                ActivationButton.Caption = "MiniPad";
                ActivationButton.Style   = MsoButtonStyle.msoButtonIcon;
                ActivationButton.FaceId  = 59;
            } // end stupid exception

            /* aside: catalogue of FaceID's:
             * 59 = smiley face! use this one please :-)
             * 58 = x_2
             * 57 = x^2
             * 52 = pig
             *  53 - 56 = assorted distance apart horizontal lines?
             */

            ActivationButton.Visible = true;
            ActivationButton.Click  += new _CommandBarButtonEvents_ClickEventHandler(ActivationButton_Click);
            oStandardBar             = null;
            oCommandBars             = null;
        } // end OnStartupComplete method