Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# table.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00024
    00025 #ifndef INTI_GTK_TABLE_H
    00026 #define INTI_GTK_TABLE_H
    00027
    00028 #ifndef INTI_GTK_CONTAINER_H
    00029 #include <inti/gtk/container.h>
    00030 #endif
    00031
    00032 #ifndef __GTK_TABLE_H__
    00033 #include <gtk/gtktable.h>
    00034 #endif
    00035
    00036 namespace Inti {
    00037
    00038 namespace Gtk {
    00039
    00040 class TableClass;
    00041
    00054
    00055 class Table : public Container
    00056 {
    00057         friend class G::Object;
    00058         friend class TableClass;
    00059
    00060         Table(const Table&);
    00061         Table& operator=(const Table&);
    00062
    00063 protected:
    00066
    00067         explicit Table(GtkTable *table, bool reference = false);
    00074
    00076 //  Properties
    00077
    00078         typedef G::Property<unsigned int> NRowsPropertyType;
    00079         typedef G::PropertyProxy<G::Object, NRowsPropertyType> NRowsPropertyProxy;
    00080         static const NRowsPropertyType n_rows_property;
    00081
    00082         typedef G::Property<unsigned int> NColumnsPropertyType;
    00083         typedef G::PropertyProxy<G::Object, NColumnsPropertyType> NColumnsPropertyProxy;
    00084         static const NColumnsPropertyType n_columns_property;
    00085
    00086         typedef G::Property<unsigned int> RowSpacingPropertyType;
    00087         typedef G::PropertyProxy<G::Object, RowSpacingPropertyType> RowSpacingPropertyProxy;
    00088         static const RowSpacingPropertyType row_spacing_property;
    00089
    00090         typedef G::Property<unsigned int> ColumnSpacingPropertyType;
    00091         typedef G::PropertyProxy<G::Object, ColumnSpacingPropertyType> ColumnSpacingPropertyProxy;
    00092         static const ColumnSpacingPropertyType column_spacing_property;
    00093
    00094         typedef G::Property<bool> HomogeneousPropertyType;
    00095         typedef G::PropertyProxy<G::Object, HomogeneousPropertyType> HomogeneousPropertyProxy;
    00096         static const HomogeneousPropertyType homogeneous_property;
    00097
    00098 //  Child properties
    00099
    00100         typedef Gtk::ChildProperty<unsigned int> LeftAttachPropertyType;
    00101         typedef Gtk::ChildPropertyProxy<Container, LeftAttachPropertyType> LeftAttachPropertyProxy;
    00102         static const LeftAttachPropertyType left_attach_property;
    00103
    00104         typedef Gtk::ChildProperty<unsigned int> RightAttachPropertyType;
    00105         typedef Gtk::ChildPropertyProxy<Container, RightAttachPropertyType> RightAttachPropertyProxy;
    00106         static const RightAttachPropertyType right_attach_property;
    00107
    00108         typedef Gtk::ChildProperty<unsigned int> TopAttachPropertyType;
    00109         typedef Gtk::ChildPropertyProxy<Container, TopAttachPropertyType> TopAttachPropertyProxy;
    00110         static const TopAttachPropertyType top_attach_property;
    00111
    00112         typedef Gtk::ChildProperty<unsigned int> BottomAttachPropertyType;
    00113         typedef Gtk::ChildPropertyProxy<Container, BottomAttachPropertyType> BottomAttachPropertyProxy;
    00114         static const BottomAttachPropertyType bottom_attach_property;
    00115
    00116         typedef Gtk::ChildProperty<AttachOptions, unsigned int> XOptionsPropertyType;
    00117         typedef Gtk::ChildPropertyProxy<Container, XOptionsPropertyType> XOptionsPropertyProxy;
    00118         static const XOptionsPropertyType x_options_property;
    00119
    00120         typedef Gtk::ChildProperty<AttachOptions, unsigned int> YOptionsPropertyType;
    00121         typedef Gtk::ChildPropertyProxy<Container, YOptionsPropertyType> YOptionsPropertyProxy;
    00122         static const YOptionsPropertyType y_options_property;
    00123
    00124         typedef Gtk::ChildProperty<unsigned int> XPaddingPropertyType;
    00125         typedef Gtk::ChildPropertyProxy<Container, XPaddingPropertyType> XPaddingPropertyProxy;
    00126         static const XPaddingPropertyType x_padding_property;
    00127
    00128         typedef Gtk::ChildProperty<unsigned int> YPaddingPropertyType;
    00129         typedef Gtk::ChildPropertyProxy<Container, YPaddingPropertyType> YPaddingPropertyProxy;
    00130         static const YPaddingPropertyType y_padding_property;
    00131
    00132 public:
    00135
    00136         Table(unsigned int rows, unsigned int columns, bool homogeneous = false);
    00145
    00146         virtual ~Table();
    00148
    00152
    00153         GtkTable* gtk_table() const { return (GtkTable*)instance; }
    00155
    00156         GtkTableClass* gtk_table_class() const;
    00158
    00159         operator GtkTable* () const;
    00161
    00162         unsigned int get_row_spacing(unsigned int row) const;
    00166
    00167         unsigned int get_column_spacing(unsigned int column) const;
    00172
    00173         unsigned int get_default_row_spacing() const;
    00178
    00179         unsigned int get_default_col_spacing() const;
    00184
    00185         bool get_homogeneous() const;
    00188
    00192
    00193         void resize(unsigned int rows, unsigned int columns);
    00198
    00199         void attach
    00200         (
    00201                 Widget& child,
    00202                 unsigned int left_attach,
    00203                 unsigned int right_attach,
    00204                 unsigned int top_attach,
    00205                 unsigned int bottom_attach,
    00206                 AttachOptionsField xoptions = EXPAND | FILL,
    00207                 AttachOptionsField yoptions = EXPAND | FILL,
    00208                 unsigned int xpadding = 0,
    00209                 unsigned int ypadding = 0
    00210         );
    00226
    00227         void set_row_spacing(unsigned int row, unsigned int spacing);
    00231
    00232         void set_col_spacing(unsigned int column, unsigned int spacing);
    00236
    00237         void set_row_spacings(unsigned int spacing);
    00240
    00241         void set_col_spacings(unsigned int spacing);
    00244
    00245         void set_spacings(unsigned int row_spacing, unsigned int col_spacing);
    00250
    00251         void set_homogeneous(bool homogeneous);
    00254
    00258
    00259         const NRowsPropertyProxy prop_n_rows()
    00260         {
    00261                 return NRowsPropertyProxy(this, &n_rows_property);
    00262         }
    00264
    00265         const NColumnsPropertyProxy prop_n_columns()
    00266         {
    00267                 return NColumnsPropertyProxy(this, &n_columns_property);
    00268         }
    00270
    00271         const RowSpacingPropertyProxy prop_row_spacing()
    00272         {
    00273                 return RowSpacingPropertyProxy(this, &row_spacing_property);
    00274         }
    00276
    00277         const ColumnSpacingPropertyProxy prop_column_spacing()
    00278         {
    00279                 return ColumnSpacingPropertyProxy(this, &column_spacing_property);
    00280         }
    00282
    00283         const HomogeneousPropertyProxy prop_homogeneous()
    00284         {
    00285                 return HomogeneousPropertyProxy(this, &homogeneous_property);
    00286         }
    00288
    00292
    00293         const LeftAttachPropertyProxy prop_left_attach()
    00294         {
    00295                 return LeftAttachPropertyProxy(this, &left_attach_property);
    00296         }
    00298
    00299         const RightAttachPropertyProxy prop_right_attach()
    00300         {
    00301                 return RightAttachPropertyProxy(this, &right_attach_property);
    00302         }
    00304
    00305         const TopAttachPropertyProxy prop_top_attach()
    00306         {
    00307                 return TopAttachPropertyProxy(this, &top_attach_property);
    00308         }
    00310
    00311         const BottomAttachPropertyProxy prop_bottom_attach()
    00312         {
    00313                 return BottomAttachPropertyProxy(this, &bottom_attach_property);
    00314         }
    00316
    00317         const XOptionsPropertyProxy prop_x_options()
    00318         {
    00319                 return XOptionsPropertyProxy(this, &x_options_property);
    00320         }
    00322
    00323         const YOptionsPropertyProxy prop_y_options()
    00324         {
    00325                 return YOptionsPropertyProxy(this, &y_options_property);
    00326         }
    00328
    00329         const XPaddingPropertyProxy prop_x_padding()
    00330         {
    00331                 return XPaddingPropertyProxy(this, &x_padding_property);
    00332         }
    00335
    00336         const YPaddingPropertyProxy prop_y_padding()
    00337         {
    00338                 return YPaddingPropertyProxy(this, &y_padding_property);
    00339         }
    00342
    00344 };
    00345
    00346 } // namespace Gtk
    00347
    00348 } // namespace Inti
    00349
    00350 #endif // INTI_GTK_TABLE_H
    00351

Main Page - Footer