Library Reference  

GeodatabaseUI Library Overview


Supported with: ArcGIS Desktop

Library dependencies: System, SystemUI, Geometry, Display, Server, Output, GeoDatabase, GISClient, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, GeoDatabaseDistributed, Carto, NetworkAnalyst, Schematic, Location, NetworkAnalysis, Controls, GeoAnalyst, 3DAnalyst, GlobeCore, SpatialAnalyst, Framework


The GeoDatabaseUI library provides user interfaces including property pages to support objects contained in the GeoDatabase library. The library supports a number of dialogs that developers can use; TableView, Calculator, and the version dialogs are all defined in the library.

It is not common for developers to extend this library.


The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:


TableView

In ArcMap, all tables are presented in a table data window. Table windows house a table view, also known as a table control. In ArcCatalog, there are no table windows; instead, a table view is directly displayed as a GX view. The table view object is cocreatable. For example, you can instantiate a new table view object, link it to a table, and display it in a custom form.

The primary interface on the table view objects is ITableView. Use this interface to link a table to the table view and display it. ITableView2 manages some additional table view properties such as whether the table can be edited or not. It also controls whether the table only shows selected records or all of the records.

The ITableControl, ITableControl2, and ITableControl3 interfaces manage methods that apply to an existing displayed table. Use methods on these interfaces to draw the features currently selected in the table, redraw the table after edits have been made, and set the current row in the table. The ITableControlWidth interface has two properties that aid in sizing the table when first displaying it. The RecommendMinimumTableWidth property returns the minimum width the table needs to be to see all columns. The FullTableWidth property returns the current table width. The ITableViewTableFields interface has one property that provides access to the fields in the table.

 

Calculator

The Calculator and CalculatorUI objects are used to update field values in a table.

Calculator

The Calculator object is the underlying object used to calculate field values in a table. The ICalculator interface should be used whenever you wish to update field values in a table, which may be either a stand-alone table or the attribute table of a featureclass. Use the ICalculatorCallback interface to get warnings, errors, and status during the calculation process.

The following example shows how to use the Calculator object.

[Visual Basic 6.0]
Private Sub Calculate()
  On Error GoTo ErrorHandler

  Dim pCalc As ICalculator
  Dim pGxApp As IGxApplication
  Dim pTable As ITable
  Dim pDataset As IDataset
  Dim pWorkspaceEdit As IWorkspaceEdit
  Dim pQFilter As IQueryFilter
  Dim pCursor As ICursor

  '++ Get the selected table in ArcCatalog
  Set pGxApp = Application
  Set pTable = pGxApp.SelectedObject.InternalObjectName.Open
  Set pDataset = pTable

  '++ Start Editing, with undo/redo
  Set pWorkspaceEdit = pDataset.Workspace
  pWorkspaceEdit.StartEditing True
  pWorkspaceEdit.StartEditOperation

  '++ Open a cursor on the table
  Set pQFilter = New QueryFilter
  pQFilter.WhereClause = pTable.OIDFieldName & " < 20"
  Set pCursor = pTable.Search(pQFilter, False)

  '++ Check for rowset to work on
  If pTable.RowCount(pQFilter) > 0 Then
  Set pCalc = New Calculator

  '++ Simple calculation
  With pCalc
    Set .Cursor = pCursor
    Set .Callback = Me
    '++ Triple quotes for text string updates
    .Expression = """AA"""
    .Field = "STATE_FIPS"
    '++ display a msgbox if error occurs
    .ShowErrorPrompt = True
  End With

  pCalc.Calculate

  '++ De-reference the cursor and calculator if saving shapefile changes
  Set pCursor = Nothing
  Set pCalc = Nothing

  '++ Stop Editing, saving edits
  pWorkspaceEdit.StopEditOperation
  pWorkspaceEdit.StopEditing True

 End If

 Exit Sub
ErrorHandler:
    MsgBox "Error: " & Err.Description
End Sub

CalculatorUI

The CalculatorUI object exposes a dialog that allows users to visually make use of the Calculator object to calculate field values. Use ICalculatorUI2 to setup the user interface and then call ICalculatorUI.DoModal show the dialog.

 

Versioning

There are two objects that are used to expose the version subsystem in the user interface. These are the NewVersionDialog and VersionManger objects.

NewVersionDialog

The INewVersionDialog interface on the NewVersionDialog object can be used to prompt the user for the information necessary when creating a version.

The following example shows how to use the NewVersionDialog object.

[Visual Basic 6.0]
Private Function CreateNewVersion(ByVal pVersion As IVersion) As IVersion
  Dim pNewVersionDialog As INewVersionDialog
  Set pNewVersionDialog = New NewVersionDialog
  If pNewVersionDialog.DoModal Then
    Dim pNewVersion As IVersion
    Set pNewVersion = pVersion.CreateVersion(pNewVersionDialog.VersionName)
    pNewVersion.Access = pNewVersionDialog.VersionAccess
    pNewVersion.Description = pNewVersionDialog.VersionDescription
    Set CreateNewVersion = pNewVersion
  End If
End Function

VersionManager

The VersionManager object is used to expose the version in a versioned workspace. The IVersionManager interface on the VersionManager object can be used to show the Version Manager dialog. The IVersionManagerEvents interface can be used to sink to the events raised when versions are created, deleted, and renamed within the VersionManager.

The following example shows how to use the VersionManager object.

[Visual Basic 6.0]
Private WithEvents VersionManagerEvents As VersionManager

Private Sub ShowVersionManager(ByVal pVersionedWorkspace As IVersionedWorkspace)
  Dim pVersionManager As IVersionManager
  Set pVersionManager = New VersionManager
  Set VersionManagerEvents = pVersionManager
  pVersionManager.DoModal pVersionedWorkspace
  Set VersionManagerEvents = Nothing
End Sub

Private Sub VersionManagerEvents_OnVersionCreated(ByVal vers As esriGeoDatabase.IVersion)
  MsgBox "Created " & vers.VersionName
End Sub