PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/reporting/crashsender/ProgressDlg.h

http://crashrpt.googlecode.com/
C++ Header | 86 lines | 49 code | 19 blank | 18 comment | 0 complexity | 02a426905faf0ee40fd263cd2fdf57d3 MD5 | raw file
 1/************************************************************************************* 
 2This file is a part of CrashRpt library.
 3Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved.
 4
 5Use of this source code is governed by a BSD-style license
 6that can be found in the License.txt file in the root of the source
 7tree. All contributing project authors may
 8be found in the Authors.txt file in the root of the source tree.
 9***************************************************************************************/
10
11#pragma once
12
13#include "resource.h"
14#include "ErrorReportSender.h"
15
16#define WM_COMPLETECOLLECT (WM_APP+1)
17
18class CProgressDlg : 
19	public CDialogImpl<CProgressDlg>,
20    public CDialogResize<CProgressDlg>
21{
22public:
23
24    enum { IDD = IDD_PROGRESSDLG };
25		
26    enum ActionOnCancel
27	{
28		DONT_CLOSE, 
29		CLOSE_MYSELF, 
30		CLOSE_MYSELF_AND_PARENT
31	};
32
33    CProgressBarCtrl m_prgProgress;
34    CListViewCtrl m_listView;
35    CButton m_btnCancel;
36    CStatic m_statText;    
37
38    BEGIN_DLGRESIZE_MAP(CProgressDlg)
39        DLGRESIZE_CONTROL(IDC_PROGRESS, DLSZ_SIZE_X)
40        DLGRESIZE_CONTROL(IDC_LIST, DLSZ_SIZE_X|DLSZ_SIZE_Y)
41        DLGRESIZE_CONTROL(IDCANCEL, DLSZ_MOVE_Y)    
42    END_DLGRESIZE_MAP()
43
44    BEGIN_MSG_MAP(CProgressDlg)
45        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
46        MESSAGE_HANDLER(WM_CLOSE, OnClose)
47        MESSAGE_HANDLER(WM_TIMER, OnTimer)        
48        COMMAND_ID_HANDLER(IDCANCEL, OnCancel)    
49        COMMAND_ID_HANDLER(ID_MENU1_COPYSEL, OnCopySel)
50        COMMAND_ID_HANDLER(ID_MENU1_COPYLOG, OnCopyLog)
51        NOTIFY_HANDLER(IDC_LIST, NM_RCLICK, OnListRClick)
52
53        CHAIN_MSG_MAP(CDialogResize<CProgressDlg>)
54    END_MSG_MAP()
55
56    // Handler prototypes (uncomment arguments if needed):
57    //	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
58    //	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
59    //	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
60
61    LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
62    LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
63    LRESULT OnTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
64    LRESULT OnListRClick(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/);
65    LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);  
66    LRESULT OnCopySel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);  
67    LRESULT OnCopyLog(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);  
68
69	// Displays the dialog and starts the timer.
70    void Start(BOOL bCollectInfo, BOOL bMakeVisible=TRUE);
71
72	// Stops the timer.
73    void Stop();
74
75	// Closes the dialog.
76    void CloseDialog(int nVal);
77
78	// This method places the data to clipboard.
79    int SetClipboard(CString& sData);
80
81	// Internal variables.
82    ActionOnCancel m_ActionOnCancel;  // What to do on cancel.
83    ActionOnCancel m_ActionOnClose;   // What to do on close.
84};
85
86