-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpareja-clrdlg-xaml.hpp
62 lines (43 loc) · 1.33 KB
/
pareja-clrdlg-xaml.hpp
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
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "win32-xaml-island-base.hpp"
#include "pareja-mainwnd-xaml.hpp"
namespace Pareja
{
class ClrDlgXamlBase : public Win32XamlIsland
{
public:
ClrDlgXamlBase() = default;
virtual void ShowHost(bool) const = 0;
virtual void CreateHostAndAttach(HINSTANCE, HWND parent) = 0;
virtual void OnMainWndResize() const {};
protected:
UIElement DoTopXamlContainer() const final { return sp_buttons.as<UIElement>(); }
static LRESULT CALLBACK ClrDlgProc(HWND, UINT, WPARAM, LPARAM);
StackPanel sp_buttons{};
Button bu_ok{}, bu_cancel{};
private:
void DoInitXamlContent() final;
virtual void AdjustWndSize() const = 0;
};
class ClrDlgXamlPopup : public ClrDlgXamlBase
{
public:
ClrDlgXamlPopup(MainWndXaml<ClrDlgXamlPopup> const& main_wnd) : main_wnd{ main_wnd } {}
void ShowHost(bool) const final;
void CreateHostAndAttach(HINSTANCE, HWND) final;
private:
void AdjustWndSize() const final;
MainWndXaml<ClrDlgXamlPopup> const& main_wnd;
};
class ClrDlgXamlChild : public ClrDlgXamlBase
{
public:
ClrDlgXamlChild(MainWndXaml<ClrDlgXamlChild> const& main_wnd) : main_wnd{ main_wnd } {}
void ShowHost(bool) const final;
void CreateHostAndAttach(HINSTANCE, HWND) final;
virtual void OnMainWndResize() const final { AdjustWndSize(); }
private:
void AdjustWndSize() const final;
MainWndXaml<ClrDlgXamlChild> const& main_wnd;
};
}