Test Purpose: Zoom in on the editor to reduce performance testing.
Test resources: a BMW.
Test result: good.
Implementation method: By calling the locally saved BMW file, the word-by-line display in the editor, and Zoom in and zoom out. Color-handle different symbols.
1. bmw File
,... ,(((( / `-.-' ))) ;' `"'"'""(((( ( ((( / ((( )) | | (( | . ' | )) \ _ ' t ,. ') ( | y;--,-"'"-.\ \ )/ ./ )/ ' \ |. / ( ( / /' || \\ //'| || \\ _//'|| || )) | _/ || \_\ |_/ || "" " \_" " $-lookbmw*/}
2. C + + implementation
A First loads the BMW file, which is displayed in the editor verbatim by line.
CStdioFile Lookbmwfile; CString Bwmfilepath = Pack::getconfiginifile (_t ("Glbbmwfilepath")); Lookbmwfile.open (Bwmfilepath, Cfile::moderead | Cfile::typetext) {MessageBox (_t ("Loading files Error" + Bwmfilepath + ", please reinstall the software ...")); CString Strbmwtxt; BOOL Bwmtxtstart = False;while (lookbmwfile.readstring (strbmwtxt)) {if (Bwmtxtstart) {if (Strbmwtxt = = _t ("$-lookbmw*/}" ) {break;} CString str;for (int i=0; i<strbmwtxt.getlength (); i++) {str = (strbmwtxt[i]); Sendmessages (Sci_addtext, 1, (LPARAM) (LPCSTR) str); UpdateWindow (); Sleep (15);} str = _t ("\ n"); Sendmessages (Sci_addtext, 1, (LPARAM) (LPCSTR) str); if (strbmwtxt.trim () = = _t ("{/*LOOKBMW")) {Bwmtxtstart = TRUE;}} Lookbmwfile.close ();
B Set the magnification multiplier, and zoom in multiples, loop 3 times.
int J=3;int I=5;while (j--) {while (i--) {sendmessages (sci_zoomin, 0, 0); UpdateWindow (); Sleep (70);} I=15;while (i--) {sendmessages (sci_zoomout, 0, 0); UpdateWindow (); Sleep (70);} i=15;} I=10;while (i--) {sendmessages (sci_zoomin, 0, 0); UpdateWindow (); Sleep (70);}
Text/Shing Original reprint please indicate the source http://blog.csdn.net/yxstars/article/details/39205345
BMW Test (c + + implementation)