]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/GMiniBuffer.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / gtk / GMiniBuffer.C
index 79a3ca9579b8ffc388b65e83498f3b905e1875fb..3f117a77455978e218f83caaff500f64103dc078 100644 (file)
@@ -9,7 +9,11 @@
  */
 
 #include <config.h>
-#include <gtkmm.h>
+
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
 
 #include "GView.h"
 #include "GMiniBuffer.h"
@@ -23,6 +27,8 @@
 
 using std::string;
 
+namespace lyx {
+namespace frontend {
 
 GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
        controller_(control), view_(view)
@@ -32,34 +38,37 @@ GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
        listView_.set_model(listStore_);
        listView_.append_column("Completions", listCol_);
        listView_.signal_key_press_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onListKeyPress));
+               sigc::mem_fun(*this, &GMiniBuffer::onListKeyPress));
        listView_.signal_focus_in_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onListFocusIn));
+               sigc::mem_fun(*this, &GMiniBuffer::onListFocusIn));
        listView_.signal_focus_out_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusOut));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
        listSel_ = listView_.get_selection();
        listSel_->signal_changed().connect(
-               SigC::slot(*this, &GMiniBuffer::onSelected));
+               sigc::mem_fun(*this, &GMiniBuffer::onSelected));
+
        listView_.show();
        scrolledWindow_.set_policy(Gtk::POLICY_AUTOMATIC,
                                   Gtk::POLICY_AUTOMATIC);
        scrolledWindow_.set_size_request(300, 150);
        scrolledWindow_.add(listView_);
-       view_->getVBox().children().push_back(
-               Gtk::Box_Helpers::Element(scrolledWindow_,
-                                         Gtk::PACK_SHRINK));
+
+       view_->getBox(GView::Bottom).children().push_back(
+               Gtk::Box_Helpers::Element(scrolledWindow_,Gtk::PACK_SHRINK));
+
        entry_.signal_key_press_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onKeyPress));
+               sigc::mem_fun(*this, &GMiniBuffer::onKeyPress));
        entry_.signal_focus_in_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusIn));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusIn));
        entry_.signal_focus_out_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusOut));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
        entry_.signal_activate().connect(
-               SigC::slot(*this, &GMiniBuffer::onCommit));
+               sigc::mem_fun(*this, &GMiniBuffer::onCommit));
        entry_.show();
-       view_->getVBox().children().push_back(
-               Gtk::Box_Helpers::Element(entry_,
-                                         Gtk::PACK_SHRINK));
+
+       view_->getBox(GView::Bottom).children().push_back(
+               Gtk::Box_Helpers::Element(entry_, Gtk::PACK_SHRINK));
+
        infoTimer_.reset(new Timeout(1500));
        idleTimer_.reset(new Timeout(6000));
        focusTimer_.reset(new Timeout(50));
@@ -215,13 +224,14 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event)
                break;
        case GDK_Tab:
        {
-               Glib::ustring new_input, input;
                string new_input_locale;
-               input = entry_.get_text();
+               Glib::ustring input = entry_.get_text();
                std::vector<string> comp =
                        controller_.completions(Glib::locale_from_utf8(input),
                                                new_input_locale);
-               new_input = Glib::locale_to_utf8(new_input_locale);
+               Glib::ustring new_input =
+                       Glib::locale_to_utf8(new_input_locale);
+
                if (comp.empty() && new_input == input) {
                        showInfo("[no match]");
                        break;
@@ -283,3 +293,6 @@ void GMiniBuffer::setInput(Glib::ustring const & input)
        entry_.set_text(input);
        entry_.set_position(-1);
 }
+
+} // namespace frontend
+} // namespace lyx