private void SetToolbar() { toolbar = new Toolbar(); toolbar.AddButton(WindowTypes.resources, "resources", "Shows how much water, oxygen, food, and electricity the colony has."); toolbar.AddButton(WindowTypes.crew, "crew", "Shows how all the crew members are doing, and what they're up to."); toolbar.AddButton(WindowTypes.log, "log", "Shows important messages and events."); toolbar.AddButton(WindowTypes.operations, "operations", "Control how much resources are consumed by different activities."); toolbar.AddButton(WindowTypes.structures, "structures", "Lists all structures and their statuses."); toolbar.AddButton(WindowTypes.robots, "robots", "Shows how all the robots are doing, and what they're up to."); toolbar.AddButton(WindowTypes.researchprojects, "research-projects", "Lists all research projects and their statuses."); toolbar.AddButton(WindowTypes.research, "research", "Shows the progress and outcomes of present and future research."); toolbar.AddButton(WindowTypes.widgetdesign, "widget-design", "Design new widgets here."); toolbar.AddButton(WindowTypes.basedesign, "base-design", "Design the base layout here."); }
private void SetToolbar() { toolbar = new Toolbar(); toolbar.AddButton(WindowTypes.inventory, "inventory", "Shows all the stuff you are carrying and allows you to ready them for use."); toolbar.AddButton(WindowTypes.equipment, "equipment", "Shows all the equipment you are wearing and allows you to equip more, or equip less."); toolbar.AddButton(WindowTypes.vehicleinventory, "vehicle-inventory", "Shows all the stuff inside all nearby vehicles."); toolbar.AddButton(WindowTypes.blueprints, "blueprints", "See a list of available blueprints that you can place on Mars."); }
/// <summary> /// OnInitialized 方法 /// </summary> protected override void OnInitialized() { base.OnInitialized(); Toolbar?.AddButton(this); ConfirmButtonText ??= Localizer[nameof(ConfirmButtonText)]; CloseButtonText ??= Localizer[nameof(CloseButtonText)]; Content ??= Localizer[nameof(Content)]; }
public void AddButtonTest1() { Toolbar target = new Toolbar(); // TODO: Initialize to an appropriate value string Name = string.Empty; // TODO: Initialize to an appropriate value MapWindow.Interfaces.ToolbarButton expected = null; // TODO: Initialize to an appropriate value MapWindow.Interfaces.ToolbarButton actual; actual = target.AddButton(Name); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
// SimMain scConvas; //This event is fired when the user loads your plug-in either through the plug-in dialog //box, or by checkmarking it in the plug-ins menu. This is where you would add buttons to the //tool bar or menu items to the menu. //It is also standard to set a global reference to the IMapWin that is passed through here so that //you can access it elsewhere in your project to act on MapWindow. public void Initialize(MapWindow.Interfaces.IMapWin m_MapWin, int ParentHandle) { this.mMapWin = m_MapWin; this.convas = (Form)Control.FromHandle(new IntPtr(ParentHandle)); //conv ResourceManager res = new ResourceManager("GISTranSim.Properties.Resources", Assembly.GetExecutingAssembly()); Toolbar toolbar = mMapWin.Toolbar;; toolbar.AddToolbar(strToolBar); if (strToolBar.Length > 0) { toolbar.AddToolbar(strToolBar); } TBTN_Config = toolbar.AddButton(strBTNConfig, strToolBar, string.Empty, string.Empty); TBTN_Config.Tooltip = "配置仿真应用程序"; TBTN_Config.Category = strToolBar; TBTN_Config.Picture = res.GetObject("Config"); TBTN_Config.Enabled = true; TBTN_Config.Text = strBTNConfig; //this.res.GetString("textCreateShp"); TBTN_Run = toolbar.AddButton(strBTNRun, strToolBar, false); TBTN_Run.Category = strToolBar; TBTN_Run.Text = strBTNRun; TBTN_Run.Tooltip = "运行仿真应用程序"; TBTN_Run.Enabled = false; TBTN_Run.Picture = res.GetObject("Run"); TBTN_Pause = toolbar.AddButton(strBTNPause, strToolBar, false); TBTN_Pause.Category = strToolBar; TBTN_Pause.Text = strBTNPause; TBTN_Pause.Tooltip = "停止仿真程序"; TBTN_Pause.Enabled = false; TBTN_Pause.Picture = res.GetObject("Pause"); TBTN_ChartSpeedTime = toolbar.AddButton(strBTNSpaceTime, strToolBar, false); TBTN_ChartSpeedTime.Category = strToolBar; TBTN_ChartSpeedTime.Text = strBTNSpaceTime; TBTN_ChartSpeedTime.Tooltip = "输出时空图像"; TBTN_ChartSpeedTime.Enabled = false; TBTN_ChartSpeedTime.Picture = res.GetObject("Chart2"); TBTN_ChartSpaceTime = toolbar.AddButton(strBTNSpeedTime, strToolBar, false); TBTN_ChartSpaceTime.Category = strToolBar; TBTN_ChartSpaceTime.Text = strBTNSpeedTime; TBTN_ChartSpaceTime.Tooltip = "输出速度时间图像"; TBTN_ChartSpaceTime.Enabled = false; TBTN_ChartSpaceTime.Picture = res.GetObject("Chart1"); TBTN_ChartMeanSpeed = toolbar.AddButton(strBTNMeanSpeed, strToolBar, false); TBTN_ChartMeanSpeed.Category = strToolBar; TBTN_ChartMeanSpeed.Text = strBTNSpeedTime; TBTN_ChartMeanSpeed.Tooltip = "输出平均速度图像"; TBTN_ChartMeanSpeed.Enabled = false; TBTN_ChartMeanSpeed.Picture = res.GetObject("Save"); TBTN_ShowData = toolbar.AddButton(strBTNShowData, strToolBar, false); TBTN_ShowData.Category = strToolBar; TBTN_ShowData.Text = strBTNShowData; TBTN_ShowData.Tooltip = "输出仿真数据"; TBTN_ShowData.Enabled = false; TBTN_ShowData.Picture = res.GetObject("Data"); }