+ make undo/redo accessible from drawing view
This commit is contained in:
parent
9290274e1c
commit
93e5668967
|
@ -327,6 +327,20 @@ bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else if(strcmp("Undo",pMsg) == 0 ) {
|
||||
Gui::Document *doc = getGuiDocument();
|
||||
if (doc) {
|
||||
doc->undo(1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(strcmp("Redo",pMsg) == 0 ) {
|
||||
Gui::Document *doc = getGuiDocument();
|
||||
if (doc) {
|
||||
doc->redo(1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -338,6 +352,14 @@ bool DrawingView::onHasMsg(const char* pMsg) const
|
|||
return getGuiDocument() != 0;
|
||||
else if (strcmp("SaveAs",pMsg) == 0)
|
||||
return getGuiDocument() != 0;
|
||||
else if (strcmp("Undo",pMsg) == 0) {
|
||||
App::Document* doc = getAppDocument();
|
||||
return doc && doc->getAvailableUndos() > 0;
|
||||
}
|
||||
else if (strcmp("Redo",pMsg) == 0) {
|
||||
App::Document* doc = getAppDocument();
|
||||
return doc && doc->getAvailableRedos() > 0;
|
||||
}
|
||||
else if (strcmp("Print",pMsg) == 0)
|
||||
return true;
|
||||
else if (strcmp("PrintPreview",pMsg) == 0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user