{\r
if (m_currentUndoBufIndex >= static_cast<int>(m_undoBuf.size()) - 1)\r
throw "no redoable";\r
- const UndoRecord& rec = m_undoBuf[m_currentUndoBufIndex];\r
++m_currentUndoBufIndex;\r
+ const UndoRecord& rec = m_undoBuf[m_currentUndoBufIndex];\r
return rec;\r
}\r
\r
, m_oldSplitPosX(-4)\r
, m_oldSplitPosY(-4)\r
{\r
- memset(m_ChildWndProc, 0, sizeof(m_ChildWndProc));\r
- memset(m_currentPage, 0, sizeof(m_currentPage));\r
+ for (int i = 0; i < 3; ++i)\r
+ {\r
+ m_ChildWndProc[i] = NULL;\r
+ m_currentPage[i] = 0;\r
+ m_bRO[i] = false;\r
+ }\r
}\r
\r
~CImgMergeWindow()\r
m_imgWindow[pane].SetFocus();\r
}\r
\r
+ bool GetReadOnly(int pane) const\r
+ {\r
+ if (pane < 0 || pane >= m_nImages)\r
+ return true;\r
+ return m_bRO[pane];\r
+ }\r
+\r
+ void SetReadOnly(int pane, bool readOnly)\r
+ {\r
+ if (pane < 0 || pane >= m_nImages)\r
+ return;\r
+ m_bRO[pane] = readOnly;\r
+ }\r
+\r
bool GetHorizontalSplit() const\r
{\r
return m_bHorizontalSplit;\r
return;\r
if (diffIndex < 0 || diffIndex >= m_diffCount)\r
return;\r
+ if (m_bRO[dstPane])\r
+ return;\r
\r
FIBITMAP *oldbitmap = FreeImage_Clone(m_imgOrig32[dstPane]);\r
\r
return m_undoRecords.is_modified(pane);\r
}\r
\r
+ bool IsUndoable() const\r
+ {\r
+ return m_undoRecords.undoable();\r
+ }\r
+\r
+ bool IsRedoable() const\r
+ {\r
+ return m_undoRecords.redoable();\r
+ }\r
+\r
bool Undo()\r
{\r
if (!m_undoRecords.undoable())\r
{\r
if (pane < 0 || pane >= m_nImages)\r
return false;\r
+ if (m_bRO[pane])\r
+ return false;\r
if (!m_undoRecords.is_modified(pane))\r
return true;\r
m_undoRecords.save(pane);\r
WNDPROC m_ChildWndProc[3];\r
std::vector<EventListenerInfo> m_listener;\r
std::wstring m_filename[3];\r
+ bool m_bRO[3];\r
int m_nDraggingSplitter;\r
bool m_bHorizontalSplit;\r
int m_oldSplitPosX;\r
virtual bool SetWindowRect(const RECT& rc) = 0;\r
virtual int GetActivePane() const = 0;\r
virtual void SetActivePane(int pane) = 0;\r
+ virtual bool GetReadOnly(int pane) const = 0;\r
+ virtual void SetReadOnly(int pane, bool readOnly) = 0;\r
virtual bool GetHorizontalSplit() const = 0;\r
virtual void SetHorizontalSplit(bool horizontalSplit) = 0;\r
virtual int GetCurrentPage(int pane) const = 0;\r
virtual int GetNextConflictIndex() const = 0;\r
virtual int GetPrevConflictIndex() const = 0;\r
virtual void CopyDiff(int diffIndex, int srcPane, int dstPane) = 0;\r
+ virtual bool IsUndoable() const = 0;\r
+ virtual bool IsRedoable() const = 0;\r
virtual bool Undo() = 0;\r
virtual bool Redo() = 0;\r
virtual bool IsModified(int pane) const = 0;\r