1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Reworked TextInput to allow text overflow support

This commit is contained in:
Ivan Savenko
2024-05-12 14:17:49 +00:00
parent 1abe9007bc
commit 93c3cf372b
11 changed files with 228 additions and 169 deletions

View File

@@ -333,11 +333,11 @@ CSplitWindow::CSplitWindow(const CCreature * creature, std::function<void(int, i
rightInput = std::make_shared<CTextInput>(Rect(176, 218, 100, 36), FONT_BIG, std::bind(&CSplitWindow::setAmountText, this, _1, false), ETextAlignment::CENTER, true);
//add filters to allow only number input
leftInput->filters += std::bind(&CTextInput::numberFilter, _1, _2, leftMin, leftMax);
rightInput->filters += std::bind(&CTextInput::numberFilter, _1, _2, rightMin, rightMax);
leftInput->setFilterNumber(leftMin, leftMax);
rightInput->setFilterNumber(rightMin, rightMax);
leftInput->setText(std::to_string(leftAmount), false);
rightInput->setText(std::to_string(rightAmount), false);
leftInput->setText(std::to_string(leftAmount));
rightInput->setText(std::to_string(rightAmount));
animLeft = std::make_shared<CCreaturePic>(20, 54, creature, true, false);
animRight = std::make_shared<CCreaturePic>(177, 54,creature, true, false);