public void changeSelectedToolIcon(Tool tool) { // change the icon of the toolPictureBox if (tool == Tool.DrawPoint || tool == Tool.DrawPolygon || tool == Tool.DrawPolyline) { this.toolPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbDraw"); } else if (tool == Tool.Move) { this.toolPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\toolPan"); } else if (tool == Tool.ZoomIn) { this.toolPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\toolZoomIn"); } else if (tool == Tool.ZoomOut) { this.toolPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\toolZoomOut"); } else if (tool == Tool.Pointer) { this.toolPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\toolPointer"); } }
public void InitializeMyOwnComponents(MapPanel mapPanel) { this.mapPanel = mapPanel; this.mapTab.Controls.Add(this.mapPanel); //this.Load += new System.EventHandler(this.Form1_Load); // ToolBar stuff this.dialogToolBar = new ToolBar(); tbOkButton = new ToolBarButton(); tbCancelButton = new ToolBarButton(); dialogToolBar.Buttons.Add(tbOkButton); dialogToolBar.Buttons.Add(tbCancelButton); lockPictureBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\stLockOpen"); ToolbarMaker.ToolBar = this.toolBar; ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbOpen"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbSave"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbTools"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbAddLayer"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbDraw"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbBack"); //ToolbarMaker.AddIcon("Icons.tbSettings.ico"); //ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbHelp"); this.tbTools.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton; this.tbTools.DropDownMenu = this.toolMenu; this.tbDraw.DropDownMenu = this.drawMenu; this.tbOpenButton.DropDownMenu = this.fileMenu; this.tbAddLayer.DropDownMenu = this.addMenu; this.tbBack.DropDownMenu = this.undoMenu; ToolbarMaker.ToolBar = dialogToolBar; ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbOk"); ToolbarMaker.AddIcon(config.ApplicationDirectory + @"\Icons\tbCancel"); // ProperyEditor // PropertyItem item = new PropertyItem("TestContainer", PropertyType.Container); // item.State = PropertyState.Closed; // item.AddItem(new PropertyItem("Testkind1", PropertyType.Checkbox)); // item.AddItem(new PropertyItem("Testkind2", PropertyType.Radio)); //// item.AddItem(new PropertyItem("EditTest", PropertyType.EditField)); // this.propertyEditor.addItem(item); // item = new PropertyItem("TestRadio", PropertyType.Radio); // item.State = PropertyState.Checked; // this.propertyEditor.addItem(item); // item = new PropertyItem("TestContainer", PropertyType.Container); // item.State = PropertyState.Closed; // item.AddItem(new PropertyItem("Testkind1", PropertyType.Checkbox)); // PropertyItem childContainer = new PropertyItem("Testkind2", PropertyType.Container); // childContainer.AddItem(new PropertyItem("Testkind3", PropertyType.Checkbox)); // item.AddItem(childContainer); // this.propertyEditor.addItem(item); // updateItemNr(); // setDelegates(propertyEditor); // propertyEditor.Invalidate(); this.KeyUp += new KeyEventHandler(MainForm_KeyUp); inputPanel1.EnabledChanged += new EventHandler(inputPanel1_EnabledChanged); // SelectedTool Observer events mapPanel.SelectedToolChanged += new MapPanel.SelectToolDelegate(changeSelectedToolIcon); mapPanel.SelectedToolChanged += new MapPanel.SelectToolDelegate(toolMenu.SelectedToolChanged); mapPanel.SelectedToolChanged += new MapPanel.SelectToolDelegate(drawMenu.SelectedToolChanged); // EditModeInterrupted Observer mapPanel.EditModeInterrupted += new MapPanel.EditModeInterruptedDelegate(drawMenu.EditModeInterrupted); mapPanel.EditModeInterrupted += new MapPanel.EditModeInterruptedDelegate(mapPanel_EditModeInterrupted); // mainControler.ActionlistCountChanged += new MainControler.ActionCountStuffDelegate(OnActionlistCountChanged); lockPictureBox.MouseUp += new MouseEventHandler(lockPictureBox_Clicked); this.Resize += new EventHandler(MainForm_Resize); mapPanel.SelectedTool = Tool.Pointer; tabControl.SelectedIndex = 1; // Events for setting items //TODO: abh. von Auflösungsvariable machen! }