Click here to Skip to main content
12,756,303 members (34,147 online)
Click here to Skip to main content

Stats

70K views
1.7K downloads
101 bookmarked
Posted 16 May 2006

A Simple, Action Based, Undo/Redo Framework

, 16 Feb 2013 CPOL
How to use a simple, action based, undo/redo framework
kis
kis.dll
kis.lib
KisWinBin_v_1_r_1
kis
kis.dll
kis.lib
KisActionDemo
res
KisActionDemo.ico
KisActionDemoDoc.ico
Toolbar.bmp
vssver.scc
KisWinSrc_v_1_r_1
kis
KisActionDemo
res
KisActionDemo.ico
KisActionDemoDoc.ico
Toolbar.bmp
vssver.scc
/*
***************************************************************************

kis v 1

(c) 2006, Florin DUMITRESCU

mailto: fdproxy@gmail.com

$Workfile: KisActionDemoDoc.h $ 

***************************************************************************
*/


#pragma once


#include "_Graphic.h"


class CKisActionDemoDoc : public CDocument
{

	DECLARE_MESSAGE_MAP()
	DECLARE_DYNCREATE(CKisActionDemoDoc)

public:

  enum
  {
    c_MaxUndoRedoTextLen = 48
  };
  kis::SP_ActionExecutor m_spActionExecutor;
  UINT m_ActiveTool;
  C_Drawing m_Drawing;

  CKisActionDemoDoc();
	virtual ~CKisActionDemoDoc();

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

  CString _GetUndoText(void);
  CString _GetRedoText(void);
  void OnLButtonDown( class CKisActionDemoView* a_pView );
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
  afx_msg void OnActionAddRandomSegment();
  afx_msg void OnEditUndo();
  afx_msg void OnEditRedo();
  afx_msg void OnUpdateEditUndo(CCmdUI *pCmdUI);
  afx_msg void OnUpdateEditRedo(CCmdUI *pCmdUI);
  afx_msg void OnActionAddsegment();
  afx_msg void OnUpdateActionAddsegment(CCmdUI *pCmdUI);
  afx_msg void OnActionAddrectangle();
  afx_msg void OnUpdateActionAddrectangle(CCmdUI *pCmdUI);
  afx_msg void OnActionAddellipse();
  afx_msg void OnUpdateActionAddellipse(CCmdUI *pCmdUI);
  afx_msg BOOL OnTipText( UINT id, NMHDR* pNMHDR, LRESULT* pResult );
  afx_msg void OnActionClearDrawing();

};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

zdf
Romania Romania
Just a humble programmer.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 16 Feb 2013
Article Copyright 2006 by zdf
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid