📄 readme.rtf
字号:
MapX Helper's Dialogs
Note: This sample application and corresponding sample code is provided for example purposes only. It has not undergone rigorous testing and as such should not be shipped as part of a final application without extensive testing on the part of the organization releasing the end-user product.
Helper's dialogs is the set of Visual Basic forms/modules with published interface, which allow developers to include them in their VB projects and control almost all of MapX OCX view and behavior.
Prerequisites:
Before running this application please install the following:
The latest MapX OCX control
The following controls can be installed by selecting ActiveX option during Visual Studio 6.0 Installation:
COMCTL32.OCX
COMDLG32.OCX
DBGRID32.OCX
This program also requires JET IISAM driver, so install it by selecting Data Access -> Jet IISAM Driver during Visual Studio 6.0 Installation.
Product contains the following forms and modules:
MainForm form
Controls:
mapxMap - MapX OCX with "US with AK & HI Insets" map
tlbMapTools - toolbar with arrow, zoom, pan, center controls and layer control button
cmdLayerControl - "Layer Control" command button, calls LayerControl form
cmdAddDataset - "Add dataset" command button, calls AddDataset form
cmdAddTheme - "Add theme" command button, calls AddTheme form
cmdModifyTheme - "Modify theme" command button, calls ModifyTheme form
cmdRemoveTheme - "Remove theme" command button, call RemoveTheme form
cmdPrint - "Print" button, prints the MapX
imlIcons- list of icons for the tlbMapTools toolbar
Data1 - data control linked with USA.DBF table.
DBGrid1 - DB Grid linked with Data1
Data2 - data control linked with CITY_1K table.
Description:
Form contains MapX map and all the controls to test the helper's dialogs functionality.
LayerControl form
Controls:
lstLayers - list box with layers' names
ckVisible - check box controlling Visible property of Layer object.
ckSelectable - check box controlling Selectable property of Layer object.
ckAutoLabel - check box controlling AutoLabel property of Layer object.
cmdDisplay - "Display..." command button, calls DisplayProperties form.
cmdLabel - "Label..." command button, calls LabelProps form.
cmdAdd - "Add..." command button, used to add new layer to the map.
cmdRemove - "Remove" command button, removes the layer from the map.
cmdUp - "Up" command button, moves the layer one position up.
cmdDown - "Down" command button, moves the layer one position down.
btnClose - "Close" command button, closes LayerControl form without applying the changes made in dialog.
btnOk - "Close" command button, closes LayerControl form and applies the changes made in dialog.
dlgSpecifyLayer - common dialog used to specify the layer to add.
Description:
Form contains one exported routine - Activate, with single argument - Map control. When activated, fills global ld array (declared in MapXUtils module) with appropriate layers' settings, displays Layer Control dialog. When user presses OK, applies the changes made in dialog to the map passed as the argument of Activate routine.
All the developers' need is to call Activate routine with parameter - Map control they want to be altered.
Comments:
Due to impossibility of creating new MapXLib.Style object, style settings are applied immediately after the user picks the style.
AddDataset form
Controls:
cmbSource - combobox with names of data sources.
cmbLayer- combobox with names of layers to bind data to, default value is <AutoDetect>.
cmbGeoField - combobox with names of all fields in data source, used to choose geographic key column, default value is <AutoDetect>
cmbRefineField - combobox with names of all fields in data source, used to choose refining geographic key column, default value is <AutoDetect>
lstSrcFields - list box with names of fields which present in data source but not included into dataset
lstDestFields - list box with names of fields in dataset
cmdAddFields - "->" button to add the fields selected in lstSrcFields into lstDestFields
cmdRemoveFields - "<-" button to remove selected fields from lstDestFields and add them to lstSrcFields
cmbAggregation - combo box to choose the aggregation function for the field. Available when selected single field from lsfDestFields
txtFieldName - edit box to enter the name of the field as it will be represented in dataset. Available when selected single field from lsfDestFields
txtName - text box to edit the name of dataset to be added.
cmdCancel - "Cancel" command button, used to close the form without adding the dataset.
cmdAdd - "Add" command button, used to add the dataset and close the form.
Description:
Form contains one exported routine - Activate, with two arguments - DataSrc() array of variant type which should contain data sources (for now, Data objects), and Map control. When activated, fills cmdSource combobox with sources' names, cmbLayer and cmbGeoField with names of fields in dataset, displays Add dataset dialog. When user presses Add, adds the new dataset to Map object using settings made in dialog by the user.
All the developers need is to call Activate routine with two parameter - DataSrc() array filled with data sources and Map control to which they want to add the dataset.
AddTheme form
Controls:
cmbDataset - combobox with names of all datasets available
cmbThemeType - combobox with all possible types of theme
cmdOptions - "Options" command button, calls one of theme options forms depending on currently selected theme type
lstFields - list box, contains names of all fields in currently selected dataset, allows multiply selection
txtThemeName - edit box to specify the theme name, default value is the list of all selected fields
cmdLegend - "Legend" command button. Calls LegendStyle form.
cmdCancel - "Cancel" command button, used to close the form without adding the theme
cmdAdd - "Add" command button, used to add the theme and close the form.
Description:
Form contains one exported routine - Activate, with one argument - Map control. When activated, fills cmdDataset combobox with datasets' names, lstFields with names of fields in dataset, displays Add Theme dialog. When user presses Add, adds the new theme to dataset object using settings made in dialog by the user.
All the developers' need is to call Activate routine with one parameter - Map control to which they want to add the theme
ModifyTheme form
Controls:
cmbThemes - combobox with names of all themes in MapX object
cmdCancel - "Close" command button, used to close the form
cmdLegend - "Legend" command button, calls LegendStyle form
cmdModify - "Modify" command button, calls one of theme options forms depending on the type of currently selected theme
Description:
Form contains one exported routine - Activate, with one argument - Map control. When activated, fills cmdThemes combobox with themes' names, and displays Modify Theme dialog. When user presses Legend or Modify, displays options dialog.
All the developers' need is to call Activate routine with one parameter - Map control theme of which they want to modify.
Comments:
Form is non-modal, so the user can see the changes in MapX object and adjust the themes without closing/reopening the form.
RemoveTheme form
Controls:
lstThemes - list box with list of all currently displayed themes. Double-clicking of the theme removes it and closes the form.
cmdCancel - "Cancel" button, used to close form without removing themes.
cmdRemove - "Remove" button, removes all selected in lstThemes list box themes.
Description:
Form contains one exported routine - Activate, with one argument - Map control. When activated, fills lstThemes list box with themes' names (constructs theme name as Dataset -- Theme), and displays Remove Themes dialog. When user presses Remove, removes all themes currently selected in lstThemes list box.
All the developers' need is to call Activate routine with one parameter - Map control from which they want to remove the theme
All other forms are called by LayerControl and AddDataset forms.
DisplayProperties form
Controls:
ckStyleOver - check box "Style Override", controls OverrideStyle property of Layer object.
cmdRegionStyle - "Reg" command button, controls region style, call Style.PickRegion method.
cmdLineStyle - "Line" command button, controls line style, calls Style.PickLine method.
cmdPointStyle - "Pnt" command button, controls symbol style, calls Style.PickSymbol method.
cmdFontStyle - "Aa" command button, controls text style, calls Style.PickText method..
ckZoomRange - "Display within Zoom Range" check box, controls ZoomLayer property of Layer object.
txtMinZoom - text box to specify minimal zoom for the layer, controls ZoomMin property of Layer object.
txtMaxZoom - text box to specify maximal zoom for the layer, controls ZoomMax property of Layer object.
cmdCancel - "Cancel" command button, closes the form without saving the changes in ld array.
cmdOk - "OK" command button, stores the changes in ld array and closes the form.
Description:
Developer does not need to display this form from his code, it is displayed from LayerControl form when the user presses "Display" button or double-clicks the layer.
LabelProps form
Controls:
cmbDataSet - combobox with list of all datasets available, default value is <None>. Controls Dataset property of Layer.LabelProperties object.
cmbField - combobox with list of all fields in currently selected dataset. Controls DataField property of Layer.LabelProperties object.
frmPosition - frame for radio group which controls position of the label
rPosition - radio group which controls Orientation property of Layer.Label object.
cmdFontStyle - "Aa" command button, controls label style, calls Layer.LabelProperties.Style.PickText method.
ckParallel - "Rotate label with line" check box, controls Parallel property of Layer.LabelProperties object.
ckVisible - "Visible" check box, controls Visible property of Layer.LabelProperties object.
ckDuplicate - "Allow duplicate text" check box, controls Duplicate property of Layer.LabelProperties object.
ckOverlapping - "Allow overlapping text" check box, controls Overlap property of Layer.LabelProperties object.
ckZoomRange - "Display within Zoom Range" check box, controls LabelZoom property of Layer.LabelProperties object.
txtMinZoom - edit box controlling LabelZoomMin property of Layer.LabelProperties object.
txtMaxZoom - edit box controlling LabelZoomMax property of Layer.LabelProperties object.
txtOffset - edit box controlling Offset property of Layer.LabelProperties object.
txtMaxLabels - edit box controlling LabelMax property of Layer.LabelProperties object.
rbNone, rbSimple, rbArrow - "None", "Simple", "Arrow" radio buttons, control LineType property of Layer.LabelProperties object.
LegendStyle form
Controls:
ckVisible - "Visible" check box. Controls Visible property of Theme.Legend object
ckCompact - "Compact" check box. Controls Compact property of Theme.Legend object
ckCurrency - "Use currency format". Controls CurrencyFormat property of Theme.Legend object
cmdFontStyle - command button. When clicked, calls font picker. Controls BodyTextStyle property of Theme.Legend object
ckNewTitle - "Override title" check box
editTitle- edit box controlling Title or CompactTitle property of Theme.Legend object
cmdTitleStyle - command button. Controls TitleStyle or CompactTitleStyle property of Theme.Legend object. When clicked, calls Theme.Legend.TitleStyle.PickText or Theme.Legend.CompactTitleStyle.PickText method.
ckNewSubTitle - "Override subtitle" check box
editSubTitle- edit box controlling SubTitle property of Theme.Legend object
cmdSubTitleStyle - command button. Controls SubTitleStyle property of Theme.Legend object. When clicked, calls Theme.Legend.SubTitleStyle.PickText method.
dlgFont - common dialog used for font pickers
cmdCancel - "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
RangeOptions form
Controls:
cmbRangesNumber - combobox controlling NumRanges property of Theme.Properties object.
cmbDistrib - controls distribution method: equal count per range or equal ranges.
pctBeginColor - picture box control, shows begin color of spread, when clicked, displays color picker dialog
pctEndColor - picture box control, shows end color of spread, when clicked, displays color picker dialog
rbRGB - radio button "RGB", specifies RGB color spread method
rgHSV - radio button "HSV", specifies HSV color spread method
dlgSpecifyColor - common dialog used for color picker dialog
cmdCancel- "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
BarOptions form
Controls:
txtDataValue - edit box, controls DataValue property of Theme.Properties object
txtSize - edit box, controls Size property of Theme.Properties object
txtWidth - edit box, controls Width property of Theme.Properties object
ckIndependent - check box "Bars are scaled Independently", controls Independent property of Theme.Properties object
cmdCancel- "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
PieOptions form
Controls:
txtDataValue - edit box, controls DataValue property of Theme.Properties object
txtSize - edit box, controls Size property of Theme.Properties object
ckGraduated - check box "Pies are Graduated", controls Graduated property of Theme.Properties object
cmdCancel- "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
GradOptions form
Controls:
txtDataValue - edit box, controls DataValue property of Theme.Properties object
cmbSize - combobox, controls SymbolStyle.SymbolFont.Size property of Theme.Properties object
pctSymbolColor - picture box control, shows color of symbols, when clicked, displays color picker dialog
dlgSymbolColor - common dialog used for color picker dialog
cmdCancel- "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
DotOptions form
Controls:
txtDataValue - edit box, controls ValuePerDot property of Theme.Properties object
cmbSize - combobox, controls DotSize property of Theme.Properties object
cmdCancel- "Cancel" command button. Closes form without accepting of the changes
cmdOK - "OK" command button. Stores the settings made and closes the form.
MapXUtils module - contains declarations and implementations of types and functions which are used by the forms
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -