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 update(double value);
82 void update(const char *value);
83 void reposition_window(int x, int y);
84 // Set images to be used
85 void set_menu_images(VFrame **data);
86 void set_tumbler_images(VFrame **data);
89 BC_WindowBase *subwindow;
96 ZoomTumbler *zoom_tumbler;
97 char string[BCTEXTLEN];
102 ArrayList<ZoomHash*> zoom_table;
103 VFrame **menu_images;
104 VFrame **tumbler_images;
107 class ZoomPopup : public BC_PopupMenu
110 ZoomPopup(MWindow *mwindow, ZoomPanel *panel, int x, int y);
119 class ZoomTumbler : public BC_Tumbler
122 ZoomTumbler(MWindow *mwindow, ZoomPanel *panel, int x, int y);
125 int handle_up_event();
126 int handle_down_event();