]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/RadioButtonGroup.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / RadioButtonGroup.C
index 7509b78378984e6af58bf8b5697dadd3a503d24a..e292c2ae7b08403039de3db835d91147e10e1b9b 100644 (file)
 
 #include "debug.h"
 
-#include "support/lyxfunctional.h"
-
 #include "lyx_forms.h"
 
 #include <boost/assert.hpp>
+#include <boost/bind.hpp>
+
+using boost::bind;
 
 using std::endl;
+using std::equal_to;
 
+namespace lyx {
+namespace frontend {
 
 void RadioButtonGroup::init(FL_OBJECT * ob, size_type value)
 {
@@ -41,7 +45,9 @@ void RadioButtonGroup::set(size_type value) const
 {
        ButtonValueMap::const_iterator it =
                find_if(map.begin(), map.end(),
-                       lyx::equal_2nd_in_pair<ButtonValuePair>(value));
+                       bind(equal_to<size_type>(),
+                            bind(&ButtonValuePair::second, _1),
+                            value));
 
        if (it != map.end()) {
                fl_set_button(it->first, 1);
@@ -72,8 +78,8 @@ void RadioButtonGroup::set(FL_OBJECT * ob) const
 }
 
 
-template < typename T >
-struct is_set_button {
+template <typename T>
+struct is_set_button : public std::unary_function<T, bool> {
        bool operator() (T const & item) const
        {
                return fl_get_button((item).first);
@@ -96,7 +102,7 @@ void RadioButtonGroup::unset() const
 }
 
 
-RadioButtonGroup::size_type RadioButtonGroup::get() const
+size_type RadioButtonGroup::get() const
 {
        // Find the active button.
        ButtonValueMap::const_iterator it =
@@ -117,6 +123,9 @@ void RadioButtonGroup::setEnabled(bool enable)
        ButtonValueMap::iterator it  = map.begin();
        ButtonValueMap::iterator end = map.end();
        for (; it != end; ++it) {
-               ::setEnabled(it->first, enable);
+               lyx::frontend::setEnabled(it->first, enable);
        }
 }
+
+} // namespace frontend
+} // namespace lyx