Commit 1be94990 authored by daniel_e's avatar daniel_e
Browse files

Check for gtkmm >= 2.1.0 and #define REGEXXER_HAVE_GTKMM_22 if available.

* configure.ac: Check for gtkmm >= 2.1.0 and #define REGEXXER_HAVE_GTKMM_22
if available.

* src/controller.cc:
* src/mainwindow.cc:
* src/statusline.cc: If building for gtkmm >= 2.1.0, make use of atkmm
to set names and descriptions of several GUI elements.
parent 1de98bed
2002-12-08 Daniel Elstner <daniel.elstner@gmx.net>
* configure.ac: Check for gtkmm >= 2.1.0 and #define
REGEXXER_HAVE_GTKMM_22 if available.
* src/controller.cc:
* src/mainwindow.cc:
* src/statusline.cc: If building for gtkmm >= 2.1.0, make use of
atkmm to set names and descriptions of several GUI elements.
2002-12-08 Daniel Elstner <daniel.elstner@gmx.net>
* pixmaps/Makefile.am (stockimages.h): Perfectionize so that it
......
......@@ -37,6 +37,17 @@ PKG_CHECK_MODULES([GTKMM], [glib-2.0 >= 2.0.7 gtk+-2.0 >= 2.0.6 sigc++-1.2 >= 1.
AC_SUBST([GTKMM_CFLAGS])
AC_SUBST([GTKMM_LIBS])
AC_MSG_CHECKING([for gtkmm >= 2.1.0])
have_gtkmm_22=no
${PKG_CONFIG:-"pkg-config"} --atleast-version=2.1.0 gtkmm-2.0 >&5 2>&5 && have_gtkmm_22=yes
AC_MSG_RESULT([${have_gtkmm_22}])
if test "x$have_gtkmm_22" = "xyes"; then
{
AC_DEFINE([REGEXXER_HAVE_GTKMM_22], [1], [Define to 1 if gtkmm >= 2.1.0 is installed.])
}
fi
gdk_pixbuf_exec_prefix=`${PKG_CONFIG:-"pkg-config"} --variable=exec_prefix gdk-pixbuf-2.0 2>&5`
prog_search_path=${gdk_pixbuf_exec_prefix:+"$gdk_pixbuf_exec_prefix/bin$PATH_SEPARATOR"}$PATH
......
......@@ -28,6 +28,8 @@
#include <gtkmm/toolbar.h>
#include <memory>
#include <config.h>
namespace
{
......@@ -76,15 +78,6 @@ void add_widget_button(Regexxer::ControlItem& control, Gtk::Button& button)
control.add_widget(button);
}
#if 0
/* TODO: Fix atkmm instead. And gtkmm. Fuck.
*/
void set_atk_description(Gtk::Widget& widget, const Glib::ustring& description)
{
atk_object_set_description(gtk_widget_get_accessible(widget.gobj()), description.c_str());
}
#endif
} // anonymous namespace
......@@ -334,14 +327,14 @@ Gtk::Widget* Controller::create_action_area()
Button *const button_replace_all = new ImageLabelButton(Stock::CONVERT, "_All files", true);
box_replace->pack_start(*manage(button_replace_all));
#if 0
set_atk_description(*button_prev_file, "Go to the previous matching file");
set_atk_description(*button_prev, "Go to previous match");
set_atk_description(*button_next, "Go to next match");
set_atk_description(*button_next_file, "Go to the next matching file");
set_atk_description(*button_replace, "Replace current match");
set_atk_description(*button_replace_file, "Replace all matches in the current file");
set_atk_description(*button_replace_all, "Replace all matches in all files");
#if REGEXXER_HAVE_GTKMM_22
button_prev_file ->get_accessible()->set_description("Go to the previous matching file");
button_prev ->get_accessible()->set_description("Go to previous match");
button_next ->get_accessible()->set_description("Go to next match");
button_next_file ->get_accessible()->set_description("Go to the next matching file");
button_replace ->get_accessible()->set_description("Replace current match");
button_replace_file->get_accessible()->set_description("Replace all matches in the current file");
button_replace_all ->get_accessible()->set_description("Replace all matches in all files");
#endif
add_widget_button(next_file, *button_next_file);
......
......@@ -28,7 +28,6 @@
#include "stringutils.h"
#include <glib.h>
#include <atk/atk.h> /* TODO: fix atkmm instead */
#include <gtkmm.h>
#include <algorithm>
#include <functional>
......@@ -442,9 +441,9 @@ Gtk::Widget* MainWindow::create_right_pane()
entry_preview_->unset_flags(CAN_FOCUS);
entry_preview_->modify_font(fileview_font_);
// TODO: Fix atkmm instead.
atk_object_set_description(gtk_widget_get_accessible(entry_preview_->Widget::gobj()),
"Preview of the substitution in the current line");
#if REGEXXER_HAVE_GTKMM_22
entry_preview_->get_accessible()->set_description("Preview of the substitution in the current line");
#endif
tooltips_.set_tip(*entry_regex_, "A regular expression in Perl syntax");
tooltips_.set_tip(*entry_substitution_, "The new string to substitute. As in Perl, you can "
......
......@@ -247,6 +247,10 @@ StatusLine::StatusLine()
progressbar_->set_pulse_step(0.025);
#if REGEXXER_HAVE_GTKMM_22
cancel_button_->get_accessible()->set_description("Cancels the running search");
#endif
show_all_children();
}
......@@ -323,7 +327,7 @@ void StatusLine::on_button_style_changed(const Glib::RefPtr<Gtk::Style>&)
// so reduce the button's size request to a reasonable amount.
int width = 0, height = 0;
cancel_button_->create_pango_layout("Stop")->get_pixel_size(width, height);
cancel_button_->create_pango_layout(cancel_button_->get_label())->get_pixel_size(width, height);
cancel_button_->set_size_request(-1, height + 4);
}
......
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