Debian Codegraph @

gtk/src/handlebox.hg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 // To exclude this file from the documentation when build-deprecated-api=false.
18 _CONFIGINCLUDE(gtkmmconfig.h)
19
20 #include <gtkmm/eventbox.h>
21 _DEFS(gtkmm,gtk)
22 _PINCLUDE(gtkmm/private/bin_p.h)
23
24 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
25 #undef GTK_DISABLE_DEPRECATED
26 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
27 #m4 _POP()
28
29 #m4 _CONVERSION(`int',`PositionType',`($2)$3')
30
31 namespace Gtk
32 {
33
34 /** A widget for detachable window portions.
35 *
36 * The Gtk::HandleBox widget allows a portion of a window to be "torn off".
37 * It displays its child and a handle that the user can drag to tear off a separate window (the float window) containing the child widget. A thin ghost is drawn in the original location of the handlebox. By dragging the separate window back to its original location, it can be reattached.
38 * When reattaching, the ghost and float window must be aligned along one of the edges, the snap edge. This can be specified by the application programmer explicitely, or GTK+ will pick a reasonable default based on the handle position.
39 * To make detaching and reattaching the handlebox as minimally confusing as possible to the user, it is important to set the snap edge so that the snap edge does not move when the handlebox is deattached.
40 * For instance, if the handlebox is packed at the bottom of a VBox, then when the handlebox is detached, the bottom edge of the handlebox's allocation will remain fixed as the height of the handlebox shrinks, so the snap edge should be set to GTK_POS_BOTTOM.
41 *
42 * @deprecated This is very specialized, lacks features
43 * to make it useful and most importantly does not fit well into modern
44 * application design. There is no replacement.
45 *
46 * @ingroup Widgets
47 * @ingroup Containers
48 */
49 class GTKMM_API HandleBox : public Bin
50 {
51 _CLASS_GTKOBJECT(HandleBox,GtkHandleBox,GTK_HANDLE_BOX,Gtk::Bin,GtkBin,,,GTKMM_API)
52 _IS_DEPRECATED
53 public:
54 _CTOR_DEFAULT
55
56
57 _WRAP_METHOD(void set_shadow_type(ShadowType type), gtk_handle_box_set_shadow_type)
58 _WRAP_METHOD(ShadowType get_shadow_type() const, gtk_handle_box_get_shadow_type)
59 _WRAP_METHOD(void set_handle_position(PositionType position), gtk_handle_box_set_handle_position)
60 _WRAP_METHOD(PositionType get_handle_position() const, gtk_handle_box_get_handle_position)
61 _WRAP_METHOD(void set_snap_edge(PositionType edge), gtk_handle_box_set_snap_edge)
62 _WRAP_METHOD(PositionType get_snap_edge() const, gtk_handle_box_get_snap_edge)
63
64 _WRAP_METHOD(bool is_child_detached() const, gtk_handle_box_get_child_detached)
65
66 _WRAP_SIGNAL(void child_attached(Widget* child), "child_attached")
67 _WRAP_SIGNAL(void child_detached(Widget* child), "child_detached")
68
69 //_WRAP_PROPERTY("shadow", ShadowType); //deprecated.
70 _WRAP_PROPERTY("shadow-type", ShadowType)
71 _WRAP_PROPERTY("handle-position", PositionType)
72 _WRAP_PROPERTY("snap-edge", PositionType)
73 _WRAP_PROPERTY("snap-edge-set", bool)
74 _WRAP_PROPERTY("child-detached", bool)
75 };
76
77 } //namespace Gtk