aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/TextBox.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-09-11 11:39:19 +0800
committercrupest <crupest@outlook.com>2020-09-11 11:39:19 +0800
commitf357d11518796b0e0c2c5f23d8eafeda48226af9 (patch)
tree503c2a8e23fb2fcf35aaea054120ee1402337b0a /src/ui/controls/TextBox.cpp
parent93b8a62d28f9427f0979d62b71f12fb2858064ee (diff)
downloadcru-f357d11518796b0e0c2c5f23d8eafeda48226af9.tar.gz
cru-f357d11518796b0e0c2c5f23d8eafeda48226af9.tar.bz2
cru-f357d11518796b0e0c2c5f23d8eafeda48226af9.zip
...
Diffstat (limited to 'src/ui/controls/TextBox.cpp')
-rw-r--r--src/ui/controls/TextBox.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/controls/TextBox.cpp b/src/ui/controls/TextBox.cpp
index 2bc4cf95..4a8d6658 100644
--- a/src/ui/controls/TextBox.cpp
+++ b/src/ui/controls/TextBox.cpp
@@ -32,20 +32,23 @@ TextBox::TextBox()
border_render_object_->SetAttachedControl(this);
scroll_render_object_->SetAttachedControl(this);
text_render_object_->SetAttachedControl(this);
- text_render_object_->SetMinSize(Size{50, 20});
+ text_render_object_->SetMinSize(Size{100, 24});
service_ = std::make_unique<TextControlService<TextBox>>(this);
service_->SetEnabled(true);
service_->SetCaretVisible(true);
service_->SetEditable(true);
+ border_render_object_->SetBorderEnabled(true);
+ border_render_object_->SetBorderStyle(border_style_.normal);
+
GainFocusEvent()->Direct()->AddHandler([this](event::FocusChangeEventArgs&) {
- this->service_->SetEnabled(true);
+ this->service_->SetCaretVisible(true);
this->UpdateBorderStyle();
});
LoseFocusEvent()->Direct()->AddHandler([this](event::FocusChangeEventArgs&) {
- this->service_->SetEnabled(false);
+ this->service_->SetCaretVisible(false);
this->UpdateBorderStyle();
});
}