aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_box.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-09 22:59:38 +0800
committercrupest <crupest@outlook.com>2018-11-09 22:59:38 +0800
commitac4b0f8d438e7a7c2ecd836af8332b5da1e035c9 (patch)
treee5b886f1884fa56dd90059523b1f4dc730bb5003 /src/ui/controls/text_box.cpp
parent4b219b569c16db6027dd36e4656152f261321c60 (diff)
downloadcru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.gz
cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.bz2
cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.zip
Add predefine resource.
Diffstat (limited to 'src/ui/controls/text_box.cpp')
-rw-r--r--src/ui/controls/text_box.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/controls/text_box.cpp b/src/ui/controls/text_box.cpp
index cb5d79a2..0ed1248c 100644
--- a/src/ui/controls/text_box.cpp
+++ b/src/ui/controls/text_box.cpp
@@ -6,23 +6,25 @@
#include "graph/graph.hpp"
#include "exception.hpp"
#include "application.hpp"
+#include "ui/predefine.hpp"
namespace cru::ui::controls
{
- using graph::CreateSolidBrush;
-
inline Microsoft::WRL::ComPtr<IDWriteFactory> GetDWriteFactory()
{
return graph::GraphManager::GetInstance()->GetDWriteFactory();
}
- TextBox::TextBox(const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format,
- const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush) : TextControl(init_text_format, init_brush)
+ TextBox::TextBox() : TextControl(
+ predefine::GetPredefineResourceComPtr<IDWriteTextFormat>(predefine::key_text_box_text_format),
+ predefine::GetPredefineResourceComPtr<ID2D1Brush>(predefine::key_text_box_text_brush)
+ )
{
SetSelectable(true);
- caret_brush_ = CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Black));
+ caret_brush_ = predefine::GetPredefineResourceComPtr<ID2D1Brush>(predefine::key_text_box_caret_brush);
+ GetBorderProperty() = predefine::GetPredefineResource<BorderProperty>(predefine::key_text_box_border);
SetBordered(true);
}