24 #ifndef CRN_USING_GTKMM3
27 #include <gtkmm/scalebutton.h>
31 using namespace GtkCRN;
46 ScaleAction::ScaleAction(
const Glib::ustring& name,
const Gtk::StockID& stock_id,
const Glib::ustring& label,
const Glib::ustring& tooltip):
47 Gtk::Action(name, stock_id, label, tooltip),
59 ScaleAction::ScaleAction(
const Glib::ustring& name,
const Glib::ustring& icon_name,
const Glib::ustring& label,
const Glib::ustring& tooltip):
60 Gtk::Action(name, icon_name, label, tooltip),
79 return Glib::RefPtr<ScaleAction>(
new ScaleAction());
88 Glib::RefPtr<ScaleAction>
ScaleAction::create(
const Glib::ustring& name,
const Glib::ustring& label,
const Glib::ustring& tooltip)
90 return Glib::RefPtr<ScaleAction>(
new ScaleAction(name, label, tooltip));
100 Glib::RefPtr<ScaleAction>
ScaleAction::create(
const Glib::ustring& name,
const Gtk::StockID& stock_id,
const Glib::ustring& label,
const Glib::ustring& tooltip)
102 return Glib::RefPtr<ScaleAction>(
new ScaleAction(name, stock_id, label, tooltip));
114 return Glib::RefPtr<ScaleAction>(
new ScaleAction(name, icon_name, label, tooltip));
120 auto *it = Gtk::manage(
new Gtk::MenuItem(
lab));
127 Gtk::ToolItem *it =
new Gtk::ToolItem;
128 Gtk::ScaleButton *sb = Gtk::manage(
new Gtk::ScaleButton(Gtk::ICON_SIZE_BUTTON, 0, 100, 10,
iconlist));
129 sb->set_adjustment(
adj);
138 Gtk::Dialog dial(
"",
true);
142 dial.set_transient_for (*mainwin);
143 dial.set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
146 dial.set_position(Gtk::WIN_POS_CENTER);
147 dial.set_position(Gtk::WIN_POS_CENTER);
148 dial.add_button(Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
149 dial.set_default_response(Gtk::RESPONSE_ACCEPT);
151 dial.get_vbox()->pack_start(hbox,
false,
true, 0);
152 Gtk::Label label(
lab,
true);
153 hbox.pack_start(label,
false,
true, 2);
154 Gtk::HScale scale(
adj);
155 scale.set_value_pos(Gtk::POS_LEFT);
156 scale.set_size_request(200);
157 hbox.pack_start(scale,
true,
true, 2);
void set_icons(const Glib::StringArrayHandle &icons)
Sets the icons to display depending of the value of the scale.
static Glib::RefPtr< ScaleAction > create()
Creates a blank ScaleAction.
static Glib::RefPtr< ScaleAction > create_with_icon_name(const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label, const Glib::ustring &tooltip)
Creates a ScaleAction.
virtual Gtk::Widget * create_tool_item_vfunc() override
virtual Gtk::Widget * create_menu_item_vfunc() override
static Gtk::Window * get_main_window()
Gets a pointer to the main window.
std::vector< Glib::ustring > iconlist