-
Notifications
You must be signed in to change notification settings - Fork 22
/
TitleBar.h
44 lines (40 loc) · 1.79 KB
/
TitleBar.h
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
#pragma once
namespace UKControllerPlugin {
namespace Euroscope {
class EuroscopeRadarLoopbackInterface;
} // namespace Euroscope
namespace Windows {
class GdiGraphicsInterface;
} // namespace Windows
} // namespace UKControllerPlugin
namespace UKControllerPlugin::Components {
class ClickableArea;
/*
* A class that builds a titlebar and then renders to screen.
*/
class TitleBar : public std::enable_shared_from_this<TitleBar>
{
public:
static std::shared_ptr<TitleBar> Create(std::wstring title, Gdiplus::Rect area);
std::shared_ptr<TitleBar> WithDefaultBackgroundBrush();
std::shared_ptr<TitleBar> WithBackgroundBrush(std::shared_ptr<Gdiplus::Brush> brush);
std::shared_ptr<TitleBar> WithTextBrush(std::shared_ptr<Gdiplus::Brush> brush);
std::shared_ptr<TitleBar> WithDefaultTextBrush();
std::shared_ptr<TitleBar> WithBorder(std::shared_ptr<Gdiplus::Pen> pen);
std::shared_ptr<TitleBar> WithDefaultBorder();
std::shared_ptr<TitleBar> WithDrag(int screenObjectId);
std::shared_ptr<TitleBar> WithPosition(Gdiplus::Rect area);
std::shared_ptr<TitleBar> WithTitle(std::wstring title);
void
Draw(Windows::GdiGraphicsInterface& graphics, Euroscope::EuroscopeRadarLoopbackInterface& radarScreen) const;
protected:
TitleBar(std::wstring title, Gdiplus::Rect area);
private:
std::shared_ptr<Gdiplus::Brush> backgroundBrush;
std::shared_ptr<Gdiplus::Brush> textBrush;
std::shared_ptr<Gdiplus::Pen> borderPen;
std::shared_ptr<ClickableArea> clickableArea = nullptr;
std::wstring title;
Gdiplus::Rect area;
};
} // namespace UKControllerPlugin::Components