+2003-08-28 Angus Leeming <leeming@lyx.org>
+
+ * RadioButtonGroup.[Ch] (unset, setEnabled): new functions extending
+ the class' functionality.
+
2003-08-23 Rob Lahaye <lahaye@snu.ac.kr>
* FormShowFile.C (build): Remove redundant "LyX:" string from title.
#include "RadioButtonGroup.h"
#include "lyx_forms.h"
+#include "xforms_helpers.h"
#include "support/LAssert.h"
#include "debug.h" // for lyxerr
};
+void RadioButtonGroup::unset() const
+{
+ // Find the active button.
+ ButtonValueMap::const_iterator it =
+ find_if(map.begin(), map.end(),
+ is_set_button<ButtonValuePair> ());
+
+ if (it == map.end())
+ // Nothing to do. No button is set.
+ return;
+
+ fl_set_button(it->first, 0);
+}
+
+
RadioButtonGroup::size_type RadioButtonGroup::get() const
{
// Find the active button.
lyxerr << "BUG: No active radio button found." << endl;
return 0;
}
+
+
+void RadioButtonGroup::setEnabled(bool enable)
+{
+ ButtonValueMap::iterator it = map.begin();
+ ButtonValueMap::iterator end = map.end();
+ for (; it != end; ++it) {
+ ::setEnabled(it->first, enable);
+ }
+}
void set(size_type value) const;
void set(FL_OBJECT * ob) const;
+ // None of the radiobuttons are set.
+ void unset() const;
+
// Get the active button's value.
size_type get() const;
+ void setEnabled(bool enabled);
+
private:
///
typedef std::pair<FL_OBJECT *, size_type> ButtonValuePair;