#ifndef RADIOBUTTONGROUP_H
#define RADIOBUTTONGROUP_H
-
#include "support/types.h"
#include <vector>
#include <utility>
#include "forms_fwd.h"
+namespace lyx {
+namespace frontend {
+
/** This class simplifies interaction with a group of radio buttons:
* one, and only one, can be selected.
* The idea is that you register a bunch of radio buttons with
*/
class RadioButtonGroup {
public:
- ///
- typedef lyx::size_type size_type;
/// Register a radio button with its corresponding value.
void init(FL_OBJECT * ob, size_type value);
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;
ButtonValueMap map;
};
+} // namespace frontend
+} // namespace lyx
+
#endif // RADIOBUTTONGROUP_H