2
/******************************************************************************
3
* MODULE : basic_widget.hpp
4
* DESCRIPTION: Basic widgets can handle the most common events
5
* COPYRIGHT : (C) 1999 Joris van der Hoeven
6
*******************************************************************************
7
* This software falls under the GNU general public license and comes WITHOUT
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11
******************************************************************************/
13
#ifndef BASIC_WIDGET_H
14
#define BASIC_WIDGET_H
16
#include "Event/basic_event.hpp"
18
class basic_widget_rep: public widget_rep {
20
int ptr_focus; // subwidget where the pointer is (-1 if none)
23
basic_widget_rep (display dis, gravity grav= north_west);
24
basic_widget_rep (display dis, array<widget> a, gravity grav= north_west);
25
basic_widget_rep (display dis, array<widget> a, array<string> name,
26
gravity grav= north_west);
28
event emit_position (SI ox, SI oy, SI w, SI h, gravity grav= north_west);
29
event emit_invalidate (SI x1, SI y1, SI x2, SI y2);
30
event emit_mouse (mouse_event ev);
31
event emit_mouse (mouse_event ev, string type);
32
event emit_mouse (mouse_event ev, string type, SI x, SI y);
33
event emit_clear (SI x1, SI y1, SI x2, SI y2);
34
event emit_repaint (SI x1, SI y1, SI x2, SI y2, bool& stop);
35
event emit_find_child (SI x, SI y, int& which);
37
virtual void handle_get_size (get_size_event ev);
38
virtual void handle_get_widget (get_widget_event ev);
39
virtual void handle_set_widget (set_widget_event ev);
40
virtual void handle_set_language (set_language_event ev);
41
virtual void handle_attach_window (attach_window_event ev);
42
virtual void handle_position (position_event ev);
43
virtual void handle_move (move_event ev);
44
virtual void handle_resize (resize_event ev);
45
virtual void handle_destroy (destroy_event ev);
46
virtual void handle_keypress (keypress_event ev);
47
virtual void handle_keyboard_focus (keyboard_focus_event ev);
48
virtual void handle_mouse (mouse_event ev);
49
virtual void handle_alarm (alarm_event ev);
50
virtual void handle_clear (clear_event ev);
51
virtual void handle_repaint (repaint_event ev);
52
virtual void handle_update (update_event ev);
53
virtual void handle_invalidate (invalidate_event ev);
54
virtual void handle_keyboard_grab (keyboard_grab_event ev);
55
virtual void handle_mouse_grab (mouse_grab_event ev);
56
virtual void handle_request_alarm (request_alarm_event ev);
57
virtual void handle_find_child (find_child_event ev);
58
virtual bool handle (event ev);
61
#endif // defined BASIC_WIDGET_H