2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_SCROLLEDWINDOW_H
4 #define _GTKMM_SCROLLEDWINDOW_H
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/bin.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkScrolledWindow GtkScrolledWindow;
34 typedef struct _GtkScrolledWindowClass GtkScrolledWindowClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class ScrolledWindow_Class; } // namespace Gtk
47 /** Adds scrollbars to its child widget.
49 * This container accepts a single child widget. It adds scrollbars to the child widget and optionally draws a beveled frame around the child widget.
50 * The scrolled window can work in two ways:
51 * 1) Some widgets have native scrolling support; these widgets handle certain Gtk::Adjustment signals. Widgets with native scroll support include Gtk::TreeView, Gtk::TextView, and Gtk::Layout.
52 * 2) For widgets that lack native scrolling support, such as Gtk::Table, Gtk::Box, and so on, the widget will be placed inside a Gtk::Viewport.
54 * The position of the scrollbars is controlled by the scroll adjustments. See Gtk::Adjustment for the fields in an adjustment - for Gtk::Scrollbar, used by Gtk::ScrolledWindow,
55 * the "value" field represents the position of the scrollbar, which must be between the "lower" field and "upper - page_size."
56 * The "page_size" field represents the size of the visible scrollable area.
57 * The "step_increment" and "page_increment" fields are used when the user asks to step down (using the small stepper arrows) or page down (using for example the PageDown key).
59 * If a Gtk::ScrolledWindow doesn't behave quite as you would like, or doesn't have exactly the right layout, it's very possible to set up your own scrolling with Gtk::Scrollbar and, for example, a Gtk::Table.
65 class ScrolledWindow : public Bin
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69 typedef ScrolledWindow CppObjectType;
70 typedef ScrolledWindow_Class CppClassType;
71 typedef GtkScrolledWindow BaseObjectType;
72 typedef GtkScrolledWindowClass BaseClassType;
73 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
75 virtual ~ScrolledWindow();
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80 friend class ScrolledWindow_Class;
81 static CppClassType scrolledwindow_class_;
84 ScrolledWindow(const ScrolledWindow&);
85 ScrolledWindow& operator=(const ScrolledWindow&);
88 explicit ScrolledWindow(const Glib::ConstructParams& construct_params);
89 explicit ScrolledWindow(GtkScrolledWindow* castitem);
91 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
94 #ifndef DOXYGEN_SHOULD_SKIP_THIS
95 static GType get_type() G_GNUC_CONST;
96 static GType get_base_type() G_GNUC_CONST;
99 ///Provides access to the underlying C GtkObject.
100 GtkScrolledWindow* gobj() { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
102 ///Provides access to the underlying C GtkObject.
103 const GtkScrolledWindow* gobj() const { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
107 //C++ methods used to invoke GTK+ virtual functions:
110 //GTK+ Virtual Functions (override these to change behaviour):
112 //Default Signal Handlers::
120 explicit ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment);
123 void set_hadjustment(Gtk::Adjustment* hadjustment = 0);
125 void set_vadjustment(Gtk::Adjustment* vadjustment = 0);
127 void set_hadjustment(Gtk::Adjustment& hadjustment);
129 void set_vadjustment(Gtk::Adjustment& vadjustment);
132 Gtk::Adjustment* get_hadjustment();
134 const Gtk::Adjustment* get_hadjustment() const;
136 Gtk::Adjustment* get_vadjustment();
138 const Gtk::Adjustment* get_vadjustment() const;
141 void set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy);
143 /** Retrieves the current policy values for the horizontal and vertical
144 * scrollbars. See set_policy().
145 * @param hscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
146 * @param vscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
148 void get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const;
151 void set_placement(CornerType window_placement);
153 /** Gets the placement of the scrollbars for the scrolled window. See
155 * @return The current placement value.
157 CornerType get_placement() const;
160 /** Changes the type of shadow drawn around the contents of
161 * @a scrolled_window .
162 * @param type Kind of shadow to draw around scrolled window contents.
164 void set_shadow_type(ShadowType type);
166 /** Gets the shadow type of the scrolled window. See
168 * @return The current shadow type.
170 ShadowType get_shadow_type() const;
172 ///Puts the child inside a Gtk::Viewport if it doesn't have native scrolling capability.
173 virtual void add(Gtk::Widget& widget);
176 bool get_vscrollbar_visible() const;
177 bool get_hscrollbar_visible() const;
178 Gtk::HScrollbar* get_hscrollbar();
179 const Gtk::HScrollbar* get_hscrollbar() const;
180 Gtk::VScrollbar* get_vscrollbar();
181 const Gtk::VScrollbar* get_vscrollbar() const;
183 //Keybinding signals:
186 /** The GtkAdjustment for the horizontal position.
188 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
189 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
190 * the value of the property changes.
192 Glib::PropertyProxy<Gtk::Adjustment*> property_hadjustment() ;
194 /** The GtkAdjustment for the horizontal position.
196 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
197 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
198 * the value of the property changes.
200 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> property_hadjustment() const;
202 /** The GtkAdjustment for the vertical position.
204 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
205 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
206 * the value of the property changes.
208 Glib::PropertyProxy<Gtk::Adjustment*> property_vadjustment() ;
210 /** The GtkAdjustment for the vertical position.
212 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
213 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
214 * the value of the property changes.
216 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> property_vadjustment() const;
218 /** When the horizontal scrollbar is displayed.
220 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
221 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
222 * the value of the property changes.
224 Glib::PropertyProxy<PolicyType> property_hscrollbar_policy() ;
226 /** When the horizontal scrollbar is displayed.
228 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
229 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
230 * the value of the property changes.
232 Glib::PropertyProxy_ReadOnly<PolicyType> property_hscrollbar_policy() const;
234 /** When the vertical scrollbar is displayed.
236 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
237 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
238 * the value of the property changes.
240 Glib::PropertyProxy<PolicyType> property_vscrollbar_policy() ;
242 /** When the vertical scrollbar is displayed.
244 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
245 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
246 * the value of the property changes.
248 Glib::PropertyProxy_ReadOnly<PolicyType> property_vscrollbar_policy() const;
250 /** Where the contents are located with respect to the scrollbars.
252 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
253 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
254 * the value of the property changes.
256 Glib::PropertyProxy<CornerType> property_window_placement() ;
258 /** Where the contents are located with respect to the scrollbars.
260 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
261 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
262 * the value of the property changes.
264 Glib::PropertyProxy_ReadOnly<CornerType> property_window_placement() const;
266 /** Style of bevel around the contents.
268 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
269 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
270 * the value of the property changes.
272 Glib::PropertyProxy<ShadowType> property_shadow_type() ;
274 /** Style of bevel around the contents.
276 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
277 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
278 * the value of the property changes.
280 Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
285 } /* namespace Gtk */
290 /** @relates Gtk::ScrolledWindow
291 * @param object The C instance
292 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
293 * @result A C++ instance that wraps this C instance.
295 Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy = false);
297 #endif /* _GTKMM_SCROLLEDWINDOW_H */