Example #1
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button == 1)
            {
                IEnvelope pEnv;
                pEnv = pPageLayoutControl.TrackRectangle();

                GetSymbol symbolForm = new GetSymbol(esriSymbologyStyleClass.esriStyleClassScaleTexts);
                symbolForm.Text = "选择比例尺文本";
                IStyleGalleryItem styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassScaleTexts);
                symbolForm.Dispose();
                if (styleGalleryItem == null)
                {
                    return;
                }

                IMapFrame         mapFrame         = (IMapFrame)m_hookHelper.ActiveView.GraphicsContainer.FindFrame(m_hookHelper.ActiveView.FocusMap);
                IMapSurroundFrame mapSurroundFrame = new MapSurroundFrameClass();
                mapSurroundFrame.MapFrame    = mapFrame;
                mapSurroundFrame.MapSurround = (IMapSurround)styleGalleryItem.Item;

                IElement element = (IElement)mapSurroundFrame;
                element.Geometry = pEnv;

                m_hookHelper.ActiveView.GraphicsContainer.AddElement((IElement)mapSurroundFrame, 0);
                m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, mapSurroundFrame, null);
            }
        }
Example #2
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            // TODO: Add Borders.OnClick implementation
            // TODO: Add Backgrounds.OnClick implementation
            GetSymbol symbolForm = new GetSymbol(esriSymbologyStyleClass.esriStyleClassBorders);

            symbolForm.Text = "选择边框";
            IStyleGalleryItem styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassBorders);

            symbolForm.Dispose();
            if (styleGalleryItem == null)
            {
                return;
            }
            //Get the frame containing the focus map
            IFrameProperties frameProperties = (IFrameProperties)pPageLayoutControl.GraphicsContainer.FindFrame(pPageLayoutControl.ActiveView.FocusMap);

            frameProperties.Border = (IBorder )styleGalleryItem.Item;
            pPageLayoutControl.Refresh(esriViewDrawPhase.esriViewBackground, null, null);
        }
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button == 1)
            {
                IEnvelope pEnv;
                pEnv = pPageLayoutControl.TrackRectangle();

                GetSymbol symbolForm = new GetSymbol(esriSymbologyStyleClass.esriStyleClassScaleTexts );
                symbolForm.Text = "ѡ��������ı�";
                IStyleGalleryItem styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassScaleTexts );
                symbolForm.Dispose();
                if (styleGalleryItem == null) return;

                IMapFrame mapFrame = (IMapFrame)m_hookHelper.ActiveView.GraphicsContainer.FindFrame(m_hookHelper.ActiveView.FocusMap);
                IMapSurroundFrame mapSurroundFrame = new MapSurroundFrameClass();
                mapSurroundFrame.MapFrame = mapFrame;
                mapSurroundFrame.MapSurround = (IMapSurround)styleGalleryItem.Item;

                IElement element = (IElement)mapSurroundFrame;
                element.Geometry = pEnv;

                m_hookHelper.ActiveView.GraphicsContainer.AddElement((IElement)mapSurroundFrame, 0);
                m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, mapSurroundFrame, null);
            }
        }