Пример #1
0
 public frmMain2()
 {
     propertyGrid = new PropertyGrid();
     tip = new DevComponents.DotNetBar.ToolTip();
     ItopVector.SpecialCursors.LoadCursors();
     InitializeComponent();
     tlVectorControl2.CanEdit = true;
     tlVectorControl2.DrawArea.FreeSelect = true;
     this.dotNetBarManager2.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "ItopVector.Tools.ToolbarImages.bmp", new Size(16, 16), new Point(0, 0));
     tlVectorControl2.LeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_LeftClick);
     //tlVectorControl1.RightClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_RightClick);
     tlVectorControl2.DoubleLeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_DoubleLeftClick);
     tlVectorControl2.MoveIn += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveIn);
     tlVectorControl2.MoveOut += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveOut);
     tlVectorControl2.OnTipEvent += new ItopVector.Core.Interface.OnTipEventHandler(tlVectorControl1_OnTipEvent);
     tlVectorControl2.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged);
     tlVectorControl2.DragAndDrop += new DragEventHandler(tlVectorControl1_DragAndDrop);
     tlVectorControl2.DrawArea.ViewChanged += new ItopVector.DrawArea.ViewChangedEventHandler(DrawArea_ViewChanged);
     //tlVectorControl1.AfterPaintPage += new ItopVector.DrawArea.PaintMapEventHandler(tlVectorControl1_AfterPaintPage);
     //tlVectorControl1.DrawArea.OnBeforeRenderTo += new ItopVector.DrawArea.PaintMapEventHandler(DrawArea_OnBeforeRenderTo);
     LoadImage = false;
     Pen pen1 = new Pen(Brushes.Cyan, 3);
     tlVectorControl2.TempPen = pen1;
     tlVectorControl2.PropertyGrid = propertyGrid;
     tlVectorControl2.BackColor = Color.White;
     tlVectorControl2.OperationChanged += new EventHandler(tlVectorControl1_OperationChanged);
     //tlVectorControl2.FullDrawMode = true;
     tlVectorControl2.DrawMode = DrawModeType.MemoryImage;
     tlVectorControl2.DrawArea.ViewMargin = new Size(1000, 1000);
     //decimal jd = Convert.ToDecimal(ConfigurationSettings.AppSettings.Get("jd"));
     //decimal wd = Convert.ToDecimal(ConfigurationSettings.AppSettings.Get("wd"));
     //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m);
     //mapview.ZeroLongLat = new LongLat(jd, wd);
     tlVectorControl2.CurrentOperation = ToolOperation.Select;
 }
Пример #2
0
        public CtrlSvgView()
        {
            //fInfo.Owner = this.FindForm();
            tip = new DevComponents.DotNetBar.ToolTip();
            Pen pen1 = new Pen(Brushes.Cyan, 3);
            InitializeComponent();
            this.dotNetBarManager1.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "ItopVector.Tools.ToolbarImages.bmp", new Size(16, 16), new Point(0, 0));
            tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged);
            tlVectorControl1.RightClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_RightClick);
            tlVectorControl1.LeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_LeftClick);
            tlVectorControl1.DoubleLeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_DoubleLeftClick);
            //tlVectorControl1.AfterPaintPage += new ItopVector.DrawArea.PaintMapEventHandler(tlVectorControl1_AfterPaintPage);
            ItopVector.SpecialCursors.LoadCursors();
            tlVectorControl1.DrawMode = DrawModeType.MemoryImage;
            tlVectorControl1.TempPen = pen1;
            popupContainerEdit1.Text = selLar;
            tlVectorControl1.CanEdit = true;
            contextMenuStrip1.Enabled = false;
            ButtonEnb(false);
            tlVectorControl1.DrawArea.ViewMargin = new Size(20000, 20000);
            //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m);
            tlVectorControl1.ContextMenuStrip = null;
             //lgm 修改
             //jd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("jd"));
             //wd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("wd"));
             jd = MIS.JD;
             wd = MIS.WD;

             chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose"));
             show3d = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("show3d"));
            //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m);
             if (show3d == 1)
             {
                 checkEdit1.Visible = true;
             }
             else if (show3d==0)
             {
                 checkEdit1.Visible = false;
             }
            //lgm chose取不到值,暂时修改值为1
             if (chose==0)
             {
                 chose = 1;
             }
            if (chose == 1)
            {

                //mapview2 = new Itop.MapView.MapViewObj("MapData3d.yap");
                mapview = new Itop.MapView.MapViewObj();
               // mapview = mapview1;
            }
            else if (chose == 2)
            {
                mapview =  new Itop.MapView.MapViewGoogle();
            }
               mapview.ZeroLongLat = new LongLat(jd, wd);
        }
Пример #3
0
        /// <summary>
        /// Destroys tooltip window.
        /// </summary>
        internal protected void HideToolTip()
        {
            if (_ToolTipWnd != null)
            {
                System.Drawing.Rectangle tipRect = _ToolTipWnd.Bounds;
                tipRect.Width += 5;
                tipRect.Height += 6;

                OnTooltip(false);
                OnToolTipVisibleChanged(new EventArgs());
                try
                {
                    if (_ToolTipWnd != null)
                    {
                        _ToolTipWnd.Hide();
                        _ToolTipWnd.Dispose();
                        _ToolTipWnd = null;
                    }
                }
                catch { }
                AdvTree tree = this.AdvTree;
                if (tree != null)
                {
                    tree.Invalidate(tree.RectangleToClient(tipRect), false);
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Shows tooltip for this item.
        /// </summary>
        public virtual void ShowToolTip()
        {
            if (this.DesignMode)
                return;

            if (Visible)
            {
                AdvTree tree = this.AdvTree;
                if (tree != null && !tree.ShowToolTips || !this.ShowToolTips)
                    return;
                OnTooltip(true);
                if (_Tooltip != "")
                {
                    if (_ToolTipWnd == null)
                        _ToolTipWnd = new DevComponents.DotNetBar.ToolTip();
                    _ToolTipWnd.Style = StyleManager.GetEffectiveStyle();
                    _ToolTipWnd.Text = _Tooltip;
                    _ToolTipWnd.ReferenceRectangle = ScreenRectangle;

                    OnToolTipVisibleChanged(new EventArgs());
                    _ToolTipWnd.ShowToolTip();
                }
            }
        }
Пример #5
0
        void tlVectorControl1_OnTipEvent(object sender, string tooltip, byte TipType)
        {
            try {

                string[] tip ={ "" };
                if (TipType == 0) {
                    LabelItem item = this.dotNetBarManager1.GetItem("plCoord") as LabelItem;
                    if (item != null)
                        item.Text = "坐标 " + tooltip;
                    LabelItem jwditem = this.dotNetBarManager1.GetItem("jwd") as LabelItem;
                    if (jwditem != null)

                        tip = tooltip.Split(',');
                    if (tip.Length > 1) {
                        try {
                            LongLat temp = mapview.OffSetZero(-(int)(Convert.ToInt32(tip[0]) * tlVectorControl1.ScaleRatio), -(int)(Convert.ToInt32(tip[1]) * tlVectorControl1.ScaleRatio));

                            string[] jd = temp.Longitude.ToString("####.####").Split('.');
                            int d1 = Convert.ToInt32(jd[0]);
                            string[] df1 = Convert.ToString(Convert.ToDecimal("0." + jd[1]) * 60).Split('.');
                            int f1 = Convert.ToInt32(df1[0]);
                            decimal m1 = Convert.ToDecimal("0." + df1[1]) * 60;

                            string[] wd = temp.Latitude.ToString("####.####").Split('.');
                            int d2 = Convert.ToInt32(wd[0]);
                            string[] df2 = Convert.ToString(Convert.ToDecimal("0." + wd[1]) * 60).Split('.');
                            int f2 = Convert.ToInt32(df2[0]);
                            decimal m2 = Convert.ToDecimal("0." + df2[1]) * 60;
                            ((MapViewBase)mapview).ZoneWide = 3;
                            double[] s= ((MapViewBase)mapview).LBtoXY54(Convert.ToDouble(temp.Longitude),Convert.ToDouble(temp.Latitude));

                            jwditem.Text = "经纬度: " + d1.ToString() + "°" + f1.ToString() + "′" + m1.ToString("##.#") + "″," + d2.ToString() + "°" + f2.ToString() + "′" + m2.ToString("##.#") + "″"+
                                            "坐标: "+s[0]+","+s[1];
                        } catch { }
                    }
                } else if (TipType == 1) {
                    LabelItem item = (LabelItem)this.dotNetBarManager1.GetItem("plTip");
                    if (item != null)
                        item.Text = tooltip;
                } else if (TipType == 2) {
                    LabelItem item = (LabelItem)this.dotNetBarManager1.GetItem("plColumn");
                    if (item != null)
                        item.Text = tooltip;
                }
            } catch (Exception ee) { string aa = ee.Message; }
        }
Пример #6
0
        public frmMain_wh()
        {
            propertyGrid = new PropertyGrid();
            tip = new DevComponents.DotNetBar.ToolTip();
            ItopVector.SpecialCursors.LoadCursors();
            InitializeComponent();
            tlVectorControl1.CanEdit = true;
            //tlVectorControl1.DrawArea.FreeSelect = true;
            this.dotNetBarManager1.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "ItopVector.Tools.ToolbarImages.bmp", new Size(16, 16), new Point(0, 0));
            tlVectorControl1.LeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_LeftClick);
            tlVectorControl1.RightClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_RightClick);
            tlVectorControl1.DoubleLeftClick += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_DoubleLeftClick);
            tlVectorControl1.MoveIn += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveIn);
            tlVectorControl1.MoveOut += new ItopVector.DrawArea.SvgElementEventHandler(tlVectorControl1_MoveOut);
            tlVectorControl1.OnTipEvent += new ItopVector.Core.Interface.OnTipEventHandler(tlVectorControl1_OnTipEvent);
            tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged);
            tlVectorControl1.DragAndDrop += new DragEventHandler(tlVectorControl1_DragAndDrop);
            tlVectorControl1.DrawArea.ViewChanged += new ItopVector.DrawArea.ViewChangedEventHandler(DrawArea_ViewChanged);
            tlVectorControl1.AfterPaintPage += new ItopVector.DrawArea.PaintMapEventHandler(tlVectorControl1_AfterPaintPage);
            tlVectorControl1.DrawArea.OnBeforeRenderTo += new ItopVector.DrawArea.PaintMapEventHandler(DrawArea_OnBeforeRenderTo);
            //tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_Move);
            //tlVectorControl1.MouseUp +=new MouseEventHandler(tlVectorControl1_MouseUp);
            tlVectorControl1.DrawArea.OnPolyLineBreak += new PolyLineBreakEventHandler(DrawArea_OnPolyLineBreak);
            tlVectorControl1.DocumentChanged += new OnDocumentChangedEventHandler(tlVectorControl1_DocumentChanged);
            tlVectorControl1.DrawArea.BeforeAddSvgElement += new AddSvgElementEventHandler(DrawArea_BeforeAddSvgElement);
            tlVectorControl1.DrawArea.OnAddElement += new AddSvgElementEventHandler(DrawArea_OnAddElement);
            tlVectorControl1.SVGDocument.OnDocumentChanged += new OnDocumentChangedEventHandler(SVGDocument_OnDocumentChanged);
            //tlVectorControl1.DrawArea.OnElementMove += new ElementMoveEventHandler(DrawArea_OnElementMove);
            tlVectorControl1.DrawArea.OnMouseDown += new MouseEventHandler(DrawArea_OnMouseDown);
            toolDel.Click += delegate { tlVectorControl1.Delete(); };
            SvgDocument.BkImageLoad = true;

            Pen pen1 = new Pen(Brushes.Cyan, 3);
            tlVectorControl1.TempPen = pen1;
            tlVectorControl1.PropertyGrid = propertyGrid;
            tlVectorControl1.BackColor = Color.White;
            tlVectorControl1.OperationChanged += new EventHandler(tlVectorControl1_OperationChanged);
            tlVectorControl1.FullDrawMode = true;
            tlVectorControl1.DrawArea.ViewMargin = new Size(50000, 50000);
            tlVectorControl1.DrawMode = DrawModeType.MemoryImage;
            //lgm 修改
            //jd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("jd"));
            //wd = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("wd"));
            jd = (decimal)MIS.JD;
            wd = (decimal)MIS.WD;
            ghType = ConfigurationSettings.AppSettings.Get("ghType");
            //mapview.ZeroLongLat = new LongLat(117.6787m, 31.0568m);
            //mapview.ZeroLongLat = new LongLat(108.1m, 24.75m);
            chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose"));
            show3d = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("show3d"));
            if (show3d == 1) {
                checkEdit1.Visible = true;
            } else if (show3d == 0) {
                checkEdit1.Visible = false;
            }
            if (chose == 1) { mapview = new Itop.MapView.MapViewObj(); } else if (chose == 2) { mapview = new Itop.MapView.MapViewGoogle(); }
            mapview.ZeroLongLat = new LongLat(jd, wd);
            tlVectorControl1.CurrentOperation = ToolOperation.Select;
        }
Пример #7
0
        public frmTLpspShortGraphical()
        {
            //Itop.Client.MIS.GetProgRight("4a535c01-3b40-4323-9a6e-f2cae00358cf", "admin");
            object ert;

            //ert=System.Configuration.ConfigurationSettings.GetConfig("lastLoginUserNumber");
            this.propertyGrid = new PropertyGrid();
            tip = new DevComponents.DotNetBar.ToolTip();
            ItopVector.SpecialCursors.LoadCursors();
            InitializeComponent();
            tlVectorControl1.CanEdit = true;
            //tlVectorControl1.DrawArea.FreeSelect = true;

            this.dotNetBarManager1.Images = ItopVector.Resource.ResourceHelper.LoadBitmapStrip(base.GetType(), "Itop.TLPsp.Graphical.ToolbarImages1.bmp", new Size(16, 16), new System.Drawing.Point(0, 0));

            Pen pen1 = new Pen(Brushes.Cyan, 3);
            tlVectorControl1.TempPen = pen1;
            //tlVectorControl1.PropertyGrid = propertyGrid;
            tlVectorControl1.BackColor = Color.White;
            tlVectorControl1.OperationChanged += new EventHandler(tlVectorControl1_OperationChanged);
            tlVectorControl1.FullDrawMode = true;
            tlVectorControl1.DrawArea.ViewMargin = new Size(5000, 5000);
            tlVectorControl1.DrawMode = DrawModeType.MemoryImage;
            tlVectorControl1.DrawArea.OnAddElement += new AddSvgElementEventHandler(tlVectorControl1_AddElement);
            tlVectorControl1.DrawArea.ViewChanged += new ItopVector.DrawArea.ViewChangedEventHandler(DrawArea_ViewChanged);
            tlVectorControl1.ScaleChanged += new EventHandler(tlVectorControl1_ScaleChanged);
            tlVectorControl1.CurrentOperation = ToolOperation.Select;
            tlVectorControl1.LeftClick += new SvgElementEventHandler(tlVectorControl1_LeftClick);
            tlVectorControl1.RightClick += new SvgElementEventHandler(tlVectorControl1_RightClick);
            tlVectorControl1.DoubleLeftClick += new SvgElementEventHandler(tlVectorControl1_DoubleLeftClick);
            //tlVectorControl1.DrawArea.OnMouseMove += new MouseEventHandler(DrawArea_OnMouseMove);
            tlVectorControl1.DrawArea.OnMouseDown += new MouseEventHandler(DrawArea_OnMouseDown);
            tlVectorControl1.DocumentChanged += new OnDocumentChangedEventHandler(tlVectorControl1_DocumentChanged);
            tlVectorControl1.DrawArea.OnElementMove += new ElementMoveEventHandler(DrawArea_OnElementMove);
            tlVectorControl1.DrawArea.OnMouseMove += new MouseEventHandler(DrawArea_OnMouseMove);
        }
Пример #8
0
		/// <summary>
		/// Shows tooltip for this item.
		/// </summary>
		public override void ShowToolTip()
		{
			if(this.DesignMode)
				return;

			if(this.Visible && this.Displayed)
			{
				IOwner owner=this.GetOwner() as IOwner;
				if(owner!=null && !owner.ShowToolTips)
					return;
				System.Windows.Forms.Control ctrl=this.ContainerControl as System.Windows.Forms.Control;
				if(ctrl==null)
					return;
				if(!m_PanelRect.Contains(ctrl.PointToClient(System.Windows.Forms.Control.MousePosition)))
					return;

				OnTooltip(true);
				if(m_Tooltip!="")
				{
					if(m_ToolTipWnd==null)
						m_ToolTipWnd=new ToolTip();
					m_ToolTipWnd.Text=m_Tooltip;
					if(owner!=null && owner.ShowShortcutKeysInToolTips && this.Shortcuts.Count>0)
						m_ToolTipWnd.Text+=(" ("+this.ShortcutString+")");
					IOwnerItemEvents ownerEvents=this.GetIOwnerItemEvents();
					if(ownerEvents!=null)
						ownerEvents.InvokeToolTipShowing(this,new EventArgs());
					m_ToolTipWnd.ShowToolTip();
				}
			}
		}
Пример #9
0
        void tlVectorControl1_OnTipEvent(object sender, string tooltip, byte TipType)
        {
            string[] tip ={ "" };
            if (TipType == 0) {
                LabelItem item = this.dotNetBarManager2.GetItem("plCoord") as LabelItem;
                if (item != null)
                    item.Text = "坐标 " + tooltip;
                LabelItem jwditem = this.dotNetBarManager2.GetItem("jwd") as LabelItem;
                if (jwditem != null)

                    tip = tooltip.Split(',');
                //if (tip.Length > 1) {
                //    try {
                //        LongLat temp = mapview.OffSetZero(-(int)(Convert.ToInt32(tip[0]) * tlVectorControl2.ScaleRatio), -(int)(Convert.ToInt32(tip[1]) * tlVectorControl2.ScaleRatio));

                //        string[] jd = temp.Longitude.ToString("####.####").Split('.');
                //        int d1 = Convert.ToInt32(jd[0]);
                //        string[] df1 = Convert.ToString(Convert.ToDecimal("0." + jd[1]) * 60).Split('.');
                //        int f1 = Convert.ToInt32(df1[0]);
                //        decimal m1 = Convert.ToDecimal("0." + df1[1]) * 60;

                //        string[] wd = temp.Latitude.ToString("####.####").Split('.');
                //        int d2 = Convert.ToInt32(wd[0]);
                //        string[] df2 = Convert.ToString(Convert.ToDecimal("0." + wd[1]) * 60).Split('.');
                //        int f2 = Convert.ToInt32(df2[0]);
                //        decimal m2 = Convert.ToDecimal("0." + df2[1]) * 60;
                //        jwditem.Text = "经纬度: " + d1.ToString() + "°" + f1.ToString() + "′" + m1.ToString("##.#") + "″," + d2.ToString() + "°" + f2.ToString() + "′" + m2.ToString("##.#") + "″";
                //    } catch { }
                //}
            } else if (TipType == 1) {
                LabelItem item = (LabelItem)this.dotNetBarManager2.GetItem("plTip") ;
                if (item != null)
                    item.Text = tooltip;
            } else if (TipType == 2) {
                LabelItem item = (LabelItem)this.dotNetBarManager2.GetItem("plColumn") ;
                if (item != null)
                    item.Text = tooltip;
            }
        }