mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
3873c51781
Use this to iterate over all the GRadioButtons in a group.
29 lines
724 B
C++
29 lines
724 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GAbstractButton.h>
|
|
|
|
class GRadioButton : public GAbstractButton {
|
|
public:
|
|
GRadioButton(const String& text, GWidget* parent);
|
|
virtual ~GRadioButton() override;
|
|
|
|
virtual const char* class_name() const override { return "GRadioButton"; }
|
|
|
|
virtual void click() override;
|
|
|
|
protected:
|
|
virtual void paint_event(GPaintEvent&) override;
|
|
|
|
private:
|
|
virtual bool is_radio_button() const final { return true; }
|
|
|
|
template<typename Callback> void for_each_in_group(Callback);
|
|
static Size circle_size();
|
|
};
|
|
|
|
template<> inline bool is<GRadioButton>(const CObject& object)
|
|
{
|
|
if (!is<GWidget>(object))
|
|
return false;
|
|
return to<GWidget>(object).is_radio_button();
|
|
}
|