/usr/include/Wt/WRadioButton is in libwt-dev 3.3.4+dfsg-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WRADIOBUTTON_H_
#define WRADIOBUTTON_H_
#include <Wt/WAbstractToggleButton>
namespace Wt {
class WButtonGroup;
/*! \class WRadioButton Wt/WRadioButton Wt/WRadioButton
* \brief A user control that represents a radio button.
*
* Use a WButtonGroup to group together radio buttons that reflect
* options that are mutually exclusive.
*
* Usage example:
* \if cpp
* \code
* enum Vote { Republican = 1, Democrate = 2, NoVote = 10 };
*
* // use a group box as widget container for 3 radio buttons, with a title
* Wt::WGroupBox *container = new Wt::WGroupBox("USA elections vote");
*
* // use a button group to logically group the 3 options
* Wt::WButtonGroup *group = new Wt::WButtonGroup(this);
*
* Wt::WRadioButton *button;
* button = new Wt::WRadioButton("I voted Republican", container);
* new Wt::WBreak(container);
* group->addButton(button, Republican);
* button = new Wt::WRadioButton("I voted Democrat", container);
* new Wt::WBreak(container);
* group->addButton(button, Democrate);
* button = new Wt::WRadioButton("I didn't vote", container);
* new Wt::WBreak(container);
* group->addButton(button, NoVote);
*
* group->setCheckedButton(group->button(NoVote));
* \endcode
* \elseif java
* \code
* enum Vote { Republican, Democrate, NoVote };
*
* // use a group box as widget container for 3 radio buttons, with a title
* WGroupBox container = new WGroupBox("USA elections vote");
* // use a button group to logically group the 3 options
* WButtonGroup group = new WButtonGroup(this);
* WRadioButton button;
* button = new WRadioButton("I voted Republican", container);
* new WBreak(container);
* group.addButton(button, Vote.Republican.ordinal());
* button = new WRadioButton("I voted Democrat", container);
* new WBreak(container);
* group.addButton(button, Vote.Democrate.ordinal());
* button = new WRadioButton("I didn't vote", container);
* new WBreak(container);
* group.addButton(button, Vote.NoVote.ordinal());
* group.setCheckedButton(group.button(Vote.NoVote.ordinal()));
* \endcode
* \endif
*
* %WRadioButton is an \link WWidget::setInline(bool) inline \endlink widget.
*
* <h3>CSS</h3>
*
* This widget corresponds to the HTML <tt><input
* type="radio"></tt> tag. When a label is specified, the input
* element is nested in a <tt><label></tt>.
*
* This widget does not provide styling, and can be styled using
* inline or external CSS as appropriate.
*
* \sa WAbstractToggleButton, WButtonGroup
*/
class WT_API WRadioButton : public WAbstractToggleButton
{
public:
/*! \brief Creates an unchecked radio button with empty label and optional
* parent.
*/
WRadioButton(WContainerWidget *parent = 0);
/*! \brief Creates an unchecked radio button with given text and optional
* parent.
*/
WRadioButton(const WString& text, WContainerWidget *parent = 0);
/*! \brief Destructor.
*/
~WRadioButton();
/*! \brief Returns the button group.
*
* Returns the button group to which this button belongs.
*
* \sa WButtonGroup::addButton(WRadioButton *, int)
*/
WButtonGroup *group() const { return buttonGroup_; }
private:
WButtonGroup *buttonGroup_;
void setGroup(WButtonGroup *buttonGroup);
friend class WButtonGroup;
protected:
virtual void updateInput(DomElement& input, bool all);
virtual void getFormObjects(FormObjectsMap& formObjects);
virtual void setFormData(const FormData& formData);
};
}
#endif // WRADIOBUTTON_H_
|