|
|
Using Configurations
This article is intended to help people understand the built-in utility for saving
and loading different configurations from the V3.2 and later ActiveX products
produced by Global Majic Software.
BACKGROUND:
Global Majic introduced a new feature with its V3.2 ActiveX Components which
enables users to load and save configurations of the different components. This
feature allows you to design and share your own configurations for any of the V3.2
ActiveX components. For instance, if you are developing applications for industrial
automation and you have a pressure meter that you use frequently, you now have
the ability to design the configuration using the Angular Gauge ActiveX and
save the configuration. The next time you need to use this gauge, you can drop a
new Angular Gauge component on your form and with the click of the mouse have all
those properties (including bitmaps) loaded into the component!
The Library Property Page within the component property pages (shown) includes a
tree which lists the current configurations available for the developer. The
developer can browse through this list and select any of the configurations to
automatically load all the properties for that particular configuration with a
single click of the mouse. The developer then needs to click the "Load" button
to force the properties into memory and the component is configured to that
Library configuration. The developer can also save and modify their own
configurations, import someone else's configurations, or export their configurations.
LOADING CONFIGURATIONS AT DESIGN TIME:
Right click on the component and go to the properties page.
Go to the Library tabbed property page.
Using the tree on the left side, browse through the different configurations
and select the one you are interested in by double-clicking on it.
Click on the "Load" button on the right hand side of the property page.
The properties for this configuration now appear within the other property pages.
You may modify these properties and even change the configuration or save the newly
modified configuration as something else.
LOADING CONFIGURATIONS AT RUN TIME:
A property named "Configuration" is available (only at run time) which allows you to load saved configurations at run time.
There are no properties to save configurations at run time.
To load a configuration at run time the syntax is: In Visual Basic: component.Configuration = Path
where Path is a string that matches the path which shows up in the Library tree.
In Visual C++: component.SetConfiguration(Path);
where Path is a string that matches the path which shows up in the Library tree.
SAVING CONFIGURATIONS:
Right click on the component and go to the properties page.
Set up all your properties to configure your component to meet your needs.
Go to the Library tabbed property page.
If you would like to create a new directory in your tree to save your configuration, right click on the directory you wish to create a new subdirectory and select "New". Type in the directory name.
Click on the directory you wish to place the new configuration.
Place your cursor in the text box labeled "Configuration Name" and type in the name of the configuration you wish to create.
Click on the "Store" button.
IMPORTING CONFIGURATIONS:
Right click on the component and go to the properties page.
Go to the Library tabbed property page.
Click on the "Import" button and find the *.gms file you wish to import.
The tree will reflect an "Import" directory and the new configuration(s) will reside within that directory. If you wish to move them out of that directory, drag the configuration(s) to the location within the tree where you wish them to reside.
EXPORTING CONFIGURATIONS:
Right click on the component and go to the properties page.
Go to the Library tabbed property page.
Click on the configuration or the directory of configurations you wish to export.
Click on the "Export" button and save the file as a *.gms file.
DELETING CONFIGURATIONS:
Right click on the component and go to the properties page.
Go to the Library tabbed property page.
Click on the directory or the configuration you wish to delete. Either hit the "delete" key or right click on the configuration and select "Delete".
INSTALLING YOUR CONFIGURATIONS ON A TARGET MACHINE:
If you are installing a configuration on target machines, it is possible that your
end user will have his own configurations already built for himself. The configurations
for all Global Majic Software ActiveX controls reside in a single file
named config.gms. You could simply include this file in your installation and
install it to the target machine's system directory. However, if your end user
also has his own configurations, then he is going to be pretty upset when all
his configurations have been overwritten. Global Majic includes a merge utility
in the GMSBin directory named GMSMergeUtil.exe. You simply pass it the argument
for the configuration you wish to merge with existing configurations
(i.e. GMSMergeUtil.exe PATHNAME). If the config.gms file does not exist on the
target machine, the merge utility will create it and place your configuration(s)
in that file.
|
|
|
Recently Visited Products
|