summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/layout.cpp4
-rw-r--r--src/gui/widgets/textbox.cpp15
-rw-r--r--src/gui/widgets/textfield.cpp2
3 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index 453e62a50..990937e06 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -349,9 +349,9 @@ void LayoutArray::reflow(int nx, int ny, int nw, int nh)
{
int dx = x, dy = y, dw = 0, dh = 0;
align(dx, dw, 0, *cell, &widths[gridX],
- widths.size() - gridX);
+ static_cast<int>(widths.size() - gridX));
align(dy, dh, 1, *cell, &heights[gridY],
- heights.size() - gridY);
+ static_cast<int>(heights.size() - gridY));
cell->reflow(dx, dy, dw, dh);
}
x += widths[gridX] + mSpacing;
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index b40a7dcb1..cd5b4bf99 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -177,7 +177,8 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
else
{
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow].size());
}
}
break;
@@ -192,11 +193,12 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
if (mCaretRow >= static_cast<int>(mTextRows.size()))
{
- mCaretRow = mTextRows.size() - 1;
+ mCaretRow = static_cast<int>(mTextRows.size()) - 1;
if (mCaretRow < 0)
mCaretRow = 0;
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow].size());
}
else
{
@@ -223,7 +225,7 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
case Input::KEY_GUI_END:
{
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(mTextRows[mCaretRow].size());
break;
}
@@ -250,7 +252,8 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
else if (mCaretColumn == 0 && mCaretRow != 0 && mEditable)
{
- mCaretColumn = mTextRows[mCaretRow - 1].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow - 1].size());
mTextRows[mCaretRow - 1] += mTextRows[mCaretRow];
mTextRows.erase(mTextRows.begin() + mCaretRow);
--mCaretRow;
@@ -303,7 +306,7 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
mCaretRow += rowsPerPage;
if (mCaretRow >= static_cast<int>(mTextRows.size()))
- mCaretRow = mTextRows.size() - 1;
+ mCaretRow = static_cast<int>(mTextRows.size()) - 1;
}
break;
}
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 3d106f9a2..f0df5eb57 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -279,7 +279,7 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
break;
case 5: // Ctrl+e
- mCaretPosition = mText.size();
+ mCaretPosition = static_cast<int>(mText.size());
consumed = true;
break;