public void InitEditToolBar() { barManager.Form = this; barManager.BeginUpdate(); //create tool and barButton var mbb = new MapBarButton(); InputTool = new mtInputPoint { MapImage = m_mapImage }; mbb.MapTool = InputTool; //create edit bar Bar editBar = new Bar(barManager, "EditBar"); editBar.OptionsBar.AllowDelete = false; editBar.OptionsBar.AllowQuickCustomization = false; editBar.OptionsBar.DisableClose = true; editBar.OptionsBar.DisableCustomization = true; editBar.DockStyle = BarDockStyle.Top; editBar.CanDockStyle = BarCanDockStyle.Top; editBar.OptionsBar.BarState = BarState.Expanded; editBar.Visible = true; editBar.DockRow = 0; editBar.DockCol = 4; editBar.ApplyDockRowCol(); editBar.AddItem(mbb); barManager.EndUpdate(); }
public void InitBufZonesToolBar() { barManager.Form = this; //create map projects bar barManager.BeginUpdate(); var mapsBar = new Bar(barManager, "BufferZones"); mapsBar.OptionsBar.AllowDelete = false; mapsBar.OptionsBar.AllowQuickCustomization = false; mapsBar.OptionsBar.DisableClose = true; mapsBar.OptionsBar.DisableCustomization = true; mapsBar.DockStyle = BarDockStyle.Top; mapsBar.CanDockStyle = BarCanDockStyle.Top; mapsBar.OptionsBar.BarState = BarState.Expanded; mapsBar.Visible = true; mapsBar.DockRow = 0; mapsBar.DockCol = 4; mapsBar.ApplyDockRowCol(); //create AddBufZonesLayer tool var mbb = new MapBarButton(); CommandMapTool mCommandTool = new MtAddBufZonesLayer { MapImage = m_mapImage }; mbb.MapTool = mCommandTool; mapsBar.AddItem(mbb); //create MapSelectorTool var cmb = new RepositoryItemComboBox(); var bei = new BarEditItem(barManager, cmb) { SmallWithoutTextWidth = 90, SmallWithTextWidth = 90, Width = 90 }; if (m_ZlyrSelector != null) { m_ZlyrSelector.Dispose(); } m_ZlyrSelector = new MtZoneLayerSelector { ControlForVisualize = bei, MapControl = m_mapImage, AddBufZoneLayer = (MtAddBufZonesLayer)mCommandTool }; mapsBar.AddItem(bei); //create CircleWithCenterBufZone tool mbb = new MapBarButton(); ControllerMapTool mControllerTool = new MtCircleWithCenterBufZone { MapImage = m_mapImage, ConnectionString = ConnectionManager.DefaultInstance.ConnectionString, ZoneLayerSelector = m_ZlyrSelector, Content = m_MapContent }; mbb.MapTool = mControllerTool; mapsBar.AddItem(mbb); //create IndependentCircleBufferZone tool mbb = new MapBarButton(); mControllerTool = new MtIndependentCircleBufferZone { MapImage = m_mapImage, ZoneLayerSelector = m_ZlyrSelector, Content = m_MapContent }; mbb.MapTool = mControllerTool; mapsBar.AddItem(mbb); //create PolygonBufferZone tool mbb = new MapBarButton(); mControllerTool = new MtPolygonBufferZone { MapImage = m_mapImage, ZoneLayerSelector = m_ZlyrSelector, Content = m_MapContent, ConnectionString = ConnectionManager.DefaultInstance.ConnectionString }; mbb.MapTool = mControllerTool; mapsBar.AddItem(mbb); //create IndependentPolygonBufferZone tool mbb = new MapBarButton(); mControllerTool = new MtIndependentPolygonBufferZone { MapImage = m_mapImage, ZoneLayerSelector = m_ZlyrSelector, Content = m_MapContent }; mbb.MapTool = mControllerTool; mapsBar.AddItem(mbb); //create RemoveBufZones tool mbb = new MapBarButton(); mControllerTool = new MtSelectBufZones { MapImage = m_mapImage, ZoneLayerSelector = m_ZlyrSelector, Content = m_MapContent }; mbb.MapTool = mControllerTool; mapsBar.AddItem(mbb); //var mapSelector = new MapSelector { MapControl = m_mapImage, ControlForVisualize = bei }; barManager.EndUpdate(); }
public void InitLightMapProjectToolBar() { barManager.Form = this; barManager.BeginUpdate(); #region Create GeoSearch bar var geoSearchBar = new Bar(barManager, "GeoSearch"); geoSearchBar.OptionsBar.AllowDelete = false; geoSearchBar.OptionsBar.AllowQuickCustomization = false; geoSearchBar.OptionsBar.DisableClose = true; geoSearchBar.OptionsBar.DisableCustomization = true; geoSearchBar.DockStyle = BarDockStyle.Top; geoSearchBar.CanDockStyle = BarCanDockStyle.Top; geoSearchBar.OptionsBar.BarState = BarState.Expanded; geoSearchBar.Visible = true; geoSearchBar.DockRow = 0; geoSearchBar.DockCol = 3; geoSearchBar.ApplyDockRowCol(); //create MapSelectorTool var beGeoSearch = new RepositoryItemButtonEdit(); //beGeoSearch.Buttons[0].ToolTip = "Search for administrative unit"; beGeoSearch.Buttons[0].Kind = ButtonPredefines.Glyph; beGeoSearch.Buttons[0].Caption = "Search"; var toolTipTitle = new ToolTipTitleItem(); toolTipTitle.Text = EidssMessages.GetForCurrentLang("gis_Geosearch_Tooltip", "Search for administrative unit"); //"Search for administrative unit"; var superToolTip = new SuperToolTip(); superToolTip.Items.Add(toolTipTitle); var beiGeoSearch = new BarEditItem(barManager, beGeoSearch) { SmallWithoutTextWidth = 130, SmallWithTextWidth = 130, Width = 130, SuperTip = superToolTip }; m_GeoSearch = new GeoSearch { MapControl = m_mapImage, ControlForVisualize = beiGeoSearch }; geoSearchBar.AddItem(beiGeoSearch); beiGeoSearch.Visibility = BarItemVisibility.Always; beGeoSearch.ButtonClick += beGeoSearch_ButtonClick; #endregion //create map projects bar var mapsBar = new Bar(barManager, "MapProjects"); mapsBar.OptionsBar.AllowDelete = false; mapsBar.OptionsBar.AllowQuickCustomization = false; mapsBar.OptionsBar.DisableClose = true; mapsBar.OptionsBar.DisableCustomization = true; mapsBar.DockStyle = BarDockStyle.Top; mapsBar.CanDockStyle = BarCanDockStyle.Top; mapsBar.OptionsBar.BarState = BarState.Expanded; mapsBar.Visible = true; mapsBar.DockRow = 0; mapsBar.DockCol = 0; mapsBar.ApplyDockRowCol(); //create ExportImage Tool var mbb = new MapBarButton(); var mTool = new MtExportAsImage { MapImage = m_mapImage }; mbb.MapTool = mTool; mapsBar.AddItem(mbb); //create Admin filter Tool mbb = new MapBarButton(); var mTool1 = new MtAdminMask() { MapImage = m_mapImage }; mbb.MapTool = mTool1; mapsBar.AddItem(mbb); //create MapSelectorTool var cmb = new RepositoryItemComboBox(); var bei = new BarEditItem(barManager, cmb); bei.SmallWithoutTextWidth = 118; bei.SmallWithTextWidth = 118; bei.Width = 118; if (m_MapSelector != null) { m_MapSelector.Dispose(); } m_MapSelector = new MapSelector { MapControl = m_mapImage, ControlForVisualize = bei, Content = m_MapContent }; m_MapSelector.MapChanging += m_MapSelector_MapChanging; mapsBar.AddItem(bei); barManager.EndUpdate(); }