This commit is contained in:
vladislav.khorev committed 2013-06-13 08:59:07 +00:00
1 parent ec449cc337
commit 9195096bcb
4 files changed
+35 -13

No files matched your search

+3
View File
@@ -640,7 +640,10 @@ void TEdit::OnTapDown(vec2 pos)
{
ResourceManager->GUIManager.KeyPressedSignal.disconnect_all_slots();
InputConnection = ResourceManager->GUIManager.KeyPressedSignal.connect(boost::bind(&TEdit::OnKeyPress, this, _1));
}
ResourceManager->GUIManager.ShowKeyboard();
}
void TEdit::OnKeyPress(int key)
+21
View File
@@ -10,6 +10,7 @@ const std::string CONST_DRAG_SIGNAL_NAME = "OnDrag";
TGUIManager::TGUIManager()
: KeyboardIsOnScreen(false)
{
}
@@ -369,6 +370,26 @@ void TGUIManager::OnMove(vec2 shift)
}
}
void TGUIManager::ShowKeyboard()
{
if (!KeyboardIsOnScreen)
{
MoveWidget("Keyboard", vec2(0, 216));
KeyboardIsOnScreen = true;
}
}
void TGUIManager::HideKeyboard()
{
if (KeyboardIsOnScreen)
{
MoveWidget("Keyboard", vec2(0, -216));
KeyboardIsOnScreen = false;
}
}
void TGUIManager::PrintWidgetList()
{
TWidgetArr::iterator i;
+6 -13
View File
@@ -4,19 +4,6 @@ namespace SE
{
/*
struct TKeyboardWidget : public TInstancingWidgetAncestor
{
TKeyboardWidget();
virtual bool CheckClick(vec2 mousePos);
virtual void OnTapDown(vec2 pos);
virtual void OnTapUp(vec2 pos);
};*/
TKeyboardWidget::TKeyboardWidget()
: Shifted(false)
{
@@ -160,6 +147,12 @@ struct TKeyboardWidget : public TInstancingWidgetAncestor
ResourceManager->GUIManager.KeyPressedSignal(std::get<1>(visualKeyElement));
}
}
if (pos.v[0] >= 280 - 74/2 && pos.v[0] <= 280 + 74/2 &&
pos.v[1] >= 23 - 38/2 && pos.v[1] <= 23 + 38/2)
{
ResourceManager->GUIManager.HideKeyboard();
}
}