ios keyboard stuff
This commit is contained in:
1 parent
e9de663388
commit
9a27aacbab
10 files changed
+128
-10
No files matched your search
@@ -643,7 +643,8 @@ void TEdit::OnTapDown(vec2 pos)
|
||||
|
||||
}
|
||||
|
||||
ResourceManager->GUIManager.ShowKeyboard();
|
||||
ResourceManager->GUIManager.ShowKeyboard(GetText());
|
||||
ResourceManager->GUIManager.SetTextSignal.connect(boost::bind(&TEdit::OnSetAllText, this, _1));
|
||||
}
|
||||
|
||||
void TEdit::OnKeyPress(int key)
|
||||
@@ -676,6 +677,22 @@ void TEdit::SetText(const std::string& newText)
|
||||
RefreshTextTriangleList();
|
||||
}
|
||||
}
|
||||
|
||||
void TEdit::OnSetAllText(std::string newText)
|
||||
{
|
||||
if (newText != TextParams.Text)
|
||||
{
|
||||
TextParams.Text = newText;
|
||||
|
||||
RefreshTextTriangleList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string TEdit::GetText()
|
||||
{
|
||||
return TextParams.Text;
|
||||
}
|
||||
|
||||
|
||||
//============================ Check Box ============================
|
||||
|
||||
@@ -7,6 +7,13 @@ namespace SE
|
||||
const std::string CONST_HOLD_SIGNAL_NAME = "OnHold";
|
||||
const std::string CONST_CLICK_SIGNAL_NAME = "OnClick";
|
||||
const std::string CONST_DRAG_SIGNAL_NAME = "OnDrag";
|
||||
|
||||
|
||||
void GuiManagerSetKeyboardText(std::string newText)
|
||||
{
|
||||
ResourceManager->GUIManager.SetTextSignal(newText);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TGUIManager::TGUIManager()
|
||||
@@ -371,23 +378,27 @@ void TGUIManager::OnMove(vec2 shift)
|
||||
}
|
||||
|
||||
|
||||
void TGUIManager::ShowKeyboard()
|
||||
void TGUIManager::ShowKeyboard(const std::string text)
|
||||
{
|
||||
SE::ShowKeyboard(text);
|
||||
/*
|
||||
if (!KeyboardIsOnScreen)
|
||||
{
|
||||
MoveWidget("Keyboard", vec2(0, 216));
|
||||
KeyboardIsOnScreen = true;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
void TGUIManager::HideKeyboard()
|
||||
{
|
||||
ResourceManager->GUIManager.SetTextSignal.disconnect_all_slots();
|
||||
/*
|
||||
if (KeyboardIsOnScreen)
|
||||
{
|
||||
MoveWidget("Keyboard", vec2(0, -216));
|
||||
KeyboardIsOnScreen = false;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void TGUIManager::PrintWidgetList()
|
||||
|
||||
Reference in new issue
Block a user