![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
The TSLAPP6APalette class should be used for all interactions with the symbol palette dialog box.
The actual MFC dialog is created in the class constructor. You can check that this has been created successfully by calling the valid method straight after construction.
Check the TSLErrorStack::lastError() method for a description of the problem.
Public Member Functions | |
TSLAPP6APalette (TSLAPP6ARequest *client, bool helpRequired=true, HWND parent=0) | |
~TSLAPP6APalette () | |
void | clear () |
void | forceUpdate () |
const char * | getCurName () |
Int | getListSize () |
bool | getSelectedSymbol (TSLAPP6ASymbol &symbol) |
bool | getSymbol (Int index, TSLAPP6ASymbol &symbol) |
TSLAPP6AProperties * | getProperties (TSLAPP6ARequest *client) |
bool | isVisible () |
bool | load (const char *path, const char *paletteName=0) |
bool | save (const char *path, bool append=false) |
void | showWindow (bool show=true) |
bool | valid () |
TSLAPP6APalette::TSLAPP6APalette | ( | TSLAPP6ARequest * | client, |
bool | helpRequired = true, | ||
HWND | parent = 0 ) |
Default Constructor.
The first parameter should be a pointer to a TSLAPP6ARequest derived class that will receive the update messages from the Palette.
If the helpRequired flag is true then a help button will be displayed on each page and the click action will be sent via a TSLAPP6ARequest::onHelp() call.
The HWND parameter should be used to specify a handle to the parent window. This is equivalent to CWnd in a normal MFC Dialog class.
TSLAPP6APalette::~TSLAPP6APalette | ( | ) |
Destructor.
void TSLAPP6APalette::clear | ( | ) |
This method clears all symbols from the palette.
void TSLAPP6APalette::forceUpdate | ( | ) |
Forces the Palette to call the TSLAPP6ARequest::onPaletteUpdate() method, passing any symbols that the user may have selected.
const char * TSLAPP6APalette::getCurName | ( | ) |
Use this method to query the name of the current palette.
Int TSLAPP6APalette::getListSize | ( | ) |
Queries the number of symbols loaded into the palette. This value can then be used with getSelectedSymbol() to loop through all the symbols in the palette.
TSLAPP6AProperties * TSLAPP6APalette::getProperties | ( | TSLAPP6ARequest * | client | ) |
Use this method to get a handle to the properties dialog used by the Symbol Palette. The Palette remains the owner of the pointer and the client application should not attempt to delete it. Using this method it is possible to limit the number of properties dialogs in the application to one.
If the properties dialog has not been created by the palette when this method is called, a new instance will be created and returned to the caller. If a valid TSLAPP6ARequest pointer was passed in the constructor of this class then the properties dialog will be updated so that it passes callbacks to that. A different callback instance can be selected by passing the memory location into this method.
A null pointer will be returned if an error occurs. Check the TSLErrorStack for details of the problem.
client | A pointer to a TSLAPP6ARequest derived object that will receive callbacks from the symbol properties dialog. If you want the callbacks to go to the same object as the tslapp6apalette callbacks do then pass 0 into this method. |
bool TSLAPP6APalette::getSelectedSymbol | ( | TSLAPP6ASymbol & | symbol | ) |
This method populates the symbol passed in, with the last symbol selected from the palette.
The helper can then be used to convert this into a bitmap, entity set, or string. The same result could be achieved by calling forceUpdate() and capturing the symbol in the TSLAPP6ARequest::onPaletteUpdate() method.
symbol | A reference to a TSLAPP6ASymbol object to be populated. |
bool TSLAPP6APalette::getSymbol | ( | Int | index, |
TSLAPP6ASymbol & | symbol ) |
Use this method to get an individual symbol from the palette.
Use the getListSize() method to retrieve the number of items in the list.
symbol | A TSLAPP6ASymbol object to populate. |
index | The integer index of the symbol in the list. |
bool TSLAPP6APalette::isVisible | ( | ) |
Use this method to query the visibility of the dialog.
bool TSLAPP6APalette::load | ( | const char * | path, |
const char * | paletteName = 0 ) |
Loads a APP6A palette from a specific location on disk.
path | The location of a valid palette (usually *.app6a). |
paletteName | If this parameter is specified, then the file will be searched for the correct palette to be loaded. This allows multiple palettes to be stored in a single file. If the palette does not exist in the file this method will return false. |
bool TSLAPP6APalette::save | ( | const char * | path, |
bool | append = false ) |
Saves the current palette to the location specified in the 'path' parameter.
path | The location of the file to save to. Note that the file does not have to exists. |
append | Boolean flag indicating if the palette should be appended to the file. This allows multiple palettes to be stored in a single file. If the flag is set to true and the file does not exist, a new file will be created and the method will return true. |
void TSLAPP6APalette::showWindow | ( | bool | show = true | ) |
Shows or hides the dialog depending on the value of 'show'. This method does nothing if you try to hide an already hidden window.
show | A boolean value which dermines whether the resulting window will be hidden or visible. |
bool TSLAPP6APalette::valid | ( | ) |
The dialog is created when the class is constructed, therefore it is not possible to returns a value to indicate whether this was successful or not. This method returns true if the palette was successfully created.
Check the TSLErrorStack for a description is this returns false.