Debian Codegraph @

xo/wbutton.h

raw
1 /* wbutton.h -*- C++ -*-
2 $Id: wbutton.h,v 1.3 1997/10/18 04:57:44 elf Exp $
3
4 written by Marc Singer
5 12 May 1997
6
7 This file is part of the project XO. See the file README for
8 more information.
9
10 Copyright (C) 1997 Marc Singer
11
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 in a file called COPYING along with this program; if not, write to
24 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
25 02139, USA.
26
27 -----------
28 DESCRIPTION
29 -----------
30
31 */
32
33 #if !defined (__WBUTTON_H__)
34 # define __WBUTTON_H__
35
36 /* ----- Includes */
37
38 /* ----- Classes */
39
40
41 class WButton : public LWindow {
42
43 protected:
44 Font m_fid;
45 unsigned long m_foreground; // Color values for foreground and
46 unsigned long m_background; // background pixels
47 unsigned long m_highlight; // Highlight for pressed button
48 bool m_fPress;
49 bool m_fOutOfWindow;
50
51 public:
52 void buttondown (XButtonEvent* pEvent);
53 void buttonup (XButtonEvent* pEvent);
54 void expose (XExposeEvent* pEvent);
55 void createself (XoCreateSelfWindowEvent* pEvent);
56 void enter (XEnterWindowEvent* pEvent);
57 void leave (XLeaveWindowEvent* pEvent);
58
59 public:
60 WButton (LDisplay* pDisplay) : LWindow (pDisplay) {
61 zero (); m_cbInstance = sizeof (*this) - sizeof (LWindow); }
62 WButton (LWindow* pWindow) : LWindow (pWindow) {}
63 ~WButton () {
64 release_this (); }
65 void release_this (void) {}
66 void zero (void) {
67 memset (((LWindow*) this) + 1, 0, sizeof (*this) - sizeof (LWindow)); }
68
69 static void register_template (LDisplay* pDisplay);
70 };
71
72
73 #define ButtonPressNotify 1
74
75
76 #endif /* __WBUTTON_H__ */