aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_box.hpp
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-03-28 20:39:36 +0800
committerGitHub <noreply@github.com>2019-03-28 20:39:36 +0800
commitc45a6e62298e972f5945f5f3461ed723aea80317 (patch)
treef46ef303ee87a8e3814ea8743bd7062d432bfee3 /src/ui/controls/text_box.hpp
parentb028e74a48de181ca078ad3bf4ababf4fa146cd3 (diff)
parent37216f211b0e22205a3a0d3373d985fc68aea59b (diff)
downloadcru-c45a6e62298e972f5945f5f3461ed723aea80317.tar.gz
cru-c45a6e62298e972f5945f5f3461ed723aea80317.tar.bz2
cru-c45a6e62298e972f5945f5f3461ed723aea80317.zip
Merge pull request #37 from crupest/render
Refactor.
Diffstat (limited to 'src/ui/controls/text_box.hpp')
-rw-r--r--src/ui/controls/text_box.hpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/ui/controls/text_box.hpp b/src/ui/controls/text_box.hpp
deleted file mode 100644
index e5cd7545..00000000
--- a/src/ui/controls/text_box.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#pragma once
-
-// ReSharper disable once CppUnusedIncludeDirective
-#include "pre.hpp"
-
-#include "text_control.hpp"
-#include "timer.hpp"
-
-namespace cru::ui::controls
-{
- class TextBox : public TextControl
- {
- public:
- static constexpr auto control_type = L"TextBox";
-
- static TextBox* Create()
- {
- return new TextBox();
- }
-
- protected:
- TextBox();
- public:
- TextBox(const TextBox& other) = delete;
- TextBox(TextBox&& other) = delete;
- TextBox& operator=(const TextBox& other) = delete;
- TextBox& operator=(TextBox&& other) = delete;
- ~TextBox() override;
-
- StringView GetControlType() const override final;
-
- protected:
- void RequestChangeCaretPosition(unsigned position) override final;
-
- private:
- // return true if left
- bool GetCaretSelectionSide() const;
- void ShiftLeftSelectionRange(int count);
- void ShiftRightSelectionRange(int count);
-
- private:
- unsigned caret_position_ = 0;
- std::optional<TimerTask> caret_timer_{};
- Microsoft::WRL::ComPtr<ID2D1Brush> caret_brush_;
- bool is_caret_show_ = false;
- };
-}