void StdCmdSave::activated(int iMsg)
{
#if 0
    Gui::Document* pActiveDoc = getActiveGuiDocument();
    if ( pActiveDoc )
        pActiveDoc->save();
    else
#endif
        doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Save\")");
}
Beispiel #2
0
bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
{
    if (strcmp("ViewFit",pMsg) == 0) {
        viewAll();
        return true;
    }
    else if (strcmp("Save",pMsg) == 0) {
        Gui::Document *doc = getGuiDocument();
        if (doc) {
            doc->save();
            return true;
        }
    }
    else if (strcmp("SaveAs",pMsg) == 0) {
        Gui::Document *doc = getGuiDocument();
        if (doc) {
            doc->saveAs();
            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;
}