blob: 4f682f95ea953f50d32d03d3223b460b0003f889 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#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() override;
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;
ObjectPtr<GTextBox> m_entry;
ObjectPtr<GLabel> m_label;
ObjectPtr<GButton> m_digit_button[10];
ObjectPtr<GButton> m_mem_add_button;
ObjectPtr<GButton> m_mem_save_button;
ObjectPtr<GButton> m_mem_recall_button;
ObjectPtr<GButton> m_mem_clear_button;
ObjectPtr<GButton> m_clear_button;
ObjectPtr<GButton> m_clear_error_button;
ObjectPtr<GButton> m_backspace_button;
ObjectPtr<GButton> m_decimal_point_button;
ObjectPtr<GButton> m_sign_button;
ObjectPtr<GButton> m_add_button;
ObjectPtr<GButton> m_subtract_button;
ObjectPtr<GButton> m_multiply_button;
ObjectPtr<GButton> m_divide_button;
ObjectPtr<GButton> m_sqrt_button;
ObjectPtr<GButton> m_inverse_button;
ObjectPtr<GButton> m_percent_button;
ObjectPtr<GButton> m_equals_button;
};
|