Back to index

texmacs  1.0.7.15
basic_widget.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : basic_widget.hpp
00004 * DESCRIPTION: Basic widgets can handle the most common events
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef BASIC_WIDGET_H
00013 #define BASIC_WIDGET_H
00014 #include "Widkit/wk_widget.hpp"
00015 #include "Widkit/Event/basic_event.hpp"
00016 
00017 class basic_widget_rep: public wk_widget_rep {
00018 protected:
00019   int ptr_focus; // subwidget where the pointer is (-1 if none)
00020 
00021 public:
00022   basic_widget_rep (gravity grav= north_west);
00023   basic_widget_rep (array<wk_widget> a, gravity grav= north_west);
00024   basic_widget_rep (array<wk_widget> a, array<string> name,
00025                   gravity grav= north_west);
00026 
00027   event emit_position   (SI ox, SI oy, SI w, SI h, gravity grav= north_west);
00028   event emit_invalidate (SI x1, SI y1, SI x2, SI y2);
00029   event emit_mouse      (mouse_event ev);
00030   event emit_mouse      (mouse_event ev, string type);
00031   event emit_mouse      (mouse_event ev, string type, SI x, SI y);
00032   event emit_clear      (SI x1, SI y1, SI x2, SI y2);
00033   event emit_repaint    (SI x1, SI y1, SI x2, SI y2, bool& stop);
00034   event emit_find_child (SI x, SI y, int& which);
00035 
00036   virtual void handle_get_size       (get_size_event ev);
00037   virtual void handle_get_widget     (get_widget_event ev);
00038   virtual void handle_set_widget     (set_widget_event ev);
00039   virtual void handle_attach_window  (attach_window_event ev);
00040   virtual void handle_position       (position_event ev);
00041   virtual void handle_move           (move_event ev);
00042   virtual void handle_resize         (resize_event ev);
00043   virtual void handle_destroy        (destroy_event ev);
00044   virtual void handle_keypress       (keypress_event ev);
00045   virtual void handle_keyboard_focus (keyboard_focus_event ev);
00046   virtual void handle_mouse          (mouse_event ev);
00047   virtual void handle_alarm          (alarm_event ev);
00048   virtual void handle_clear          (clear_event ev);
00049   virtual void handle_repaint        (repaint_event ev);
00050   virtual void handle_update         (update_event ev);
00051   virtual void handle_refresh        (refresh_event ev);
00052   virtual void handle_invalidate     (invalidate_event ev);
00053   virtual void handle_keyboard_grab  (keyboard_grab_event ev);
00054   virtual void handle_mouse_grab     (mouse_grab_event ev);
00055   virtual void handle_request_alarm  (request_alarm_event ev);
00056   virtual void handle_find_child     (find_child_event ev);
00057   virtual bool handle                (event ev);
00058 };
00059 
00060 #endif // defined BASIC_WIDGET_H