uitoolkit.cpp
来自「这是VCF框架的代码」· C++ 代码 · 共 1,812 行 · 第 1/4 页
CPP
1,812 行
std::vector<Component*>::iterator found = std::find( componentsToUpdate_.begin(), componentsToUpdate_.end(), component );
if ( found == componentsToUpdate_.end() ) {
componentsToUpdate_.push_back( component );
}
}
void UIToolkit::internal_removeFromUpdateList( Component* component )
{
std::vector<Component*>::iterator found = std::find( componentsToUpdate_.begin(), componentsToUpdate_.end(), component );
if ( found != componentsToUpdate_.end() ) {
componentsToUpdate_.erase( found );
}
}
void UIToolkit::internal_setUpdateTimerSpeed( const unsigned long& milliseconds )
{
EventHandler* ev = getEventHandler( "UIToolkit::onUpdateComponentsTimer" );
if ( NULL != ev ) {
internal_unregisterTimerHandler( ev );
}
if ( NULL == ev ) {
ev = new TimerEventHandler<UIToolkit>( this, &UIToolkit::onUpdateComponentsTimer, "UIToolkit::onUpdateComponentsTimer" );
}
internal_registerTimerHandler( this, ev, milliseconds );
}
void UIToolkit::onUpdateComponentsTimer( TimerEvent* e )
{
std::vector<Component*>::iterator it = componentsToUpdate_.begin();
while ( it != componentsToUpdate_.end() ) {
Component* component = *it;
Event updateEvent( this, Component::COMPONENT_NEEDS_UPDATING );
component->handleEvent( &updateEvent );
it ++;
}
}
void UIToolkit::internal_idleTime()
{
Frame* frm = Frame::getActiveFrame();
if ( NULL != frm ) {
if ( frm->getVisible() ) {
std::vector<Component*>::iterator it = componentsToUpdate_.begin();
while ( it != componentsToUpdate_.end() ) {
Component* component = *it;
Event updateEvent( this, Component::COMPONENT_NEEDS_UPDATING );
component->handleEvent( &updateEvent );
it ++;
}
}
}
}
/**
*CVS Log info
*$Log$
*Revision 1.6 2006/04/07 02:35:26 ddiego
*initial checkin of merge from 0.6.9 dev branch.
*
*Revision 1.5.2.16 2006/04/05 03:35:58 ddiego
*post cvs crash updates.
*
*Revision 1.5.2.15 2006/03/28 04:10:17 ddiego
*tweaked some function names for the update process.
*
*Revision 1.5.2.14 2006/03/28 04:04:36 ddiego
*added a slight adjustment to idle message handling. Component
*updating is now handled there instead of a timer.
*
*Revision 1.5.2.13 2006/03/17 03:08:11 ddiego
*updated osx code to latest changes.
*
*Revision 1.5.2.12 2006/03/06 03:48:30 ddiego
*more docs, plus update add-ins, plus migrated HTML browser code to a new kit called HTMLKit.
*
*Revision 1.5.2.11 2006/03/01 04:34:56 ddiego
*fixed tab display to use themes api.
*
*Revision 1.5.2.10 2006/02/23 05:54:23 ddiego
*some html help integration fixes and new features. context sensitive help is finished now.
*
*Revision 1.5.2.9 2006/02/21 04:32:51 ddiego
*comitting moer changes to theme code, progress bars, sliders and tab pages.
*
*Revision 1.5.2.8 2005/11/10 04:43:27 ddiego
*updated the osx build so that it
*compiles again on xcode 1.5. this applies to the foundationkit and graphicskit.
*
*Revision 1.5.2.7 2005/11/07 00:10:14 ddiego
*fixed two memory leaks that fraggle found.
*
*Revision 1.5.2.6 2005/10/07 16:41:21 kiklop74
*Added support for building ApplicationKit with Borland Free Compiler
*
*Revision 1.5.2.5 2005/09/14 01:50:07 ddiego
*minor adjustment to control for enable setting. and registered
*more proeprty editors.
*
*Revision 1.5.2.4 2005/09/12 03:47:04 ddiego
*more prop editor updates.
*
*Revision 1.5.2.3 2005/09/07 20:24:48 ddiego
*added some more help support.
*
*Revision 1.5.2.2 2005/09/07 04:19:54 ddiego
*filled in initial code for help support.
*
*Revision 1.5.2.1 2005/08/28 05:14:17 ddiego
*small changes to component editor class.
*
*Revision 1.5 2005/07/09 23:14:56 ddiego
*merging in changes from devmain-0-6-7 branch.
*
*Revision 1.4 2005/01/02 03:04:21 ddiego
*merged over some of the changes from the dev branch because they're important resoource loading bug fixes. Also fixes a few other bugs as well.
*
*Revision 1.3.2.17 2005/06/08 03:27:26 ddiego
*fix for popup menus
*
*Revision 1.3.2.16 2005/06/06 02:34:06 ddiego
*menu changes to better support win32 and osx.
*
*Revision 1.3.2.15 2005/06/02 16:12:16 marcelloptr
*some more documentation
*
*Revision 1.3.2.14 2005/05/15 23:17:38 ddiego
*fixes for better accelerator handling, and various fixes in hwo the text model works.
*
*Revision 1.3.2.13 2005/05/04 00:36:17 marcelloptr
*the accelerator checks first for an unitialized menu item associated to an action... fixed
*
*Revision 1.3.2.12 2005/04/25 00:11:57 ddiego
*added more advanced text support. fixed some memory leaks. fixed some other miscellaneous things as well.
*
*Revision 1.3.2.11 2005/04/20 02:26:00 ddiego
*fixes for single line text and formatting problems in text window creation.
*
*Revision 1.3.2.10 2005/03/27 05:25:13 ddiego
*added more fixes to accelerator handling.
*
*Revision 1.3.2.9 2005/03/21 17:30:38 marcelloptr
*added a comment
*
*Revision 1.3.2.8 2005/03/15 05:29:01 ddiego
*makes the accelerator check logic a bit smarter and also changes
*teh way menu items test to check whether or not they are enabled.
*
*Revision 1.3.2.7 2005/03/14 04:17:24 ddiego
*adds a fix plus better handling of accelerator keys, ands auto menu title for the accelerator key data.
*
*Revision 1.3.2.6 2005/03/09 05:11:19 ddiego
*fixed property editor class.
*
*Revision 1.3.2.5 2005/03/06 22:50:59 ddiego
*overhaul of RTTI macros. this includes changes to various examples to accommadate the new changes.
*
*Revision 1.3.2.4 2005/02/28 04:51:56 ddiego
*fixed issue in handling componenent state and events when in design mode
*
*Revision 1.3.2.3 2005/02/21 16:20:02 ddiego
*minor changes to various things, property editors, and tree list control.
*
*Revision 1.3.2.2 2004/12/19 07:09:18 ddiego
*more modifications to better handle resource bundles, especially
*if they are part of a LibraryApplication instance.
*
*Revision 1.3.2.1 2004/12/19 04:04:59 ddiego
*made modifications to methods that return a handle type. Introduced
*a new typedef for handles, that is a pointer, as opposed to a 32bit int,
*which was causing a problem for 64bit compiles.
*
*Revision 1.3 2004/12/01 04:31:38 ddiego
*merged over devmain-0-6-6 code. Marcello did a kick ass job
*of fixing a nasty bug (1074768VCF application slows down modal dialogs.)
*that he found. Many, many thanks for this Marcello.
*
*Revision 1.2.2.4 2004/09/21 23:41:24 ddiego
*made some big changes to how the base list, tree, text, table, and tab models are laid out. They are not just plain interfaces. The actual
*concrete implementations of them now derive from BOTH Model and the specific
*tree, table, etc model interface.
*Also made some fixes to the way the text input is handled for a text control.
*We now process on a character by character basis and modify the model one
*character at a time. Previously we were just using brute force and setting
*the whole models text. This is more efficent, though its also more complex.
*
*Revision 1.2.2.3 2004/08/31 04:12:12 ddiego
*cleaned up the GraphicsContext class - made more pervasive use
*of transformation matrix. Added common print dialog class. Fleshed out
*printing example more.
*
*Revision 1.2.2.2 2004/08/19 03:22:54 ddiego
*updates so new system tray code compiles
*
*Revision 1.2.2.1 2004/08/18 21:20:24 ddiego
*added initial system tray code for win32
*
*Revision 1.2 2004/08/07 02:49:10 ddiego
*merged in the devmain-0-6-5 branch to stable
*
*Revision 1.1.2.4 2004/05/23 14:11:59 ddiego
*osx updates
*
*Revision 1.1.2.3 2004/05/06 02:56:35 ddiego
*checking in OSX updates
*
*Revision 1.1.2.2 2004/04/29 03:43:15 marcelloptr
*reformatting of source files: macros and csvlog and copyright sections
*
*Revision 1.1.2.1 2004/04/28 00:28:19 ddiego
*migration towards new directory structure
*
*Revision 1.58 2004/04/03 15:48:50 ddiego
*Merged over code from the 0-6-3 branch.
*
*Revision 1.57 2004/01/20 01:54:57 ddiego
*merged some more changes from dev branch, primarily changes to
*teh RTTI API so that we now process enum sets correctly (i.e. a long
*that is a mask made of enum values).
*
*Revision 1.56.2.5 2004/03/21 19:44:58 marcelloptr
*improvements on TextModel and getCRCount
*
*Revision 1.56.2.4 2004/03/21 00:39:24 ddiego
*merged vc7.1 changes into dev branch
*
*Revision 1.56.2.3 2004/03/18 04:19:57 ddiego
*some minor stuff for tables
*
*Revision 1.56.2.2 2004/02/24 01:42:45 ddiego
*initial OSX ApplicationKit port checkin
*
*Revision 1.56.2.1 2004/01/18 04:52:46 ddiego
*Added a new EnumSet class that handles manipulating unsigned longs
*as a mask of bits. Adds support for reading in the enum value names and
*ORing them together to form the complete mask value. Also made
*mods to the VFFOutput and VFFInput stream classes so that that the []
*property is correctly read and written
*
*Revision 1.56 2003/12/18 05:16:02 ddiego
*merge from devmain-0-6-2 branch into the stable branch
*
*Revision 1.55.2.6 2003/12/08 05:05:28 ddiego
*added a bunch more documentation to classes, and added support for new doc
*keywords (@delegates, @del, @delegate, @event, and @eventtype). This
*makes it easier to see at a glance what events a class fires off.
*Added finishing touches for the Action implementation and have a partially
*complete example for this checked in.
*
*Revision 1.55.2.5 2003/10/31 05:06:38 ddiego
*added toolbar impl
*
*Revision 1.55.2.4 2003/10/04 20:14:59 ddiego
*aaddec changes to support compiling on GCC 3.3.1, which is much more
*picky than some of the previous versions.
*
*Revision 1.55.2.3 2003/09/12 00:09:31 ddiego
*added better tabbing behaviour - fixed an earlier bug.
*Code is easier to understand and it simplified the implementation
*a bit as well
*Moved around the RTTI definitions for various Appkit classes to a
*single inline and stripped them from the various class headers
*
*Revision 1.55.2.2 2003/08/28 21:47:30 ddiego
*added escape reponse...
*
*Revision 1.55.2.1 2003/08/18 19:52:39 ddiego
*changed the Container from being a class you derive from to a separate
*intance that is created and assigned dynamically to any Control.
*
*Revision 1.55 2003/08/09 02:56:46 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.54.2.3 2003/08/02 22:36:20 marcelloptr
*use of std::map more conforming to standard
*
*Revision 1.54.2.2 2003/07/24 04:10:45 ddiego
*added fixes for the following tasks:
*Task #82279 ApplicationKit: add static methods to singleton objects
*Task #82277 FoundationKit: add static methods to singleton objects
*this required a bunch of changes in terms of getting rid of older style code
*
*Revision 1.54.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.54 2003/05/17 20:37:42 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.53.2.3 2003/04/17 04:29:51 ddiego
*updated scintilla, added gtk support for the application kit, with stubs
*for the basic peers.
*
*Revision 1.53.2.2 2003/03/23 03:23:59 marcelloptr
*3 empty lines at the end of the files
*
*Revision 1.53.2.1 2003/03/12 03:12:50 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.53 2003/02/26 04:30:53 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.52.2.5 2003/01/08 00:19:55 marcelloptr
*mispellings and newlines at the end of all source files
*
*Revision 1.52.2.4 2002/12/27 23:04:57 marcelloptr
*Improved macros for automatic import/export of libraries. - Warning fixes. - Other Minor Changes.
*
*Revision 1.52.2.3 2002/12/26 04:32:12 ddiego
*added basic peer implementation to ApplicationKit so that we can now create
*a VERY simple application and terminate correctly. Woohoo! First steps
*of running on linux!
*
*Revision 1.52.2.2 2002/12/25 22:38:00 ddiego
*more stupid fixes to get rid of the damn gcc no newline warning...grrr...
*
*Revision 1.52.2.1 2002/12/25 22:06:32 ddiego
*whole bunch of little changes to the header files used by the ApplicationKit
*to get rid of no newline warnings by gcc.
*fixes to various event handlers in the ApplicationKit to compile with gcc
*since gcc does not like a member function pointer without the "&"
*addressof operator.
*Added initial file for the X11 UIToolkit implementation
*
*Revision 1.52 2002/11/18 00:46:09 ddiego
*this is the merge over of all the bug fixes and features (mostly
*VCF Builder stuff) from the devmain-0-5-8 branch
*
*Revision 1.51.4.2 2002/09/28 02:37:38 ddiego
*fixed up the radiobox and checkbox, label and header controls to properly
*take advantage of default heights from the UIMetricsManager
*fixed the default height for radioboxes and checkboxes in Win32 so that they are
*10 dialog units high - added the neccessary conversion code from dialog
*units to pixels
*
*Revision 1.51.4.1 2002/09/27 23:38:36 ddiego
*added support for geting various layout information
*added support for drawing various graphics UI primitives like scroll buttons
*tabs, tab pages, etc, partially to have this support in place for use
*in MacOSX.
*Also added scrolling buttons to TabbedPages, this fixes task 56652 in the
*ApplicationKit list
*
*Revision 1.51 2002/09/12 03:26:06 ddiego
*merged over the changes from the devmain-0-5-5b branch
*
*Revision 1.50.6.2 2002/07/26 04:24:29 ddiego
*added more support for properly querying modified document, and removing the
*documents from the doc tab pages, made some changes in TabbedPages to support
*this as well
*
*Revision 1.50.6.1 2002/07/02 05:35:11 marcelloptr
*fixes for vc6, vc7, separated builds, automatic library selection, stlport
*
*Revision 1.50 2002/05/09 03:10:45 ddiego
*merged over code from development branch devmain-0-5-1a into the main CVS trunk
*
*Revision 1.49 2002/03/31 18:21:26 ddiego
*fixed memory leak of accelerators in UIToolkit::removeAcceleratorKeysForControl()
*
*Revision 1.48 2002/03/19 01:39:56 ddiego
*minor changes to ComboBoxControl to fix tabbing error with arrow keys
*fixes bug 531678 Bad behaviour of arrow keys in Combobox
*
*Revision 1.47.4.2 2002/04/27 15:52:32 ddiego
*Changed a bunch of files include and made it a bit faster and added better include
*guards in the common headers
*
*Revision 1.47.4.1 2002/04/08 20:55:30 zzack
*changed include style
*
*Revision 1.47 2002/03/13 01:26:34 ddiego
*fixes to the TreeListControl
*plus fix for bug [ 529012 ] typecombo crash in the ComboBoxControl. Caused
*by not checking a null pointer in the UIToolkits' methods for getting the
*next and previous control
*
*Revision 1.46 2002/02/20 04:07:59 ddiego
*consolidated event handling code a bit
*introduced a virtual handleEvent() method to Component
*clean up some of the event constants, so they are now localized in the
*appropriate control classes.
*
*Revision 1.45 2002/02/07 04:38:55 ddiego
*fixes to Win32Edit, which include problems with setting text, and a bug that
*caused it to crash in Win 98. All textControls now default to the "EDIT"
*window class unles they are multiline, in which case an attempt is made to
*load the richedit control, and if that fails then the EDIT class is used
*Removed responding to WM_COMMAND messages
*in the default parent in the Win32Toolkit, also to fix the Win32Edit crash in 9.x
*
*Revision 1.44 2002/01/26 15:11:09 ddiego
*Default button now working
*
*Revision 1.43 2002/01/24 01:46:49 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 + =
减小字号Ctrl + -
显示快捷键?