/** * Show a dialog so as to get a text from user */ bool GD_EXTENSION_API ShowTextInput( RuntimeScene & scene, gd::Variable & variable, const gd::String & message, const gd::String & title ) { sf::Clock timeSpent; gd::String result; //Display the box #if defined(WINDOWS) CInputBox ibox(NULL); if (ibox.DoModal(title.ToWide().c_str(), message.ToWide().c_str())) result = gd::String::FromWide(ibox.Text); #endif #if defined(LINUX) || defined(MACOS) std::string strResult; nw::TextInput dialog(title.ToLocale(), message.ToLocale(), strResult); dialog.wait_until_closed(); result = gd::String::FromLocale(strResult); //Convert from locale #endif scene.GetTimeManager().NotifyPauseWasMade(timeSpent.getElapsedTime().asMicroseconds());//Don't take the time spent in this function in account. //Update the variable variable.SetString(result); return true; }
void idisplay() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_COLOR_MATERIAL); ibox(); iball(); glDisable(GL_COLOR_MATERIAL); glutTimerFunc(16, imove, 0); glutSwapBuffers(); }