Exemple #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public SketchJournalMainForm()
        {
            InitializeComponent();

            // Initialize and add InkPicture to form
            toolStripContainer1.ContentPanel.SuspendLayout();
            sketchPanel      = new SketchPanel();
            sketchPanel.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(sketchPanel);
            toolStripContainer1.ContentPanel.ResumeLayout();

            // Attach a (demo) recognizer
            //recognizer = new TimeoutRecognizer();
            recognizer = new GateRecognizer();
            //recognizer = new PartialGateRecognizer();
            recognizer.SubscribeToPanel(sketchPanel);
            sketchPanel.ResultReceived += new RecognitionResultReceivedHandler(sketchPanel_ResultReceived);

            // Add and configure feedback
            circuitColorFeedback = new ColorFeedback(sketchPanel, FilenameConstants.DefaultCircuitDomainFilePath);

            // Set up selection clearing callback for toolbar
            // FOR ALL NEW TOOLS, should add
            lassoMenuButton.CheckedChanged       += new EventHandler(lassoMenuButton_CheckedChanged);
            lassoSortedMenuButton.CheckedChanged += new EventHandler(lassoSortedMenuButton_CheckedChanged);
            lassoRegroupButton.CheckedChanged    += new EventHandler(lassoRegroupButton_CheckedChanged);
            retraceButton.CheckedChanged         += new EventHandler(retraceButton_CheckedChanged);


            // Set up correction tool
            commandManager      = new CommandManagement.CommandManager();
            lassoMenuStaticTool = new LassoMenuStaticTool(commandManager);
            lassoSortedMenuTool = new LassoMenuStaticTool(commandManager); // Same type as static for now
            lassoRegroupTool    = new LassoRegroupTool(commandManager);
        }
        public SelectionManager(ref CommandManagement.CommandManager commandManager, ref SketchPanel SP)
        {
            // Set the CommandManager, DomainInfo and SketchPanel
            this.commandManager = commandManager;
            this.sketchPanel    = SP;

            // Widget helpers
            this.selector = new DragBoxSelect(ref sketchPanel);
            this.editMenu = new EditMenu.EditMenu(ref this.sketchPanel, this.commandManager);
        }
Exemple #3
0
        public EditMenu(ref SketchPanel sp, CommandManagement.CommandManager commandManager)
        {
            sketchPanel         = sp;
            activeButtonList    = new List <Popup>();
            this.commandManager = commandManager;
            visible             = false;
            labelFuncSet        = false;
            overButton          = false;
            drawPoint           = new Point();

            #region Initialize the images for undo/redo, brush effects

            undoImage = new System.Windows.Controls.Image();
            System.Windows.Media.Imaging.BitmapImage undoBitmap = new System.Windows.Media.Imaging.BitmapImage(new Uri(
                                                                                                                   (AppDomain.CurrentDomain.BaseDirectory + @"EditIcons\UndoIcon.bmp")));
            undoImage.Source = undoBitmap;

            redoImage = new System.Windows.Controls.Image();
            System.Windows.Media.Imaging.BitmapImage redoBitmap = new System.Windows.Media.Imaging.BitmapImage(new Uri(
                                                                                                                   (AppDomain.CurrentDomain.BaseDirectory + @"EditIcons\RedoIcon.bmp")));
            redoImage.Source = redoBitmap;

            undoImageGray = new System.Windows.Controls.Image();
            System.Windows.Media.Imaging.BitmapImage undoGrayBitmap = new System.Windows.Media.Imaging.BitmapImage(new Uri(
                                                                                                                       (AppDomain.CurrentDomain.BaseDirectory + @"EditIcons\UndoIconGray.bmp")));
            undoImageGray.Source = undoGrayBitmap;

            redoImageGray = new System.Windows.Controls.Image();
            System.Windows.Media.Imaging.BitmapImage redoGrayBitmap = new System.Windows.Media.Imaging.BitmapImage(new Uri(
                                                                                                                       (AppDomain.CurrentDomain.BaseDirectory + @"EditIcons\RedoIconGray.bmp")));
            redoImageGray.Source = redoGrayBitmap;

            // Initialize Button Effects and Brushes
            highlightBrush = new System.Windows.Media.LinearGradientBrush(System.Windows.Media.Colors.White, System.Windows.Media.Colors.SkyBlue,
                                                                          new System.Windows.Point(0, 0), new System.Windows.Point(0, 1));
            normalBrush = new System.Windows.Media.LinearGradientBrush(System.Windows.Media.Colors.White, System.Windows.Media.Colors.Silver,
                                                                       new System.Windows.Point(0, 0), new System.Windows.Point(0, 1));

            highlightEffect             = new System.Windows.Media.Effects.DropShadowEffect();
            highlightEffect.ShadowDepth = 1.0;
            highlightEffect.Color       = System.Windows.Media.Colors.Silver;

            #endregion

            InitializeLabelMenu();
        }
Exemple #4
0
        public LabelMenu(ref SketchPanelLib.SketchPanel SP, CommandManagement.CommandManager CM)
        {
            InitializeComponent();

            // To know what strokes are selected
            sketchPanel = SP;
            this.CM     = CM;

            // Add the panel to the main popup
            Child           = labelList;
            PlacementTarget = sketchPanel.InkCanvas;
            Placement       = System.Windows.Controls.Primitives.PlacementMode.RelativePoint;
            Visibility      = System.Windows.Visibility.Visible;
            IsOpen          = false;

            // Make everything but the buttons invisible
            AllowsTransparency    = true;
            labelList.BorderBrush = Brushes.Transparent;
            labelList.Background  = Brushes.Transparent;
        }