mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
90d13ee068
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9073 a592a061-630c-0410-9148-cb99ea01b6c8
85 lines
1.6 KiB
C++
85 lines
1.6 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file GToolbar.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Huang Ying
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef GTOOLBAR_H
|
|
#define GTOOLBAR_H
|
|
|
|
#include "frontends/Toolbars.h"
|
|
|
|
#include <gtkmm.h>
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
class GView;
|
|
|
|
class stringcolumns : public Gtk::TreeModel::ColumnRecord {
|
|
public:
|
|
stringcolumns()
|
|
{
|
|
add(name);
|
|
}
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> name;
|
|
};
|
|
|
|
|
|
class GLayoutBox: public LayoutBox, public sigc::trackable {
|
|
public:
|
|
GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
|
|
|
|
/// select the right layout in the combox.
|
|
void set(std::string const & layout);
|
|
/// Populate the layout combox.
|
|
void update();
|
|
/// Erase the layout list.
|
|
void clear();
|
|
/// Display the layout list.
|
|
void open();
|
|
///
|
|
void setEnabled(bool);
|
|
private:
|
|
///
|
|
void selected();
|
|
|
|
Gtk::ComboBox combo_;
|
|
Glib::RefPtr<Gtk::ListStore> model_;
|
|
stringcolumns cols_;
|
|
|
|
LyXView & owner_;
|
|
bool internal_;
|
|
};
|
|
|
|
|
|
class GToolbar : public Toolbar, public sigc::trackable {
|
|
public:
|
|
GToolbar(ToolbarBackend::Toolbar const &, LyXView &);
|
|
void add(FuncRequest const & func, std::string const & tooltip);
|
|
void hide(bool);
|
|
void show(bool);
|
|
void update();
|
|
LayoutBox * layout() const { return layout_.get(); }
|
|
private:
|
|
void clicked(FuncRequest);
|
|
|
|
GView & owner_;
|
|
Gtk::Toolbar toolbar_;
|
|
boost::scoped_ptr<GLayoutBox> layout_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // NOT GTOOLBAR_H
|