Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

toolbar.h

00001 /* 00002 * =========================== 00003 * VDK Visual Development Kit 00004 * Version 0.4 00005 * October 1998 00006 * =========================== 00007 * 00008 * Copyright (C) 1998, Mario Motta 00009 * Developed by Mario Motta <mmotta@guest.net> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Library General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Library General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Library General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00024 * 02111-1307, USA. 00025 */ 00026 00027 #ifndef TOOLBAR_H 00028 #define TOOLBAR_H 00029 00030 00031 #include <vdk/vdkprops.h> 00032 #include <vdk/widcontain.h> 00033 #include <gtk/gtkenums.h> 00034 00035 class VDKForm; 00036 class VDKBox; 00037 00038 00039 typedef VDKList<VDKObject> ToolWidgetList; 00040 typedef VDKListiterator<VDKObject> ToolWidgetListIterator; 00041 typedef VDKList<GtkWidget> GtkWidgetList; 00042 typedef VDKListiterator<GtkWidget> GtkWidgetListIterator; 00051 class VDKToolbar : public VDKObjectContainer 00052 { 00053 00054 static void ButtonSignal(GtkWidget *wid, gpointer gp); 00055 ToolWidgetList toolWidgets; 00056 GtkWidgetList widgets; 00057 VDKList<VDKObject> tool_buttons; 00058 00059 public: 00060 // properties 00064 VDKReadOnlyValueProp<VDKToolbar, ToolWidgetList*> WidgetList; 00068 VDKReadOnlyValueProp<VDKToolbar, GtkWidgetList*> ButtonList; 00072 VDKReadOnlyValueProp<VDKToolbar, int> ButtonPressed; 00079 VDKReadWriteValueProp<VDKToolbar, GtkOrientation> Orientation; 00087 VDKReadWriteValueProp<VDKToolbar, GtkToolbarStyle> Style; 00094 VDKReadWriteValueProp<VDKToolbar, GtkToolbarSpaceStyle> SpaceStyle; 00098 VDKReadWriteValueProp<VDKToolbar, bool> Borderless; 00106 VDKReadWriteValueProp<VDKToolbar, GtkReliefStyle> Relief; 00110 VDKReadWriteValueProp<VDKToolbar, int> Spacing; 00111 // 00117 VDKToolbar(VDKForm* owner, 00118 GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL); 00122 virtual ~VDKToolbar() {} 00128 virtual void Add(VDKObject* obj, int , int , int , int ) 00129 { AddWidget(obj); } 00135 void AddWidget(VDKObject* widget, char* tip = NULL); 00142 void AddButton(char** pixdata, 00143 char* tip = NULL, 00144 char* text = NULL); 00151 void AddButton(char* pixfile, 00152 char* tip = NULL, 00153 char* text = NULL); 00157 void AddSpace() { 00158 gtk_toolbar_append_space(GTK_TOOLBAR(widget)); 00159 } 00160 00161 void SetOrientation( GtkOrientation orientation) { 00162 gtk_toolbar_set_orientation(GTK_TOOLBAR(widget),orientation); 00163 } 00164 00165 void SetStyle(GtkToolbarStyle style) { 00166 gtk_toolbar_set_style(GTK_TOOLBAR(widget),style); 00167 } 00168 // DEPRECATED 00169 void SetRelief(GtkReliefStyle style); 00170 // DEPRECTAED 00171 void SetBorderless(bool flag) { 00172 if(!flag) 00173 // gtk_toolbar_set_button_relief (GTK_TOOLBAR (widget), GTK_RELIEF_NORMAL); 00174 SetRelief(GTK_RELIEF_NORMAL); 00175 else 00176 // gtk_toolbar_set_button_relief (GTK_TOOLBAR (widget), GTK_RELIEF_NONE); 00177 SetRelief(GTK_RELIEF_NONE); 00178 } 00179 // DEPRECATED 00180 void SetSpacing(int s) { 00181 //gtk_toolbar_set_space_size(GTK_TOOLBAR(widget),s); 00182 // gtk_object_set(GTK_OBJECT(widget), "space_size", s, NULL); 00183 } 00184 00185 // DEPRECATED 00186 void SetSpaceStyle(GtkToolbarSpaceStyle style) { 00187 // gtk_toolbar_set_space_style (GTK_TOOLBAR (widget), style); 00188 // gtk_object_set(GTK_OBJECT(widget), "space_style", style, NULL); 00189 } 00190 // DEPRECATED 00191 GtkToolbarSpaceStyle GetSpaceStyle() { 00192 return (GtkToolbarSpaceStyle) 0; // return GTK_TOOLBAR(widget)->space_style; 00193 } 00194 00195 VDKObject* operator[](int ndx) { 00196 if( (ndx >= 0) && (ndx < tool_buttons.size()) ) 00197 return tool_buttons[ndx]; 00198 else 00199 return NULL; 00200 } 00201 }; 00202 00203 00204 #endif 00205 00206 00207 00208 00209 00210 00211 00212 00213

Generated on Wed Jul 28 17:23:53 2004 for vdk 2.0.3 by doxygen 1.3.7