本文整理汇总了C++中GLView::getWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ GLView::getWindow方法的具体用法?C++ GLView::getWindow怎么用?C++ GLView::getWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLView
的用法示例。
在下文中一共展示了GLView::getWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openKeyboard
void EditBoxImplWin::openKeyboard()
{
if (_delegate != nullptr)
{
_delegate->editBoxEditingDidBegin(_editBox);
}
CEditBox* pEditBox = this->getEditBox();
if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
{
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
ScriptEvent event(kCommonEvent,(void*)&data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
}
std::string placeHolder = _labelPlaceHolder->getString();
if (placeHolder.length() == 0)
placeHolder = "Enter value";
char pText[100]= {0};
std::string text = getText();
if (text.length())
strncpy(pText, text.c_str(), 100);
GLView *glView = Director::getInstance()->getOpenGLView();
GLFWwindow *glfwWindow = glView->getWindow();
HWND hwnd = glfwGetWin32Window(glfwWindow);
bool didChange = CWin32InputBox::InputBox("Input", placeHolder.c_str(), pText, 100, false, hwnd) == IDOK;
if (didChange)
setText(pText);
if (_delegate != nullptr) {
if (didChange)
_delegate->editBoxTextChanged(_editBox, getText());
_delegate->editBoxEditingDidEnd(_editBox);
_delegate->editBoxReturn(_editBox);
}
#if CC_ENABLE_SCRIPT_BINDING
if (nullptr != _editBox && 0 != _editBox->getScriptEditBoxHandler())
{
CommonScriptData data(_editBox->getScriptEditBoxHandler(), "changed",_editBox);
ScriptEvent event(kCommonEvent,(void*)&data);
if (didChange)
{
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
}
memset(data.eventName,0,sizeof(data.eventName));
strncpy(data.eventName,"ended",sizeof(data.eventName));
event.data = (void*)&data;
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
memset(data.eventName,0,sizeof(data.eventName));
strncpy(data.eventName,"return",sizeof(data.eventName));
event.data = (void*)&data;
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
}
#endif // #if CC_ENABLE_SCRIPT_BINDING
}
示例2: openKeyboard
void EditBoxImplWin::openKeyboard()
{
if (_delegate != NULL)
{
_delegate->editBoxEditingDidBegin(_editBox);
}
EditBox* pEditBox = this->getEditBox();
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
{
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
ScriptEvent event(kCommonEvent,(void*)&data);
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
}
std::string placeHolder = _labelPlaceHolder->getString();
if (placeHolder.length() == 0)
placeHolder = "Enter value";
char pText[100]= {0};
std::string text = getText();
if (text.length())
strncpy(pText, text.c_str(), 100);
GLView *glView = Director::getInstance()->getOpenGLView();
GLFWwindow *glfwWindow = glView->getWindow();
HWND hwnd = glfwGetWin32Window(glfwWindow);
bool didChange = CWin32InputBox::InputBox("Input", placeHolder.c_str(), pText, 100, false, hwnd) == IDOK;
if (didChange)
setText(pText);
if (_delegate != NULL) {
if (didChange)
_delegate->editBoxTextChanged(_editBox, getText());
_delegate->editBoxEditingDidEnd(_editBox);
_delegate->editBoxReturn(_editBox);
}
}