4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "mwindow.inc"
32 #define ZOOM_PERCENTAGE 0
40 ZoomHash(double value, const char *text);
50 ZoomPanel(MWindow *mwindow,
51 BC_WindowBase *subwindow,
58 int zoom_type = ZOOM_PERCENTAGE);
59 ZoomPanel(MWindow *mwindow,
60 BC_WindowBase *subwindow,
67 int zoom_type = ZOOM_PERCENTAGE);
70 virtual int handle_event() { return 1; };
72 void calculate_menu();
73 static int calculate_w(int menu_w);
75 void create_objects();
78 void set_text(const char *text);
79 char* value_to_text(double value, int use_table = 1);
80 double text_to_zoom(char *text, int use_table = 1);
81 void set_tooltip(const char *text);
82 void update(double value);
83 void update(const char *value);
84 void reposition_window(int x, int y);
87 BC_WindowBase *subwindow;
94 ZoomTumbler *zoom_tumbler;
95 char string[BCTEXTLEN];
100 ArrayList<ZoomHash*> zoom_table;
103 class ZoomPopup : public BC_PopupMenu
106 ZoomPopup(MWindow *mwindow, ZoomPanel *panel, int x, int y);
115 class ZoomTumbler : public BC_Tumbler
118 ZoomTumbler(MWindow *mwindow, ZoomPanel *panel, int x, int y);
121 int handle_up_event();
122 int handle_down_event();