Provides access to members that control the active view - the main application window.
Product Availability
When To Use
This interface manages the main application window in ArcMap and all drawing operations.
In ArcMap, two objects implement this interface: PageLayout and Map. These two objects correspond to the two different views in ArcMap: layout and data view. Only one view can be active at a time and this is termed the active view. IMxDocument::ActiveView holds a reference to the current active view object (a Map or the PageLayout). For example, if the ArcMap application is in layout mode, IMxDocument::ActiveView returns an IActiveView reference to the PageLayout object. Alternatively, if the application is in data view, this propery returns a reference to the focus map.
ArcMap has view commands which allow users to toggle between layout view and data view. These commands appear on the View menu and on the scroll bar.
An ArcMap document can contain many Maps. Make sure you have the desired object when working with this interface. Otherwise, operations such as drawing may not be occurring in the application window as you expect. For example, a Map obtained through IMxDocument::Maps is not guaranteed to be the focus map. If you know you want a reference to the focus map, use IMxDocument::FocusMap. Similarly, if you know you want a reference to the page layout, use IMxDocument::PageLayout instead. You can change the document's active view by setting IMxDocument::ActiveView. Learn more by reading the help for this property.
Members
Description | ||
---|---|---|
Activate | Gives this view control of the specified window. | |
Clear | Empties the view contents. | |
ContentsChanged | Called by clients when view objects are modified. | |
Deactivate | Another view takes over the associated window. | |
Draw | Draws the view to the specified device context. | |
ExportFrame | The device rectangle to export. | |
Extent | The visible extent rectangle. | |
ExtentStack | The extent stack. | |
FocusMap | The map that tools and controls act on. | |
FullExtent | The full extent rectangle. | |
GetContextMenu | Called when a context menu should be displayed at the given xy location. Return menu that should be displayed. | |
GraphicsContainer | The active graphics container. | |
HitTestMap | Returns any maps present in the view at the given location. Return value may be zero if there are no maps or the coordinate is not over a map. | |
IsActive | Indicates if view is active or not. | |
IsMapActivated | Indicates if the focus map is activated. | |
OnMessage | Call from your application's message loop to enable automatic resizing and keyboard accelerators. | |
Output | Renders the view to the specified DC. | |
PartialRefresh | Draws the specified view phase. Use an envelope of zero to draw the entire phase. | |
PrinterChanged | Called by application when printer changes. | |
Refresh | Causes the entire view to draw. | |
ScreenCacheID | The screen cache ID that is used to draw the specified phase. | |
ScreenDisplay | The screen display used by the view. | |
Selection | The selection. | |
ShowRulers | Indicates if rulers are visible. | |
ShowScrollBars | Indicates if scrollbars are visible. | |
ShowSelection | Indicates if selection is visible. | |
TipText | The tip text to display at the given location. |
CoClasses that implement IActiveView
CoClasses and Classes | Description |
---|---|
Globe (esriGlobeCore) | A container for the display and manipulation of data in the Globe. |
Map | A container for the display and manipulation of map data. |
PageLayout | Page Layout class contains maps and map surrounds. |
Scene (esri3DAnalyst) | A container for the display and manipulation of data. |
Remarks
When working with the IActiveView interface on a MapDocument object, you should always first call IActiveView::Activate() in order to properly initialize the display of the PageLayout or Map object. The MxDocument and MapServer objects initialize display objects automatically after opening an MXD, but MapDocument does not do this. If your application has a user interface, you should call Activate() with the hWnd of the application's client area. If your application runs in the background and has no windows, you can always get a valid hWnd from the GDI GetDesktopWindow() function, part of the Win32 API.