You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/Module/GeoSigmaDraw/InterfaceUndoRedo.cpp

63 lines
990 B
C++

#include "stdafx.h"
#include "SigmaDoc.h"
#include "SigmaView.h"
extern "C" __declspec(dllexport)
int GeoSigma_Undo(CSigmaView * pView, HDC hdc)
{
if (pView == 0)
return -1;
if (pView->m_pDoc == 0)
return -1;
CDC * pDC = CDC::FromHandle(hdc);
pView->SetScreenDC(pDC);
return pView->m_pDoc->Undo();
}
/**
* ·µ»Ø²Ù×÷ÀàÐÍ
**/
extern "C" __declspec(dllexport)
int GeoSigma_Redo(CSigmaView * pView, HDC hdc)
{
if (pView == 0)
return -1;
if (pView->m_pDoc == 0)
return -1;
CDC * pDC = CDC::FromHandle(hdc);
pView->SetScreenDC(pDC);
return pView->m_pDoc->Redo();
}
extern "C" __declspec(dllexport)
int GeoSigma_CanUndo(CSigmaView * pView)
{
if (pView == 0)
return -1;
if (pView->m_pDoc == 0)
return -1;
if (pView->m_pDoc->CanUndo())
return 1;
return -1;
}
extern "C" __declspec(dllexport)
int GeoSigma_CanRedo(CSigmaView * pView)
{
if (pView == 0)
return -1;
if (pView->m_pDoc == 0)
return -1;
if (pView->m_pDoc->CanRedo())
return 1;
return -1;
}