// CDirView view
#include <afxcview.h>
#include <memory>
+#include <optional>
#include "OptionsDirColors.h"
#include "SortHeaderCtrl.h"
#include "UnicodeString.h"
const uintptr_t SPECIAL_ITEM_POS = (uintptr_t)(reinterpret_cast<DIFFITEM *>( - 1L));
/** Default column width in directory compare */
-const UINT DefColumnWidth = 150;
+const UINT DefColumnWidth = 111;
/**
* @brief Directory compare results view.
void MoveToPrevDiff();
void OpenNextDiff();
void OpenPrevDiff();
+ void OpenFirstFile();
+ void OpenLastFile();
+ void OpenNextFile();
+ void OpenPrevFile();
+ bool IsFirstFile();
+ bool IsLastFile();
+
void SetActivePane(int pane);
// Implementation types
void DoOpenWith(SIDE_TYPE stype);
void DoOpenWithEditor(SIDE_TYPE stype);
void DoOpenParentFolder(SIDE_TYPE stype);
- void DoUpdateOpen(SELECTIONTYPE selectionType, CCmdUI* pCmdUI);
+ void DoUpdateOpen(SELECTIONTYPE selectionType, CCmdUI* pCmdUI, bool openableForDir = true);
void ConfirmAndPerformActions(FileActionScript & actions);
void PerformActionList(FileActionScript & actions);
void UpdateAfterFileScript(FileActionScript & actionList);
bool m_bUserCancelEdit; /**< `true` if the user cancels rename */
String m_lastCopyFolder; /**< Last Copy To -target folder. */
- int m_firstDiffItem;
- int m_lastDiffItem;
- bool m_bNeedSearchFirstDiffItem;
- bool m_bNeedSearchLastDiffItem;
+ std::optional<int> m_firstDiffItem;
+ std::optional<int> m_lastDiffItem;
DIRCOLORSETTINGS m_cachedColors; /**< Cached color settings */
bool m_bUseColors;
afx_msg void OnUpdateCtxtDirCopyTo(CCmdUI* pCmdUI);
afx_msg void OnUpdateCtxtDirCopyBothTo(CCmdUI* pCmdUI);
afx_msg void OnUpdateCtxtDirCopyBothDiffsOnlyTo(CCmdUI* pCmdUI);
+ template<SIDE_TYPE stype>
+ afx_msg void OnUpdateCtxtDirCopy2(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateCtxtDirCopyBoth2(CCmdUI* pCmdUI);
afx_msg void OnDestroy();
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnUpdateViewExpandAllSubdirs(CCmdUI* pCmdUI);
afx_msg void OnViewCollapseAllSubdirs();
afx_msg void OnUpdateViewCollapseAllSubdirs(CCmdUI* pCmdUI);
+ template <int pane1, int pane2>
afx_msg void OnViewSwapPanes();
+ template <int pane1, int pane2>
+ afx_msg void OnUpdateViewSwapPanes(CCmdUI* pCmdUI);
afx_msg void OnOptionsShowDifferent();
afx_msg void OnOptionsShowIdentical();
afx_msg void OnOptionsShowUniqueLeft();
bool OnHeaderEndDrag(LPNMHEADER hdr, LRESULT* pResult);
private:
- void Open(const PathContext& paths, DWORD dwFlags[3], PackingInfo * infoUnpacker = nullptr);
- void OpenSelection(SELECTIONTYPE selectionType = SELECTIONTYPE_NORMAL, PackingInfo * infoUnpacker = nullptr);
+ void Open(const PathContext& paths, DWORD dwFlags[3], FileTextEncoding encoding[3], PackingInfo * infoUnpacker = nullptr);
+ void OpenSelection(SELECTIONTYPE selectionType = SELECTIONTYPE_NORMAL, PackingInfo * infoUnpacker = nullptr, bool openableForDir = true);
void OpenSelectionAs(UINT id);
bool GetSelectedItems(int * sel1, int * sel2, int * sel3);
void OpenParentDirectory();
void CollapseSubdir(int sel);
void ExpandSubdir(int sel, bool bRecursive = false);
void GetColors(int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText) const;
+ int GetDefColumnWidth() const { return MulDiv(DefColumnWidth, CClientDC(const_cast<CDirView *>(this)).GetDeviceCaps(LOGPIXELSX), 72); };
+
public:
DirItemIterator Begin() const { return DirItemIterator(m_pIList.get()); }
DirItemIterator End() const { return DirItemIterator(); }