3
* Copyright (C) 2007 Johannes Schmid <johannes.schmid@openismus.com>
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
28
: m_width(0), m_height(0)
30
set_handle_position(Gtk::POS_TOP);
31
set_snap_edge(Gtk::POS_TOP);
33
palette = EGG_TOOL_PALETTE(egg_tool_palette_new());
34
egg_tool_palette_set_style (palette, GTK_TOOLBAR_BOTH_HORIZ);
35
Gtk::Container* container = Glib::wrap(GTK_CONTAINER(palette));
46
void SideBar::add_group(EggToolItemGroup* group)
48
gtk_container_add(GTK_CONTAINER(palette), GTK_WIDGET(group));
51
void SideBar::remove_group(EggToolItemGroup* group)
53
gtk_container_remove(GTK_CONTAINER(palette), GTK_WIDGET(group));
56
void SideBar::set_drag_source()
58
// It's important to call this AFTER all groups have been added
59
egg_tool_palette_set_drag_source(palette, EGG_TOOL_PALETTE_DRAG_ITEMS);
62
void SideBar::on_child_detached(Gtk::Widget* child)
64
get_size_request(m_width, m_height);
65
child->set_size_request(m_width, m_height);
66
set_size_request(0, 0);
69
void SideBar::on_child_attached(Gtk::Widget* child)
71
set_size_request(m_width, m_height);