2 /**************************************************************************
3 ** (c) Copyright 1998, Andromeda Technology & Automation
4 ***************************************************************************
5 ** MODULE INFORMATION *
6 ***********************
7 ** FILE NAME : button.h
8 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
9 ** VERSION NUMBER : $Revision: 1.1 $
11 ** DESCRIPTION : Definition of button classes
16 ***************************************************************************
17 ** ADMINISTRATIVE INFORMATION *
18 ********************************
19 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
20 ** CREATION DATE : Mar 07, 1998
21 ** LAST UPDATE : Mar 13, 1998
23 **************************************************************************/
25 /*****************************
27 Revision 1.1 2002-07-25 08:01:26 arjen
28 First checkin, AXE release 0.2
30 *****************************/
32 /* static const char *RCSID = "$Id: button.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */
37 ///////////////////////////////////////////////////////////////////////////
49 ///////////////////////////////////////////////////////////////////////////
52 class button : public frame
57 button(window &par, int x, int y,char *label) : frame(par, x, y, label)
59 SelectInput(ButtonReleaseMask|ButtonPressMask, 1);
62 virtual int EV_ButtonPress(XButtonEvent ev)
64 Strength(-Strength());
68 virtual int EV_ButtonRelease(XButtonEvent ev)
70 Strength(-Strength());
75 class touch_button : public button
80 touch_button(window &par, int x, int y, char *label)
81 : button(par, x, y, label)
86 virtual int EV_ButtonPress(XButtonEvent ev);
88 virtual void click(void);
92 class toggle_button : public touch_button
94 enum { State_Off, State_On } state;
98 toggle_button(window &par, int x, int y, char *label)
99 : touch_button(par, x, y, label)
104 virtual void click(void);
106 virtual void redraw(void);
109 class command_button : public button
115 command_button(window &par, int x, int y, char *label, int cc = 0)
116 : button(par, x, y, label)
121 virtual int EV_ButtonPress(XButtonEvent ev)
123 Strength(-Strength());
127 virtual int EV_ButtonRelease(XButtonEvent ev)
129 Strength(-Strength());
131 return XApp->SendCommand(command_code);