Click here to Skip to main content
15,894,410 members
Articles / Desktop Programming / MFC

A Logging Listbox Control

Rate me:
Please Sign up or sign in to vote.
4.80/5 (9 votes)
16 May 2000 176.6K   3K   85  
Learn how to use printf-like functionality to debug your GUI applications.
#if !defined(AFX_LOGWINDOWVIEW_H__319C7EEE_D94C_11D3_9FE9_006067718D04__INCLUDED_)
#define AFX_LOGWINDOWVIEW_H__319C7EEE_D94C_11D3_9FE9_006067718D04__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LogWindowView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CLogWindowView form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

class CLogWindowView : public CFormView
{
protected:
	CLogWindowView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CLogWindowView)

// Form Data
public:
	//{{AFX_DATA(CLogWindowView)
	enum { IDD = IDD_FORMLOG };
	CButton	c_ToDisk;
	CButton	c_SetLimit;
	CButton	c_ToTop;
	CButton	c_PrevError;
	CButton	c_NextError;
	CTraceList	c_Log;
	CEdit	c_Limit;
	CButton	c_EnableLimit;
	CButton	c_ToBottom;
	//}}AFX_DATA

// Attributes
public:

// Operations
public:
        int AddString(TraceEvent * event);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLogWindowView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
        void updateControls();                                       // *** JMN
        void ResizeLog();                                            // *** JMN
	virtual ~CLogWindowView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(CLogWindowView)
	afx_msg LRESULT OnTraceChange(WPARAM, LPARAM);
	afx_msg void OnFileSave();
	afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
	afx_msg void OnFileSaveAs();
	afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
	afx_msg void OnFilePrint();
	afx_msg void OnNext();
	afx_msg void OnNote();
	afx_msg void OnPrev();
	afx_msg void OnTop();
	afx_msg void OnEnableLimit();
	afx_msg void OnBottom();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSetlimit();
	afx_msg void OnSelchangeLog();
	afx_msg void OnUpdateLogwindow(CCmdUI* pCmdUI);
	afx_msg void OnEditCopy();
	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnEditCut();
	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
	afx_msg void OnEditClearAll();
	afx_msg void OnUpdateEditClearAll(CCmdUI* pCmdUI);
	afx_msg void OnEditClear();
	afx_msg void OnUpdateEditClear(CCmdUI* pCmdUI);
	afx_msg void OnTodisk();
	afx_msg void OnEditSelectAll();
	afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
	afx_msg void OnUpdateFilePrint(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LOGWINDOWVIEW_H__319C7EEE_D94C_11D3_9FE9_006067718D04__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Retired
United States United States
PhD, Computer Science, Carnegie Mellon University, 1975
Certificate in Forensic Science and the Law, Duquesne University, 2008

Co-Author, [i]Win32 Programming[/i]

Comments and Discussions