mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
add TextInput::focus and unfocus
This commit is contained in:
parent
d49ac634f3
commit
749fdf1ad3
2 changed files with 16 additions and 0 deletions
|
@ -138,6 +138,15 @@ namespace geode {
|
||||||
*/
|
*/
|
||||||
std::string getString() const;
|
std::string getString() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Focus this input (activate the cursor)
|
||||||
|
*/
|
||||||
|
void focus();
|
||||||
|
/**
|
||||||
|
* Defocus this input (deactivate the cursor)
|
||||||
|
*/
|
||||||
|
void defocus();
|
||||||
|
|
||||||
CCTextInputNode* getInputNode() const;
|
CCTextInputNode* getInputNode() const;
|
||||||
cocos2d::extension::CCScale9Sprite* getBGSprite() const;
|
cocos2d::extension::CCScale9Sprite* getBGSprite() const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -191,6 +191,13 @@ std::string TextInput::getString() const {
|
||||||
return m_input->getString();
|
return m_input->getString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextInput::focus() {
|
||||||
|
m_input->onClickTrackNode(true);
|
||||||
|
}
|
||||||
|
void TextInput::defocus() {
|
||||||
|
m_input->detachWithIME();
|
||||||
|
}
|
||||||
|
|
||||||
CCTextInputNode* TextInput::getInputNode() const {
|
CCTextInputNode* TextInput::getInputNode() const {
|
||||||
return m_input;
|
return m_input;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue