示例#1
0
        public void ActivateNoLoad()
        {
            m_Activated = true;

            //save the previous mode and cursor
            if (m_MapWin.View.UserCursorHandle != (int)m_Cursor.Handle)
            {
                m_PreviousCursorMode = m_MapWin.View.CursorMode;
                m_PreviousCursor     = m_MapWin.View.MapCursor;
            }
            m_MapWin.View.CursorMode       = MapWinGIS.tkCursorMode.cmNone;
            m_MapWin.View.UserCursorHandle = (int)m_Cursor.Handle;
            m_MapWin.View.MapCursor        = tkCursor.crsrUserDefined;
            //make the button sate pressed
            m_IdentBtn.Pressed = true;
        }
示例#2
0
        public void PopulateForm(bool ShowAfterward, MapWinGIS.Grid grid, string layerName, MapWinGIS.Extents ex, int LyrHandle)
        {
            m_HavePanel = !ShowAfterward;

            try
            {
                SetTitle(layerName);
                MapWinGIS.Extents extents = null;

                //clear the list view
                dgv.DataSource = null;

                System.Data.DataSet ds = new System.Data.DataSet();
                ds.Tables.Add();
                ds.Tables[0].Columns.Add("Value", typeof(string));
                ds.Tables[0].Columns.Add("Count", typeof(long));

                if (m_hDraw != -1)
                {
                    m_parent.m_MapWin.View.Draw.ClearDrawing(m_hDraw);
                    m_hDraw = -1;
                }

                //recalculates the extents if needed
                extents = GetMaxExtents(ex, grid.Header);

                extents = ex;

                if (extents != null)
                {
                    //set the map cursor to a wait cursor
                    MapWinGIS.tkCursor m_PreviousCursor = m_parent.m_MapWin.View.MapCursor;
                    m_parent.m_MapWin.View.MapCursor = MapWinGIS.tkCursor.crsrWait;

                    //populate all the values and counts
                    PopulateLV(ref ds, grid, extents, LyrHandle);

                    //set the cursor back to the Identifier cursor
                    m_parent.m_MapWin.View.MapCursor = m_PreviousCursor;
                }
                else
                {
                    lbHighValue.Text = "No Data";
                    lbLowValue.Text  = "No Data";
                }

                SkipDisplayValues = true;
                if (m_hDraw != -1)
                {
                    m_parent.m_MapWin.View.Draw.ClearDrawing(m_hDraw);
                }

                dgv.DataSource = ds.Tables[0];

                if (dgv.SelectedRows.Count > 0)
                {
                    dgv.SelectedRows[0].Selected = false;
                }

                SkipDisplayValues = false;

                m_Extents = extents;
                m_Grid    = grid;

                if (ShowAfterward)
                {
                    this.Show();
                }
            }
            catch (System.Exception exception)
            {
                ShowErrorBox("PopulateForm()", exception.Message);
            }
        }