summaryrefslogtreecommitdiff
path: root/navit/osd
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-08-22 22:52:05 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-08-22 22:52:05 +0000
commit72d1c444f816cfe8e4a6f4ef0efca85b7cf7b3d4 (patch)
treeac8158ed9ebf2c5a35b2b3be55e2491d16ade0a2 /navit/osd
parentb528bc2fd554f10eb997009817c8abc586734be7 (diff)
downloadnavit-72d1c444f816cfe8e4a6f4ef0efca85b7cf7b3d4.tar.gz
Add:Core:Make it possible to add more commands to osd buttons
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1306 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/osd')
-rw-r--r--navit/osd/core/osd_core.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index ee8b04c64..53ceac8ae 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -594,6 +594,7 @@ struct osd_button {
struct callback *navit_init_cb;
struct callback *draw_cb;
struct graphics_image *img;
+ int pressed;
char *src;
char *command;
};
@@ -613,17 +614,14 @@ osd_button_click(struct osd_button *this, struct navit *nav, int pressed, int bu
{
struct point bp=this->p;
wrap_point(&bp, this->nav);
- if (p->x < bp.x || p->y < bp.y || p->x > bp.x+this->img->width || p->y > bp.y+this->img->height)
+ dbg(0,"%d,%d-%d,%d %d,%d\n", bp.x, bp.y, bp.x+this->img->width, bp.y+this->img->height, p->x, p->y);
+ if ((p->x < bp.x || p->y < bp.y || p->x > bp.x+this->img->width || p->y > bp.y+this->img->height) && !this->pressed)
return;
navit_ignore_button(nav);
+ this->pressed=pressed;
if (pressed) {
- dbg(0,"enter\n");
- if (! strcmp(this->command, "zoom_in")) {
- navit_zoom_in(nav, 2, NULL);
- }
- if (! strcmp(this->command, "zoom_out")) {
- navit_zoom_out(nav, 2, NULL);
- }
+ dbg(0,"calling command '%s'\n", this->command);
+ navit_command_call(nav, this->command);
}
}