-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeypad.h
More file actions
32 lines (27 loc) · 998 Bytes
/
Keypad.h
File metadata and controls
32 lines (27 loc) · 998 Bytes
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
#pragma once
#include "Visible.h"
#include "Image.h"
#include "Character.h"
//Like, a keypad
class Keypad : public Visible
{
public:
Keypad();
~Keypad(void);
void draw(HDC hdc, RECT rect) const;
void drawMarked(HDC hdc, RECT rect, const Character & character) const;
void drawMarked(HDC hdc, RECT rect, const std::vector<Character> & characters) const;
//Returns the image on clicked button
const CompositeImage* locate(Point point, Box box) const;
private:
static std::pair<int, int> pair(int x, int y) {
return std::make_pair(x,y);
}
static CompositeImage image(const std::string & character);
std::map<std::pair<int, int>, CompositeImage> images;
void drawCell(HDC hdc, RECT totalRect, int x, int y) const;
RECT subrect(RECT totalRect, int x, int y, bool pad) const;
void drawBorders(HDC hdc, RECT rect) const;
bool findChar(const Character & character, int & x, int & y) const;
void drawMarked(HDC hdc, RECT rect, const Character & character, DrawStyle style) const;
};