All pastes #2065568 Raw Edit

Mine

public cpp v1 · immutable
#2065568 ·published 2011-05-20 11:32 UTC
rendered paste body
voiddailyreminder::SwitchForm(int formType){	if (activeFormType == formType)		return;	BaseForm * form = 0;	switch (formType)	{	case AppGlobals::FORM_MAIN:			form = new MainForm();			break;	case AppGlobals::FORM_ADD:			form = new AddForm();			break;	case AppGlobals::FORM_EDIT:			form = new EditForm();			break;	default:		AppAssert(false);	}	form->Initialize();	Frame *pFrame = GetAppFrame()->GetFrame();	// FIXME: we should delete the previously active form somewhere as well,	// 		  but this lets the app crash.	if (activeForm)		pFrame->RemoveControl(*activeForm);	pFrame->AddControl(*form);	pFrame->SetCurrentForm(*form);	form->Draw();	form->Show();	activeForm = form;	activeFormType = formType;}