Click here to Skip to main content
15,885,952 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.6K   2.7K   25  
A psychological journey into a project crafted from start to finish.
#include "StdAfx.h"
#include ".\newhighscoredlg.h"

LRESULT CNewHighScoreDlg::OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	EndDialog(1);
	return 0;
}

LRESULT CNewHighScoreDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// previous high score
	high_score current_hs = high_score_manager::get_current_high_score(_hs);
	if(!current_hs.is_null())
	{
		GetDlgItem(STC_PREVIOUS_HIGH_SCORE).SetWindowText(
			current_hs.get_string().c_str());
	}

	// score
	std::string score = _T(" ");
	score += hf::int_to_str(_hs.get_points());
	GetDlgItem(STC_SCORE).SetWindowText(score.c_str());

	// type
	GetDlgItem(STC_TYPE).SetWindowText(_hs.get_type_string().c_str());

	return TRUE;
}

LRESULT CNewHighScoreDlg::OnBnClickedOk(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	_hs.set_name(hf::get_window_text(GetDlgItem(ED_NAME)));
	EndDialog(0);
	return 0;
}

LRESULT CNewHighScoreDlg::OnBnClickedCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	EndDialog(1);
	return 0;
}

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