Chat messages

This commit is contained in:
Vladislav Khorev 2013-12-12 21:07:42 +00:00
parent 37ba5e51f6
commit 33040259bd
2 changed files with 34 additions and 10 deletions

View File

@ -145,7 +145,8 @@ public:
boost::signal<void(int)> KeyPressedSignal;
boost::signal<void(std::string)> SetTextSignal;
//boost::signal<void()> PostUpdateSignal;
boost::signal<void()> OnKeyboardShowSignal;
boost::signal<void()> OnKeyboardHideSignal;
TGUIManager();
@ -178,6 +179,8 @@ public:
void ShowKeyboard(const std::string text = "");
void HideKeyboard();
bool IsKeyboardOnScreen();
void PrintWidgetList();

View File

@ -108,12 +108,15 @@ void TGUIManager::Update(cardinal dt)
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
{
i->Widget->Update(dt);
//i->Widget->Update(dt);
if (i->IsMouseDown)
{
signalMap.push_back((i->SignalMap[CONST_HOLD_SIGNAL_NAME]));
}
i->Widget->Update(dt);
}
//Keep this outside since signal may affect WidgetArr
@ -456,24 +459,37 @@ void TGUIManager::OnMove(vec2 shift, int touchNumber)
void TGUIManager::ShowKeyboard(const std::string text)
{
#ifdef TARGET_IOS
SE::ShowKeyboard(text);
#endif
/*
if (!KeyboardIsOnScreen)
{
MoveWidget("Keyboard", vec2(0, 216));
#ifdef TARGET_IOS
SE::ShowKeyboard(text);
#endif
/*
if (!KeyboardIsOnScreen)
{
MoveWidget("Keyboard", vec2(0, 216));
KeyboardIsOnScreen = true;
}*/
OnKeyboardShowSignal();
KeyboardIsOnScreen = true;
}*/
}
}
void TGUIManager::HideKeyboard()
{
ResourceManager->GUIManager.SetTextSignal.disconnect_all_slots();
if (KeyboardIsOnScreen)
{
ResourceManager->GUIManager.SetTextSignal.disconnect_all_slots();
#ifdef TARGET_IOS
SE::HideKeyboard();
SE::HideKeyboard();
#endif
OnKeyboardHideSignal();
OnKeyboardShowSignal.disconnect_all_slots();
OnKeyboardHideSignal.disconnect_all_slots();
KeyboardIsOnScreen = false;
}
/*
if (KeyboardIsOnScreen)
{
@ -482,6 +498,11 @@ void TGUIManager::HideKeyboard()
}*/
}
bool TGUIManager::IsKeyboardOnScreen()
{
return KeyboardIsOnScreen;
}
void TGUIManager::PrintWidgetList()
{
TWidgetArr::iterator i;