Пример #1
0
 void Textbox::textInputEvent(const TextInputEvent &event) {
     const std::string &newText = event.getText();
     for (auto iter = newText.cbegin(); iter != newText.cend(); ++iter) {
         char letter = *iter;
         if ((int) text.length() < max && allowedCharacters.find(letter) != std::string::npos) {
             text.push_back(letter);
         }
     }
 }
Пример #2
0
	void Application::textInputEvent(Context& context, const TextInputEvent& event)
	{
		if (console.isActive())
		{
			console.textInputEvent(event.getText());
		}
		else
		{
			context.textInputEvent(event);
		}
	}