2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Button.h /main/3 1995/11/06 09:39:10 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
36 class Button : public MotifUI {
40 ButtonCallback _callback;
41 void * _callback_data;
42 static void ActivateCB(Widget, XtPointer, XtPointer);
43 ButtonType _button_type;
45 void CreateButton(MotifUI *, char *, char *, ButtonType, ButtonCallback,
46 void *, char *, char *, char *, char *);
50 // If the callback_data is NULL, the this pointer will be the callback data
51 Button(MotifUI *parent,
53 ButtonType button_type = PUSH_BUTTON,
54 ButtonCallback callback = NULL,
55 void * callback_data = NULL,
56 char *mnemonic = NULL,
57 char *acceleratorText = NULL,
58 char *accelerator = NULL,
59 char *iconFile = NULL);
61 Button(char *category,
64 ButtonType button_type = PUSH_BUTTON,
65 ButtonCallback callback = NULL,
66 void * callback_data = NULL,
67 char *mnemonic = NULL,
68 char *acceleratorText = NULL,
69 char *accelerator = NULL,
70 char *iconFile = NULL);
74 void Callback(ButtonCallback cb) { _callback = cb; }
75 void CallbackData(void *data) { _callback_data = data; }
76 ButtonCallback Callback() { return _callback; }
77 void * CallbackData() { return _callback_data; }
78 const char *IconFile() { return _iconFile; }
79 void IconFile(char *);
81 const UI_Class UIClass() { return BUTTON; }
82 const int UISubClass() { return _button_type; }
83 const char *const UIClassName() { return "Button"; }