| 209 | } |
| 210 | |
| 211 | void ScriptModule::DrawModule() |
| 212 | { |
| 213 | if (Minimized() || IsVisible() == false) |
| 214 | return; |
| 215 | |
| 216 | if (!sHasPythonEverSuccessfullyInitialized) |
| 217 | { |
| 218 | //DrawTextNormal("please ensure that you have Python 3.8 installed\nif you do not have Python 3.8 installed, Bespoke may crash\n\nclick to continue...", 20, 20); |
| 219 | juce::String pythonVersionRev = Bespoke::PYTHON_VERSION; |
| 220 | juce::String pythonVersionMinor = pythonVersionRev.substring(0, pythonVersionRev.lastIndexOfChar('.')); |
| 221 | if (pythonVersionRev.lastIndexOfChar('.') == -1) |
| 222 | pythonVersionMinor = "***ERROR***"; |
| 223 | DrawTextNormal("this version of bespoke was built with Python " + pythonVersionRev.toStdString() + "\n" + |
| 224 | "please ensure that you have some flavor of Python " + pythonVersionMinor.toStdString() + " installed.\n" + |
| 225 | "(not an older or newer version!)\n\n" + |
| 226 | "if you do not, bespoke will crash!", |
| 227 | 20, 20); |
| 228 | |
| 229 | mCodeEntry->SetShowing(false); |
| 230 | |
| 231 | mPythonInstalledConfirmButton->SetLabel(("yes, I have Python " + pythonVersionMinor.toStdString() + " installed").c_str()); |
| 232 | mPythonInstalledConfirmButton->Draw(); |
| 233 | |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | mTrustScriptButton->SetShowing(mIsScriptUntrusted); |
| 238 | mDontTrustScriptButton->SetShowing(mIsScriptUntrusted); |
| 239 | mLoadScriptSelector->SetShowing(!mIsScriptUntrusted); |
| 240 | mLoadScriptButton->SetShowing(!mIsScriptUntrusted); |
| 241 | mSaveScriptButton->SetShowing(!mIsScriptUntrusted); |
| 242 | mShowReferenceButton->SetShowing(!mIsScriptUntrusted); |
| 243 | |
| 244 | mPythonInstalledConfirmButton->SetShowing(false); |
| 245 | mCodeEntry->SetShowing(true); |
| 246 | |
| 247 | mLoadScriptSelector->Draw(); |
| 248 | mLoadScriptButton->Draw(); |
| 249 | mSaveScriptButton->Draw(); |
| 250 | mShowReferenceButton->Draw(); |
| 251 | mCodeEntry->Draw(); |
| 252 | mRunButton->Draw(); |
| 253 | mStopButton->Draw(); |
| 254 | mASlider->Draw(); |
| 255 | mBSlider->Draw(); |
| 256 | mCSlider->Draw(); |
| 257 | mDSlider->Draw(); |
| 258 | |
| 259 | if (mIsScriptUntrusted) |
| 260 | { |
| 261 | mTrustScriptButton->Draw(); |
| 262 | mDontTrustScriptButton->Draw(); |
| 263 | ofPushStyle(); |
| 264 | ofFill(); |
| 265 | |
| 266 | ofRectangle buttonRect = mTrustScriptButton->GetRect(K(local)); |
| 267 | ofSetColor(0, 255, 0, 80); |
| 268 | ofRect(buttonRect); |
nothing calls this directly
no test coverage detected