BEGIN_MESSAGE_MAP(CDirFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CDirFrame)
ON_WM_CREATE()
- ON_UPDATE_COMMAND_UI(ID_STATUS_DIFFNUM, OnUpdateStatusNum)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_MDIACTIVATE()
}
/**
- * @brief Empty diff-number pane from statusbar when dirview active
- */
-void CDirFrame::OnUpdateStatusNum(CCmdUI* pCmdUI)
-{
- pCmdUI->SetText(_T(""));
-}
-
-/**
* @brief Store callback which we check to see if we're allowed to close
* This keeps us decoupled from the doc
*/
// Generated message map functions
//{{AFX_MSG(CDirFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnUpdateStatusNum(CCmdUI* pCmdUI);
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
ON_COMMAND(ID_MERGE_DELETE, OnDelete)
ON_UPDATE_COMMAND_UI(ID_MERGE_DELETE, OnUpdateDelete)
ON_COMMAND(ID_DIR_RESCAN, OnMarkedRescan)
+ ON_UPDATE_COMMAND_UI(ID_STATUS_DIFFNUM, OnUpdateStatusNum)
//}}AFX_MSG_MAP
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClick)
ON_NOTIFY_REFLECT(LVN_GETINFOTIP, OnInfoTip)
MarkForRescan();
GetDocument()->Rescan();
}
+
+/**
+ * @brief Called to update the item count in the status bar
+ */
+void CDirView::OnUpdateStatusNum(CCmdUI* pCmdUI)
+{
+ CString s; // text to display
+
+ int count = m_pList->GetItemCount();
+ int focusItem = GetFocusedItem();
+
+ if (focusItem == -1)
+ {
+ // No item has focus
+ CString sCnt;
+ sCnt.Format(_T("%ld"), count);
+ // "Items: %1"
+ AfxFormatString1(s, IDS_DIRVIEW_STATUS_FMT_NOFOCUS, sCnt);
+ }
+ else
+ {
+ // An item has focus
+ CString sIdx, sCnt;
+ sIdx.Format(_T("%ld"), focusItem+1);
+ sCnt.Format(_T("%ld"), count);
+ // "Item %1 of %2"
+ AfxFormatString2(s, IDS_DIRVIEW_STATUS_FMT_FOCUS, sIdx, sCnt);
+ }
+ pCmdUI->SetText(s);
+}
+
afx_msg void OnDelete();
afx_msg void OnUpdateDelete(CCmdUI* pCmdUI);
afx_msg void OnMarkedRescan();
+ afx_msg void OnUpdateStatusNum(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
BOOL OnHeaderBeginDrag(LPNMHEADER hdr, LRESULT* pResult);
IDS_STATUSBAR_READONLY "RO"
END
+// MORE STATUS PANES
+STRINGTABLE
+BEGIN
+ IDS_DIRVIEW_STATUS_FMT_FOCUS "Item %1 of %2"
+ IDS_DIRVIEW_STATUS_FMT_NOFOCUS "Items: %1"
+END
+
// OPEN DIALOG
STRINGTABLE
BEGIN
+2005-06-27 Perry
+ PATCH: 1213781 ] Fill item location into statusbar in dirview
+ DirFrame.cpp DirFrame.h DirView.cpp DirView.h Merge.rc resource.h
+
2005-06-23 Kimmo
BUG: [ 1225257 ] cvs: FileFilters broken?
Restore behavior in 2.3.3.5 and earlier for directory filtering
#define IDS_NO_DIFF_SEL_FMT 16837
#define IDS_1_DIFF_FOUND 16838
#define IDS_STATUSBAR_READONLY 16839
+#define IDS_DIRVIEW_STATUS_FMT_FOCUS 16840
+#define IDS_DIRVIEW_STATUS_FMT_NOFOCUS 16841
#define IDS_ERROR_INCOMPARABLE 17200
#define IDS_DIRSEL_TAG 17201
#define IDS_OPEN_FILESDIRS 17202