Skip to content

Commit

Permalink
implemented reset view feature as described in #139
Browse files Browse the repository at this point in the history
  • Loading branch information
janwilmans committed Sep 23, 2015
1 parent 5045497 commit fae1f36
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Binary file modified DebugView++/DebugView++.rc
Binary file not shown.
22 changes: 22 additions & 0 deletions DebugView++/LogView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ BEGIN_MSG_MAP_TRY(CLogView)
REFLECTED_NOTIFY_CODE_HANDLER_EX(LVN_ODCACHEHINT, OnOdCacheHint)
REFLECTED_NOTIFY_CODE_HANDLER_EX(LVN_BEGINDRAG, OnBeginDrag)
COMMAND_ID_HANDLER_EX(ID_VIEW_CLEAR, OnViewClear)
COMMAND_ID_HANDLER_EX(ID_VIEW_RESET, OnViewReset)
COMMAND_ID_HANDLER_EX(ID_VIEW_RESET_TO_LINE, OnViewResetToLine)
COMMAND_ID_HANDLER_EX(ID_VIEW_SELECTALL, OnViewSelectAll)
COMMAND_ID_HANDLER_EX(ID_VIEW_COPY, OnViewCopy)
COMMAND_ID_HANDLER_EX(ID_VIEW_SCROLL, OnViewAutoScroll)
Expand Down Expand Up @@ -921,6 +923,26 @@ void CLogView::OnViewClear(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/
ClearView();
}

void CLogView::OnViewReset(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
{
ResetToLine(0);
}

void CLogView::OnViewResetToLine(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
{
int begin = GetNextItem(-1, LVNI_FOCUSED);
if (begin < 0)
return;
ResetToLine(m_logLines[begin].line);
}

void CLogView::ResetToLine(int line)
{
StopTracking();
m_firstLine = line;
ApplyFilters();
}

void CLogView::OnViewSelectAll(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
{
SelectAll();
Expand Down
3 changes: 3 additions & 0 deletions DebugView++/LogView.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ class CLogView :
LRESULT OnOdCacheHint(NMHDR* pnmh);
LRESULT OnBeginDrag(NMHDR* pnmh);
void OnViewClear(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewReset(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewResetToLine(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewSelectAll(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewCopy(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewAutoScroll(UINT uNotifyCode, int nID, CWindow wndCtl);
Expand Down Expand Up @@ -225,6 +227,7 @@ class CLogView :
void OnViewClearBookmarks(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnViewColumn(UINT uNotifyCode, int nID, CWindow wndCtl);

void ResetToLine(int line);
void ClearView();
void UpdateColumnInfo();
void UpdateColumns();
Expand Down
Binary file modified DebugView++/resource.h
Binary file not shown.

0 comments on commit fae1f36

Please sign in to comment.