mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
30 lines
599 B
C++
30 lines
599 B
C++
#pragma once
|
|
|
|
#include "Calculator.h"
|
|
#include "Keypad.h"
|
|
#include <AK/Vector.h>
|
|
#include <LibGUI/GWidget.h>
|
|
|
|
class GTextBox;
|
|
class GButton;
|
|
class GLabel;
|
|
|
|
class CalculatorWidget final : public GWidget {
|
|
C_OBJECT(CalculatorWidget)
|
|
public:
|
|
explicit CalculatorWidget(GWidget*);
|
|
virtual ~CalculatorWidget();
|
|
|
|
private:
|
|
void add_button(GButton&, Calculator::Operation);
|
|
void add_button(GButton&, int);
|
|
void add_button(GButton&);
|
|
|
|
void update_display();
|
|
|
|
Calculator m_calculator;
|
|
Keypad m_keypad;
|
|
|
|
GTextBox* m_entry { nullptr };
|
|
GLabel* m_label { nullptr };
|
|
};
|