Label edit


PurposeThis sample demonstrates editing the TOCControl's labels.  The TabStrip control's click event determines whether the TOCControl's Buddy property is set to either the MapControl or PageLayoutControl. The ActiveView of the Buddy is used by the TOCControl to populate itself. The LabelEdit property determines whether labels can be edited unchecked (automatic) or whether the OnBeginLabelEdit and OnEndLabelEdit events are triggered (manual). If label editing is set to manual the HitTest method is used within the OnBeginLabelEdit event to determine the type of label being edited. In this sample, only layer labels can be edited. The OnEndLabelEdit event ensures there are no empty layer labels.

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 application.
  2. Use the 'Load Map Document' button to load a map document into both the MapControl and PageLayoutControl.
  3. Toggle the visibility of data layers in the TOCControl.
  4. Toggle between the MapControl and PageLayoutControl to change the buddy and see the TOCControl update itself.
  5. Edit the TOCControl labels by clicking on a label, then clicking on it a second time to invoke label editing. The ESC key on the keyboard can be used during the edit to cancel the label edit.

LabelEdit.h Main header file
LabelEdit.cpp Main implementation file
TOCControlEvents.h Event header file
TOCControlEvents.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