 |
Modification of menu.ini
The items of the menu may be hidden or shown according to the needs of the project. This
can be done by editing menu.ini file stored in the same folder like Drive.exe.
menu.ini structure
-
Drive menu can be divided into two parts:
-
Menu.ini is divided into these two parts. In the first part of menu.ini is
the default menu defined, custom menu is defined afterwards.
-
Both default menu and custom menu are divided into sections. Section
represents one menu dialog. Each section begins with section name written in
square brackets, e.g. [menu.main] represents main menu dialog. It is
following with list of buttons (one button per line). It is necessary to enter
new line immediately after section name otherwise whole section will be
ignored.
-
Comments begins with semicolon ( ; ) and are ignored by Drive.
-
Menu.ini does not allow to make user-defined dialogs it just allows to change
existing dialogs.
Default menu
-
Buttons in default menu can be just shown (as without menu.ini) or hidden. It
is not possible to change their appearance or function.
-
Button is shown until it is explicitly hidden.
-
Section example in default menu:
[menu.navigateTo]
menu.navigateTo.address=1
menu.navigateTo.favorite=1
menu.navigateTo.history=1
menu.navigateTo.poi=1
menu.navigateTo.zipCode=1
menu.navigateTo.home=1
menu.navigateTo.pointOnMap=1
menu.navigateTo.enterPosition=1
menu.navigateTo.cityCentre=1
menu.navigateTo.cityPOI=1
;group
menu.navigateTo.currentPosition=1
menu.navigateTo.lastValidPosition=1
This is definition of menu Navigate to in menu.ini
-
Each line menu.navigateTo.button
(e.g. menu.navigateTo.address) are unique identifiers of buttons in Navigate to
menu.
-
To hide button just set its value to zero.
menu.navigateTo.address=0
hides Address button in Navigate to menu.
-
In group of buttons begining with
;group
are buttons alternating at one position. In this example
;group
menu.navigateTo.currentPosition=1
menu.navigateTo.lastValidPosition=1
currentPosition is shown if Drive has GPS position, lastValidPosition
is shown otherwise.
It is necessary to turn on/off each of these buttons.
;group
menu.navigateTo.currentPosition=0
menu.navigateTo.lastValidPosition=1
is incorrect because currentPosition is turned off and
lastValidPosition is turned off.
The line
;group
is just information for user. Drive ignores it.
-
Menu.ini part defining default menu need not to be changed. It serves just for
turning buttons on and off.
-
Do not forget to turn on/off all buttons in set of buttons started with ;group
Custom menu
-
Custom menu is defined in menu.ini after the default menu.
-
To add new button into menu dialog create new section and write list of buttons
you want to add below.
-
Example:
[menu.main]
button1=1
button2=1
This code commands Drive to add two buttons (button1 and button2) to
main menu. It is necessary to define both buttons.
Defining buttons properties:
[button1]
bitmap=_b.fromFavorites.bmp
action=default_command
command=hide_application
text=Drive to background
position=0
-
bitmap
name of picture which will be shown on button. The picture has to be stored in
Icons folder in 32-bit bmp format.
-
action
action attribute has to be set to default_command, or
execute_file. Drive then performs action defined in command
attribute. It is also possible to raise a EVENT_CUSTOM_MENU with the button, in that case the attribute has to be set to default_command.
-
command
command attribute defines action to perform. Possible values are:
-
hide_application hides Drive to background
-
route_cancel cancels route and stops navigation
-
exit_application ends Drive
-
show_route shows computed route on browse map
-
route_summary shows computed route summary
-
browse_map shows browse map
-
load_map shows dialog enabling user to load map
-
volume_settings shows dialog enablig user to set volume
-
gps_hardware shows dialog enabling user to set GPS setting
- string parameter of custom event if no action is to be taken, but an EVENT_CUSTOM_MENU has to be raised
-
name of external application this value is allowed only if
action=execute_file.The external application must be stored in \Res folder.
-
text
text shown on button
-
position
defines position of the button in the menu page (zero based index)
|
|
|
|