vdk 2.4.0
abstract_button.h
1/*
2 * ===========================
3 * VDK Visual Develeopment Kit
4 * Version 0.4
5 * October 1998
6 * ===========================
7 *
8 * Copyright (C) 1998, Mario Motta
9 * Developed by Mario Motta <mmotta@guest.net>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 * 02111-1307, USA.
25 */
26
27#ifndef ABSTRACTBUTTON_H
28#define ABSTRACTBUTTON_H
29#include <vdk/vdkobj.h>
30
39{
40public:
41 VDKReadWriteValueProp<VDKAbstractButton, GtkReliefStyle> Relief;
42
44 virtual ~VDKAbstractButton();
45 virtual void SetForeground(VDKRgb, GtkStateType) {}
46 virtual void SetFont(VDKFont*) {}
47
48 void SetRelief(GtkReliefStyle style) {
49 gtk_button_set_relief(GTK_BUTTON(widget), style);
50 }
51
52 GtkReliefStyle GetRelief() {
53 return gtk_button_get_relief(GTK_BUTTON(widget));
54 }
55#ifdef USE_SIGCPLUSPLUS
56 public:
61 VDKSignal0<void> OnButtonClicked;
66 VDKSignal0<void> OnButtonPressed;
71 VDKSignal0<void> OnButtonLeave;
72 protected:
73 /* This method establishes the connection to sigc-signals in
74 a concrete subclass. Wid is the underlaying used gtk-widget
75 */
76 static void make_gtksigc_connection(VDKAbstractButton* obj,
77 GtkWidget* wid);
78 private:
79 static void _handle_clicked(GtkWidget* wid, gpointer obj);
80 static void _handle_pressed(GtkWidget* wid, gpointer obj);
81 static void _handle_leave(GtkWidget* wid, gpointer obj);
82#endif
83};
84
85#endif
This class provides a common base for different types of buttons.
Definition: abstract_button.h:39
virtual void SetFont(VDKFont *)
Definition: abstract_button.h:46
virtual void SetForeground(VDKRgb, GtkStateType)
Definition: abstract_button.h:45
Provides a raw font.
Definition: vdkfont.h:38
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Definition: vdkobj.h:141
GtkWidget * widget
Definition: vdkobj.h:241
Provides a simple RGB color structure.
Definition: vdkutils.h:38