2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_SCROLLEDWINDOW_H
4 #define _GTKMM_SCROLLEDWINDOW_H
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/bin.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkScrolledWindow GtkScrolledWindow;
35 typedef struct _GtkScrolledWindowClass GtkScrolledWindowClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class ScrolledWindow_Class; } // namespace Gtk
48 /** Adds scrollbars to its child widget.
50 * This container accepts a single child widget. It adds scrollbars to the child widget and optionally draws a beveled frame around the child widget.
51 * The scrolled window can work in two ways:
52 * 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.
53 * 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.
55 * 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,
56 * the "value" field represents the position of the scrollbar, which must be between the "lower" field and "upper - page_size."
57 * The "page_size" field represents the size of the visible scrollable area.
58 * 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).
60 * 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.
66 class ScrolledWindow : public Bin
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 typedef ScrolledWindow CppObjectType;
71 typedef ScrolledWindow_Class CppClassType;
72 typedef GtkScrolledWindow BaseObjectType;
73 typedef GtkScrolledWindowClass BaseClassType;
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76 virtual ~ScrolledWindow();
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81 friend class ScrolledWindow_Class;
82 static CppClassType scrolledwindow_class_;
85 ScrolledWindow(const ScrolledWindow&);
86 ScrolledWindow& operator=(const ScrolledWindow&);
89 explicit ScrolledWindow(const Glib::ConstructParams& construct_params);
90 explicit ScrolledWindow(GtkScrolledWindow* castitem);
92 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96 static GType get_type() G_GNUC_CONST;
97 static GType get_base_type() G_GNUC_CONST;
100 ///Provides access to the underlying C GtkObject.
101 GtkScrolledWindow* gobj() { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
103 ///Provides access to the underlying C GtkObject.
104 const GtkScrolledWindow* gobj() const { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
108 //C++ methods used to invoke GTK+ virtual functions:
109 #ifdef GLIBMM_VFUNCS_ENABLED
110 #endif //GLIBMM_VFUNCS_ENABLED
113 //GTK+ Virtual Functions (override these to change behaviour):
114 #ifdef GLIBMM_VFUNCS_ENABLED
115 #endif //GLIBMM_VFUNCS_ENABLED
117 //Default Signal Handlers::
118 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
119 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
127 explicit ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment);
130 void set_hadjustment(Gtk::Adjustment* hadjustment = 0);
132 void set_vadjustment(Gtk::Adjustment* vadjustment = 0);
134 void set_hadjustment(Gtk::Adjustment& hadjustment);
136 void set_vadjustment(Gtk::Adjustment& vadjustment);
139 Gtk::Adjustment* get_hadjustment();
141 const Gtk::Adjustment* get_hadjustment() const;
143 Gtk::Adjustment* get_vadjustment();
145 const Gtk::Adjustment* get_vadjustment() const;
148 void set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy);
150 /** Retrieves the current policy values for the horizontal and vertical
151 * scrollbars. See set_policy().
152 * @param hscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
153 * @param vscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
155 void get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const;
158 /** Sets the placement of the contents with respect to the scrollbars
159 * for the scrolled window.
160 * The default is Gtk::CORNER_TOP_LEFT, meaning the child is
161 * in the top left, with the scrollbars underneath and to the right.
162 * Other values in Gtk::CornerType are Gtk::CORNER_TOP_RIGHT,
163 * Gtk::CORNER_BOTTOM_LEFT, and Gtk::CORNER_BOTTOM_RIGHT.
165 * See also get_placement() and
167 * @param window_placement Position of the child window.
169 void set_placement(CornerType window_placement);
171 /** Unsets the placement of the contents with respect to the scrollbars
172 * for the scrolled window. If no window placement is set for a scrolled
173 * window, it obeys the "gtk-scrolled-window-placement" XSETTING.
175 * See also set_placement() and
180 void unset_placement();
182 /** Gets the placement of the contents with respect to the scrollbars
183 * for the scrolled window. See set_placement().
184 * @return The current placement value.
186 * See also set_placement() and
189 CornerType get_placement() const;
192 /** Changes the type of shadow drawn around the contents of
193 * @a scrolled_window .
194 * @param type Kind of shadow to draw around scrolled window contents.
196 void set_shadow_type(ShadowType type);
198 /** Gets the shadow type of the scrolled window. See
200 * @return The current shadow type.
202 ShadowType get_shadow_type() const;
204 ///Puts the child inside a Gtk::Viewport if it doesn't have native scrolling capability.
205 virtual void add(Gtk::Widget& widget);
208 /** Returns: the vertical scrollbar of the scrolled window, or
209 * @return The vertical scrollbar of the scrolled window, or
210 * <tt>0</tt> if it does not have one.
214 VScrollbar* get_vscrollbar();
216 /** Returns: the vertical scrollbar of the scrolled window, or
217 * @return The vertical scrollbar of the scrolled window, or
218 * <tt>0</tt> if it does not have one.
222 const VScrollbar* get_vscrollbar() const;
225 /** Returns: the horizontal scrollbar of the scrolled window, or
226 * @return The horizontal scrollbar of the scrolled window, or
227 * <tt>0</tt> if it does not have one.
231 HScrollbar* get_hscrollbar();
233 /** Returns: the horizontal scrollbar of the scrolled window, or
234 * @return The horizontal scrollbar of the scrolled window, or
235 * <tt>0</tt> if it does not have one.
239 const HScrollbar* get_hscrollbar() const;
241 bool get_vscrollbar_visible() const;
242 bool get_hscrollbar_visible() const;
244 //Keybinding signals:
247 #ifdef GLIBMM_PROPERTIES_ENABLED
248 /** The GtkAdjustment for the horizontal position.
250 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
251 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
252 * the value of the property changes.
254 Glib::PropertyProxy<Gtk::Adjustment*> property_hadjustment() ;
255 #endif //#GLIBMM_PROPERTIES_ENABLED
257 #ifdef GLIBMM_PROPERTIES_ENABLED
258 /** The GtkAdjustment for the horizontal position.
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<Gtk::Adjustment*> property_hadjustment() const;
265 #endif //#GLIBMM_PROPERTIES_ENABLED
267 #ifdef GLIBMM_PROPERTIES_ENABLED
268 /** The GtkAdjustment for the vertical position.
270 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
271 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
272 * the value of the property changes.
274 Glib::PropertyProxy<Gtk::Adjustment*> property_vadjustment() ;
275 #endif //#GLIBMM_PROPERTIES_ENABLED
277 #ifdef GLIBMM_PROPERTIES_ENABLED
278 /** The GtkAdjustment for the vertical position.
280 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
281 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
282 * the value of the property changes.
284 Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> property_vadjustment() const;
285 #endif //#GLIBMM_PROPERTIES_ENABLED
287 #ifdef GLIBMM_PROPERTIES_ENABLED
288 /** When the horizontal scrollbar is displayed.
290 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
291 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
292 * the value of the property changes.
294 Glib::PropertyProxy<PolicyType> property_hscrollbar_policy() ;
295 #endif //#GLIBMM_PROPERTIES_ENABLED
297 #ifdef GLIBMM_PROPERTIES_ENABLED
298 /** When the horizontal scrollbar is displayed.
300 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
301 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
302 * the value of the property changes.
304 Glib::PropertyProxy_ReadOnly<PolicyType> property_hscrollbar_policy() const;
305 #endif //#GLIBMM_PROPERTIES_ENABLED
307 #ifdef GLIBMM_PROPERTIES_ENABLED
308 /** When the vertical scrollbar is displayed.
310 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
311 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
312 * the value of the property changes.
314 Glib::PropertyProxy<PolicyType> property_vscrollbar_policy() ;
315 #endif //#GLIBMM_PROPERTIES_ENABLED
317 #ifdef GLIBMM_PROPERTIES_ENABLED
318 /** When the vertical scrollbar is displayed.
320 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
321 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
322 * the value of the property changes.
324 Glib::PropertyProxy_ReadOnly<PolicyType> property_vscrollbar_policy() const;
325 #endif //#GLIBMM_PROPERTIES_ENABLED
327 #ifdef GLIBMM_PROPERTIES_ENABLED
328 /** Where the contents are located with respect to the scrollbars. This property only takes effect if window-placement-set is TRUE.
330 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
331 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
332 * the value of the property changes.
334 Glib::PropertyProxy<CornerType> property_window_placement() ;
335 #endif //#GLIBMM_PROPERTIES_ENABLED
337 #ifdef GLIBMM_PROPERTIES_ENABLED
338 /** Where the contents are located with respect to the scrollbars. This property only takes effect if window-placement-set is TRUE.
340 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
341 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
342 * the value of the property changes.
344 Glib::PropertyProxy_ReadOnly<CornerType> property_window_placement() const;
345 #endif //#GLIBMM_PROPERTIES_ENABLED
347 #ifdef GLIBMM_PROPERTIES_ENABLED
348 /** Style of bevel around the contents.
350 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
351 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
352 * the value of the property changes.
354 Glib::PropertyProxy<ShadowType> property_shadow_type() ;
355 #endif //#GLIBMM_PROPERTIES_ENABLED
357 #ifdef GLIBMM_PROPERTIES_ENABLED
358 /** Style of bevel around the contents.
360 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
361 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
362 * the value of the property changes.
364 Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
365 #endif //#GLIBMM_PROPERTIES_ENABLED
370 } /* namespace Gtk */
375 /** A Glib::wrap() method for this object.
377 * @param object The C instance.
378 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
379 * @result A C++ instance that wraps this C instance.
381 * @relates Gtk::ScrolledWindow
383 Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy = false);
387 #endif /* _GTKMM_SCROLLEDWINDOW_H */