mirror of https://github.com/axmolengine/axmol.git
Added the very first implementation of CCEditBox for Win32.
This commit is contained in:
parent
229ad55dfa
commit
9889b4f9fd
|
@ -0,0 +1,382 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2010-2012 cocos2d-x.org
|
||||||
|
Copyright (c) 2013 Jozef Pridavok
|
||||||
|
|
||||||
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "CCEditBoxImplWin.h"
|
||||||
|
#include "CCEditBox.h"
|
||||||
|
#include "proj.win32/Win32InputBox.h"
|
||||||
|
|
||||||
|
NS_CC_BEGIN
|
||||||
|
extern long cc_utf8_strlen (const char * p, int max);
|
||||||
|
NS_CC_END
|
||||||
|
|
||||||
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
CCEditBoxImpl* __createSystemEditBox(CCEditBox* pEditBox)
|
||||||
|
{
|
||||||
|
return new CCEditBoxImplWin(pEditBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
CCEditBoxImplWin::CCEditBoxImplWin(CCEditBox* pEditText)
|
||||||
|
: CCEditBoxImpl(pEditText)
|
||||||
|
, m_pLabel(NULL)
|
||||||
|
, m_pLabelPlaceHolder(NULL)
|
||||||
|
, m_eEditBoxInputMode(kEditBoxInputModeSingleLine)
|
||||||
|
, m_eEditBoxInputFlag(kEditBoxInputFlagInitialCapsAllCharacters)
|
||||||
|
, m_eKeyboardReturnType(kKeyboardReturnTypeDefault)
|
||||||
|
, m_colText(ccWHITE)
|
||||||
|
, m_colPlaceHolder(ccGRAY)
|
||||||
|
, m_nMaxLength(-1)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CCEditBoxImplWin::~CCEditBoxImplWin()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::doAnimationWhenKeyboardMove(float duration, float distance)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCEditBoxImplWin::initWithSize(const CCSize& size)
|
||||||
|
{
|
||||||
|
//! int fontSize = getFontSizeAccordingHeightJni(size.height-12);
|
||||||
|
m_pLabel = CCLabelTTF::create("", "", size.height-12);
|
||||||
|
m_pLabel->setAnchorPoint(ccp(0, 0));
|
||||||
|
m_pLabel->setPosition(ccp(5, 2));
|
||||||
|
m_pLabel->setColor(m_colText);
|
||||||
|
m_pEditBox->addChild(m_pLabel);
|
||||||
|
|
||||||
|
m_pLabelPlaceHolder = CCLabelTTF::create("", "", size.height-12);
|
||||||
|
m_pLabelPlaceHolder->setAnchorPoint(ccp(0, 0));
|
||||||
|
m_pLabelPlaceHolder->setPosition(ccp(5, 2));
|
||||||
|
m_pLabelPlaceHolder->setVisible(false);
|
||||||
|
m_pLabelPlaceHolder->setColor(m_colPlaceHolder);
|
||||||
|
m_pEditBox->addChild(m_pLabelPlaceHolder);
|
||||||
|
|
||||||
|
m_EditSize = size;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setFontColor(const ccColor3B& color)
|
||||||
|
{
|
||||||
|
m_colText = color;
|
||||||
|
m_pLabel->setColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPlaceholderFontColor(const ccColor3B& color)
|
||||||
|
{
|
||||||
|
m_colPlaceHolder = color;
|
||||||
|
m_pLabelPlaceHolder->setColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setInputMode(EditBoxInputMode inputMode)
|
||||||
|
{
|
||||||
|
m_eEditBoxInputMode = inputMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setMaxLength(int maxLength)
|
||||||
|
{
|
||||||
|
m_nMaxLength = maxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CCEditBoxImplWin::getMaxLength()
|
||||||
|
{
|
||||||
|
return m_nMaxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setInputFlag(EditBoxInputFlag inputFlag)
|
||||||
|
{
|
||||||
|
m_eEditBoxInputFlag = inputFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setReturnType(KeyboardReturnType returnType)
|
||||||
|
{
|
||||||
|
m_eKeyboardReturnType = returnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCEditBoxImplWin::isEditing()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setText(const char* pText)
|
||||||
|
{
|
||||||
|
if (pText != NULL)
|
||||||
|
{
|
||||||
|
m_strText = pText;
|
||||||
|
|
||||||
|
if (m_strText.length() > 0)
|
||||||
|
{
|
||||||
|
m_pLabelPlaceHolder->setVisible(false);
|
||||||
|
|
||||||
|
std::string strToShow;
|
||||||
|
|
||||||
|
if (kEditBoxInputFlagPassword == m_eEditBoxInputFlag)
|
||||||
|
{
|
||||||
|
long length = strlen(m_strText.c_str());
|
||||||
|
for (long i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
strToShow.append("*");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strToShow = m_strText;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), m_EditSize.width, m_EditSize.height-12);
|
||||||
|
//! m_pLabel->setString(strWithEllipsis.c_str());
|
||||||
|
m_pLabel->setString(strToShow.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pLabelPlaceHolder->setVisible(true);
|
||||||
|
m_pLabel->setString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* CCEditBoxImplWin::getText(void)
|
||||||
|
{
|
||||||
|
return m_strText.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPlaceHolder(const char* pText)
|
||||||
|
{
|
||||||
|
if (pText != NULL)
|
||||||
|
{
|
||||||
|
m_strPlaceHolder = pText;
|
||||||
|
if (m_strPlaceHolder.length() > 0 && m_strText.length() == 0)
|
||||||
|
{
|
||||||
|
m_pLabelPlaceHolder->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pLabelPlaceHolder->setString(m_strPlaceHolder.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPosition(const CCPoint& pos)
|
||||||
|
{
|
||||||
|
//m_pLabel->setPosition(pos);
|
||||||
|
//m_pLabelPlaceHolder->setPosition(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setContentSize(const CCSize& size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::visit(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void editBoxCallbackFunc(const char* pText, void* ctx)
|
||||||
|
{
|
||||||
|
CCEditBoxImplWin* thiz = (CCEditBoxImplWin*)ctx;
|
||||||
|
thiz->setText(pText);
|
||||||
|
|
||||||
|
if (thiz->getDelegate() != NULL)
|
||||||
|
{
|
||||||
|
thiz->getDelegate()->editBoxTextChanged(thiz->getCCEditBox(), thiz->getText());
|
||||||
|
thiz->getDelegate()->editBoxEditingDidEnd(thiz->getCCEditBox());
|
||||||
|
thiz->getDelegate()->editBoxReturn(thiz->getCCEditBox());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::openKeyboard()
|
||||||
|
{
|
||||||
|
if (m_pDelegate != NULL)
|
||||||
|
{
|
||||||
|
m_pDelegate->editBoxEditingDidBegin(m_pEditBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string placeHolder = m_pLabelPlaceHolder->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);
|
||||||
|
bool didChange = CWin32InputBox::InputBox("Input", placeHolder.c_str(), pText, 100, false) == IDOK;
|
||||||
|
|
||||||
|
if (didChange)
|
||||||
|
setText(pText);
|
||||||
|
|
||||||
|
if (m_pDelegate != NULL) {
|
||||||
|
if (didChange)
|
||||||
|
m_pDelegate->editBoxTextChanged(m_pEditBox, getText());
|
||||||
|
m_pDelegate->editBoxEditingDidEnd(m_pEditBox);
|
||||||
|
m_pDelegate->editBoxReturn(m_pEditBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::closeKeyboard()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_CC_EXT_END
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
#include "CCEditBoxImplWin.h"
|
||||||
|
#include "CCEditBox.h"
|
||||||
|
#include "CCEGLView.h"
|
||||||
|
|
||||||
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
CCEditBoxImpl* __createSystemEditBox(CCEditBox* pEditBox)
|
||||||
|
{
|
||||||
|
return new CCEditBoxImplWin(pEditBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#define GET_IMPL ((CCEditBoxImplWin*)m_pSysEdit)
|
||||||
|
|
||||||
|
CCEditBoxImplWin::CCEditBoxImplWin(CCEditBox* pEditText)
|
||||||
|
: CCEditBoxImpl(pEditText)
|
||||||
|
, m_pSysEdit(NULL)
|
||||||
|
, m_nMaxTextLength(-1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CCEditBoxImplWin::~CCEditBoxImplWin()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::doAnimationWhenKeyboardMove(float duration, float distance)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCEditBoxImplWin::initWithSize(const CCSize& size)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
CCEGLViewProtocol* eglView = CCEGLView::sharedOpenGLView();
|
||||||
|
CCEGLView* pMainWnd = CCEGLView::sharedOpenGLView();
|
||||||
|
|
||||||
|
HWND hParent = pMainWnd->getHWnd();
|
||||||
|
m_pSysEdit = ::CreateWindowA("EDIT", "text", WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE, 0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY(), hParent, NULL, NULL, NULL);
|
||||||
|
if (!m_pSysEdit)
|
||||||
|
break;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setFontColor(const ccColor3B& color)
|
||||||
|
{
|
||||||
|
//GET_IMPL.textField.textColor = [UIColor colorWithRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f];
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPlaceholderFontColor(const ccColor3B& color)
|
||||||
|
{
|
||||||
|
// TODO need to be implemented.
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setInputMode(EditBoxInputMode inputMode)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setMaxLength(int maxLength)
|
||||||
|
{
|
||||||
|
m_nMaxTextLength = maxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CCEditBoxImplWin::getMaxLength()
|
||||||
|
{
|
||||||
|
return m_nMaxTextLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setInputFlag(EditBoxInputFlag inputFlag)
|
||||||
|
{
|
||||||
|
// TODO: ES_PASSWORD
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setReturnType(KeyboardReturnType returnType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCEditBoxImplWin::isEditing()
|
||||||
|
{
|
||||||
|
return true; //GET_IMPL->isEditState() ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setText(const char* pText)
|
||||||
|
{
|
||||||
|
::SetWindowTextA(m_pSysEdit, pText);
|
||||||
|
//GET_IMPL.textField.text = [NSString stringWithUTF8String:pText];
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* CCEditBoxImplWin::getText(void)
|
||||||
|
{
|
||||||
|
int nCharacters = ::GetWindowTextLength(m_pSysEdit);
|
||||||
|
char *szBuff = (char *)malloc(nCharacters + 1);
|
||||||
|
::GetWindowText(m_pSysEdit, szBuff, nCharacters);
|
||||||
|
return szBuff;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPlaceHolder(const char* pText)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setPosition(const CCPoint& pos)
|
||||||
|
{
|
||||||
|
//TODO should consider anchor point, the default value is (0.5, 0,5)
|
||||||
|
RECT rect;
|
||||||
|
::GetWindowRect(m_pSysEdit, &rect);
|
||||||
|
POINT pt;
|
||||||
|
pt.x = rect.left;
|
||||||
|
pt.y = rect.top;
|
||||||
|
CCEGLView* pMainWnd = CCEGLView::sharedOpenGLView();
|
||||||
|
::ScreenToClient(pMainWnd->getHWnd(), &pt);
|
||||||
|
::SetWindowPos(m_pSysEdit, NULL, pt.x + pos.x-m_tContentSize.width/2, pt.y + pos.y+m_tContentSize.height/2, 0, 0, SWP_NOSIZE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_NOCOPYBITS);
|
||||||
|
//GET_IMPL->setPosition(ccp(pos.x-m_tContentSize.width/2, pos.y+m_tContentSize.height/2));;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::setContentSize(const CCSize& size)
|
||||||
|
{
|
||||||
|
m_tContentSize = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::visit(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::openKeyboard()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCEditBoxImplWin::closeKeyboard()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_CC_EXT_END
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1,91 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2010-2012 cocos2d-x.org
|
||||||
|
Copyright (c) 2013 Jozef Pridavok
|
||||||
|
|
||||||
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __CCEditBoxIMPLWIN_H__
|
||||||
|
#define __CCEditBoxIMPLWIN_H__
|
||||||
|
|
||||||
|
#include "cocos2d.h"
|
||||||
|
#include "ExtensionMacros.h"
|
||||||
|
#include "CCEditBoxImpl.h"
|
||||||
|
|
||||||
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
|
class CCEditBox;
|
||||||
|
|
||||||
|
class CCEditBoxImplWin : public CCEditBoxImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CCEditBoxImplWin(CCEditBox* pEditText);
|
||||||
|
virtual ~CCEditBoxImplWin();
|
||||||
|
|
||||||
|
virtual bool initWithSize(const CCSize& size);
|
||||||
|
virtual void setFontColor(const ccColor3B& color);
|
||||||
|
virtual void setPlaceholderFontColor(const ccColor3B& color);
|
||||||
|
virtual void setInputMode(EditBoxInputMode inputMode);
|
||||||
|
virtual void setInputFlag(EditBoxInputFlag inputFlag);
|
||||||
|
virtual void setMaxLength(int maxLength);
|
||||||
|
virtual int getMaxLength();
|
||||||
|
virtual void setReturnType(KeyboardReturnType returnType);
|
||||||
|
virtual bool isEditing();
|
||||||
|
|
||||||
|
virtual void setText(const char* pText);
|
||||||
|
virtual const char* getText(void);
|
||||||
|
virtual void setPlaceHolder(const char* pText);
|
||||||
|
virtual void setPosition(const CCPoint& pos);
|
||||||
|
virtual void setContentSize(const CCSize& size);
|
||||||
|
virtual void visit(void);
|
||||||
|
virtual void doAnimationWhenKeyboardMove(float duration, float distance);
|
||||||
|
virtual void openKeyboard();
|
||||||
|
virtual void closeKeyboard();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
CCLabelTTF* m_pLabel;
|
||||||
|
CCLabelTTF* m_pLabelPlaceHolder;
|
||||||
|
EditBoxInputMode m_eEditBoxInputMode;
|
||||||
|
EditBoxInputFlag m_eEditBoxInputFlag;
|
||||||
|
KeyboardReturnType m_eKeyboardReturnType;
|
||||||
|
|
||||||
|
std::string m_strText;
|
||||||
|
std::string m_strPlaceHolder;
|
||||||
|
|
||||||
|
ccColor3B m_colText;
|
||||||
|
ccColor3B m_colPlaceHolder;
|
||||||
|
|
||||||
|
int m_nMaxLength;
|
||||||
|
CCSize m_EditSize;
|
||||||
|
|
||||||
|
/*
|
||||||
|
CCSize m_tContentSize;
|
||||||
|
HWND m_pSysEdit;
|
||||||
|
int m_nMaxTextLength;
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
NS_CC_EXT_END
|
||||||
|
|
||||||
|
#endif /* __CCEditBoxIMPLWIN_H__ */
|
||||||
|
|
|
@ -0,0 +1,319 @@
|
||||||
|
#include "Win32InputBox.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#pragma warning (disable: 4312)
|
||||||
|
|
||||||
|
typedef struct _MSDN_DLGTEMPLATEEX
|
||||||
|
{
|
||||||
|
WORD dlgVer;
|
||||||
|
WORD signature;
|
||||||
|
DWORD helpID;
|
||||||
|
DWORD exStyle;
|
||||||
|
DWORD style;
|
||||||
|
WORD cDlgItems;
|
||||||
|
short x;
|
||||||
|
short y;
|
||||||
|
short cx;
|
||||||
|
short cy;
|
||||||
|
BYTE _rest[1]; // rest of structure
|
||||||
|
} MSDN_DLGTEMPLATEEX;
|
||||||
|
|
||||||
|
static bool IsDlgTemplateExtended(DLGTEMPLATE *dlgTemplate)
|
||||||
|
{
|
||||||
|
MSDN_DLGTEMPLATEEX *dgExTemplate = (MSDN_DLGTEMPLATEEX *) dlgTemplate;
|
||||||
|
|
||||||
|
// MSDN excerpt:
|
||||||
|
//* dlgVer
|
||||||
|
// Specifies the version number of the extended dialog box template. This member must be 1.
|
||||||
|
//* signature
|
||||||
|
// Indicates whether a template is an extended dialog box template.
|
||||||
|
// If signature is 0xFFFF, this is an extended dialog box template.
|
||||||
|
// In this case, the dlgVer member specifies the template version number.
|
||||||
|
// If signature is any value other than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures.
|
||||||
|
|
||||||
|
return (dgExTemplate->dlgVer == 1) && (dgExTemplate->signature == 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use alignment if supported by the compiler
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER > 1200
|
||||||
|
__declspec(align(4))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// per the MSDN, the DLGTEMPLATE must be DWORD aligned
|
||||||
|
// this was generated by the DlgResToDlgTemplate tool
|
||||||
|
static unsigned char definputbox_dlg[] =
|
||||||
|
{
|
||||||
|
0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0xc8,0x00,0x06,
|
||||||
|
0x00,0x16,0x00,0x11,0x00,0xe7,0x00,0x6d,0x00,0x00,0x00,0x00,0x00,0x57,0x00,0x69,
|
||||||
|
0x00,0x6e,0x00,0x33,0x00,0x32,0x00,0x49,0x00,0x6e,0x00,0x70,0x00,0x75,0x00,0x74,
|
||||||
|
0x00,0x42,0x00,0x6f,0x00,0x78,0x00,0x00,0x00,0x08,0x00,0xbc,0x02,0x00,0x00,0x4d,
|
||||||
|
0x00,0x53,0x00,0x20,0x00,0x53,0x00,0x68,0x00,0x65,0x00,0x6c,0x00,0x6c,0x00,0x20,
|
||||||
|
0x00,0x44,0x00,0x6c,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x80,0x00,0x02,0x50,0x06,0x00,0x04,0x00,0x9d,0x00,0x21,0x00,0xe8,
|
||||||
|
0x03,0x00,0x00,0xff,0xff,0x82,0x00,0x50,0x00,0x72,0x00,0x6f,0x00,0x6d,0x00,0x70,
|
||||||
|
0x00,0x74,0x00,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x80,0x00,0x81,0x50,0x06,0x00,0x25,0x00,0xd8,0x00,0x0e,0x00,0xe9,
|
||||||
|
0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x84,0x10,0xa1,0x50,0x06,0x00,0x37,0x00,0xd8,0x00,0x31,0x00,0xea,
|
||||||
|
0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x01,0x00,0x03,0x50,0xab,0x00,0x04,0x00,0x33,0x00,0x0e,0x00,0x01,
|
||||||
|
0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x4f,0x00,0x4b,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x50,0xab,0x00,0x15,0x00,0x33,
|
||||||
|
0x00,0x0e,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x43,0x00,0x41,0x00,0x4e,
|
||||||
|
0x00,0x43,0x00,0x45,0x00,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x27,0x00,0x08,0x00,0x08,0x00,0xff,
|
||||||
|
0xff,0xff,0xff,0xff,0xff,0x82,0x00,0x00,0x00,0x00,0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
static LPCTSTR definputbox_buttonnames[] = { _T("OK"), _T("CANCEL") };
|
||||||
|
static const INT_PTR definputbox_buttonids[] = { IDOK, IDCANCEL };
|
||||||
|
|
||||||
|
static const INT
|
||||||
|
definputbox_id_prompt = 1000,
|
||||||
|
definputbox_id_edit1 = 1001,
|
||||||
|
definputbox_id_edit2 = 1002;
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM::WIN32INPUTBOX_PARAM()
|
||||||
|
{
|
||||||
|
bMultiline = false;
|
||||||
|
hwndOwner = 0;
|
||||||
|
DlgTemplateName = 0;
|
||||||
|
hInstance = (HINSTANCE) ::GetModuleHandle(0);
|
||||||
|
DlgTemplateData = definputbox_dlg;
|
||||||
|
|
||||||
|
bCenter = true;
|
||||||
|
|
||||||
|
dwStylesPlus = 0;
|
||||||
|
dwExStylesPlus = 0;
|
||||||
|
dwStylesMinus = 0xFFFFFFFF;
|
||||||
|
dwExStylesMinus = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
xPos = yPos = -1;
|
||||||
|
|
||||||
|
szResult = 0;
|
||||||
|
nResultSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox::CWin32InputBox(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
_param = param;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox::~CWin32InputBox()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWin32InputBox::SetParam(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
_param = param;
|
||||||
|
}
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM *CWin32InputBox::GetParam()
|
||||||
|
{
|
||||||
|
return _param;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param)
|
||||||
|
{
|
||||||
|
// Check mandatory parameters
|
||||||
|
if (param->szResult == 0)
|
||||||
|
{
|
||||||
|
::SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPDLGTEMPLATE dlgTemplate;
|
||||||
|
|
||||||
|
if (param->DlgTemplateName != 0)
|
||||||
|
{
|
||||||
|
HMODULE hModule = (HMODULE)param->hInstance;
|
||||||
|
HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG);
|
||||||
|
if (rcDlg == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg);
|
||||||
|
if (hglobalDlg == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dlgTemplate = (LPDLGTEMPLATE) hglobalDlg;
|
||||||
|
}
|
||||||
|
else if (param->DlgTemplateData != 0)
|
||||||
|
{
|
||||||
|
dlgTemplate = (LPDLGTEMPLATE) param->DlgTemplateData;
|
||||||
|
}
|
||||||
|
|
||||||
|
MSDN_DLGTEMPLATEEX *dlgTemplateEx =
|
||||||
|
IsDlgTemplateExtended((LPDLGTEMPLATE) dlgTemplate) ? (MSDN_DLGTEMPLATEEX *) dlgTemplate : 0;
|
||||||
|
|
||||||
|
if (dlgTemplateEx != 0)
|
||||||
|
{
|
||||||
|
dlgTemplateEx->exStyle |= param->dwExStylesPlus;
|
||||||
|
dlgTemplateEx->style |= param->dwStylesPlus;
|
||||||
|
dlgTemplateEx->exStyle &= param->dwExStylesMinus;
|
||||||
|
dlgTemplateEx->style &= param->dwStylesMinus;
|
||||||
|
|
||||||
|
if (param->bCenter)
|
||||||
|
dlgTemplateEx->style |= DS_CENTER;
|
||||||
|
|
||||||
|
if (param->xPos != -1)
|
||||||
|
dlgTemplateEx->x = param->xPos;
|
||||||
|
if (param->yPos != -1)
|
||||||
|
dlgTemplateEx->y = param->yPos;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dlgTemplate->dwExtendedStyle |= param->dwExStylesPlus;
|
||||||
|
dlgTemplate->style |= param->dwStylesPlus;
|
||||||
|
dlgTemplate->dwExtendedStyle &= param->dwExStylesMinus;
|
||||||
|
dlgTemplate->style &= param->dwStylesMinus;
|
||||||
|
|
||||||
|
if (param->bCenter)
|
||||||
|
dlgTemplate->style |= DS_CENTER;
|
||||||
|
|
||||||
|
if (param->xPos != -1)
|
||||||
|
dlgTemplate->x = param->xPos;
|
||||||
|
|
||||||
|
if (param->yPos != -1)
|
||||||
|
dlgTemplate->y = param->yPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
CWin32InputBox inputbox(param);
|
||||||
|
|
||||||
|
// Resize dialog and SHOW or HIDE multiline
|
||||||
|
INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT_PTR CWin32InputBox::InputBox(
|
||||||
|
LPCSTR szTitle,
|
||||||
|
LPCSTR szPrompt,
|
||||||
|
LPSTR szResult,
|
||||||
|
DWORD nResultSize,
|
||||||
|
bool bMultiLine,
|
||||||
|
HWND hwndParent)
|
||||||
|
{
|
||||||
|
WIN32INPUTBOX_PARAM param;
|
||||||
|
|
||||||
|
param.szTitle = szTitle;
|
||||||
|
param.szPrompt = szPrompt;
|
||||||
|
param.szResult = szResult;
|
||||||
|
param.nResultSize = nResultSize;
|
||||||
|
param.bMultiline = bMultiLine;
|
||||||
|
|
||||||
|
return InputBoxEx(¶m);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWin32InputBox::InitDialog()
|
||||||
|
{
|
||||||
|
// Set the button captions
|
||||||
|
for (size_t i=0;i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);i++)
|
||||||
|
::SetDlgItemText(_param->hDlg, (int) definputbox_buttonids[i], definputbox_buttonnames[i]);
|
||||||
|
|
||||||
|
// Set other controls
|
||||||
|
::SetWindowTextA(_param->hDlg, _param->szTitle);
|
||||||
|
::SetDlgItemTextA(_param->hDlg, definputbox_id_prompt, _param->szPrompt);
|
||||||
|
|
||||||
|
HWND hwndEdit1 = ::GetDlgItem(_param->hDlg, definputbox_id_edit1);
|
||||||
|
HWND hwndEdit2 = ::GetDlgItem(_param->hDlg, definputbox_id_edit2);
|
||||||
|
|
||||||
|
if (_param->bMultiline)
|
||||||
|
_hwndEditCtrl = hwndEdit2;
|
||||||
|
else
|
||||||
|
_hwndEditCtrl = hwndEdit1;
|
||||||
|
|
||||||
|
::SetWindowTextA(_hwndEditCtrl, _param->szResult);
|
||||||
|
|
||||||
|
RECT rectDlg, rectEdit1, rectEdit2;
|
||||||
|
|
||||||
|
::GetWindowRect(_param->hDlg, &rectDlg);
|
||||||
|
::GetWindowRect(hwndEdit1, &rectEdit1);
|
||||||
|
::GetWindowRect(hwndEdit2, &rectEdit2);
|
||||||
|
|
||||||
|
if (_param->bMultiline)
|
||||||
|
{
|
||||||
|
::ShowWindow(hwndEdit1, SW_HIDE);
|
||||||
|
::SetWindowPos(
|
||||||
|
hwndEdit2,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
rectEdit1.left - rectDlg.left,
|
||||||
|
(rectEdit1.top - rectDlg.top) - (rectEdit1.bottom - rectEdit1.top),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
SWP_NOSIZE | SWP_NOZORDER);
|
||||||
|
|
||||||
|
::SetWindowPos(
|
||||||
|
_param->hDlg,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
rectDlg.right - rectDlg.left,
|
||||||
|
rectDlg.bottom - rectDlg.top - (rectEdit1.bottom - rectEdit1.top),
|
||||||
|
SWP_NOMOVE);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::SetWindowPos(
|
||||||
|
_param->hDlg,
|
||||||
|
HWND_NOTOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
rectDlg.right - rectDlg.left,
|
||||||
|
rectEdit1.bottom - rectDlg.top + 5,
|
||||||
|
SWP_NOMOVE);
|
||||||
|
|
||||||
|
::ShowWindow(hwndEdit2, SW_HIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message handler for about box.
|
||||||
|
LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLong(hDlg, GWL_USERDATA);
|
||||||
|
WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0;
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
::SetWindowLong(hDlg, GWL_USERDATA, (LONG) lParam);
|
||||||
|
|
||||||
|
_this = (CWin32InputBox *) lParam;
|
||||||
|
_this->_param->hDlg = hDlg;
|
||||||
|
_this->InitDialog();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
{
|
||||||
|
#ifdef _MY_DEBUG
|
||||||
|
CHAR buf[1024];
|
||||||
|
static int i=0;
|
||||||
|
sprintf(buf, "WM_COMMAND: %09d wParam=%08X lParam=%08X\n", i++, wParam, lParam);
|
||||||
|
OutputDebugString(buf);
|
||||||
|
#endif
|
||||||
|
INT_PTR buttonId = LOWORD(wParam);
|
||||||
|
for (size_t i=0;
|
||||||
|
i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);
|
||||||
|
i++)
|
||||||
|
{
|
||||||
|
if (buttonId == definputbox_buttonids[i])
|
||||||
|
{
|
||||||
|
::GetWindowTextA(
|
||||||
|
_this->_hwndEditCtrl,
|
||||||
|
_this->_param->szResult,
|
||||||
|
_this->_param->nResultSize);
|
||||||
|
|
||||||
|
::EndDialog(hDlg, buttonId);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
#ifndef __03022006__WIN32INPUTBOX__
|
||||||
|
#define __03022006__WIN32INPUTBOX__
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
This library is (c) Elias Bachaalany aka lallous <lallousx86@yahoo.com>
|
||||||
|
You may use this library under the following license agreement:
|
||||||
|
|
||||||
|
The zlib/libpng License.
|
||||||
|
---------------------------
|
||||||
|
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose, including commercial applications,
|
||||||
|
and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented;
|
||||||
|
you must not claim that you wrote the original software.
|
||||||
|
If you use this software in a product, an acknowledgment in the product
|
||||||
|
documentation would be appreciated but is not required.
|
||||||
|
2. Altered source versions must be plainly marked as such,
|
||||||
|
and must not be misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
|
||||||
|
class CWin32InputBox;
|
||||||
|
|
||||||
|
// Structure used to orient the inputbox behavior
|
||||||
|
struct WIN32INPUTBOX_PARAM
|
||||||
|
{
|
||||||
|
friend class CWin32InputBox;
|
||||||
|
|
||||||
|
//
|
||||||
|
IN OPTIONAL bool bMultiline;
|
||||||
|
|
||||||
|
// Pass this as none zero so to use this memory dlg template
|
||||||
|
IN OPTIONAL LPVOID DlgTemplateData;
|
||||||
|
|
||||||
|
// Pass this as none ZERO so to load DLGTEMPLATE from resources
|
||||||
|
IN OPTIONAL LPCSTR DlgTemplateName;
|
||||||
|
|
||||||
|
// passing both "DlgTemplateName" and "DlgTemplateData" ZERO will cause
|
||||||
|
// the dialog to use his default embedded resource
|
||||||
|
|
||||||
|
// Center on monitor or owner window?
|
||||||
|
IN OPTIONAL bool bCenter;
|
||||||
|
|
||||||
|
// Want to add more styles to the dialog?
|
||||||
|
IN OPTIONAL DWORD dwStylesPlus, dwStylesMinus;
|
||||||
|
IN OPTIONAL DWORD dwExStylesPlus, dwExStylesMinus;
|
||||||
|
|
||||||
|
IN LPCSTR szTitle, szPrompt;
|
||||||
|
|
||||||
|
// Return buffer
|
||||||
|
OUT LPSTR szResult;
|
||||||
|
IN DWORD nResultSize;
|
||||||
|
|
||||||
|
// Owner window
|
||||||
|
HWND hwndOwner;
|
||||||
|
HINSTANCE hInstance;
|
||||||
|
|
||||||
|
short xPos, yPos;
|
||||||
|
|
||||||
|
WIN32INPUTBOX_PARAM();
|
||||||
|
private:
|
||||||
|
HWND hDlg;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CWin32InputBox
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
WIN32INPUTBOX_PARAM *_param;
|
||||||
|
static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
HWND _hwndEditCtrl;
|
||||||
|
|
||||||
|
void InitDialog();
|
||||||
|
void SetParam(WIN32INPUTBOX_PARAM *);
|
||||||
|
WIN32INPUTBOX_PARAM * GetParam();
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
CWin32InputBox(WIN32INPUTBOX_PARAM *);
|
||||||
|
~CWin32InputBox();
|
||||||
|
|
||||||
|
static INT_PTR InputBoxEx(WIN32INPUTBOX_PARAM *);
|
||||||
|
static INT_PTR InputBox(
|
||||||
|
LPCSTR szTitle,
|
||||||
|
LPCSTR szPrompt,
|
||||||
|
LPSTR szResult,
|
||||||
|
DWORD nResultSize,
|
||||||
|
bool bMultiLine = false,
|
||||||
|
HWND hwndParent = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -123,6 +123,8 @@
|
||||||
<ClCompile Include="..\GUI\CCControlExtension\CCControlUtils.cpp" />
|
<ClCompile Include="..\GUI\CCControlExtension\CCControlUtils.cpp" />
|
||||||
<ClCompile Include="..\GUI\CCControlExtension\CCInvocation.cpp" />
|
<ClCompile Include="..\GUI\CCControlExtension\CCInvocation.cpp" />
|
||||||
<ClCompile Include="..\GUI\CCControlExtension\CCScale9Sprite.cpp" />
|
<ClCompile Include="..\GUI\CCControlExtension\CCScale9Sprite.cpp" />
|
||||||
|
<ClCompile Include="..\GUI\CCEditBox\CCEditBox.cpp" />
|
||||||
|
<ClCompile Include="..\GUI\CCEditBox\CCEditBoxImplWin.cpp" />
|
||||||
<ClCompile Include="..\GUI\CCScrollView\CCScrollView.cpp" />
|
<ClCompile Include="..\GUI\CCScrollView\CCScrollView.cpp" />
|
||||||
<ClCompile Include="..\GUI\CCScrollView\CCSorting.cpp" />
|
<ClCompile Include="..\GUI\CCScrollView\CCSorting.cpp" />
|
||||||
<ClCompile Include="..\GUI\CCScrollView\CCTableView.cpp" />
|
<ClCompile Include="..\GUI\CCScrollView\CCTableView.cpp" />
|
||||||
|
@ -131,6 +133,7 @@
|
||||||
<ClCompile Include="..\network\HttpClient.cpp" />
|
<ClCompile Include="..\network\HttpClient.cpp" />
|
||||||
<ClCompile Include="..\physics_nodes\CCPhysicsDebugNode.cpp" />
|
<ClCompile Include="..\physics_nodes\CCPhysicsDebugNode.cpp" />
|
||||||
<ClCompile Include="..\physics_nodes\CCPhysicsSprite.cpp" />
|
<ClCompile Include="..\physics_nodes\CCPhysicsSprite.cpp" />
|
||||||
|
<ClCompile Include="Win32InputBox.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\CCBReader\CCBAnimationManager.h" />
|
<ClInclude Include="..\CCBReader\CCBAnimationManager.h" />
|
||||||
|
@ -174,6 +177,9 @@
|
||||||
<ClInclude Include="..\GUI\CCControlExtension\CCControlUtils.h" />
|
<ClInclude Include="..\GUI\CCControlExtension\CCControlUtils.h" />
|
||||||
<ClInclude Include="..\GUI\CCControlExtension\CCInvocation.h" />
|
<ClInclude Include="..\GUI\CCControlExtension\CCInvocation.h" />
|
||||||
<ClInclude Include="..\GUI\CCControlExtension\CCScale9Sprite.h" />
|
<ClInclude Include="..\GUI\CCControlExtension\CCScale9Sprite.h" />
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBox.h" />
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBoxImpl.h" />
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBoxImplWin.h" />
|
||||||
<ClInclude Include="..\GUI\CCScrollView\CCScrollView.h" />
|
<ClInclude Include="..\GUI\CCScrollView\CCScrollView.h" />
|
||||||
<ClInclude Include="..\cocos-ext.h" />
|
<ClInclude Include="..\cocos-ext.h" />
|
||||||
<ClInclude Include="..\ExtensionMacros.h" />
|
<ClInclude Include="..\ExtensionMacros.h" />
|
||||||
|
@ -186,6 +192,7 @@
|
||||||
<ClInclude Include="..\network\HttpResponse.h" />
|
<ClInclude Include="..\network\HttpResponse.h" />
|
||||||
<ClInclude Include="..\physics_nodes\CCPhysicsDebugNode.h" />
|
<ClInclude Include="..\physics_nodes\CCPhysicsDebugNode.h" />
|
||||||
<ClInclude Include="..\physics_nodes\CCPhysicsSprite.h" />
|
<ClInclude Include="..\physics_nodes\CCPhysicsSprite.h" />
|
||||||
|
<ClInclude Include="Win32InputBox.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|
|
@ -22,6 +22,9 @@
|
||||||
<Filter Include="LocalStorage">
|
<Filter Include="LocalStorage">
|
||||||
<UniqueIdentifier>{4da8061d-80f3-45fd-aa7e-2c0a96701b79}</UniqueIdentifier>
|
<UniqueIdentifier>{4da8061d-80f3-45fd-aa7e-2c0a96701b79}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="GUI\CCEditBox">
|
||||||
|
<UniqueIdentifier>{5d186e3d-0aaf-4904-a5d8-e5cb0f35f4cc}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\GUI\CCScrollView\CCScrollView.cpp">
|
<ClCompile Include="..\GUI\CCScrollView\CCScrollView.cpp">
|
||||||
|
@ -156,6 +159,15 @@
|
||||||
<ClCompile Include="..\LocalStorage\LocalStorage.cpp">
|
<ClCompile Include="..\LocalStorage\LocalStorage.cpp">
|
||||||
<Filter>LocalStorage</Filter>
|
<Filter>LocalStorage</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\GUI\CCEditBox\CCEditBoxImplWin.cpp">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Win32InputBox.cpp">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\GUI\CCEditBox\CCEditBox.cpp">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\GUI\CCScrollView\CCScrollView.h">
|
<ClInclude Include="..\GUI\CCScrollView\CCScrollView.h">
|
||||||
|
@ -313,5 +325,17 @@
|
||||||
<ClInclude Include="..\LocalStorage\LocalStorage.h">
|
<ClInclude Include="..\LocalStorage\LocalStorage.h">
|
||||||
<Filter>LocalStorage</Filter>
|
<Filter>LocalStorage</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBoxImplWin.h">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Win32InputBox.h">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBox.h">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\GUI\CCEditBox\CCEditBoxImpl.h">
|
||||||
|
<Filter>GUI\CCEditBox</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -6,7 +6,7 @@
|
||||||
#include "NetworkTest/HttpClientTest.h"
|
#include "NetworkTest/HttpClientTest.h"
|
||||||
#include "TableViewTest/TableViewTestScene.h"
|
#include "TableViewTest/TableViewTestScene.h"
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
#include "EditBoxTest/EditBoxTest.h"
|
#include "EditBoxTest/EditBoxTest.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ enum
|
||||||
TEST_CCCONTROLBUTTON,
|
TEST_CCCONTROLBUTTON,
|
||||||
TEST_COCOSBUILDER,
|
TEST_COCOSBUILDER,
|
||||||
TEST_HTTPCLIENT,
|
TEST_HTTPCLIENT,
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
TEST_EDITBOX,
|
TEST_EDITBOX,
|
||||||
#endif
|
#endif
|
||||||
TEST_TABLEVIEW,
|
TEST_TABLEVIEW,
|
||||||
|
@ -35,7 +35,7 @@ static const std::string testsName[TEST_MAX_COUNT] =
|
||||||
"CCControlButtonTest",
|
"CCControlButtonTest",
|
||||||
"CocosBuilderTest",
|
"CocosBuilderTest",
|
||||||
"HttpClientTest",
|
"HttpClientTest",
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
"EditBoxTest",
|
"EditBoxTest",
|
||||||
#endif
|
#endif
|
||||||
"TableViewTest"
|
"TableViewTest"
|
||||||
|
@ -107,7 +107,7 @@ void ExtensionsMainLayer::menuCallback(CCObject* pSender)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
case TEST_EDITBOX:
|
case TEST_EDITBOX:
|
||||||
{
|
{
|
||||||
runEditBoxTest();
|
runEditBoxTest();
|
||||||
|
|
|
@ -120,6 +120,7 @@
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\EditBoxTest\EditBoxTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\NetworkTest\HttpClientTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\NetworkTest\HttpClientTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\TableViewTest\CustomTableViewCell.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\TableViewTest\CustomTableViewCell.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\TableViewTest\TableViewTestScene.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\TableViewTest\TableViewTestScene.cpp" />
|
||||||
|
@ -210,6 +211,7 @@
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\EditBoxTest\EditBoxTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\NetworkTest\HttpClientTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\NetworkTest\HttpClientTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\TableViewTest\CustomTableViewCell.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\TableViewTest\CustomTableViewCell.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\TableViewTest\TableViewTestScene.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\TableViewTest\TableViewTestScene.h" />
|
||||||
|
|
|
@ -205,6 +205,9 @@
|
||||||
<Filter Include="Classes\ClippingNodeTest">
|
<Filter Include="Classes\ClippingNodeTest">
|
||||||
<UniqueIdentifier>{b79f4701-6fe2-4996-83c5-0567bcf90287}</UniqueIdentifier>
|
<UniqueIdentifier>{b79f4701-6fe2-4996-83c5-0567bcf90287}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Classes\ExtensionsTest\EditBoxTest">
|
||||||
|
<UniqueIdentifier>{a24eb0b9-5a01-4750-bc9a-cc14637a636a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="main.cpp">
|
<ClCompile Include="main.cpp">
|
||||||
|
@ -468,6 +471,9 @@
|
||||||
<ClCompile Include="..\Classes\ClippingNodeTest\ClippingNodeTest.cpp">
|
<ClCompile Include="..\Classes\ClippingNodeTest\ClippingNodeTest.cpp">
|
||||||
<Filter>Classes\ClippingNodeTest</Filter>
|
<Filter>Classes\ClippingNodeTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\EditBoxTest\EditBoxTest.cpp">
|
||||||
|
<Filter>Classes\ExtensionsTest\EditBoxTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="main.h">
|
<ClInclude Include="main.h">
|
||||||
|
@ -908,5 +914,8 @@
|
||||||
<ClInclude Include="..\Classes\ClippingNodeTest\ClippingNodeTest.h">
|
<ClInclude Include="..\Classes\ClippingNodeTest\ClippingNodeTest.h">
|
||||||
<Filter>Classes\ClippingNodeTest</Filter>
|
<Filter>Classes\ClippingNodeTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\EditBoxTest\EditBoxTest.h">
|
||||||
|
<Filter>Classes\ExtensionsTest\EditBoxTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue