serenity/LibGUI/GRadioButton.h
Robin Burchell 0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00

31 lines
728 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();
}