°Ë±¦Êé¿â > ÎÄѧÆäËûµç×ÓÊé > CÓïÑÔʵÀý½Ì³Ì(PDF¸ñʽ) >

µÚ29²¿·Ö

CÓïÑÔʵÀý½Ì³Ì(PDF¸ñʽ)-µÚ29²¿·Ö

С˵£º CÓïÑÔʵÀý½Ì³Ì(PDF¸ñʽ) ×ÖÊý£º ÿҳ4000×Ö

°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡





¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡218¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

hLine¡£LoadBitmap£¨IDB_LINE£©£»¡¡¡¡



hCircle¡£LoadBitmap£¨IDB_CIRCLE£©£»¡¡¡¡



hRectangle¡£LoadBitmap£¨IDB_RECTANGLE£©£»¡¡¡¡



hText¡£LoadBitmap£¨IDB_TEXT£©£»¡¡¡¡



//¡¡¡£¡£¡£¡¡¡¡



£ý¡¡¡¡



¹¤×÷¼ä£¬´Ëʱ£¬ÏµÍ³¼ì²âµ½×ÊÔ´ÒѾ­ÔÚϵͳÍⲿ·¢Éú±ä»¯£¬Ñ¯ÎÊÊÇ·ñ¡¡

ÖØ×éÊý¾Ý¿â£¬Ñ¡ÔñÊÇ£¬ÎÒÃÇËùÐèÒªµÄ¾ÍÒѾ­È«²¿×¼±¸Íê±Ï¡£ÏÂÃæ¸ø³ö¡¡

ÕâÒ»±ä»¯Ç°ºóÎļþMenu¡£rcµÄ±ä»¯Çé¿ö¡£¡¡¡¡



//¸Ä±äÒÔÇ°£º¡¡¡¡



POPUP¡¡¡¨&Help¡¨¡¡¡¡



BEGIN¡¡¡¡



MENUITEM¡¡¡¨&About¡¡Menu¡£¡£¡£¡¨£»¡¡ID_APP_ABOUT¡¡¡¡



MENUITEM¡¡¡¨&I¡¡¡¯m¡¡Menu¡¡inserted¡¨£»¡¡ID_HELP_INSERT¡¡¡¡¡¡



//ÉÏÃæÕâÐдúÂëÎÒÃÇÔÚʵÏÖÁËÏûÏ¢Ó³Éäºó½«½«Æäɾ³ý¡¡¡¡



END¡¡¡¡



//¸Ä±äÒԺ󣺡¡¡¡



POPUP¡¡¡¨&Help¡¨¡¡¡¡



BEGIN¡¡¡¡



MENUITEM¡¡¡¨&About¡¡Menu¡£¡£¡£¡¨£»¡¡ID_APP_ABOUT¡¡¡¡



END¡¡¡¡



ͨ¹ýÒÔÉϵıȽÏÎÒÃDz»ÄÑ·¢ÏÖ£¬Ê¹ÓõڶþÖÖ·½Ê½½øÐÐÐÞ¸ÄÊDZȽϷ½±ã¡¡

µÄ¡£¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Í¼5¡£¡¡16¡¡ÏµÍ³²Ëµ¥¸Ä±äºóµÄÈÎÎñÌõ¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡219¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

ÏÂÃæÎÒÃǽ²Ò»ÏÂÓйØϵͳ²Ëµ¥µÄÏûÏ¢ÏìÓ¦ÎÊÌâ¡£Èçͼ5¡£16£¬ÔÚÎÒÃǸġ¡

±äϵͳ²Ëµ¥ºó£¬µ±ÔÚÈÎÎñÀ¸ÓÒµ¥»÷Êó±êʱ£¬µ¯³öµÄϵͳ²Ëµ¥¾ßÓÐÁËÓë¡¡

Ô­À´²»Í¬µÄÐÎʽ¡£¡¡¡¡



˳±ãÌáһϣ¬Èç¹ûÎÒÃDz»Ï£ÍûÓû§ÔÚ³ÌÐòÍⲿֱ½ÓÍ˳ö³ÌÐò£¬¸Ä±äϵ¡¡

ͳ²Ëµ¥¾ÍÊÇÕâ¸ö·½·¨µÄÒ»¸ö;¾¶¡££¨Èç¹û½«ÏµÍ³²Ëµ¥ÉèΪNULL£¬Óû§¡¡

¾ÍÖ»ÓнøÈëÓ¦ÓóÌÐò½øÐÐÑ¡ÔñÁË¡£µ±È»£¬³ý·ÇÕâÊDZØÒªµÄ£¬·ñÔò£¬²»¡¡

ҪǿÆÈÓû§¸Ä±äËûÃǵIJÙ×÷Ï°¹ß¡££©¡¡¡¡



Ê×ÏÈ£¬ÎÒÃDZØÐëÈ¡µÃϵͳ²Ëµ¥£¬Õâ¿ÉÒÔͨ¹ýµ÷ÓÃCWndÀàµÄÒ»¸ö³ÉÔ±º¯¡¡

ÊýGetSystemMenu£©´ïµ½¡£´Ëº¯ÊýµÄÔ­ÐÍΪ£º¡¡¡¡



CMenu¡¡*GetSystemMenu£¨BOOL¡¡bRevert£©¡¡const£»¡¡¡¡



ÔÚÒÔTRUE×÷ΪbRevertµÄÖµ½øÐе÷ÓÃʱ£¬»Ö¸´Ô­ÏµÍ³²Ëµ¥ÉèÖá£ÔÚ¸ü¡¡

¶àµÄÇé¿öÏ£¬ÎÒÃÇÒÔFALSE½øÐе÷Ó㬴ËʱÎÒÃÇ¿ÉÒÔ¶Ôϵͳ²Ëµ¥½øв¡¡

Ù×÷¡¡¡£µÇ£ÃÏ¢ÏìÓ£¿£¿/FONT¡·OnSysmandº¯Êý£¬¶øÇÒ£¬´ËÏûÏ¢Ïì¡¡

Ó¦º¯ÊýÊÇϵͳÉ趨µÄ£¬²»ÔÊÐí³ÌÐòÔ±ÁíÐÐÖ¸¶¨¡£¡¡¡¡



¡¡¡¡l¡¡×¢Ò⣺¡¡¡¡



¡¡¡¡l¡¡ÎÒÃÇ¿ÉÒÔͨ¹ýϵͳÌṩµÄSpy£«£«À´²é¿´ÏµÍ³²Ëµ¥µÄÏûÏ¢·¢Ëͼ°ÏìÓ¦¡¡

¡¡¡¡¡¡×´¿ö¡£ÖÁÓÚÏêϸµÄÇé¿ö£¬ÔÚÎÒÃÇËæºó¸ø³öÁËÏêϸµÄ½âÊÍ¡£Óë¸ÃÏû¡¡

¡¡¡¡¡¡Ï¢ÏàÓ¦µÄ´úÂ룬ÎÒÃǽ«ÓþßÓе×ÎƵÄÎÄ×Ö±ê³ö¡£¡¡¡¡



ÔÚ±¾ÕµÄ×îºó£»ÎÒÃDz»·ÁÀ´¿´¿´ÔõÑùÔÚ³ÌÐòÖÐʵÏÖÓÒ»÷Êó±êʱ³öÏֵġ¡

ÉÏÏÂÎIJ˵¥£»ÓëÇ°ÃæÎÒÃÇËùÓöµ½µÄÆäËûµ¯³öʽ²Ëµ¥ÔÚCmainFrameÖÐʵ¡¡

ÏÖ²»Í¬£»ÉÏÏÂÎIJ˵¥ÒªÔÚÀàCmenuViewÖÐʵÏÖ¡£´Ó±¾ÖÊÉÏÀ´Ëµ£¬ÊµÏÖÉÏ¡¡

ÏÂÎIJ˵¥Ê±·¢Ë͵ÄÏûÏ¢Óë±ê×¼µÄ²Ëµ¥ÏûÏ¢²¢Ã»ÓÐʲôÁ½Ñù£¬ËüÃǶ¼·¢¡¡

ËÍON_MANDÏûÏ¢¡£µ«ÊÇ£¬ÓÉÓÚÉÏÏÂÎIJ˵¥µÄÌØÊâÐÔ£¬ÎÒÃÇÊ×ÏȱØÐë¡¡

±£Ö¤ÎÒÃÇÄܽÓÊÕµ½ÕâÑùµÄÏûÏ¢¡£Í¬Ê±£¬ÓÉÓÚÉÏÏÂÎIJ˵¥ÖÐûÓж¥²ã²Ë¡¡

µ¥£¬ÎÒÃǶÔËüÃǵĸú×ÙÓÐÒ»¶¨µÄÌØÊâÐÔ¡£ÎÒÃDzÉÓÃCMenuÀàµÄÒ»¸ö³É¡¡

Ô±º¯ÊýTrackPopupMenuÀ´ÊµÏÖ¡£¸Ãº¯ÊýµÄÔ­ÐÍΪ£º¡¡¡¡



BOOL¡¡TrackPopupMenu£¨UINT¡¡nFlags£»¡¡int¡¡x£»¡¡int¡¡y£»¡¡CWnd*¡¡pWnd£»¡¡LPCRECT¡¡lpRect¡¡=¡¡¡¡

NULL¡¡£©¡¡¡¡



¸Ãº¯ÊýÖУ¬²ÎÊýnFlagsÖ¸Ã÷ÆÁĻλÖÃÓëÊó±êλÖ÷ç¸ñ£¬x£»yΪһÒÀÀµ¡¡

ÓÚÇ°ÃæËùÖ¸¶¨·ç¸ñµÄÉÏÏÂÎIJ˵¥µÄÆÁĻλÖÃ×ø±ê£¬pWndΪһָÏòÓµÓС¡

¸Ã²Ëµ¥µÄ´°¿ÚÖ¸Õ룬¶ølpRectÖ¸Ã÷Óû§²»»á¶ªÊ§µôÉÏÏÂÎIJ˵¥µÄ¾ØÐΡ¡

Óò¡£²ÎÊýnFlags¿ÉÒÔÈ¡ÒÔÏÂÖµ£º¡¡¡¡



ÆÁĻλÖ÷ç¸ñ£ºTPM_CENTERALIGN£»TPM_LEFTALIGN£¬TPM_RIGHTALIGN¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡220¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

Êó±êλÖ÷ç¸ñ£ºTPM_LEFTBUTTON£¬TPM_RIGHTBUTTON¡¡¡¡



ÖÁÓÚ˵ËüÃǵÄÈ¡ÖµÊÇ¿ÉÒÔ»¥ÏàÈ¡¡¡¡°»ò¡±µÄ£¬¶øËüÃǵÄʵ¼ÊЧ¹û£¬ÎÒÃÇ¡¡

Ï£Íû¶ÁÕßͨ¹ýʵ¼ù¾ßÌå¿´¿´¡£ÏÂÃæµÄ³ÌÐò¶ÎÕª×ÔÀý³ÌÖÐÎļþ¡¡

CMenuView¡£cppÖУº¡¡¡¡



void¡¡CMenuView£º£ºOnRButtonDown£¨UINT¡¡nFlags£»¡¡CPoint¡¡point£©¡¡¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡message¡¡handler¡¡code¡¡here¡¡and/or¡¡call¡¡default¡¡¡¡



CMenu¡¡ContextMenu£»¡¡¡¡



if£¨£¡ContextMenu¡£LoadMenu£¨IDR_CONTEXTMENU£©£©¡¡¡¡



AfxThrowResourceException£¨£©£»¡¡¡¡



CMenu¡¡*pPopupMenu=ContextMenu¡£GetSubMenu£¨0£©£»¡¡¡¡



ASSERT£¨pPopupMenu£¡=NULL£©£»¡¡¡¡



ClientToScreen£¨&point£©£»¡¡¡¡



pPopupMenu¡­¡·TrackPopupMenu£¨TPM_LEFTALIGN£üTPM_RIGHTBUTTON£»¡¡¡¡



point¡£x£»point¡£y£»AfxGetMainWnd£¨£©£©£»¡¡¡¡



CView£º£ºOnRButtonDown£¨nFlags£»¡¡point£©£»¡¡¡¡



£ý¡¡¡¡



ÏÂÃæÎÒÃǶÔÕâÒ»¶Î´úÂë×÷¼òÒª·ÖÎö£º¡¡¡¡



³ÌÐòÖÐÏÈ×°Èë¸Ã²Ëµ¥¡¡£¨Ê¹ÓÃLoadMenu×°È룩£¬½ÓÏÂÀ´ÓÉÓÚÉÏÏÂÎIJ˵¥¡¡

µÄ¶¨Î»Ê¹ÓÃÆÁÄ»×ø±ê£¬ËùÒÔʹÓÃÁËÒ»¸öCWndÀàµÄ³ÉÔ±º¯Êý¡¡

ClientToScreen£¬È»ºóʹÓÃÁËTrackPopupMenu½«²Ëµ¥ÒÔÉÏÏÂÎÄ·½Ê½ÏÔ¡¡

ʾ£¬×îºó£¬³ÌÐòµ÷ÓÃCViewÀàµÄͨÓôúÂë´¦ÀíһЩƽ³£ÐÅÏ¢¡£¡¡¡¡



¡¡¡¡¡¡l¡¡×¢Ò⣺¡¡¡¡



¡¡¡¡¡¡l¡¡ÓÉÓڸú¯ÊýÔÚÀàCMenuViewÖÐʵÏÖ£¬ÔÚʹÓÃClassWizardʱÎñÇë×¢¡¡

¡¡¡¡¡¡¡¡¡¡Òâ»ùÀàµÄÑ¡Ôñ¡£È硡ͼ5¡£17Ëùʾ¡¡£¨Èç¹û´íÑ¡¡¡ÁËCMaimFrameÀ࣬³ÌÐò¡¡

¡¡¡¡¡¡¡¡¡¡×îºóËùµ÷ÓõĴ¦ÀíÀý³ÌΪCWndÀàµÄ´¦Àíº¯Êý£¬ÉÏÏÂÎIJ˵¥µÄÏÔʾ¡¡

¡¡¡¡¡¡¡¡¾Í³ÉÁËÎÊÌ⣩¡£¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡221¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Í¼5¡£¡¡17¡¡Ñ¡ÔñÉÏÏÂÎIJ˵¥ÊµÏֵĻùÀà¡¡¡¡



ÔÚ±¾ÕµÄ×îºó£¬ÎÒÃǸø³öÒ»²¿·Ö¹Ø¼üÐÔ´úÂ룬ÆäÖÐÊÖ¹¤¼ÓÈëµÄ²¿·ÖÒÔ¡¡

¾ßÓе×ÎƵÄÎÄ×Ö¸ø³ö¡¡£¨»ùÓÚ°æÃæ·½ÃæµÄ¿¼ÂÇ£¬ÎÒÃǶÔһЩÖظ´ÐԵĴú¡¡

ÂëÂÔÈ¥ÁË£©¡£¡¡¡¡



¡¡¡¡¡¡l¡¡×¢Ò⣺¡¡¡¡



¡¡¡¡¡¡l¡¡ÓÉÓڲ˵¥ÏîµÄÑ¡Ôñ±ê¼Ç¼°Ê¹ÄÜʵÏֽϼòµ¥£¬´Ë´¦Ê¡È¥Á˸ò¿·Ö¡£¡¡

¡¡¡¡¡¡¡¡µ«ÊµÏÖʱÐèµ÷ÓÃÏûÏ¢ÏìÓ¦WM_INITMENU¡£¡¡¡¡



¡¡¡¡¡¡l¡¡ÎªÁ˽Úʡƪ·ù£¬ÔÚ³ÌÐòÖÐÎÒÃÇûÓÐÔÚ´°¿Ú±ä»¯ºó½øÐÐÖػ棬Õⲿ¡¡

¡¡¡¡¡¡¡¡·ÖµÄÏêϸÄÚÈÝÇë²Î¼ûGDI»æͼһ½Ú¡£¡¡¡¡



//¡¡MainFrm¡£cpp¡¡£º¡¡ÀàCMainFrame¡¡µÄʵÏÖ¡¡¡¡



//¡¡¡¡



#include¡¡¡¨stdafx¡£h¡¨¡¡¡¡



//¡¡¡£¡£¡£¡¡¡¡



IMPLEMENT_DYNCREATE£¨CMainFrame£»¡¡CFrameWnd£©¡¡¡¡



BEGIN_MESSAGE_MAP£¨CMainFrame£»¡¡CFrameWnd£©¡¡¡¡



//£û£ûAFX_MSG_MAP£¨CMainFrame£©¡¡¡¡



ON_WM_CREATE£¨£©¡¡¡¡



ON_MAND£¨ID_VIEW_NORMALMENU£»¡¡OnViewNormalmenu£©¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡222¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

ON_MAND£¨ID_DRAW_LINE£»¡¡OnDrawLine£©¡¡¡¡



ON_MAND£¨ID_DRAW_CIRCLE£»¡¡OnDrawCircle£©¡¡¡¡



ON_MAND£¨ID_DRAW_RECTANGLE£»¡¡OnDrawRectangle£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_INSERT£»¡¡OnDyncmodifyInsert£©¡¡¡¡



ON_MAND£¨ID_HELP_INSERT£»¡¡OnHelpInsert£©¡¡¡¡



ON_MAND£¨ID_APP_EXIT£»¡¡OnAppExit£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_APPEND£»¡¡OnDyncmodifyAppend£©¡¡¡¡



ON_MAND£¨ID_HELP_APPEND£»¡¡OnHelpAppend£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_DELETE£»¡¡OnDyncmodifyDelete£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_MODIFY£»¡¡OnDyncmodifyModify£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_MODIFYSYSTEMMENU£»¡¡OnDyncmodifyModifysystemmenu£©¡¡¡¡



ON_MAND£¨ID_DYNCMODIFY_RESET£»¡¡OnDyncmodifyReset£©¡¡¡¡



ON_MAND£¨ID_CHANGE£»¡¡OnChange£©¡¡¡¡



ON_WM_SYSMAND£¨£©¡¡¡¡



//´Ë´¦ÎªÏµÍ³²Ëµ¥ÏûÏ¢ÏìÓ¦ÉùÃ÷£¬¸Ä±äϵͳ²Ëµ¥ºóµÄÏûÏ¢´¦Àí±ØÐëÉùÃ÷¸ÃÏìÓ¦¡¡¡¡



ON_MAND£¨ID_FILE_NEW£»¡¡OnFileNew£©¡¡¡¡



ON_MAND£¨ID_VIEW_LONGMENU£»¡¡OnViewLongmenu£©¡¡¡¡



//£ý£ýAFX_MSG_MAP¡¡¡¡



END_MESSAGE_MAP£¨¡¡£©¡¡¡¡



//ÒÔÉϺ¯ÊýÓ³É䲿·Ö½ö¹©¶ÁÕßÑ¡Óò˵¥IDʱ²Î¿¼¡£µ«ÊÇ£¬¡¡¡¡



//½«Õⲿ·Ö´úÂëÓëʵÏÖϵͳ²Ëµ¥Ê±µÄÏûÏ¢Ó³Éä×÷Ò»¶Ô±ÈÊÇÓÐÒâÒåµÄ¡£¡¡¡¡



static¡¡UINT¡¡indicators£§£§¡¡=¡¡¡¡



£û¡¡¡¡



ID_SEPARATOR£»¡¡//¡¡status¡¡line¡¡indicator¡¡¡¡



ID_INDICATOR_CAPS£»¡¡¡¡



ID_INDICATOR_NUM£»¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡223¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

ID_INDICATOR_SCRL£»¡¡¡¡



£ý£»¡¡¡¡¡¡



//´Ë´¦Îª×´Ì¬À¸ÉϵķÖÅ䣬¾ßÌåÎÒÃÇÔÚºóÃæ»áÓÐÌá¼°¡£¡¡¡¡



/////////////////////////////////////////////////////////////////////////////¡¡¡¡



//¡¡CMainFrame¡¡construction/destruction¡¡¡¡



CMainFrame£º£ºCMainFrame£¨£©¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡add¡¡member¡¡initialization¡¡code¡¡here¡¡¡¡



bInsert=TRUE£»//·ÀÖ¹²Ëµ¥±»Öظ´²åÈëµÄ¿ØÖƱäÁ¿¡¡¡¡



bAppend=TRUE£»//·ÀÖ¹²Ëµ¥±»Öظ´¼ÓÈëµÄ¿ØÖƱäÁ¿¡¡¡¡



bDelete=TRUE£»//·ÀÖ¹²Ëµ¥±»Öظ´É¾³ýµÄ¿ØÖƱäÁ¿¡¡¡¡



bModify=TRUE£»//·ÀÖ¹²Ëµ¥±»Öظ´Ð޸ĵĿØÖƱäÁ¿¡¡¡¡



bBitmap=FALSE£»//±êʶÊÇ·ñʹÓÃÁËͼ·û²Ëµ¥¡¡¡¡



£ý¡¡¡¡



//ÔÚCMainFrameÀàµÄ¹¹Ô캯ÊýÖУ¬ÎÒÃǼÓÈëÁËÒ»²¿·ÖÖ§³Ö²Ëµ¥¶¯Ì¬¡¡¡¡



//´¦Àí¿ØÖƵÄBOOLÐͱäÁ¿£¬ËüÃǵĶ¨ÒåÔÚº¯ÊýCMainFrame¡£hÖС¡¡¡



//¡¡¡£¡£¡£¡¡¡¡



int¡¡CMainFrame£º£ºOnCreate£¨LPCREATESTRUCT¡¡lpCreateStruct£©¡¡¡¡



£û¡¡¡¡



//¡¡¡£¡£¡£¡¡¡¡



//¡¡Ìáʾ£º¡¡ÒÔϲ¿·Ö´úÂëÓÃÓÚ¿ØÖƹ¤¾ßÌõÌáʾ¼°¹¤¾ßÌõ±¾ÉíʵÏÖ£¬¡¡¡¡



//Èç¹û²»ÐèÒª¿ÉÒÔ½«ÏÂÃæÁ½ÐдúÂëÒÆÈ¥¡¡¡¡



m_wndToolBar¡£SetBarStyle£¨m_wndToolBar¡£GetBarStyle£¨£©¡¡£ü¡¡¡¡



CBRS_TOOLTIPS¡¡£ü¡¡CBRS_FLYBY¡¡£ü¡¡CBRS_SIZE_DYNAMIC£©£»¡¡¡¡



//Ìáʾ£ºÏÂÃæÈýÐдúÂë¿ØÖƹ¤¾ßÌõÊÇ·ñ¿ÉÒÔÒƶ¯£¬Èç¹ûÄã²¢²»¡¡¡¡



//Ï£Íû¹¤¾ßÌõ¿ÉÒÔÔÚÆÁÄ»ÄÚÒƶ¯£¬¿ÉÒÔɾȥËüÃÇ¡£¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡224¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

m_wndToolBar¡£EnableDocking£¨CBRS_ALIGN_ANY£©£»¡¡¡¡



EnableDocking£¨CBRS_ALIGN_ANY£©£»¡¡¡¡



DockControlBar£¨&m_wndToolBar£©£»¡¡¡¡



hLongMenu¡£LoadMenu£¨IDR_MAINFRAME1£©£»¡¡¡¡



hNormalMenu¡£LoadMenu£¨IDR_MAINFRAME0£©£»¡¡¡¡



hLine¡£LoadBitmap£¨IDB_LINE£©£»¡¡¡¡



hCircle¡£LoadBitmap£¨IDB_CIRCLE£©£»¡¡¡¡



hRectangle¡£LoadBitmap£¨IDB_RECTANGLE£©£»¡¡¡¡



hText¡£LoadBitmap£¨IDB_TEXT£©£»¡¡¡¡



//ÒÔÉϼ¸ÐдúÂë×°Èë×ÊÔ´¡¡£¨²Ëµ¥£¬Î»Í¼£©£¬µ«ÓÉÓÚÉÏÏÂÎIJ˵¥¡¡¡¡



//´¦Àí»úÖƲ»Ò»Ñù£¬Æä×ÊÔ´²¢²»ÔÚ´Ë´¦×°Èë¡£¡¡¡¡



return¡¡0£»¡¡¡¡



£ý¡¡¡¡



//ÒÔÉÏÊ¡ÂÔ´úÂëÓÃÓÚµ÷ÊÔ£¬ÔÚ³ÌÐòµÄ·¢ÐаæÖн«±»ÒÆÈ¥¡¡¡¡



//¡¡¡£¡£¡£¡¡¡¡



/////////////////////////////////////////////////////////////////////////////¡¡¡¡



//¡¡CMainFrame¡¡message¡¡handlers¡¡¡¡



void¡¡CMainFrame£º£ºOnViewLongmenu£¨£©¡¡¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



SetMenu£¨&hLongMenu£©£»¡¡¡¡



hLongMenu¡£Detach£¨£©£»¡¡¡¡



//ÒÔÉϲ¿·Ö´úÂëÓÃÓÚʵÏÖÖÁ³¤²Ëµ¥µÄÇл»¡¡¡¡



£ý¡¡¡¡



void¡¡CMainFrame£º£ºOnViewNormalmenu£¨£©¡¡¡¡¡¡



£û¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡225¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



SetMenu£¨&hNormalMenu£©£»¡¡¡¡



hNormalMenu¡£Detach£¨£©£»¡¡¡¡



//ÒÔÉϲ¿·Ö´úÂëÓÃÓÚʵÏÖÖÁÆÕͨ²Ëµ¥µÄÇл»¡¡¡¡



£ý¡¡¡¡



void¡¡CMainFrame£º£ºOnDrawLine£¨£©¡¡¡¡¡¡



£û¡¡¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



CClientDC¡¡ClientDC£¨this£©£»//´´½¨Ò»¿Í»§ÇøÉ豸¶ÔÏó¡¡¡¡



ClientDC¡£MoveTo£¨120£»120£©£»//Òƶ¯¶ÔÏóÆðµãÖÁ¡¡£¨120£¬120£©¡¡¡¡



ClientDC¡£LineTo£¨260£»260£©£»//×Ô¡¡£¨120£¬120£©ÖÁ¡¡£¨260£¬260£©»­Ö±Ïß¡¡¡¡



//ÒÔÉϲ¿·Ö´úÂëÓÃÓÚÔÚ³ÌÐòÖ÷´°¿ÚÖÐ×÷Ò»Æðµã¡¡¡¡



//Ϊ¡¡£¨120£¬120£©£¬ÖÕµãΪ¡¡£¨260£¬260£©µÄÖ±Ïß¡¡¡¡



£ý¡¡¡¡



void¡¡CMainFrame£º£ºOnDrawCircle£¨£©¡¡¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



CClientDC¡¡ClientDC£¨this£©£»¡¡¡¡



ClientDC¡£Arc£¨80£»40£»160£»120£»80£»80£»80£»80£©£»¡¡¡¡



//ÒÔÉÏ´úÂ벿·ÖÓÃÓÚÔÚÆÁÄ»ÄÚ»­Ô²£¬»ù±¾Í¬ÉÏ£¬Ö»ÊÇ×îºó×÷ͼµ÷Óú¯ÊýArc¡¡¡¡¡¡



£ý¡¡¡¡



void¡¡CMainFrame£º£ºOnDrawRectangle£¨£©¡¡¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



CClientDC¡¡ClientDC£¨this£©£»¡¡¡¡



ClientDC¡£MoveTo£¨120£»120£©£»¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡226¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

ClientDC¡£LineTo£¨170£»120£©£»¡¡¡¡



ClientDC¡£LineTo£¨170£»150£©£»¡¡¡¡



ClientDC¡£LineTo£¨120£»150£©£»¡¡¡¡



ClientDC¡£LineTo£¨120£»120£©£»¡¡¡¡



//»ù±¾½âÊÍͬÉÏ£¬Ê¹ÓÃÉ豸¶ÔÏó»­¾ØÐΡ¡¡¡



£ý¡¡¡¡



void¡¡CMainFrame£º£ºOnDyncmodifyInsert£¨£©¡¡¡¡¡¡



£û¡¡¡¡



//¡¡TODO£º¡¡Add¡¡your¡¡mand¡¡handler¡¡code¡¡here¡¡¡¡



if£¨bInsert£©//¿ØÖÆÖظ´¼ÓÈë±äÁ¿ÎªÕæʱÔÊÐí¼ÓÈë¡¡¡¡



£û¡¡¡¡



CMenu¡¡*pMenu=GetMenu£¨¡¡£©£»//È¡µÃ³ÌÐ

·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨0£© ²È£¨0£©

Äã¿ÉÄÜϲ»¶µÄ