Customizing controls and dialog boxes – Pitney Bowes MapXtreme User Manual

Page 139

Advertising
background image

Chapter 7: Desktop Applications, Controls, Dialogs, and Tools

Customizing Controls and Dialog Boxes

MapXtreme v7.1

139

Developer Guide

Methods

Once the wizard is created, call the CreateTheme() method from the CreateThematicWizard class to
create the theme. An optional string parameter can be added to set the theme’s alias. The alias can
be used to access the theme from the Layers collection in the case of an ObjectTheme (Bar, Pie,
GraduatedSymbol) or the Modifiers collection in the case of a FeatureStyleModifier (Ranged,
RangedLabel, IndividualValue, IndividualValueLabel, Dot Density). You would access the theme to
modify or delete it.

ITheme theme = themeWizard.CreateTheme("theme1");

If you already know which table is to be themed or which label source to use for a label theme, you
can use the methods, CreateFeatureTheme() for tables or CreateLabelTheme() for labels.

Properties

There are a few properties that can be useful for obtaining information about the theme creation.
WizardResult contains an enumeration WizardStepResult that allows you to check how the user
exited the wizard. These choices are WizardStepResult.Done and WizardStepResult.Cancel. These
are useful to appropriately update the controls or menus in your application.

The following example shows of the use of this.

if (createThemeWizard.WizardResult == WizardStepResult.Done
{

// Update the menus
mnuRemoveTheme.Enabled = true;
mnuModifyTheme.Enabled = true;

}

SelectedLabelSource, SelectedLayer, and SelectedThemeType are properties on the
CreateThemeWizard class that can be used to find out which layer or label source the theme has
been applied to. This is useful when you want to provide the ability to modify a theme and need to
access that object.

To modify a theme, determine the type of theme and then launch the appropriate type of modification
dialog. Dialog box classes for modifying themes are ModifyBarThemeDlg,
ModifyDotDensityThemeDlg, ModifyGradSymbolThemeDlg, ModifyIndValueThemeDlg,
ModifyPieThemeDlg, and ModifyRangedThemeDlg.

MapXtreme ships with a ThemeDialogs sample application in which you can analyze the
implementation and customize it for your needs. See ..\MapInfo\MapXtreme\7.x.x\Samples\Desktop\
Features\ThemeDialogs under your installation of MapXtreme.

Customizing Controls and Dialog Boxes

MapXtreme ships with a wide variety of dialog box classes in the MapInfo.Windows.Dialogs
namespace. Each of the dialog boxes represented there have possible customizations specific to
each one. To modify a specific dialog box, assign values to the different properties that are specific
to each dialog box. Since there are so many, it is not practical to list all the possible customizations
here. Please refer to the online reference for details about each dialog box.

Advertising