2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-05-23 22:37:21 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-02-06 20:33:02 +01:00
|
|
|
#include <LibGUI/AbstractButton.h>
|
2019-05-23 22:37:21 +02:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
|
|
class RadioButton : public AbstractButton {
|
2020-12-28 13:18:10 +01:00
|
|
|
C_OBJECT(RadioButton);
|
|
|
|
|
|
2019-05-23 22:37:21 +02:00
|
|
|
public:
|
2020-02-02 15:07:41 +01:00
|
|
|
virtual ~RadioButton() override;
|
2019-05-23 22:37:21 +02:00
|
|
|
|
2020-05-12 20:30:33 +02:00
|
|
|
virtual void click(unsigned modifiers = 0) override;
|
2019-05-23 22:37:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
2020-12-28 13:18:10 +01:00
|
|
|
explicit RadioButton(String text = {});
|
2020-02-02 15:07:41 +01:00
|
|
|
virtual void paint_event(PaintEvent&) override;
|
2019-05-23 22:37:21 +02:00
|
|
|
|
|
|
|
|
private:
|
2019-07-13 10:27:19 +02:00
|
|
|
// These don't make sense for a radio button, so hide them.
|
2020-02-02 15:07:41 +01:00
|
|
|
using AbstractButton::auto_repeat_interval;
|
|
|
|
|
using AbstractButton::set_auto_repeat_interval;
|
2019-07-13 10:27:19 +02:00
|
|
|
|
2020-06-10 10:57:59 +02:00
|
|
|
static Gfx::IntSize circle_size();
|
2019-05-23 22:37:21 +02:00
|
|
|
};
|
2019-05-27 04:18:24 +02:00
|
|
|
|
2020-02-02 15:07:41 +01:00
|
|
|
}
|