Status bar


Purpose
This sample demonstrates using the ToolBarControl and MapControl in conjunction with Control Commands and a status bar. The sample demonstrates displaying text in the StatusBar control by setting each Pane's text property.

How to use

If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the sample.
  2. Use the "Open File" icon to load an MXD to work with.
  3. Move the mouse pointer over the ToolbarControl. The first StatusBar pane will be updated with each Item's command message.
  4. Move the mouse pointer over the MapControl. The second StatusBar pane will be updated with the current mouse coordinates in map units.

Additional information

The HitTest method is used within the IToolbarControlEvents::OnMouseMove event to determine whether the mouse pointer is over an Item. If the mouse is over an IToolbarItem, the text of the first StatusBar pane is set to the Message of the IToolbarItem::Command.
 
The IMapControlEvents2::OnMouseMove event sets the text of the second StatusBar pane to the mouse coordinates in map units. The IMapControlEvent2::OnMapReplaced event is used to keep track of the MapControl's MapUnits.


StatusBar.h Main header file
StatusBar.cpp Main implementation file
MapControlEvents.h Event header file
MapControlEvents.cpp Event implementation file
ToolbarControlEvents.h Event header file
ToolbarControlEvents.cpp Event implementation file
Makefile.SolarisMotif Solaris Project Makefile
Makefile.LinuxMotif Linux Project Makefile
Download the Motif_CPP files

Download the files for all languages




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime