Click here to Skip to main content
15,891,905 members
Articles / Desktop Programming / WTL

The Psychology of a WTL Project: Lowercase Cause (a typing program)

Rate me:
Please Sign up or sign in to vote.
4.99/5 (32 votes)
20 Apr 200524 min read 63.9K   2.7K   25  
A psychological journey into a project crafted from start to finish.
#pragma once
#include "stdafx.h"
#include "resource.h"
#include "HighScoresListCtrl.h"

class CHighScoresDlg : public CDialogImpl<CHighScoresDlg>, 
					   public CDialogResize<CHighScoresDlg>
{
public:
	enum { IDD = DLG_HIGH_SCORES };

	BEGIN_MSG_MAP(CHighScoresDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		NOTIFY_HANDLER(TAB_PHRASES, TCN_SELCHANGE, OnTcnSelchangePhrases)
		CHAIN_MSG_MAP(CDialogResize<CHighScoresDlg>)
	END_MSG_MAP()

	BEGIN_DLGRESIZE_MAP(CHighScoresDlg)
		DLGRESIZE_CONTROL(TAB_PHRASES, DLSZ_SIZE_X | DLSZ_SIZE_Y)
	END_DLGRESIZE_MAP()

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnTcnSelchangePhrases(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);

	// general resizing code, CResizeDlg handles the tab control, we must 
	// handle the _lvwHighScores, mostly because the rows of tabs doesn't
	// have to be 1. it's also a convenient place to call 
	// CHighScoresListCtrl's ResizeColumns() 
	void SizeList();

	// sets the list's filter so that the entries are relative to the
	// tab selected
	void UpdateList();

private:
	CHighScoresListCtrl _lvwHighScores;
	CTabCtrl _tabFileList;
};

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions