Merge pull request #2084 from young40/master

fixed #1761: Implementing setVisible() for CCEditBox.
This commit is contained in:
James Chen 2013-03-03 19:10:20 -08:00
commit 52feaad12f
11 changed files with 34 additions and 0 deletions

View File

@ -232,6 +232,15 @@ void CCEditBox::setPosition(const CCPoint& pos)
}
}
void CCEditBox::setVisible(bool visible)
{
CCControlButton::setVisible(visible);
if (m_pEditBoxImpl != NULL)
{
m_pEditBoxImpl->setVisible(visible);
}
}
void CCEditBox::setContentSize(const CCSize& size)
{
CCControlButton::setContentSize(size);

View File

@ -286,6 +286,7 @@ public:
/* override functions */
virtual void setPosition(const CCPoint& pos);
virtual void setVisible(bool visible);
virtual void setContentSize(const CCSize& size);
virtual void setAnchorPoint(const CCPoint& anchorPoint);
virtual void visit(void);

View File

@ -60,6 +60,7 @@ public:
virtual void closeKeyboard() = 0;
virtual void setPosition(const CCPoint& pos) = 0;
virtual void setVisible(bool visible) = 0;
virtual void setContentSize(const CCSize& size) = 0;
virtual void setAnchorPoint(const CCPoint& anchorPoint) = 0;
virtual void visit(void) = 0;

View File

@ -209,6 +209,11 @@ void CCEditBoxImplAndroid::setPosition(const CCPoint& pos)
}
void CCEditBoxImplAndroid::setVisible(bool visible)
{ // don't need to be implemented on android platform.
}
void CCEditBoxImplAndroid::setContentSize(const CCSize& size)
{ // don't need to be implemented on android platform.

View File

@ -59,6 +59,7 @@ public:
virtual const char* getText(void);
virtual void setPlaceHolder(const char* pText);
virtual void setPosition(const CCPoint& pos);
virtual void setVisible(bool visible);
virtual void setContentSize(const CCSize& size);
virtual void setAnchorPoint(const CCPoint& anchorPoint);
virtual void visit(void);

View File

@ -89,6 +89,7 @@ public:
virtual const char* getText(void);
virtual void setPlaceHolder(const char* pText);
virtual void setPosition(const CCPoint& pos);
virtual void setVisible(bool visible);
virtual void setContentSize(const CCSize& size);
virtual void setAnchorPoint(const CCPoint& anchorPoint);
virtual void visit(void);

View File

@ -412,6 +412,11 @@ void CCEditBoxImplIOS::setPosition(const CCPoint& pos)
}
}
void CCEditBoxImplIOS::setVisible(bool visible)
{
m_systemControl.textField.hidden = !visible;
}
void CCEditBoxImplIOS::setContentSize(const CCSize& size)
{
m_tContentSize = size;

View File

@ -89,6 +89,7 @@ public:
virtual const char* getText(void);
virtual void setPlaceHolder(const char* pText);
virtual void setPosition(const CCPoint& pos);
virtual void setVisible(bool visible);
virtual void setContentSize(const CCSize& size);
virtual void setAnchorPoint(const CCPoint& anchorPoint);
virtual void visit(void);

View File

@ -345,6 +345,11 @@ void CCEditBoxImplMac::setPosition(const CCPoint& pos)
}
void CCEditBoxImplMac::setVisible(bool visible)
{
[GET_IMPL.textField setHidden:!visible];
}
void CCEditBoxImplMac::setContentSize(const CCSize& size)
{
m_tContentSize = size;

4
extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp Normal file → Executable file
View File

@ -206,6 +206,10 @@ void CCEditBoxImplWin::setPosition(const CCPoint& pos)
//m_pLabelPlaceHolder->setPosition(pos);
}
void CCEditBoxImplWin::setVisible(bool visible)
{ // don't need to be implemented on win32 platform.
}
void CCEditBoxImplWin::setContentSize(const CCSize& size)
{
}

1
extensions/GUI/CCEditBox/CCEditBoxImplWin.h Normal file → Executable file
View File

@ -59,6 +59,7 @@ public:
virtual const char* getText(void);
virtual void setPlaceHolder(const char* pText);
virtual void setPosition(const CCPoint& pos);
virtual void setVisible(bool visible);
virtual void setContentSize(const CCSize& size);
virtual void setAnchorPoint(const CCPoint& anchorPoint);
virtual void visit(void);