示例#1
0
View::View (Win::Dow win, Calculator & calc)
	: _calc (calc)
{
	Win::StatusBarMaker status (win, 10);
	_status.Init (status.Create ());
	// Create child windows
	Win::ListBoxMaker listBox1 (win, 11);
	_historyView.Init (listBox1.Create ());
	Win::ListBoxMaker listBox2 (win, 12);
	_memoryView.Init (listBox2.Create ());
	Win::EditMaker edit (win, 13);
	_edit.Init (edit.Create ());
	_edit.SubClass (&_editCtrl);

	Win::EditMaker result (win, 14);
	result.MakeReadOnly ();
	_result.Init (result.Create ());

	Font::OemFixed fixed;
	fixed.GetTextSize (_charWidth, _charHeight);
	_wValue = VALUE_CHARS * _charWidth;

	_historyView.SetFont (fixed);
	_memoryView.SetFont (fixed);
	_result.SetFont (fixed);
	_edit.SetFont (fixed);
}
示例#2
0
bool TopCtrl::OnCreate (Win::CreateData const * create, bool & success) throw ()
{
	Win::Dow::Handle win = GetWindow ();
	try
	{
		win.SetText ("Unit Test");
		Win::EditMaker editMaker (_h, 1);
		editMaker.Style () 
			<< Win::Edit::Style::MultiLine 
			<< Win::Edit::Style::AutoVScroll 
			<< Win::Style::Ex::ClientEdge
			<< Win::Style::AddVScrollBar;
		_output.Reset (editMaker.Create ());
		_watch.reset (new Watch (win));
		_timer.Attach (win);

		win.PostMsg (_initMsg);
		success = true;
	}
	catch (Win::Exception e)
	{
		TheOutput.Display (e);
		success = false;
	}
	catch (...)
	{
		Win::ClearError ();
		TheOutput.Display ("Initialization -- Unknown Error", Out::Error);
		success = false;
	}
	TheOutput.SetParent (win);
	_ready = true;
	return true;
}