#define new DEBUG_NEW
#endif
-/** @brief Location for image compare specific help to open. */
-static const TCHAR ImgMergeFrameHelpLocation[] = _T("::/htmlhelp/Compare_images.html");
-
/////////////////////////////////////////////////////////////////////////////
// CImgMergeFrame
CImgMergeFrame::~CImgMergeFrame()
{
+ GetMainFrame()->UnwatchDocuments(this);
+
if (m_pDirDoc != nullptr)
{
m_pDirDoc->MergeDocClosing(this);
if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST))
m_pImgMergeWindow->FirstDiff();
+ GetMainFrame()->WatchDocuments(this);
+
return true;
}
{
if (nPane < 0)
{
- nPane = GetOptionsMgr()->GetInt(OPT_ACTIVE_PANE);
+ nPane = (m_nBufferType[0] != BUFFERTYPE::UNNAMED) ? GetOptionsMgr()->GetInt(OPT_ACTIVE_PANE) : 0;
if (nPane < 0 || nPane >= m_pImgMergeWindow->GetPaneCount())
nPane = 0;
}
}
else if (evt.eventType == IImgMergeWindow::CONTEXTMENU)
{
- CImgMergeFrame *pFrame = reinterpret_cast<CImgMergeFrame *>(evt.userdata);
BCMenu menuPopup;
menuPopup.LoadMenu(MAKEINTRESOURCE(IDR_POPUP_IMG_CTXT));
theApp.TranslateMenu(menuPopup.m_hMenu);
bool bResult;
if (std::count(m_nBufferType, m_nBufferType + m_filePaths.GetSize(), BUFFERTYPE::UNNAMED) == m_filePaths.GetSize())
{
+ m_infoUnpacker.Initialize(false);
bResult = m_pImgMergeWindow->NewImages(m_filePaths.GetSize(), 1, 256, 256);
}
else
}
m_wndFilePathBar.SetPaneCount(m_pImgMergeWindow->GetPaneCount());
- m_wndFilePathBar.SetOnSetFocusCallback([&](int pane) { m_pImgMergeWindow->SetActivePane(pane); });
+ m_wndFilePathBar.SetOnSetFocusCallback([&](int pane) {
+ if (m_nActivePane != pane)
+ m_pImgMergeWindow->SetActivePane(pane);
+ });
+ m_wndFilePathBar.SetOnCaptionChangedCallback([&](int pane, const String& sText) {
+ m_strDesc[pane] = sText;
+ UpdateHeaderPath(pane);
+ });
+ m_wndFilePathBar.SetOnFileSelectedCallback([&](int pane, const String& sFilepath) {
+ ChangeFile(pane, sFilepath);
+ });
// Merge frame also has a dockable bar at the very left
// created in OnCreateClient
DWORD dwFlags[3];
String strDesc[3];
int nBuffers = m_filePaths.GetSize();
- CDirDoc *pDirDoc = m_pDirDoc->GetMainView() ? m_pDirDoc :
- static_cast<CDirDoc*>(theApp.m_pDirTemplate->CreateNewDocument());
PackingInfo infoUnpacker(m_infoUnpacker.GetPluginPipeline());
for (int nBuffer = 0; nBuffer < nBuffers; ++nBuffer)
{
if (m_pImgMergeWindow != nullptr)
{
+ const int scrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
int w[3];
CRect rc, rcMergeWindow;
int nPaneCount = m_pImgMergeWindow->GetPaneCount();
{
RECT rc1 = m_pImgMergeWindow->GetPaneWindowRect(pane);
w[pane] = rc1.right - rc1.left - 4;
+ if (pane == nPaneCount - 1)
+ w[pane] -= scrollbarWidth;
if (w[pane]<1) w[pane]=1; // Perry 2003-01-22 (I don't know why this happens)
}
}
else
{
for (int pane = 0; pane < nPaneCount; pane++)
- w[pane] = rcMergeWindow.Width() / nPaneCount - 4;
+ w[pane] = (rcMergeWindow.Width() - scrollbarWidth) / nPaneCount - 6;
}
if (!std::equal(m_nLastSplitPos, m_nLastSplitPos + nPaneCount - 1, w))
// If directory compare has results
if (pDirDoc && pDirDoc->HasDiffs())
{
- const String &pathLeft = m_filePaths.GetLeft();
- const String &pathRight = m_filePaths.GetRight();
- CDiffContext &ctxt = const_cast<CDiffContext &>(pDirDoc->GetDiffContext());
// FIXME:
+// const String &pathLeft = m_filePaths.GetLeft();
+// const String &pathRight = m_filePaths.GetRight();
+// CDiffContext &ctxt = const_cast<CDiffContext &>(pDirDoc->GetDiffContext());
// if (UINT_PTR pos = pDirDoc->FindItemFromPaths(pathLeft, pathRight))
// {
// DIFFITEM &di = pDirDoc->GetDiffRefByKey(pos);