Commit a3f2df54 authored by daniel_e's avatar daniel_e
Browse files

Add a 'name' argument to the ctor which is used to set the accessibility

* src/imagebutton.{cc,h} (ImageButton): Add a 'name' argument to
the ctor which is used to set the accessibility object's name.

* src/controller.cc (create_action_area): Set accessibility names
for all image-only buttons.
parent 1be94990
2002-12-08 Daniel Elstner <daniel.elstner@gmx.net>
* src/imagebutton.{cc,h} (ImageButton): Add a 'name' argument to
the ctor which is used to set the accessibility object's name.
* src/controller.cc (create_action_area): Set accessibility
names for all image-only buttons.
2002-12-08 Daniel Elstner <daniel.elstner@gmx.net>
* configure.ac: Check for gtkmm >= 2.1.0 and #define
......
......@@ -306,16 +306,16 @@ Gtk::Widget* Controller::create_action_area()
Box *const box_move = new HBox(true, 5);
action_area->pack_end(*manage(box_move), PACK_SHRINK);
Button *const button_prev_file = new ImageButton(Stock::GOTO_FIRST);
Button *const button_prev_file = new ImageButton(Stock::GOTO_FIRST, "File backward");
box_move->pack_start(*manage(button_prev_file));
Button *const button_prev = new ImageButton(Stock::GO_BACK);
Button *const button_prev = new ImageButton(Stock::GO_BACK, "Backward");
box_move->pack_start(*manage(button_prev));
Button *const button_next = new ImageButton(Stock::GO_FORWARD);
Button *const button_next = new ImageButton(Stock::GO_FORWARD, "Forward");
box_move->pack_start(*manage(button_next));
Button *const button_next_file = new ImageButton(Stock::GOTO_LAST);
Button *const button_next_file = new ImageButton(Stock::GOTO_LAST, "File forward");
box_move->pack_start(*manage(button_next_file));
Button *const button_replace = new ImageLabelButton(Stock::CONVERT, "_Replace", true);
......
......@@ -20,20 +20,27 @@
#include "imagebutton.h"
#include <atkmm.h>
#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <config.h>
namespace Regexxer
{
ImageButton::ImageButton(const Gtk::StockID& stock_id)
ImageButton::ImageButton(const Gtk::StockID& stock_id, const Glib::ustring& name)
{
Gtk::Image *const image = new Gtk::Image(stock_id, Gtk::ICON_SIZE_BUTTON);
add(*Gtk::manage(image));
image->show();
#if REGEXXER_HAVE_GTKMM_22
get_accessible()->set_name(name);
#endif
}
ImageButton::~ImageButton()
......
......@@ -30,7 +30,7 @@ namespace Regexxer
class ImageButton : public Gtk::Button
{
public:
explicit ImageButton(const Gtk::StockID& stock_id);
ImageButton(const Gtk::StockID& stock_id, const Glib::ustring& name);
virtual ~ImageButton();
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment