Click here to Skip to main content
13,771,078 members
Click here to Skip to main content

Stats

81.3K views
1.1K downloads
49 bookmarked
Posted 24 Nov 2008
Licenced CPOL

The SBJ MVC Framework - The Model, from Abstraction to Realization

, 20 Mar 2009
A Model-View-Controller Framework that integrates with the MFC Doc/View architecture
XmlMvc2090.dll
Shapes.exe
SbjCore2090.dll
Shapes
Data
res
buttons.bmp
filelarge.bmp
filesmall.bmp
filesmall.png
main.bmp
Shapes.ico
ShapesDoc.ico
Toolbar.bmp
Toolbar256.bmp
treeimages.bmp
vssver.scc
Write - Copy.png
Write.png
Write1.png
writelarge.bmp
writesmall - Copy.bmp
writesmall - Copy.png
writesmall.bmp
writesmall.png
Shapes.vcproj
XmlMvc
res
vssver.scc
XmlMvc.vcproj
SbjCore
Registry.H
res
bigcat.ico
main.bmp
properties.bmp
properties_hc.bmp
properties_wnd_hc.ico
vssver.scc
SbjCore.vcproj
CommonSettings.vsprops
CommonAppDebugSettings.vsprops
CommonAppReleaseSettings.vsprops
CommonDLLDebugSettings.vsprops
CommonDLLReleaseSettings.vsprops
//------------------------------------------------------------------------------
// $Workfile: WndController.h $
// $Header: /SbjDev/SbjCore/WndController.h 4     10/14/08 1:12p Steve $
//
//	Copyright � 2008 SbjCat
// All rights reserved.
//
//
// *** Authors ***
//	 Steve Johnson
//
// $Revision: 4 $
//
//-----------------------------------------------------------------------------

#pragma once

#include "CmdTargetController.h"

namespace SbjCore
{
	namespace Mvc
	{
		struct WndControllerImpl;

		/** 

		The WndController class provides message management for 
		ControlledWndT classes. It is derived from CmdTargetController 
		and adds handling of non-CmdMsg Windows messages (WndMsgs).  
		For information on how message handling differs in the Mvc 
		framework from that in the MFC framework, see the Mvc overview. 

		When WndMsgs are received by the ControlledWndT they are
		first routed to its WndController so that the WndMsgHandlers 
		maintained in the handler map of its base Controller class can have
		an opportunity to handle the message before the default CWnd 
		MFC style message processing.		

		*/
		class AFX_EXT_CLASS WndController :	public CmdTargetController
		{
			DECLARE_DYNCREATE(WndController)
		public:
			WndController();
			
			virtual ~WndController();
		
		public:		
			void SetWnd(CWnd* p);

			CWnd* GetWnd() const;

			SbjCore::Utils::Menu::ItemRange PrepareCtxMenu(CMenu& ctxMenu);
			
		public:			

			BOOL HandleWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
			
			bool CallDefaultFirst(UINT message);
			
		protected:
			virtual SbjCore::Utils::Menu::ItemRange OnPrepareCtxMenu(CMenu& ctxMenu);

		private:
			virtual bool OnRoutCmdMsg(UINT nID,		
				int nCode,							
				void* pExtra,						
				AFX_CMDHANDLERINFO* pHandlerInfo);	

		private:
			struct WndControllerImpl* const m_pImpl;
		};
		
		
	}
}

//*** Modification History ***
// $Log: /SbjDev/SbjCore/WndController.h $
// 
// 4     10/14/08 1:12p Steve
// Implemented Deletes

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

SBJ
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06-2016 | 2.8.181119.1 | Last Updated 20 Mar 2009
Article Copyright 2008 by SBJ
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid