aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-26 19:39:24 +0800
committercrupest <crupest@outlook.com>2020-12-26 19:39:24 +0800
commit715be3c81b96fcf87c7650501d71480a8743a984 (patch)
treef56119db325f57280ab625cf1927b846e3eebdcb /include/cru/ui/controls
parent61b835d47ab98279c5f2f43bebcd4fe18f7c408d (diff)
downloadcru-715be3c81b96fcf87c7650501d71480a8743a984.tar.gz
cru-715be3c81b96fcf87c7650501d71480a8743a984.tar.bz2
cru-715be3c81b96fcf87c7650501d71480a8743a984.zip
...
Diffstat (limited to 'include/cru/ui/controls')
-rw-r--r--include/cru/ui/controls/TextHostControlService.hpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/cru/ui/controls/TextHostControlService.hpp b/include/cru/ui/controls/TextHostControlService.hpp
index 0bea52c8..9e6a08bc 100644
--- a/include/cru/ui/controls/TextHostControlService.hpp
+++ b/include/cru/ui/controls/TextHostControlService.hpp
@@ -70,8 +70,10 @@ class TextHostControlService : public Object {
void SetSelection(gsl::index caret_position);
void SetSelection(TextRange selection, bool scroll_to_caret = true);
- void DeleteSelectedText();
+ void ChangeSelectionEnd(gsl::index new_end);
+ void AbortSelection();
+ void DeleteSelectedText();
// If some text is selected, then they are deleted first. Then insert text
// into caret position.
void ReplaceSelectedText(std::u16string_view text);
@@ -92,10 +94,6 @@ class TextHostControlService : public Object {
void SyncTextRenderObject();
- void StartSelection(Index start);
- void UpdateSelection(Index new_end);
- void AbortSelection();
-
void UpdateInputMethodPosition();
template <typename TArgs>
@@ -106,16 +104,14 @@ class TextHostControlService : public Object {
std::bind(handler, this, std::placeholders::_1));
}
- void SetUpHandlers();
- void TearDownHandlers();
-
void MouseMoveHandler(event::MouseEventArgs& args);
void MouseDownHandler(event::MouseButtonEventArgs& args);
void MouseUpHandler(event::MouseButtonEventArgs& args);
- void KeyDownHandler(event::KeyEventArgs& args);
void GainFocusHandler(event::FocusChangeEventArgs& args);
void LoseFocusHandler(event::FocusChangeEventArgs& args);
+ void SetUpShortcuts();
+
private:
gsl::not_null<Control*> control_;
gsl::not_null<ITextHostControl*> text_host_control_;
@@ -136,6 +132,6 @@ class TextHostControlService : public Object {
helper::ShortcutHub shortcut_hub_;
// true if left mouse is down and selecting
- bool mouse_move_selecting_;
+ bool mouse_move_selecting_ = false;
};
} // namespace cru::ui::controls