MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLAPP6APalette Class Reference

Detailed Description

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)
 
TSLAPP6APropertiesgetProperties (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 ()
 

Constructor & Destructor Documentation

◆ TSLAPP6APalette()

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::~TSLAPP6APalette ( )

Destructor.

Member Function Documentation

◆ clear()

void TSLAPP6APalette::clear ( )

This method clears all symbols from the palette.

◆ forceUpdate()

void TSLAPP6APalette::forceUpdate ( )

Forces the Palette to call the TSLAPP6ARequest::onPaletteUpdate() method, passing any symbols that the user may have selected.

◆ getCurName()

const char * TSLAPP6APalette::getCurName ( )

Use this method to query the name of the current palette.

Returns
A pointer to a string containing the name of the palette. This string is owned by the palette and should not be deleted.

◆ getListSize()

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.

Returns
An integer value indicating the number of symbols in the palette.

◆ getProperties()

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.

Parameters
clientA 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.
Returns
A pointer to the TSLAPP6AProperties dialog used by the palette.

◆ getSelectedSymbol()

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.

Parameters
symbolA reference to a TSLAPP6ASymbol object to be populated.
Returns
False if no symbol is selected, true otherwise.

◆ getSymbol()

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.

Parameters
symbolA TSLAPP6ASymbol object to populate.
indexThe integer index of the symbol in the list.
Returns
True if successful, false otherwise (if the index is out of range).

◆ isVisible()

bool TSLAPP6APalette::isVisible ( )

Use this method to query the visibility of the dialog.

Returns
True if the dialog is currently visible, false otherwise.

◆ load()

bool TSLAPP6APalette::load ( const char * path,
const char * paletteName = 0 )

Loads a APP6A palette from a specific location on disk.

Parameters
pathThe location of a valid palette (usually *.app6a).
paletteNameIf 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.
Returns
True if the palette was loaded, false otherwise.

◆ save()

bool TSLAPP6APalette::save ( const char * path,
bool append = false )

Saves the current palette to the location specified in the 'path' parameter.

Parameters
pathThe location of the file to save to. Note that the file does not have to exists.
appendBoolean 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.
Returns
True if the palette was saved, false otherwise. Check the TSLErrorStack to a reason for the failiure.

◆ showWindow()

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.

Parameters
showA boolean value which dermines whether the resulting window will be hidden or visible.

◆ valid()

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.

Returns
True if the dialog created successfully, false otherwise.