-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuibase.cpp
More file actions
104 lines (103 loc) · 2.44 KB
/
uibase.cpp
File metadata and controls
104 lines (103 loc) · 2.44 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "stdafx.h"
namespace local {
UIBase::UIBase(const UIType& uitype, const bool& show) : m_Type(uitype) {
m_Show.store(show);
Init();
}
UIBase::~UIBase() {
UnInit();
}
void UIBase::Init() {
}
void UIBase::UnInit() {
}
const HWND& UIBase::Hwnd() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return m_hWnd;
}
bool UIBase::IsOpen() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return m_IsOpen.load();
}
bool UIBase::Show() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return m_Show.load();
}
void UIBase::Show(const bool& show) {
std::lock_guard<std::mutex> lock{ *m_Mutex };
m_Show.store(show);
}
const UIType& UIBase::Type() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return m_Type;
}
#if 0
void UIBase::Open() {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return;
}
void UIBase::Close() {
std::lock_guard<std::mutex> lock{ *m_Mutex };
do {
if (!m_IsOpen.load())
break;
for (auto& it : m_Threads)
it.join();
m_Threads.clear();
UIFrame::Close(IDOK);
m_IsOpen.store(false);
} while (0);
}
#endif
void UIBase::ParentSet(const HWND& parent) {
std::lock_guard<std::mutex> lock{ *m_Mutex };
do {
if (!m_hWnd || !parent)
break;
auto Style = ::GetWindowLongW(m_hWnd, GWL_STYLE);
if (!(Style & WS_CHILD)) {
Style |= WS_CHILD;
::SetWindowLongW(m_hWnd, GWL_STYLE, Style);
}
::SetParent(m_hWnd, parent);
m_Parent = parent;
} while (0);
}
void UIBase::OnShowMininized() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
::ShowWindow(m_hWnd, SW_SHOWMINIMIZED);
}
bool UIBase::AppendDownTaskNode(TaskNode*) {
return false;
}
bool UIBase::RemoveDownTaskNode(TaskNode*) {
return false;
}
void UIBase::Refresh() const {
return;
}
const HWND& UIBase::GetParent() const {
std::lock_guard<std::mutex> lock{ *m_Mutex };
return m_Parent;
}
void UIBase::SetPosition(const ::tagPOINT& inPoint, const ::tagSIZE& inSize) {
std::lock_guard<std::mutex> lock{ *m_Mutex };
::memcpy(&m_tagSize, &inSize, sizeof(::tagSIZE));
::memcpy(&m_tagPoint, &inPoint, sizeof(::tagPOINT));
}
unsigned int UIBase::UIListDownTaskCount() const {
return 0;
}
bool UIBase::SwitchPage(const EnChildPageType&) {
return false;
}
void UIBase::DownStatusTotalCount(const size_t&) {
return;
}
size_t UIBase::DownStatusTotoalCount() const {
return 0;
}
void UIBase::StatusbarProgressCtrl(const bool&) {
return;
}
}///namespace local