summaryrefslogtreecommitdiffstats
path: root/gui/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/input.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/gui/input.cpp b/gui/input.cpp
index 68bd163b9..c12ecc2b2 100644
--- a/gui/input.cpp
+++ b/gui/input.cpp
@@ -39,8 +39,8 @@
extern "C" {
#include "../twcommon.h"
-#include "../minuitwrp/minui.h"
}
+#include "../minuitwrp/minui.h"
#include "rapidxml.hpp"
#include "objects.hpp"
@@ -196,7 +196,7 @@ int GUIInput::HandleTextLocation(int x)
maskedValue += mMask;
displayValue = maskedValue;
}
- textWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
if (textWidth <= mRenderW) {
lastX = x;
scrollingX = 0;
@@ -209,7 +209,7 @@ int GUIInput::HandleTextLocation(int x)
if (skipChars && skipChars < displayValue.size())
displayValue.erase(0, skipChars);
- textWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
mRendered = false;
int deltaX, deltaText, newWidth;
@@ -222,11 +222,11 @@ int GUIInput::HandleTextLocation(int x)
if (mCursorLocation == -1) {
displayValue = originalValue;
skipChars = 0;
- textWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
while (textWidth > mRenderW) {
displayValue.erase(0, 1);
skipChars++;
- textWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
}
scrollingX = mRenderW - textWidth;
mInputText->SkipCharCount(skipChars);
@@ -237,12 +237,12 @@ int GUIInput::HandleTextLocation(int x)
cursorLocate = displayValue;
cursorLocate.resize(mCursorLocation);
- textWidth = gr_measureEx(cursorLocate.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource);
while (textWidth > mRenderW) {
skipChars++;
mCursorLocation--;
cursorLocate.erase(0, 1);
- textWidth = gr_measureEx(cursorLocate.c_str(), fontResource);
+ textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource);
adjust_scrollingX = -1;
}
if (adjust_scrollingX) {
@@ -261,7 +261,7 @@ int GUIInput::HandleTextLocation(int x)
}
insertChar = originalValue.substr(skipChars - 1, 1);
displayValue.insert(0, insertChar);
- newWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
deltaText = newWidth - textWidth;
if (newWidth > mRenderW) {
scrollingX = mRenderW - textWidth;
@@ -289,7 +289,7 @@ int GUIInput::HandleTextLocation(int x)
}
insertChar = originalValue.substr(skipChars - 1, 1);
displayValue.insert(0, insertChar);
- newWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
deltaText = newWidth - textWidth;
if (deltaText < deltaX) {
lastX += deltaText;
@@ -324,7 +324,7 @@ int GUIInput::HandleTextLocation(int x)
deltaX = lastX - x;
displayValue.erase(0, 1);
skipChars++;
- newWidth = gr_measureEx(displayValue.c_str(), fontResource);
+ newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
deltaText = textWidth - newWidth;
if (newWidth <= mRenderW) {
scrollingX = mRenderW - newWidth;
@@ -407,15 +407,15 @@ int GUIInput::Render(void)
cursorDisplay = displayValue;
cursorDisplay.resize(mCursorLocation);
- cursorX = gr_measureEx(cursorDisplay.c_str(), fontResource) + mRenderX;
+ cursorX = gr_ttf_measureEx(cursorDisplay.c_str(), fontResource) + mRenderX;
} else {
// Cursor location is after the end of the text - reset to -1
mCursorLocation = -1;
- cursorX = gr_measureEx(displayValue.c_str(), fontResource) + mRenderX;
+ cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX;
}
} else {
// Cursor is at the end (-1)
- cursorX = gr_measureEx(displayValue.c_str(), fontResource) + mRenderX;
+ cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX;
}
}
cursorX += scrollingX;
@@ -534,7 +534,7 @@ int GUIInput::NotifyTouch(TOUCH_STATE state, int x, int y)
for(index=0; index<displayValue.size(); index++)
{
cursorString = displayValue.substr(0, index);
- cursorX = gr_measureEx(cursorString.c_str(), fontResource) + mRenderX;
+ cursorX = gr_ttf_measureEx(cursorString.c_str(), fontResource) + mRenderX;
if (cursorX > x) {
if (index > 0)
mCursorLocation = index - 1;