win32dialog.cpp

来自「这是VCF框架的代码」· C++ 代码 · 共 689 行 · 第 1/2 页

CPP
689
字号
	HWND activeWnd = GetActiveWindow();	//if ( !IsWindow ( activeWnd ) ) {		Win32ToolKit* toolkit = (Win32ToolKit*)UIToolkit::internal_getDefaultUIToolkit();		/**		JC - I commented this line out as it was creating a 		new entry in the start bar for the window. I do not think that is		correct behaviour. In addition, it would not return focus to the 		window that called it. Again I think this is incorrect behaviour		*/		//activeWnd = toolkit->getDummyParent();	//}	String tmp = caption;	if ( tmp == "" ){		TCHAR modFilename[MAX_PATH];		memset(modFilename, 0, sizeof(modFilename) );		GetModuleFileName( GetModuleHandle(NULL), modFilename, MAX_PATH );		tmp = modFilename;		FilePath fp = tmp;		tmp = fp.getBaseName(true);	}	int returnVal = 0;	if ( System::isUnicodeEnabled() ) {		returnVal = ::MessageBoxW( activeWnd, message.c_str(), tmp.c_str(), mbStyle );	}	else {		returnVal = ::MessageBoxA( activeWnd, message.ansi_c_str(), tmp.ansi_c_str(), mbStyle );	}	switch ( returnVal ){		case IDABORT:{			result = UIToolkit::mrAbort;		}		break;		case IDCANCEL:{			result = UIToolkit::mrCancel;		}		break;		/*		case IDCONTINUE:{		}		break;		*/		case IDIGNORE:{			result = UIToolkit::mrIgnore;		}		break;		case IDNO:{			result = UIToolkit::mrNo;		}		break;		case IDOK:{			result = UIToolkit::mrOK;		}		break;		case IDRETRY:{			result = UIToolkit::mrRetry;		}		break;		/*		case IDTRYAGAIN:{		}		break;		*/		case IDYES:{			result = UIToolkit::mrYes;		}		break;	}	return result;}DWORD Win32Dialog::generateStyleForSetParent(VCF::Control* parent){	DWORD result = ::GetWindowLong( hwnd_, GWL_STYLE );	if ( NULL == parent ) {		if ( !peerControl_->isDesigning() ) {			result &= ~WS_CHILD;			result |= WS_POPUP;		}	}	else {		Frame* frame = (Frame*)peerControl_;		if ( frame->allowFrameAsChildControl() ) {			result &= ~WS_POPUP;			result |= WS_CHILD;			result |= DS_MODALFRAME | DS_3DLOOK;		}			}	return result;}/***CVS Log info*$Log$*Revision 1.7  2006/04/07 02:35:26  ddiego*initial checkin of merge from 0.6.9 dev branch.**Revision 1.6.2.2  2006/03/16 03:23:11  ddiego*fixes some font change notification issues in win32 peers.**Revision 1.6.2.1  2005/09/18 22:54:47  ddiego*fixed some minor bugs in vffinput stream and parser class.**Revision 1.6  2005/07/09 23:14:57  ddiego*merging in changes from devmain-0-6-7 branch.**Revision 1.5  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.4.2.7  2005/06/07 21:16:24  marcelloptr*added Dialog::msQuestion**Revision 1.4.2.6  2005/05/05 12:42:26  ddiego*this adds initial support for run loops,*fixes to some bugs in the win32 control peers, some fixes to the win32 edit*changes to teh etxt model so that notification of text change is more*appropriate.**Revision 1.4.2.5  2005/04/20 02:26:00  ddiego*fixes for single line text and formatting problems in text window creation.**Revision 1.4.2.4  2005/04/09 17:20:36  marcelloptr*bugfix [ 1179853 ] memory fixes around memset. Documentation. DocumentManager::saveAs and DocumentManager::reload**Revision 1.4.2.3  2005/02/16 05:09:31  ddiego*bunch o bug fixes and enhancements to the property editor and treelist control.**Revision 1.4.2.2  2005/02/10 20:13:02  ddiego*commented out a line of code that was causing a message dialog*to popup with a sepateate start bar window entry and non-modal behaviour.**Revision 1.4.2.1  2004/12/10 21:14:00  ddiego*fixed bug 1082362 App Icons do not appear.**Revision 1.4  2004/12/05 21:11:55  ddiego*dialog allowClose() fix in peer.**Revision 1.3  2004/12/01 04:31:39  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.2  2004/09/12 22:34:21  ddiego*fixed bug in handling window cleanup when exception thrown from constructor.**Revision 1.2.2.1  2004/09/06 18:33:43  ddiego*fixed some more transparent drawing issues**Revision 1.2  2004/08/07 02:49:10  ddiego*merged in the devmain-0-6-5 branch to stable**Revision 1.1.2.3  2004/07/18 14:45:18  ddiego*integrated Marcello's new File/Directory API changes into both*the FoundationKit and the ApplicationKit. Many, many thanks go out*to Marcello for a great job with this. This adds much better file searching*capabilities, with many options for how to use it and extend it in the*future.**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:20  ddiego*migration towards new directory structure**Revision 1.44.2.1  2004/04/21 02:17:25  ddiego*checking in change to FoundationKit, GraphicsKit and Application*Kit to support unicode in Win32**Revision 1.44  2004/04/03 16:09:31  ddiego*Found some more merge issues that needing resolving.**Revision 1.43  2003/12/18 05:16:01  ddiego*merge from devmain-0-6-2 branch into the stable branch**Revision 1.42.2.5  2003/10/13 21:28:41  ddiego*fiddles with the containers a bit - didn't fix anything :(**Revision 1.42.2.4  2003/09/03 22:52:49  marcelloptr*minor fixes**Revision 1.42.2.3  2003/09/03 01:42:05  ddiego*some minor fixes**Revision 1.42.2.2  2003/08/28 21:47:30  ddiego*added escape reponse...**Revision 1.42.2.1  2003/08/20 22:55:18  ddiego*got rid of some older methods for StringUtils, should be using the FilePath*class instead**Revision 1.42  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.41.2.5  2003/08/01 00:50:16  ddiego*added a fix for popup windows that also fixed a problem with the*ComboBoxControl drop down list disapearing.**Revision 1.41.2.4  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.41.2.3  2003/06/13 03:05:32  ddiego*bug fixes for*585238:	Modal dialog which makes a modal Dialog*585239:	Painting weirdness in a modal dialog*also some clean up of miscellaneous debug trace statements*and implemented task*79266 - change DebugInfo to be stack based**Revision 1.41.2.2  2003/06/13 00:02:12  ddiego*more xmake fixes for the new version*bug fixes for bugs*509004	Opening a modal Dialog causes flicker*also have tooltips working again**Revision 1.41.2.1  2003/05/27 04:45:33  ddiego*doing some code cleanup to fix some bugs in the way dialogs and popups*work in Win32 port. Cleaned up the ControlPeer and DialogPeer interfaces*a bit.**Revision 1.41  2003/05/17 20:37:35  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.40.2.2  2003/03/23 03:23:57  marcelloptr*3 empty lines at the end of the files**Revision 1.40.2.1  2003/03/12 03:12:28  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.40  2003/02/26 04:30:50  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.39.2.4  2003/02/24 05:42:19  ddiego*moved the code for the VariantData calss into it's own header*migrated to the new event style using Delegates instead of relying on*the ugly macros that we were using before - same functionality though*made sure everything still works and compiles, including neccessary*changes in the VCF Builder so that it creates code in the new style*This changes to teh new style of using Delegates completes task 58837**Revision 1.39.2.3  2003/01/08 00:19:52  marcelloptr*mispellings and newlines at the end of all source files**Revision 1.39.2.2  2002/12/27 23:04:52  marcelloptr*Improved macros for automatic import/export of libraries. - Warning fixes. - Other Minor Changes.**Revision 1.39.2.1  2002/12/02 00:38:35  ddiego*more fixes to get the ApplicationKit to compile under mingw. Everything now*compiles OK at this point.**Revision 1.39  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.38.10.2  2002/11/02 20:51:56  ddiego*fixed NT4 menu bug 533453 Disapearing menu items on WinNT 4*also added soem bug fixes for hte VCF Builder and some empty name*error checking in the Win32FileStream class**Revision 1.38.10.1  2002/10/08 04:16:57  ddiego*fixed a bug in the getClientBounds() that caused a stack overflow! DOH!*further additions to the TemplateNewClassDlg to sync the various file names*in the dialog to the lcass name**Revision 1.38  2002/05/09 03:10:44  ddiego*merged over code from development branch devmain-0-5-1a into the main CVS trunk**Revision 1.37  2002/03/21 04:01:01  ddiego*fixed [ 532894 ] bug using the Frame::setClientBounds()**Revision 1.36.4.2  2002/04/27 15:52:28  ddiego*Changed a bunch of files include and made it a bit faster and added better include*guards in the common headers**Revision 1.36.4.1  2002/04/08 20:55:30  zzack*changed include style**Revision 1.36  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.35  2002/01/30 22:12:47  ddiego*fixed the internals of default CommandButton::click() method*closes the dialog without relying on the WM_COMMAND message,*and responds to  vkEnter keyboards events more correctly, i.e.*the Doalog will automatically close now when you hit the enter key*and the button wil set the modal result of the dialogd**Revision 1.34  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 + -
显示快捷键?