Interface of setting up the panel of applied task

Print Previous page Top page

System of digital maps the Panorama supports possibility of creating and customizing the custom toolbars. The toolbar can be created from available buttons, both of the Panorama shell, and its applications supporting the interface of customizing the toolbars.

The  customizing interface is a set of functions to be exported by the application task of the Panorama system. These functions provide shell an access to such information about the task, as:

- application name;

- number of toolbars in the application;

- names of toolbars;

- number of buttons in toolbars;

- names of buttons in toolbars;

- identifiers of buttons (the image in DDB format).

So, the application task of the system of digital maps the GIS Panorama must export the following functions:

char* userGetTaskName(long language);

 where:

        language - the language's code of the returned string (see maptype.h).

The function returns the name of the task in terms of language, in the case of an error it returns the zero-length string. It is desirable to limit the size of a returned string by 32 symbols.  

long userGetPanelCount ();

The function returns the number of available toolbars, or 0 at error.

const char* userGetPanelName(long panel, long language);

        where:

panel      - number of toolbar in the task starting from 1 etc.,

language - the language's code of the returned string (see maptype.h).

The function returns the name of the toolbar, in case of error it returns a zero-length string. It is desirable to limit the size of a returned string by 32 symbols.

long userGetPanelButtonCount(long panel);

 where:

        panel - number of toolbar in the task starting from 1 etc.

The function returns the number of buttons available in the toolbar or 0 on error.

long userGetPanelButtonResID(long button, long panel);

where:

button - number of button in the toolbar starting from 1 etc.,

panel  - number of toolbar in the task starting from 1 etc.

Function returns the button identifier in the toolbar or 0 at an error.

const char* userGetPanelButtonName(long number, long panel, long language);

const WCHAR * userGetPanelButtonNameUn(long number, long panel, long language);

 where:        

button    - number of button in the toolbar starting from 1 etc.,

panel      - number of toolbar in the task starting from 1 etc.,

language - the language's code of the returned string (see maptype.h)

Function returns the button name, in case of error it returns a zero-length string. It is desirable to limit the size of a returned string by 32 symbols.

 

constchar* userGetButtonName(longid, longpanel);

const WCHAR* userGetButtonNameUn(long id, long panel);

 where:

id    - the button identifier,

panel      - number of toolbar in the task starting from 1 etc. (parameter is not used).

Function returns the button name, in case of error it returns a zero-length string. It is desirable to limit the size of a returned string by 32 symbols.

The use of these functions is demonstrated in the file RSWEDIT.CPP which is contained in the folder \SDK12\RSWEDIT of examples of application development in GIS "Panorama" 12.

For creation by applications of its own toolbars working under control of the Panorama system, in interface PANAPI there is implemented a set of functions allowing to:

- create the standard toolbar of the task;

- create the empty toolbar;

- add/insert the button into the panel;

- move the toolbar;

- remove the button from the toolbar;

- change an image on the button etc.

virtual int CreateTaskPanel(int panel = 1);

where:

       panel – number of a toolbar in the task (see above userGetPanelCount()).

Function creates the standard panel of an application and returns its identifier or 0 on an error. Usually this function is called by the Panorama system at start of an application, and should be redefined in the module of this application.

int CreatePanel(HINSTANCE hInst, const char* name);

int CreatePanel(HINSTANCE hInst, const WCHAR* name);

 where:

       hInst  - identifier of the module containing resources of buttons,

       name - panel title.

Function creates the empty panel of tools and returns it or 0 on an error.

int InsertButton(int panelID, int bmpFace, int command, int after = 0);

 where:

                 panelID    - identifier of the earlier created panel,

                 bmpFace  - identifier of the button image from resources,

                 command - button identifier, if 0 - a separator,

                 after         - identifier of the existing button after which

                                   the button is inserted, if 0 - into the end of panel.

Function inserts the button into the existing panel and returns its identifier command or 0 on an error.

int DeleteButton(int panelID, int command);

 where:

           panelID    - identifier of the earlier created panel,

           command - identifier of the deleted button.

Function deletes the button from existing the panel and returns 1 or 0 on an error.

int MovePanel(int panelID, RECT rect, int  position, int layout = 1);

 where:

       panelID - identifier of the earlier created panel,

       rect        - coordinates of new toolbar location,

       position - toolbar position in the window:

0 - floating;

1 - in the upper part of the window;

2 - in the lower part of the window;

3 - in the left part of the window;

4 - in the right part of the window;

    layout    - sign of immediate updating a window

The function shifts the panel to the specified location and returns 1 or 0 on error.

int SetButtonFace(int panelID, int command, HBITMAP bmpFace);

 where:

                 panelID    - identifier of the earlier created panel,

                 command - button identifier,

                 bmpFace  - identifier of the new button image.

Function changes a picture on the button with identifier the command in the panel panelID, or in all panels of system if panelID = 0, and returns command or 0 at on error.

int SetButtonFacePNG(int panelID, int command, int pngid);

 where:

                 panelID    - identifier of the earlier created panel,

                 command - button identifier,

                 pngid- identifier of the new button of PNG format.

Function changes a picture on the button with identifier the command in the panel panelID, or in all panels of system if panelID = 0, and returns command or 0 at on error.

virtual int PanelCanClose(int panelID);

 where:

        panelID - identifier of the earlier created panel,

Function is called by the Panorama system as a request on closing the panel of tools panelID, and should be redefined in the module of this task.

virtual int PanelRightUp(int panelID, POINT * point);

where:

      panelID  - identifier of the panel

      point      - cursor position on the screen

Function is called by the Panorama system at the moment of releasing the right mouse button over the panel panelID, and should be redefined in the module of this application, for example for call of pop-up menu.

The use of these functions is demonstrated in the file RSWEDIT.CPP which is contained in \SDK12\RSWEDIT of examples of application development in GIS "Panorama" 12.