Skip to content

Commit

Permalink
ImgMergeFrm.*: Update tabbar item when comparing image files are changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Oct 23, 2016
1 parent c1f6249 commit aa769c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Src/ImgMergeFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void CImgMergeFrame::ChangeFile(int nBuffer, const String& path)
}

UpdateHeaderPath(nBuffer);
UpdateLastCompareResult();
}

bool CImgMergeFrame::IsModified() const
Expand Down Expand Up @@ -950,6 +951,8 @@ void CImgMergeFrame::SetTitle(LPCTSTR lpszTitle)
sTitle = string_join(&sFileName[0], &sFileName[0] + nBuffers, _T(" - "));
}
CMDIChildWnd::SetTitle(sTitle.c_str());
if (m_hWnd)
SetWindowText(sTitle.c_str());
}

/**
Expand Down Expand Up @@ -980,6 +983,11 @@ void CImgMergeFrame::SetLastCompareResult(int nResult)
theApp.SetLastCompareResult(nResult);
}

void CImgMergeFrame::UpdateLastCompareResult()
{
SetLastCompareResult(m_pImgMergeWindow->GetDiffCount() > 0 ? 1 : 0);
}

void CImgMergeFrame::UpdateAutoPaneResize()
{
}
Expand Down Expand Up @@ -1339,6 +1347,7 @@ void CImgMergeFrame::OnEditUndo()
m_pImgMergeWindow->Undo();
if (!m_pImgMergeWindow->IsUndoable())
m_bAutoMerged = false;
UpdateLastCompareResult();
}

/**
Expand All @@ -1355,6 +1364,7 @@ void CImgMergeFrame::OnUpdateEditUndo(CCmdUI* pCmdUI)
void CImgMergeFrame::OnEditRedo()
{
m_pImgMergeWindow->Redo();
UpdateLastCompareResult();
}

/**
Expand Down Expand Up @@ -1536,6 +1546,7 @@ void CImgMergeFrame::OnUpdateX2Y(CCmdUI* pCmdUI, int srcPane, int dstPane)
void CImgMergeFrame::OnX2Y(int srcPane, int dstPane)
{
m_pImgMergeWindow->CopyDiff(m_pImgMergeWindow->GetCurrentDiffIndex(), srcPane, dstPane);
UpdateLastCompareResult();
}

/**
Expand Down Expand Up @@ -1645,6 +1656,7 @@ void CImgMergeFrame::OnAllLeft()
CWaitCursor waitstatus;

m_pImgMergeWindow->CopyDiffAll(srcPane, dstPane);
UpdateLastCompareResult();
}

/**
Expand Down Expand Up @@ -1675,6 +1687,7 @@ void CImgMergeFrame::OnAllRight()
CWaitCursor waitstatus;

m_pImgMergeWindow->CopyDiffAll(srcPane, dstPane);
UpdateLastCompareResult();
}

/**
Expand Down Expand Up @@ -1788,7 +1801,7 @@ void CImgMergeFrame::OnUpdateImgThreshold(CCmdUI* pCmdUI)
void CImgMergeFrame::OnImgPrevPage()
{
m_pImgMergeWindow->SetCurrentPageAll(m_pImgMergeWindow->GetCurrentMaxPage() - 1);
UpdateDiffItem(m_pDirDoc);
UpdateLastCompareResult();
}

void CImgMergeFrame::OnUpdateImgPrevPage(CCmdUI* pCmdUI)
Expand All @@ -1799,7 +1812,7 @@ void CImgMergeFrame::OnUpdateImgPrevPage(CCmdUI* pCmdUI)
void CImgMergeFrame::OnImgNextPage()
{
m_pImgMergeWindow->SetCurrentPageAll(m_pImgMergeWindow->GetCurrentMaxPage() + 1);
UpdateDiffItem(m_pDirDoc);
UpdateLastCompareResult();
}

void CImgMergeFrame::OnUpdateImgNextPage(CCmdUI* pCmdUI)
Expand All @@ -1811,7 +1824,7 @@ void CImgMergeFrame::OnUpdateImgNextPage(CCmdUI* pCmdUI)
void CImgMergeFrame::OnImgCurPanePrevPage()
{
m_pImgMergeWindow->SetCurrentPage(m_pImgMergeWindow->GetActivePane(), m_pImgMergeWindow->GetCurrentPage(m_pImgMergeWindow->GetActivePane()) - 1);
UpdateDiffItem(m_pDirDoc);
UpdateLastCompareResult();
}

void CImgMergeFrame::OnUpdateImgCurPanePrevPage(CCmdUI* pCmdUI)
Expand All @@ -1822,7 +1835,7 @@ void CImgMergeFrame::OnUpdateImgCurPanePrevPage(CCmdUI* pCmdUI)
void CImgMergeFrame::OnImgCurPaneNextPage()
{
m_pImgMergeWindow->SetCurrentPage(m_pImgMergeWindow->GetActivePane(), m_pImgMergeWindow->GetCurrentPage(m_pImgMergeWindow->GetActivePane()) + 1);
UpdateDiffItem(m_pDirDoc);
UpdateLastCompareResult();
}

void CImgMergeFrame::OnUpdateImgCurPaneNextPage(CCmdUI* pCmdUI)
Expand Down
1 change: 1 addition & 0 deletions Src/ImgMergeFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class CImgMergeFrame : public CMDIChildWnd, public IMergeDoc
void DirDocClosing(CDirDoc * pDirDoc) { m_pDirDoc = NULL; }
void SetSharedMenu(HMENU hMenu) { m_hMenuShared = hMenu; };
void SetLastCompareResult(int nResult);
void UpdateLastCompareResult();
void UpdateAutoPaneResize();
void UpdateSplitter();
bool GenerateReport(const String& sFileName) const;
Expand Down

0 comments on commit aa769c0

Please sign in to comment.