Change Entry::maxSize property from size_t to int

This commit is contained in:
David Capello 2017-04-19 17:51:03 -03:00
parent 6829b3d5a0
commit 7bc593ac34
2 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@
namespace ui {
Entry::Entry(const std::size_t maxsize, const char* format, ...)
Entry::Entry(const int maxsize, const char* format, ...)
: Widget(kEntryWidget)
, m_timer(500, this)
, m_maxsize(maxsize)
@ -72,7 +72,7 @@ Entry::~Entry()
{
}
void Entry::setMaxTextLength(const std::size_t maxsize)
void Entry::setMaxTextLength(const int maxsize)
{
m_maxsize = maxsize;
}
@ -548,7 +548,7 @@ void Entry::executeCmd(EntryCmd cmd, int unicodeChar, bool shift_pressed)
// Convert the unicode character -> wstring -> utf-8 string -> insert the utf-8 string
if (lastCaretPos() < m_maxsize) {
ASSERT((std::size_t)m_caret <= lastCaretPos());
ASSERT(m_caret <= lastCaretPos());
std::wstring unicodeStr;
unicodeStr.push_back(unicodeChar);

View File

@ -18,10 +18,10 @@ namespace ui {
class Entry : public Widget {
public:
Entry(const std::size_t maxsize, const char *format, ...);
Entry(const int maxsize, const char *format, ...);
~Entry();
void setMaxTextLength(const std::size_t maxsize);
void setMaxTextLength(const int maxsize);
bool isReadOnly() const;
void setReadOnly(bool state);
@ -104,7 +104,7 @@ namespace ui {
CharBoxes m_boxes;
Timer m_timer;
std::size_t m_maxsize;
int m_maxsize;
int m_caret;
int m_scroll;
int m_select;