Example #1
0
        protected override void OnMouseDown(MouseEventArgs arg)
        {
            base.OnMouseDown(arg);

            try
            {
                ValueSymbolForm valueSymbolForm = AddIn.FromID <ValueSymbolForm.AddinImpl>(ThisAddIn.IDs.ValueSymbolForm).UI;
                selectedValue = valueSymbolForm.SelectedValue;
                selectedColor = valueSymbolForm.SelectedColor;

                if ((Painter.ActiveLayer == null) ||
                    (arg.Button != MouseButtons.Left) ||
                    (selectedValue == null))
                {
                    return;
                }

                preMousePos = Raster.ScreenCoor2RasterCoor(arg.X, arg.Y, Painter.ActiveLayer);
                iniMousePos = preMousePos;
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
Example #2
0
        protected override void OnMouseDown(MouseEventArgs arg)
        {
            base.OnMouseDown(arg);

            if (Painter.ActiveLayer != null && arg.Button == MouseButtons.Left)
            {
                try
                {
                    ValueSymbolForm valueSymbolForm = AddIn.FromID <ValueSymbolForm.AddinImpl>(ThisAddIn.IDs.ValueSymbolForm).UI;
                    selectedValue = valueSymbolForm.SelectedValue;
                    selectedColor = valueSymbolForm.SelectedColor;

                    IPoint startCoor = Raster.ScreenCoor2MapCoor(arg.X, arg.Y);

                    if (!isDrawing)
                    {
                        newLineFeedback         = new NewLineFeedback();
                        newLineFeedback.Display = ArcMap.Document.ActiveView.ScreenDisplay;
                        newLineFeedback.Symbol  = (ISymbol)Display.GetDefaultSelectLineSymbol();
                        newLineFeedback.Start(startCoor);
                    }

                    newLineFeedback.AddPoint(startCoor);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
                }
            }
        }
Example #3
0
 protected override IntPtr OnCreateChild()
 {
     m_windowUI = new ValueSymbolForm(this.Hook);
     return(m_windowUI.Handle);
 }
Example #4
0
 protected override IntPtr OnCreateChild()
 {
     m_windowUI = new ValueSymbolForm(this.Hook);
     return m_windowUI.Handle;
 }