mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
Calculator: Add a simple calculator app
Closes https://github.com/SerenityOS/serenity/issues/319
This commit is contained in:
parent
79f867238a
commit
ccb482d1a7
10 changed files with 611 additions and 0 deletions
30
Applications/Calculator/CalculatorWidget.h
Normal file
30
Applications/Calculator/CalculatorWidget.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#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 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue