📄 model.cpp
字号:
//Model.cpp/*Copyright 2000-2004 The VCF Project.Please see License.txt in the top level directorywhere you installed the VCF.*///Model.h#include "vcf/ApplicationKit/ApplicationKit.h"#include <algorithm>using namespace VCF;Model::Model(){ viewContainer_.initContainer(views_);}Model::~Model(){}void Model::addView( View* view ){ view->setViewModel( this ); std::vector<View*>::iterator found = std::find( views_.begin(), views_.end(), view ); if ( found == views_.end() ) { views_.push_back( view ); }}void Model::removeView( View* view ){ std::vector<View*>::iterator found = std::find( views_.begin(), views_.end(), view ); if ( found != views_.end() ) { views_.erase( found ); view->setViewModel( NULL ); }}void Model::updateAllViews(){ std::vector<View*>::iterator it = views_.begin(); while ( it != views_.end() ) { View* view = *it; view->updateView( this ); it++; }}/***CVS Log info*$Log$*Revision 1.3 2006/04/07 02:35:24 ddiego*initial checkin of merge from 0.6.9 dev branch.**Revision 1.2.6.1 2005/10/04 01:57:03 ddiego*fixed some miscellaneous issues, especially with model ownership.**Revision 1.2 2004/08/07 02:49:08 ddiego*merged in the devmain-0-6-5 branch to stable**Revision 1.1.2.2 2004/04/29 03:43:14 marcelloptr*reformatting of source files: macros and csvlog and copyright sections**Revision 1.1.2.1 2004/04/28 00:28:18 ddiego*migration towards new directory structure**Revision 1.7 2003/08/09 02:56:45 ddiego*merge over from the devmain-0-6-1 branch*Changes*Features:*-Added additional implementation to better support the MVC architecture in*the VCF**-Added a Document/View architecure that is similar to MFC's or NextSteps's*Doc/View architectures**-Integrated the Anti Grain Graphics library into the GraphicsKit. There is*now basic support for it in terms of drawing vector shapes*(fills and strokes). Image support will come in the next release**-Added several documented graphics tutorials**Bugfixes:**[ 775744 ] wrong buttons on a dialog*[ 585239 ] Painting weirdness in a modal dialog ?*[ 585238 ] Modal dialog which makes a modal Dialog*[ 509004 ] Opening a modal Dialog causes flicker*[ 524878 ] onDropped not called for MLTcontrol**Plus an issue with some focus and getting the right popup window to activate*has also been fixed**Revision 1.6.2.3 2003/08/08 21:40:27 ddiego*little fix in constructor (it was missing! DOH!)**Revision 1.6.2.2 2003/08/07 21:44:05 ddiego*minor change to the Win32 reg peer (allows "/" instead of "\")*added a getViews() method to Model class**Revision 1.6.2.1 2003/07/06 01:20:29 ddiego*added basic Document/View classes. These are based on the existing MVC*architecture already present in the framework already, and exapnd on the*existing functionality. Many of the ideas were influenced by the NeXT/Cocoa's*Document/View architecture. Some of the new features are:* automatic creation and connection of the various parts including the* Document, view and Window.* Automatic default menu items, to ensure standard UI conformance. The menu* items are merged with an existing ones.* Automatic clipboard support in the form of cut/copy/paste and connecting this* directly to the current document* Support for Undo/Redo item as well, including default menu item validation* Default support for opening and saving documents, including presenting the* correct Dialogs to the User, and properly filling the default data, based* on the documents data.* Support for multiple document types* Support for differnt Document Interface policies. Currently we support* SDI (Single Document Interface) and MDI (Multiple Document Interface)**Revision 1.6 2003/05/17 20:37:49 ddiego*this is the checkin for the 0.6.1 release - represents the merge over from*the devmain-0-6-0 branch plus a few minor bug fixes**Revision 1.5.2.1 2003/03/12 03:13:15 ddiego*switched all member variable that used the "m_"<name> prefix to* <name>"_" suffix nameing standard.*Also changed all vcf builder files to accomadate this.*Changes were made to the Stream classes to NOT multiple inheritance and to*be a little more correct. Changes include breaking the FileStream into two*distinct classes, one for input and one for output.**Revision 1.5 2003/02/26 04:30:56 ddiego*merge of code in the devmain-0-5-9 branch into the current tree.*most additions are in the area of the current linux port, but the major*addition to this release is the addition of a Condition class (currently*still under development) and the change over to using the Delegate class*exclusively from the older event handler macros.**Revision 1.4.14.1 2003/01/08 00:20:00 marcelloptr*mispellings and newlines at the end of all source files**Revision 1.4 2002/03/20 02:46:54 ddiego*fixes an issue with with changes to an items state not correctly being reflected in the*TreeListControl*Also makes another adjustment to the scroll positioning when collapsing nodes**Revision 1.3 2002/01/24 01:46:50 ddiego*added a cvs "log" comment to the top of all files in vcf/src and vcf/include*to facilitate change tracking**/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -