2009-03-08 17:50:23 +01:00
|
|
|
/*
|
|
|
|
|
panel-bar.hpp - Declaration of the panel bar widget
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, Joel Holdsworth <joel@airwebreathe.org.uk>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
*/
|
|
|
|
|
/** @file panel-bar.hpp
|
|
|
|
|
** This file contains the definition of timeline widget
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef PANEL_BAR_HPP
|
|
|
|
|
#define PANEL_BAR_HPP
|
|
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
|
#include "menu-button.hpp"
|
|
|
|
|
|
|
|
|
|
namespace gui {
|
2009-03-18 18:58:57 +01:00
|
|
|
|
|
|
|
|
namespace panels {
|
|
|
|
|
class Panel;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-08 17:50:23 +01:00
|
|
|
namespace widgets {
|
|
|
|
|
|
2009-03-16 18:41:51 +01:00
|
|
|
/**
|
|
|
|
|
* A container widget for widgets to be displayed on GDL panels grips.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-04-16 16:44:40 +02:00
|
|
|
class PanelBar : public Gtk::Box
|
2009-03-08 17:50:23 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2009-03-16 18:41:51 +01:00
|
|
|
/**
|
|
|
|
|
* Constructor - creates a PanelBar with a given stock_id.
|
2009-03-18 18:58:57 +01:00
|
|
|
* @param owner_panel The panel that is the parent of this panel bar.
|
2009-03-16 18:41:51 +01:00
|
|
|
* @param stock_id The stock id with a name and an icon for this
|
|
|
|
|
* panel.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-18 18:58:57 +01:00
|
|
|
PanelBar(panels::Panel &owner_panel, const gchar *stock_id);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
2009-04-14 20:37:46 +02:00
|
|
|
/**
|
|
|
|
|
* Sets up panelButton, populating it with menu items.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-18 18:58:57 +01:00
|
|
|
void setup_panel_button();
|
2009-03-17 22:57:45 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An override to intercept realize events.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-17 22:57:45 +01:00
|
|
|
void on_realize();
|
|
|
|
|
|
2009-04-16 16:44:40 +02:00
|
|
|
/**
|
|
|
|
|
* An event handler that is called to offer an allocation to this
|
|
|
|
|
* widget.
|
|
|
|
|
* @param requisition The area offered for this widget.
|
|
|
|
|
*/
|
|
|
|
|
void on_size_request(Gtk::Requisition* requisition);
|
|
|
|
|
|
2009-03-17 22:57:45 +01:00
|
|
|
/**
|
|
|
|
|
* An override to intercept size allocate events.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-17 22:57:45 +01:00
|
|
|
void on_size_allocate(Gtk::Allocation& allocation);
|
|
|
|
|
|
2009-03-16 18:41:51 +01:00
|
|
|
private:
|
|
|
|
|
|
2009-04-14 20:37:46 +02:00
|
|
|
/**
|
|
|
|
|
* An event handler for when a panel type is chosen.
|
2009-04-15 12:13:27 +02:00
|
|
|
* @param type_index The index of the panel description that will be
|
|
|
|
|
* instantiated.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-04-04 19:53:09 +02:00
|
|
|
void on_panel_type(int type_index);
|
|
|
|
|
|
2009-04-14 20:37:46 +02:00
|
|
|
/**
|
|
|
|
|
* An event handler for when the "Hide" menu item is clicked
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-18 18:58:57 +01:00
|
|
|
void on_hide();
|
2009-04-14 20:39:58 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Event handler for when the "Lock" menu item is clicked
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-04-14 20:39:58 +02:00
|
|
|
void on_lock();
|
2009-04-15 13:24:34 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Event handler for when the split panel menu item is clicked
|
|
|
|
|
* @param split_direction The direction to split in.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-04-15 13:24:34 +02:00
|
|
|
void on_split_panel(Gtk::Orientation split_direction);
|
2009-03-18 18:58:57 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
2009-04-14 20:37:46 +02:00
|
|
|
/**
|
|
|
|
|
* A reference to the owner panel object.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-18 18:58:57 +01:00
|
|
|
panels::Panel &panel;
|
|
|
|
|
|
2009-03-16 18:41:51 +01:00
|
|
|
/**
|
|
|
|
|
* The panel menu drop-down button widget, that will be displayed in
|
|
|
|
|
* the corner of the bar.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-16 18:41:51 +01:00
|
|
|
MenuButton panelButton;
|
2009-03-17 22:57:45 +01:00
|
|
|
|
2009-04-14 20:39:58 +02:00
|
|
|
/**
|
|
|
|
|
* A pointer to the lock menu item.
|
|
|
|
|
* @remarks This value will remain NULL until after setup_panel_button
|
|
|
|
|
* has been called.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-04-14 20:39:58 +02:00
|
|
|
Gtk::CheckMenuItem *lockItem;
|
|
|
|
|
|
2009-03-17 22:57:45 +01:00
|
|
|
/**
|
|
|
|
|
* The bar window.
|
|
|
|
|
* @remarks This window is used only to set the cursor as an arrow for
|
|
|
|
|
* any child widgets.
|
2011-01-03 10:30:45 +01:00
|
|
|
*/
|
2009-03-17 22:57:45 +01:00
|
|
|
Glib::RefPtr<Gdk::Window> window;
|
2009-03-08 17:50:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // gui
|
|
|
|
|
} // widgets
|
|
|
|
|
|
|
|
|
|
#endif // PANEL_BAR_HPP
|
|
|
|
|
|