forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibGUI: Make GCheckBox inherit from GAbstractButton.
- Loading branch information
1 parent
21c5647
commit 677794f
Showing
9 changed files
with
25 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,19 @@ | ||
#pragma once | ||
|
||
#include "GWidget.h" | ||
#include <AK/AKString.h> | ||
#include <AK/Function.h> | ||
#include <LibGUI/GAbstractButton.h> | ||
|
||
class GCheckBox final : public GWidget { | ||
class GCheckBox : public GAbstractButton { | ||
public: | ||
explicit GCheckBox(GWidget* parent); | ||
virtual ~GCheckBox() override; | ||
|
||
String caption() const { return m_caption; } | ||
void set_caption(const String&); | ||
|
||
bool is_checked() const { return m_checked; } | ||
void set_checked(bool); | ||
|
||
Function<void(GCheckBox&, bool)> on_change; | ||
virtual void click() override; | ||
|
||
virtual const char* class_name() const override { return "GCheckBox"; } | ||
|
||
private: | ||
virtual void paint_event(GPaintEvent&) override; | ||
virtual void mousedown_event(GMouseEvent&) override; | ||
virtual void mouseup_event(GMouseEvent&) override; | ||
virtual void mousemove_event(GMouseEvent&) override; | ||
virtual void keydown_event(GKeyEvent&) override; | ||
virtual bool accepts_focus() const override { return true; } | ||
|
||
String m_caption; | ||
bool m_checked { false }; | ||
bool m_being_modified { false }; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters