2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * This file Copyright 2000 Baruch Even
10 * ================================================= */
13 * This class simplifies the work with a group of radio buttons,
14 * the idea is that you register a bunch of radio buttons with the accompanying
15 * value for each radio button and then you get to query or set the active
16 * button in a single function call.
19 #ifndef RADIOBUTTONGROUP_H
20 #define RADIOBUTTONGROUP_H
32 #include FORMS_H_LOCATION
35 class RadioButtonGroup {
37 /// Constructor. Allocate space for 'n' items in the group.
38 RadioButtonGroup(unsigned n = 5) : map(n) {};
40 /// Register a radio button with it's corresponding value.
41 void registerRadioButton(FL_OBJECT *button, int value);
42 /// Reset registrations.
45 // Set the active button.
46 void setButton(int value);
48 // Get the active button.
53 typedef pair<FL_OBJECT *, int> ButtonValuePair;
55 typedef vector<ButtonValuePair> ButtonValueMap;