亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch11.htm

?? vc學(xué)習(xí)相關(guān)書(shū)籍,希望對(duì)大家有幫助,如果不好請(qǐng)批評(píng)指正
?? HTM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
	<P>	<DT></DT>	<DD><B>5. </B>Search for the line BEGIN_MESSAGE_MAP and add the lines in Listing	11.2 just after it. It's important that this code be between the BEGIN_MESSAGE_MAP	line and the //{{AFX_MSG_MAP line. If these commands are between the //{{AFX_MSG_MAP	and //}}AFX_MSG_MAP lines, then the Class Wizard will remove or corrupt them.	<P></DL><H4>LISTING 11.2. THE EVENT-HANDLER MESSAGE MAP ENTRIES IN Day11Doc.cpp.</H4><PRE> 1: ////////////////////////////////////////////////////////////////////// 2: // CDay11Doc 3:  4: IMPLEMENT_DYNCREATE(CDay11Doc, CDocument) 5:  6: BEGIN_MESSAGE_MAP(CDay11Doc, CDocument) 7:     ON_COMMAND_RANGE(ID_COLOR_BLACK, ID_COLOR_WHITE, OnColorCommand) 8:     ON_UPDATE_COMMAND_UI_RANGE(ID_COLOR_BLACK, ID_COLOR_WHITE, &Acirc;OnUpdateColorUI) 9:     //{{AFX_MSG_MAP(CDay11Doc)10:         // NOTE - the ClassWizard will add and remove mapping macros &Acirc;here.11:         //    DO NOT EDIT what you see in these blocks of generated &Acirc;code!12:     //}}AFX_MSG_MAP13: END_MESSAGE_MAP()14: 15: const COLORREF CDay11Doc::m_crColors[8] = {16:     RGB(   0,   0,   0),    // Black17:     RGB(   0,   0, 255),    // Blue18: .19: .</PRE><PRE>20: .</PRE><P><DL>	<DT></DT>	<DD><B>6. </B>Scroll to the bottom of the file and add the two event message handler	functions in Listing 11.3.	<P></DL><H4>LISTING 11.3. THE COLOR MENU EVENT-HANDLER FUNCTIONS.</H4><PRE> 1: void CDay11Doc::OnColorCommand(UINT nID) 2: { 3:     // Set the current color 4:     m_nColor = nID - ID_COLOR_BLACK; 5: } 6:  7: void CDay11Doc::OnUpdateColorUI(CCmdUI* pCmdUI) 8: { 9:     // Determine if the menu entry should be checked10:     pCmdUI-&gt;SetCheck(GetColor() == pCmdUI-&gt;m_nID ? 1 : 0);</PRE><PRE>11: }</PRE><P>In Listing 11.1, the two function declarations that you added are specified asevent message handlers by the afx_msg function type declarations. These type of functiondeclarations need to have protected access. Otherwise, they are virtually identicalto any other class member function declaration.</P><P>In Listing 11.2, the two message map entries, ON_COMMAND_RANGE and ON_UPDATE_COMMAND_UI_RANGE,are standard message map entries, but the Class Wizard does not support or understandthem. If you examine the message map entries from the previous day's applications,you will notice that there are ON_COMMAND and ON_UPDATE_COMMAND_UI message map entries.These macros have two arguments, the message ID and the event-handler function namethat should be called for the event message. These new message map entries functionin the same way, but they have two event ID arguments instead of one. The two eventID arguments mark the two ends of a range of event IDs that should be passed to thefunction specified. These two event IDs should be the first and last menu entriesyou created when building the color menu.</P><BLOCKQUOTE>	<P><HR><STRONG>NOTE:</STRONG> The message map is a mechanism used by Visual C++ and MFC to easily	specify event messages and the functions that should be called to handle the event.	These message-map commands are converted by the Visual C++ compiler into a fast and	efficient map for calling the appropriate event functions when a message is received	by the application. Whenever you add a function through the Class Wizard, you are	not only adding the function to the code, but you are also adding an entry into the	message map for that class.<HR></BLOCKQUOTE><P>When you use the ON_COMMAND_RANGE message-map entry, the event message ID is automaticallypassed as an argument to the event-handler function. This allows you to create thefunction in Listing 11.3 to handle the color selection event messages. If you compileand run your application at this point, you should find that the color selectionfunctionality is all working just as it did yesterday, as shown in Figure 11.3.</P><P><A HREF="javascript:popUp('11fig03.gif')"><B>FIGURE 11.3.</B></A><B> </B><I>Runningthe MDI application.</I></P><P><I></I><H2><A NAME="Heading6"></A>Adding a Context Menu</H2><P>In most Windows applications, you can right-click the mouse and what is knownas a context menu, or pop-up menu, appears. Back on Day 6, &quot;Creating Menus forYour Application,&quot; you implemented a simple pop-up menu. However, there is amechanism for creating and using these context menus when Windows thinks that themenu should be opened. This process allows you to add context menus that behave moreconsistently with other Windows applications (and if Microsoft changes how the contextmenus are triggered with a new version of Windows, yours will still behave accordingto the Windows standard).</P><P>An event message WM_CONTEXTMENU is passed to the event queue when the right mousebutton is released or when the context menu button is pressed (if you have a newerWindows-enabled keyboard with the context menu button). If you place an event-handlerfunction on the WM_CONTEXTMENU event message, you can display a pop-up menu withconfidence that you are showing it at the appropriate time.</P><P>To add the context menu to your application, you create a new menu for use asthe context menu. To do this, follow these steps:</P><P><DL>	<DT></DT>	<DD><B>1. </B>In the Resource View tab on the workspace pane, right-click the Menu	folder.	<P>	<DT></DT>	<DD><B>2. </B>Select Insert Menu from the pop-up menu (or should I say context menu).	<P>	<DT></DT>	<DD><B>3. </B>Select the new menu (still in the workspace pane), open its properties	dialog, and name the menu IDR_CONTEXTMENU.	<P>	<DT></DT>	<DD><B>4. </B>In the Menu Designer, specify the top-level menu caption as a single	space. This causes Visual C++ to add the first entry in the drop-down portion of	the menu.	<P>	<DT></DT>	<DD><B>5. </B>In the first drop-down menu entry, specify the caption as &amp;Width	and check the Pop-up check box. (This causes the ID combo box to be disabled and	an arrow to display beside the caption, along with another menu entry to the right	of the menu entry you are modifying.)	<P>	<DT></DT>	<DD><B>6. </B>Do not add any menu entries into the Width cascading menu at this time	(that is left for an exercise at the end of the chapter). Instead, select the menu	entry below the Width entry and open its properties dialog. Specify the caption as	&amp;Colors and check the Pop-up check box.	<P>	<DT></DT>	<DD><B>7. </B>In the colors cascading menu, add the color menu entries as you did	for the IDR_DAY11TYPE menu, using the same property settings. You can select the	ID from the drop-down list of IDs, if you would rather search for them instead of	type. When you finish, your menu should look like the one in Figure 11.4.	<P>	<DT></DT>	<DD><B>8. </B>Select the Class View tab in the workspace pane.	<P>	<DT></DT>	<DD><B>9. </B>Select the CDay11View class. Open the Class Wizard by selecting View|ClassWizard	from the menu.	<P></DL><P><A HREF="javascript:popUp('11fig04.gif')"><B>FIGURE 11.4.</B></A><B> </B><I>Thecontext menu design.</I></P><P><I></I><DL>	<DT><I></I></DT>	<DD><B>10. </B>Add a function for the WM_CONTEXTMENU event message on the CDay11View	class.	<P>	<DT></DT>	<DD><B>11. </B>Edit the function, adding the code in Listing 11.4.	<P></DL><H4>LISTING 11.4. THE CDay11View OnContextMenu FUNCTION.</H4><PRE> 1: void CDay11View::OnContextMenu(CWnd* pWnd, CPoint point) 2: { 3:     // TODO: Add your message handler code here 4:  5:     /////////////////////// 6:     // MY CODE STARTS HERE 7:     /////////////////////// 8:  9:     CMenu menu;10: 11:     // Load the context menu12:     menu.LoadMenu(IDR_CONTEXTMENU);13:     // Get the first sub menu (the real menu)14:     CMenu *pContextMenu = menu.GetSubMenu(0);15: 16:     // Display the context menu for the user17:     pContextMenu-&gt;TrackPopupMenu(TPM_LEFTALIGN | 18:         TPM_LEFTBUTTON | TPM_RIGHTBUTTON,19:         point.x, point.y, AfxGetMainWnd());20: 21:     ///////////////////////22:     // MY CODE ENDS HERE23:     ///////////////////////</PRE><PRE>24: }</PRE><P>This code should all look familiar to you from what you learned on Day 6. If youcompile and run your application now, you should be able to click your right mousebutton on the child window and change your drawing color from the context menu thatopened, as shown in Figure 11.5.</P><P><A HREF="javascript:popUp('11fig05.gif')"><B>FIGURE 11.5.</B></A><B> </B><I>Usingthe context menu to change drawing colors.</I></P><P><I></I><H2><A NAME="Heading7"></A>Summary</H2><P>That wasn't too bad; was it? After yesterday, you probably needed the easy daytoday, along with all the review of what you did yesterday to help it all sink in.But you did get to learn some new things today. You learned about MDI applications,what they are, and how they differ from SDI applications. You learned how you couldtake a series of menus and use a single event-handler function for all of them. Youalso learned how you can create a menu specifically for use as a pop-up context menuand how you can integrate it into an MDI application.</P><P><H2><A NAME="Heading8"></A>Q&amp;A</H2><DL>	<DT></DT>	<DD><B>Q Because it's basically the same code to create an MDI or SDI application,	why would I want to create an SDI application? Why wouldn't I want to make all my	applications MDI applications?</B>	<P>	<DT><B></B></DT>	<DD><B>A</B> It depends on the application and how it's going to be used. You probably	use both types of applications on a daily basis. If you are writing a memo or working	on a spreadsheet, you are probably using an MDI application. If you are browsing	the World Wide Web, your Web browser is most likely an SDI application. A simple	text editor such as Notepad would probably be more difficult for the user as an MDI	style application, but as an SDI application, it's just about right (for the task	it handles). Certain applications make more sense implemented as an SDI application	than as an MDI application. You need to think through how your application is going	to be used and determine which model it's more suited for.	<P>	<DT></DT>	<DD><B>Q Some entries on my color menu are changing to the wrong color. How can I	determine the problem?</B>	<P>	<DT><B></B></DT>	<DD><B>A</B> The problem is that the color menu IDs are probably not in sequential	order or are out of order. You can check them by right-clicking on the Day11 resources	in the Resource View tab of the workspace pane. Select Resource Symbols from the	pop-up menu to display a list of the IDs and the numbers assigned to them in alphabetical	order. Start with the Black ID and make sure that the numbers increase by 1 without	skipping any numbers. Be sure to check these IDs in the order that the colors appear	on the menu (and in the color table in the Day11Doc.cpp file), not in the alphabetical	order in which they are displayed in this list. If you find some errors, you have	to close Visual C++ and open the Resource.h file in a text editor to renumber the	IDs correctly. Once you make the corrections (be sure to delete any duplicates),	save your corrections, restart Visual C++, and recompile your application. The color	menu should work correctly.	<P></DL><H2><A NAME="Heading9"></A>Workshop</H2><P>The Workshop provides quiz questions to help you solidify your understanding ofthe material covered and exercises to provide you with experience in using what you'velearned. The answers to the quiz questions and exercises are provided in AppendixB, &quot;Answers.&quot;</P><P><H3><A NAME="Heading10"></A>Quiz</H3><DL>	<DT></DT>	<DD><B>1. </B>What are the five base classes that are used in MDI applications?	<P>	<DT></DT>	<DD><B>2. </B>Why do you have to place the ON_COMMAND_RANGE message map entry outside	the section maintained by the Class Wizard?	<P>	<DT></DT>	<DD><B>3. </B>What argument does ON_COMMAND_RANGE pass to the event function?	<P>	<DT></DT>	<DD><B>4. </B>What event message should you use to display a pop-up menu?	<P></DL><H3><A NAME="Heading11"></A>Exercise</H3><P>Add the pull-down and context menus for the width, using the same pen widths asyesterday.</P><H1></H1><CENTER><P><HR><A HREF="../ch10/ch10.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch12/ch12.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <BR><BR></P><P>&copy; <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. Allrights reserved.</CENTER></BODY></HTML>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利精品一区二区| 五月天久久比比资源色| 国产一区二区三区黄视频| 日韩欧美美女一区二区三区| 男人的j进女人的j一区| 亚洲精品在线网站| 国产+成+人+亚洲欧洲自线| 国产日韩欧美麻豆| 色婷婷av久久久久久久| 亚洲高清不卡在线观看| 欧美一二三区在线| 国产在线不卡一区| 亚洲日本乱码在线观看| 精品视频免费在线| 免费观看在线综合色| 国产视频亚洲色图| 91在线国产福利| 肉色丝袜一区二区| 日本一区二区三区免费乱视频| 99国产精品国产精品毛片| 亚洲成人三级小说| 欧美精品一区二区三| 91蜜桃婷婷狠狠久久综合9色| 亚洲大尺度视频在线观看| 2022国产精品视频| 91久久香蕉国产日韩欧美9色| 美女一区二区视频| 成人免费在线播放视频| 欧美一二三四在线| 91视频精品在这里| 精品一区二区免费看| 亚洲欧美一区二区三区极速播放 | 亚洲影院久久精品| 日韩一区二区三区高清免费看看| 国产成人精品亚洲777人妖| 亚洲无人区一区| 久久精品视频免费| 欧美夫妻性生活| 成人av免费在线播放| 久久国产尿小便嘘嘘尿| 亚洲综合图片区| 欧美极品xxx| 日韩一区二区视频在线观看| 成人国产一区二区三区精品| 免费看日韩精品| 一级中文字幕一区二区| 2024国产精品视频| 欧美精品色综合| 色乱码一区二区三区88| 国产精品123| 久久99热国产| 天使萌一区二区三区免费观看| 国产精品久久久久久久久图文区 | 欧美视频完全免费看| 国产99精品在线观看| 久久福利视频一区二区| 婷婷一区二区三区| 亚洲另类在线制服丝袜| 国产精品成人一区二区三区夜夜夜| 日韩一级欧美一级| 欧美嫩在线观看| 91成人免费在线视频| 99综合影院在线| 懂色av一区二区三区蜜臀| 麻豆精品国产91久久久久久| 韩国v欧美v亚洲v日本v| 天堂va蜜桃一区二区三区| 夜夜嗨av一区二区三区| 日韩理论片中文av| 国产免费成人在线视频| 国产亚洲一二三区| 久久精品水蜜桃av综合天堂| 精品乱人伦小说| 欧美电影免费观看高清完整版在线| 337p亚洲精品色噜噜| 欧美电影一区二区三区| 欧美日韩中字一区| 欧美图区在线视频| 在线欧美小视频| 欧美中文字幕一区| 欧美日韩一区高清| 欧美精品九九99久久| 欧美美女一区二区三区| 欧美女孩性生活视频| 555夜色666亚洲国产免| 在线播放/欧美激情| 日韩网站在线看片你懂的| 这里只有精品电影| 日韩欧美高清dvd碟片| 日韩免费观看高清完整版在线观看| 91麻豆精品久久久久蜜臀| 91精品国产色综合久久| 日韩欧美一区二区三区在线| 精品久久久久久久久久久久久久久 | 国产69精品久久99不卡| 白白色 亚洲乱淫| 91亚洲午夜精品久久久久久| 欧洲中文字幕精品| 欧美三级电影一区| 日韩免费看的电影| 欧美激情一区二区三区蜜桃视频| 国产精品色哟哟网站| 亚洲精品视频免费看| 亚洲成人福利片| 麻豆精品国产传媒mv男同| 国产精品99久久久| 成人黄色777网| 精品视频在线免费看| 日韩欧美一级二级三级久久久| 国产亚洲短视频| 亚洲免费高清视频在线| 日本亚洲一区二区| 国产精品1区二区.| 欧美探花视频资源| 欧美电影免费观看高清完整版在线观看| 久久久久9999亚洲精品| 亚洲精品你懂的| 另类小说图片综合网| 99精品视频在线观看免费| 欧美色视频在线观看| 精品成人在线观看| 中文字幕亚洲区| 日本女人一区二区三区| 成人性生交大片免费看视频在线| 欧洲精品一区二区三区在线观看| 精品国产一区二区亚洲人成毛片| 亚洲视频香蕉人妖| 免费成人结看片| 色94色欧美sute亚洲13| 欧美精品一区二区三区蜜臀| 亚洲伊人伊色伊影伊综合网| 国产精品影视天天线| 欧美在线观看18| 国产欧美日本一区二区三区| 丝袜诱惑制服诱惑色一区在线观看| 成人免费观看视频| 日韩欧美国产综合| 一区二区三区四区视频精品免费| 国产一区二区主播在线| 欧美日韩国产美| 亚洲女人小视频在线观看| 国产一区999| 欧美一级电影网站| 亚洲国产欧美在线| 91在线视频在线| 国产日韩欧美一区二区三区综合| 日韩国产欧美三级| 欧美又粗又大又爽| 国产精品久久久久久久久免费丝袜| 麻豆精品久久久| 欧美另类久久久品| 亚洲一区二区三区中文字幕在线| 成人美女视频在线观看18| 久久婷婷国产综合精品青草| 日本亚洲视频在线| 7777精品伊人久久久大香线蕉完整版| 亚洲精品中文在线| av高清不卡在线| 国产精品视频一二| 国产成人av一区二区| 2020国产精品自拍| 狠狠狠色丁香婷婷综合久久五月| 91精品欧美久久久久久动漫 | 欧美国产禁国产网站cc| 国产成人自拍网| 久久综合丝袜日本网| 久久精品国产亚洲一区二区三区| 91.com在线观看| 日韩国产精品久久| 欧美一区二区三区免费视频| 男人的天堂久久精品| 欧美一区二区在线看| 蜜臀久久久99精品久久久久久| 欧美一卡二卡在线| 久久爱另类一区二区小说| 精品欧美久久久| 激情综合亚洲精品| 久久久久久久久久久黄色| 高清成人在线观看| 国产精品理论在线观看| 一本一道波多野结衣一区二区| 亚洲欧美激情在线| 欧美精品色一区二区三区| 免费高清在线视频一区·| 久久夜色精品国产噜噜av| 国产精品一区二区在线观看网站 | 蜜桃视频一区二区| 久久久久综合网| 成人激情文学综合网| 一区二区三区在线观看国产| 欧美日韩在线一区二区| 看国产成人h片视频| 久久―日本道色综合久久| proumb性欧美在线观看| 亚洲男人电影天堂| 日韩一区二区三区电影在线观看| 国产乱码精品一区二区三区忘忧草| 中文在线一区二区| 日本韩国精品一区二区在线观看| 午夜电影网一区|