Cleaning for mesh addition.
This commit is contained in:
parent
8e0ce22b57
commit
402f381d10
67 changed files with 655 additions and 456 deletions
|
@ -1,8 +1,8 @@
|
|||
#include "TextBox.h"
|
||||
|
||||
#include "TextElement.h"
|
||||
#include "TextNode.h"
|
||||
#include "VisualLayer.h"
|
||||
#include "GeometryElement.h"
|
||||
#include "GeometryNode.h"
|
||||
#include "KeyboardEvent.h"
|
||||
|
||||
#include <sstream>
|
||||
|
@ -12,7 +12,7 @@ TextBox::TextBox()
|
|||
mContent(),
|
||||
mCaps(false)
|
||||
{
|
||||
mBackgroundColor = Color::Create(250, 250, 250);
|
||||
mBackgroundColor = Color(250, 250, 250);
|
||||
mPadding = {10, 0, 10, 0};
|
||||
}
|
||||
|
||||
|
@ -21,17 +21,17 @@ std::unique_ptr<TextBox> TextBox::Create()
|
|||
return std::make_unique<TextBox>();
|
||||
}
|
||||
|
||||
void TextBox::SetContent(const std::string& text)
|
||||
void TextBox::setContent(const std::string& text)
|
||||
{
|
||||
mContent = text;
|
||||
}
|
||||
|
||||
std::string TextBox::GetContent() const
|
||||
std::string TextBox::getContent() const
|
||||
{
|
||||
return mContent;
|
||||
}
|
||||
|
||||
void TextBox::AppendContent(const std::string& text)
|
||||
void TextBox::appendContent(const std::string& text)
|
||||
{
|
||||
mContent += text;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ bool TextBox::onMyKeyboardEvent(const KeyboardEvent* event)
|
|||
const auto keyString = event->GetKeyString();
|
||||
if (keyString == "KEY_RETURN")
|
||||
{
|
||||
AppendContent("\n");
|
||||
appendContent("\n");
|
||||
}
|
||||
else if (keyString == "KEY_BACK")
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ bool TextBox::onMyKeyboardEvent(const KeyboardEvent* event)
|
|||
}
|
||||
else if (keyString == "KEY_SPACE")
|
||||
{
|
||||
AppendContent(" ");
|
||||
appendContent(" ");
|
||||
}
|
||||
else if (keyString == "KEY_CAPS")
|
||||
{
|
||||
|
@ -62,11 +62,11 @@ bool TextBox::onMyKeyboardEvent(const KeyboardEvent* event)
|
|||
if (mCaps && !keyString.empty())
|
||||
{
|
||||
const char c = std::toupper(keyString[0]);
|
||||
AppendContent(std::string(&c));
|
||||
appendContent(std::string(&c));
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendContent(keyString);
|
||||
appendContent(keyString);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -92,9 +92,9 @@ void TextBox::onPaintEvent(const PaintEvent* event)
|
|||
auto loc = DiscretePoint(mLocation.GetX() + mPadding.mLeft,
|
||||
mLocation.GetY() + mPadding.mTop + unsigned(offset));
|
||||
auto textLayer = VisualLayer::Create();
|
||||
auto textElement = TextElement::Create(line, loc);
|
||||
textElement->SetFillColor(Color::Create(*mBackgroundColor));
|
||||
textLayer->SetText(std::move(textElement));
|
||||
auto textElement = TextNode::Create(line, loc);
|
||||
textElement->setFillColor(mBackgroundColor);
|
||||
textLayer->setText(std::move(textElement));
|
||||
mMyLayers.push_back(std::move(textLayer));
|
||||
offset += 20;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue