MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / onProcessMessage

Method onProcessMessage

src/app/commands/cmd_palette_editor.cpp:351–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351bool PaletteEntryEditor::onProcessMessage(Message* msg)
352{
353 if (msg->type() == kTimerMessage &&
354 static_cast<TimerMessage*>(msg)->timer() == &m_redrawTimer) {
355 // Redraw all editors
356 if (m_redrawAll) {
357 m_redrawAll = false;
358 m_implantChange = false;
359 m_redrawTimer.stop();
360
361 // Call all observers of PaletteChange event.
362 m_selfPalChange = true;
363 App::instance()->PaletteChange();
364 m_selfPalChange = false;
365
366 // Redraw all editors
367 try {
368 ContextWriter writer(UIContext::instance());
369 Document* document(writer.document());
370 if (document != NULL)
371 document->notifyGeneralUpdate();
372 }
373 catch (...) {
374 // Do nothing
375 }
376 }
377 // Redraw just the current editor
378 else {
379 m_redrawAll = true;
380 if (current_editor != NULL)
381 current_editor->updateEditor();
382 }
383 }
384 return Window::onProcessMessage(msg);
385}
386
387void PaletteEntryEditor::onExit()
388{

Callers

nothing calls this directly

Calls 7

instanceFunction · 0.85
timerMethod · 0.80
notifyGeneralUpdateMethod · 0.80
updateEditorMethod · 0.80
typeMethod · 0.45
stopMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected