private void chkAllOn_Click(object sender, EventArgs e)
        {
            CheckedListBox editEventList = m_selectTab.GetNextControl(m_selectTab, true) as CheckedListBox;

            for (int i = 0; i < editEventList.Items.Count; i++)
            {
                editEventList.SetItemChecked(i, true);
            }
        }
Пример #2
0
        /// @todo Document Gear.GUI.Emulator.pinActiveTab_Click()
        ///
        private void pinActiveTab_Click(object sender, EventArgs e)
        {
            Control oldPin = pinnedPanel.GetNextControl(null, true);

            TabPage tp = documentsTab.SelectedTab;

            tp.Parent = null;

            Control newPin = tp.GetNextControl(null, true);

            newPin.Dock   = DockStyle.Fill;
            newPin.Parent = pinnedPanel;
            newPin.Text   = tp.Text;

            if (pinnedSplitter.IsCollapsed)
            {
                pinnedSplitter.ToggleState();
            }

            if (oldPin != null)
            {
                tp            = new TabPage(oldPin.Text);
                tp.Parent     = documentsTab;
                oldPin.Parent = tp;
            }
        }
        public EditorEventsDialog(object hook)
        {
            InitializeComponent();
            this.Hook     = hook;
            e_dockWinForm = this;
            //get a reference to the editor
            UID uid = new UIDClass();

            uid.Value = "esriEditor.Editor";
            m_editor  = ArcMap.Application.FindExtensionByCLSID(uid) as ESRI.ArcGIS.Editor.IEditor;

            m_TabControl = e_dockWinForm.tabControl1;
            System.Collections.IEnumerator e = m_TabControl.TabPages.GetEnumerator();
            e.MoveNext();
            m_listenTab = e.Current as TabPage;
            e.MoveNext();
            m_selectTab = e.Current as TabPage;

            CheckedListBox editEventList = m_selectTab.GetNextControl(m_selectTab, true) as CheckedListBox;

            editEventList.ItemCheck += new ItemCheckEventHandler(editEventList_ItemCheck);

            ListBox listEvent = m_listenTab.GetNextControl(m_listenTab, true) as ListBox;

            listEvent.MouseDown += new MouseEventHandler(listEvent_MouseDown);

            eventListener = new EventListener(m_editor);

            eventListener.Changed += new ChangedEventHandler(eventListener_Changed);

            //populate the editor events
            editEventList.Items.AddRange(Enum.GetNames(typeof(EventListener.EditorEvent)));
        }
Пример #4
0
        /// @todo Document Gear.GUI.Emulator.floatActiveTab_Click()
        ///
        private void floatActiveTab_Click(object sender, EventArgs e)
        {
            TabPage tp = documentsTab.SelectedTab;

            tp.Parent = null;

            FloatedWindow fw = new FloatedWindow(this);

            Control c = tp.GetNextControl(null, true);

            c.Dock   = DockStyle.Fill;
            c.Parent = fw;
            c.Text   = tp.Text;

            fw.MdiParent = this.MdiParent;
            fw.Show();
            fw.Text = tp.Text + ": " + Source;

            FloatControls.Add(fw);
        }
        private void EngineEditingForm_Load(object sender, EventArgs e)
        {
            m_editor = new EngineEditorClass();

            //Set buddy controls
            axTOCControl1.SetBuddyControl(axMapControl1);
            axEditorToolbar.SetBuddyControl(axMapControl1);
            axToolbarControl1.SetBuddyControl(axMapControl1);

            //Add items to the ToolbarControl
            axToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsSaveAsDocCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsAddDataCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomInTool", 0, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomOutTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapPanTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapFullExtentCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomToLastExtentBackCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomToLastExtentForwardCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);

            //Add items to the custom editor toolbar
            axEditorToolbar.AddItem("esriControls.ControlsEditingEditorMenu", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsEditingEditTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsEditingSketchTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsUndoCommand", 0, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsRedoCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsEditingTargetToolControl", 0, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsEditingTaskToolControl", 0, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);

            //Create a popup menu
            m_toolbarMenu = new ToolbarMenuClass();
            m_toolbarMenu.AddItem("esriControls.ControlsEditingSketchContextMenu", 0, 0, false, esriCommandStyles.esriCommandStyleTextOnly);

            //share the command pool
            axToolbarControl1.CommandPool = axEditorToolbar.CommandPool;
            m_toolbarMenu.CommandPool     = axEditorToolbar.CommandPool;

            //Create an operation stack for the undo and redo commands to use
            IOperationStack operationStack = new ControlsOperationStackClass();

            axEditorToolbar.OperationStack = operationStack;

            // Fill the Check List of Events for Selection
            TabControl tabControl = eventTabControl as TabControl;

            System.Collections.IEnumerator enumTabs = tabControl.TabPages.GetEnumerator();
            enumTabs.MoveNext();
            m_listenTab = enumTabs.Current as TabPage;
            enumTabs.MoveNext();
            m_selectTab = enumTabs.Current as TabPage;

            CheckedListBox editEventList = m_selectTab.GetNextControl(m_selectTab, true) as CheckedListBox;

            editEventList.ItemCheck += new ItemCheckEventHandler(editEventList_ItemCheck);

            ListBox listEvent = m_listenTab.GetNextControl(m_listenTab, true) as ListBox;

            listEvent.MouseDown += new MouseEventHandler(listEvent_MouseDown);

            eventListener = new Events.EventListener(m_editor);

            eventListener.Changed += new Events.ChangedEventHandler(eventListener_Changed);

            //populate the editor events
            editEventList.Items.AddRange(Enum.GetNames(typeof(Events.EventListener.EditorEvent)));

            //add some sample line data to the map
            IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactoryClass();
            //relative file path to the sample data from EXE location
            string filePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            filePath = System.IO.Path.Combine(filePath, @"ArcGIS\data\StreamflowDateTime\Streamflow.mdb");

            IFeatureWorkspace workspace = (IFeatureWorkspace)workspaceFactory.OpenFromFile(filePath, axMapControl1.hWnd);

            //Add the various layers
            IFeatureLayer featureLayer1 = new FeatureLayerClass();

            featureLayer1.Name         = "Watershed";
            featureLayer1.Visible      = true;
            featureLayer1.FeatureClass = workspace.OpenFeatureClass("Watershed");
            axMapControl1.Map.AddLayer((ILayer)featureLayer1);

            IFeatureLayer featureLayer2 = new FeatureLayerClass();

            featureLayer2.Name         = "TimSerTool";
            featureLayer2.Visible      = true;
            featureLayer2.FeatureClass = workspace.OpenFeatureClass("TimSerTool");
            axMapControl1.Map.AddLayer((ILayer)featureLayer2);
        }
 void eventListener_Changed(object sender, Events.EditorEventArgs e)
 {
     ((ListBox)m_listenTab.GetNextControl(m_listenTab, true)).Items.Add(e.eventType.ToString());
 }