void keyReleaseEvent(int keyCode) { if(keyCode == MAK_CLEAR) { if(currentLength!=0)currentLength--; currentString[currentLength] = 0; int h = renderCurrent(); sprintf(buff, "%s", currentString); mExtent = maGetTextSize(buff); maDrawText(1,h,buff); h+=EXTENT_Y(mExtent); renderCursor(h, EXTENT_X(mExtent)); } if(keyCode == MAK_SOFTRIGHT) { const char* ms = matchString.c_str(); if(strcmp(ms, currentString) == 0) assert(name, true); else assert(name, false); MAUtil::Environment::getEnvironment().removeKeyListener(this); //printf("charInput test finished\n"); suite->runNextCase(); } }
void start() { currentLength = 0; MAUtil::Environment::getEnvironment().addKeyListener(this); clearScreen(); renderCurrent(); maUpdateScreen(); }
void SceneComponent::render(sf::RenderTarget& target, sf::RenderStates states) { states.transform *= getTransform(); if (renderable() && isVisible()) { renderCurrent(target, states); } renderChildren(target, states); }
void characterChanged(char c) { int h = renderCurrent(); currentString[currentLength] = c; currentString[currentLength+1] = 0; sprintf(buff, "%s", currentString); mExtent = maGetTextSize(buff); maDrawText(1,h,buff); h+=EXTENT_Y(mExtent); renderCursor(h, EXTENT_X(mExtent)-8); }