// -*- C++ -*-
-/* This file is part of
- * =================================================
- *
- * LyX, The Document Processor
- * Copyright 1995 Matthias Ettrich.
- * Copyright 1995-2000 The LyX Team.
+/**
+ * \file RadioButtonGroup.h
+ * Copyright 2000 Baruch Even
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * This file Copyright 2000 Baruch Even
- * ================================================= */
+ * \author Baruch Even
+ *
+ * Full author contact details are available in file CREDITS
+ */
#ifndef RADIOBUTTONGROUP_H
#ifdef __GNUG__
#pragma interface
-#endif
+#endif
+#include "support/types.h"
#include <vector>
#include <utility>
-
-using std::vector;
-using std::pair;
-
-#include FORMS_H_LOCATION
+#include "forms_fwd.h"
/** This class simplifies the work with a group of radio buttons,
* the idea is that you register a bunch of radio buttons with the accompanying
* value for each radio button and then you get to query or set the active
* button in a single function call.
- * @author Baruch Even
*/
class RadioButtonGroup {
public:
+ ///
+ typedef lyx::size_type size_type;
+
/// Constructor. Allocate space for 'n' items in the group.
RadioButtonGroup(unsigned n = 5) : map(n) {};
/// Register a radio button with it's corresponding value.
- void registerRadioButton(FL_OBJECT *button, int value);
+ void init(FL_OBJECT * button, size_type value);
/// Reset registrations.
void reset();
// Set the active button.
- void setButton(int value);
+ void set(size_type value);
// Get the active button.
- int getButton();
+ size_type get() const;
private:
///
- typedef pair<FL_OBJECT *, int> ButtonValuePair;
+ typedef std::pair<FL_OBJECT *, size_type> ButtonValuePair;
///
- typedef vector<ButtonValuePair> ButtonValueMap;
+ typedef std::vector<ButtonValuePair> ButtonValueMap;
///
ButtonValueMap map;
};
-#endif
+#endif