vdk 2.4.0
toolbar.h
1/*
2 * ===========================
3 * VDK Visual Development 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 TOOLBAR_H
28#define TOOLBAR_H
29
30
31#include <vdk/vdkprops.h>
32#include <vdk/widcontain.h>
33#include <gtk/gtkenums.h>
34
35class VDKForm;
36class VDKBox;
37
38
52{
53
54 static void ButtonSignal(GtkWidget *wid, gpointer gp);
55 ToolWidgetList toolWidgets;
56 GtkWidgetList widgets;
57 VDKList<VDKObject> tool_buttons;
58
59public:
60 // properties
64 VDKReadOnlyValueProp<VDKToolbar, ToolWidgetList*> WidgetList;
68 VDKReadOnlyValueProp<VDKToolbar, GtkWidgetList*> ButtonList;
72 VDKReadOnlyValueProp<VDKToolbar, int> ButtonPressed;
79 VDKReadWriteValueProp<VDKToolbar, GtkOrientation> Orientation;
87 VDKReadWriteValueProp<VDKToolbar, GtkToolbarStyle> Style;
94 VDKReadWriteValueProp<VDKToolbar, GtkToolbarSpaceStyle> SpaceStyle;
98 VDKReadWriteValueProp<VDKToolbar, bool> Borderless;
106 VDKReadWriteValueProp<VDKToolbar, GtkReliefStyle> Relief;
110 VDKReadWriteValueProp<VDKToolbar, int> Spacing;
111 //
117 VDKToolbar(VDKForm* owner,
118 GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL);
122 virtual ~VDKToolbar() {}
128 virtual void Add(VDKObject* obj, int , int , int , int )
129 { AddWidget(obj); }
135 void AddWidget(VDKObject* widget, char* tip = NULL);
142 void AddButton(char** pixdata,
143 char* tip = NULL,
144 char* text = NULL);
151 void AddButton(char* pixfile,
152 char* tip = NULL,
153 char* text = NULL);
157 void AddSpace() {
158 gtk_toolbar_append_space(GTK_TOOLBAR(widget));
159 }
160
161 void SetOrientation( GtkOrientation orientation) {
162 gtk_toolbar_set_orientation(GTK_TOOLBAR(widget),orientation);
163 }
164
165 void SetStyle(GtkToolbarStyle style) {
166 gtk_toolbar_set_style(GTK_TOOLBAR(widget),style);
167 }
168 // DEPRECATED
169 void SetRelief(GtkReliefStyle style);
170 // DEPRECTAED
171 void SetBorderless(bool flag) {
172 if(!flag)
173 // gtk_toolbar_set_button_relief (GTK_TOOLBAR (widget), GTK_RELIEF_NORMAL);
174 SetRelief(GTK_RELIEF_NORMAL);
175 else
176 // gtk_toolbar_set_button_relief (GTK_TOOLBAR (widget), GTK_RELIEF_NONE);
177 SetRelief(GTK_RELIEF_NONE);
178 }
179 // DEPRECATED
180 void SetSpacing(int s) {
181 //gtk_toolbar_set_space_size(GTK_TOOLBAR(widget),s);
182 // gtk_object_set(GTK_OBJECT(widget), "space_size", s, NULL);
183 }
184
185 // DEPRECATED
186 void SetSpaceStyle(GtkToolbarSpaceStyle style) {
187 // gtk_toolbar_set_space_style (GTK_TOOLBAR (widget), style);
188 // gtk_object_set(GTK_OBJECT(widget), "space_style", style, NULL);
189 }
190 // DEPRECATED
191 GtkToolbarSpaceStyle GetSpaceStyle() {
192 return (GtkToolbarSpaceStyle) 0; // return GTK_TOOLBAR(widget)->space_style;
193 }
194
195 VDKObject* operator[](int ndx) {
196 if( (ndx >= 0) && (ndx < tool_buttons.size()) )
197 return tool_buttons[ndx];
198 else
199 return NULL;
200 }
201};
202
203
204#endif
205
206
207
208
209
210
211
212
213
One of the most used widget containers.
Definition: boxes.h:38
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
int size()
Definition: dlist.h:181
Provides a VDKList iterator.
Definition: dlist.h:201
Containers base class.
Definition: widcontain.h:40
Definition: vdkobj.h:141
GtkWidget * widget
Definition: vdkobj.h:241
Provides a GtkToobar wrapper.
Definition: toolbar.h:52
VDKReadWriteValueProp< VDKToolbar, GtkToolbarStyle > Style
Definition: toolbar.h:87
void AddButton(char **pixdata, char *tip=NULL, char *text=NULL)
Definition: toolbar.cc:92
VDKReadWriteValueProp< VDKToolbar, int > Spacing
Definition: toolbar.h:110
VDKReadWriteValueProp< VDKToolbar, GtkReliefStyle > Relief
Definition: toolbar.h:106
VDKReadWriteValueProp< VDKToolbar, GtkOrientation > Orientation
Definition: toolbar.h:79
VDKReadWriteValueProp< VDKToolbar, bool > Borderless
Definition: toolbar.h:98
void AddSpace()
Definition: toolbar.h:157
VDKReadOnlyValueProp< VDKToolbar, ToolWidgetList * > WidgetList
Definition: toolbar.h:64
VDKReadOnlyValueProp< VDKToolbar, int > ButtonPressed
Definition: toolbar.h:72
VDKReadWriteValueProp< VDKToolbar, GtkToolbarSpaceStyle > SpaceStyle
Definition: toolbar.h:94
VDKReadOnlyValueProp< VDKToolbar, GtkWidgetList * > ButtonList
Definition: toolbar.h:68
void AddWidget(VDKObject *widget, char *tip=NULL)
Definition: toolbar.cc:77
virtual void Add(VDKObject *obj, int, int, int, int)
Definition: toolbar.h:128
VDKToolbar(VDKForm *owner, GtkOrientation orientation=GTK_ORIENTATION_HORIZONTAL)
Definition: toolbar.cc:58
virtual ~VDKToolbar()
Definition: toolbar.h:122