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

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

?? ch10.htm

?? 24小時(shí)精通VC
?? HTM
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 10 -- Menus</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR><FONT COLOR="#000077">Teach Yourself Visual C++&#174; 5 in 24 Hours</FONT></H1></CENTER><CENTER><P><A HREF="../ch09/ch09.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch11/ch11.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> <HR></CENTER><CENTER><H1><FONT COLOR="#000077">- Hour 10 -<BR>Menus</FONT></H1></CENTER><P>Menus are an essential part of most Windows programs. With the exception of somesimple dialog box-based applications, all Windows programs offer some type of menu.</P><P>In this hour, you will learn<UL>	<LI>How menus are used in Windows programs<BR>	<BR>		<LI>How the MFC <TT>CMenu</TT> class is used to support menus<BR>	<BR>		<LI>How to add accelerators to your menu items</UL><P>In this hour you will also modify a menu created by AppWizard and create a floatingcontext menu.<H2><FONT COLOR="#000077"><B>What Is a Menu?</B></FONT></H2><P>A <I>menu</I> is a list of command messages that can be selected and sent to awindow.</P><P>To the user, a menu item is a string that indicates a task that can be performedby the application. Each menu item also has an ID that is used to identify the itemwhen routing window messages. This ID is also used when modifying attributes forthe menu item.</P><P>Menus are usually attached to a window, although many applications support floatingpop-up menus that can appear anywhere on the desktop. Later in this hour, you createa floating pop-up menu that is displayed when the right mouse button is pressed.These menus are often used to provide context-sensitive help and offer differentmenu choices depending on the window that creates the menu.</P><P>In order to make Windows programs easier to use, most programs follow a commonset of guidelines regarding the appearance of their menus. For example, menu itemsleading to dialog boxes that require additional user input are usually marked withan ellipsis (...).</P><P>Another user interface requirement is a mnemonic, or underlined letter for eachmenu item. When this letter is pressed, the appropriate menu item is selected. Thisletter is usually the first letter of the menu item; however, in some cases anotherletter is used. For example, the Exit menu item found in the File menu uses X asits mnemonic. You must be careful not to duplicate letters used for mnemonics; ifyou do, the menu won't work properly.</P><P>Menus are sometimes <I>nested</I>, which means that one menu item is actuallya submenu with a series of additional menu items. A menu item that leads to a nestedsubmenu has a right arrow to indicate that more selections are available. You cansee an example of a nested menu structure in the menus used by the Windows 95 Startbutton, as shown in Figure 10.1.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 10.1.</B></A> <BR><I>The nested menu structure used by the Start button.</I><H3><FONT COLOR="#000077"><B>Command Message Routing</B></FONT></H3><P>Before you learn about creating and modifying menus, look at how menu messagesare handled by Windows programs in general and MFC programs in particular.</P><P>A menu is always associated with a particular window. In most MFC programs, itis associated with the main frame window, which also contains the application's toolbarand status bar. When a menu item is selected, a <TT>WM_COMMAND</TT> message is sentto the main frame window; this message includes the ID of the menu item. The MFCframework and your application convert this message into a function call, as describedin Hour 8, &quot;Messages and Event-Driven Programming.&quot;</P><P>In an MFC application, many windows can receive a menu selection message. In general,any window that is derived from the <TT>CCmdTarget</TT> class is plugged into theMFC framework's message loop. When a menu item is selected, the message is offeredto all the command target objects in your application, in the following order:<DL>	<DD>1. The <TT>CMainFrame</TT> object<BR>	<BR>	2. The main MDI frame window<BR>	<BR>	3. The active child frame of an MDI frame window<BR>	<BR>	4. The view that is associated with the MDI child frame<BR>	<BR>	5. The document object associated with the active view<BR>	<BR>	6. The document template associated with the document object<BR>	<BR>	7. The <TT>CWinApp</TT> object</DL><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>This list might	seem like a large number of steps to take, but it's actually not very complicated	in practice. Usually, a menu item is handled by one type of object: a view or main	frame. Menu messages are rarely handled directly by the document template or child	frame objects. <HR></BLOCKQUOTE><P>Figure 10.2 shows a simplified map of how commands are routed in an MFC application.</P><P>In most cases, you can use ClassWizard to configure the message maps requiredto route menu selection messages to their proper destinations.<H3><FONT COLOR="#000077"><B>MFC Support for Menus</B></FONT></H3><P>You can create menus dynamically or as static resources that are added to yourprogram. The MFC class library provides a <TT>CMenu</TT> class that simplifies handlingmenus and is used for the examples in this hour.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 10.2.</B></A> <I><BR>Menu command routing in an MFC application.</I></P><P>AppWizard generates a menu resource for programs that it creates. This menu resourcecan be edited to add extra menu items for your application, or you can create newmenu resources for your application.</P><P>For the examples used in this hour, create a sample SDI application called Menu.This program is used to demonstrate how menu resources are created and modified.<H2><FONT COLOR="#000077"><B>Adding New Menu Items</B></FONT></H2><P>One of the easiest tasks to perform with a menu is adding a new menu item. Inorder to use a new menu item, you must do two things:<UL>	<LI>Modify the menu resource to include the new menu item.	<LI>Add a message-handling function using ClassWizard.</UL><P>These steps are explained in the next two sections.<H3><FONT COLOR="#000077"><B>Opening the Menu Resource</B></FONT></H3><P>To display the current menu resources, select the ResourceView tab in the projectworkspace window. Expand the resource tree to show the different resource types definedfor the current project; one of the folders is labeled Menu.</P><P>Open the Menu folder to display the resources defined for the project's menus.Every multiple-document application created by AppWizard has two menu resources.MDI applications use an <TT>IDR_MAINFRAME</TT> menu when no views are active. Theyalso have an additional menu item used when a view is active. The name of this menuresource is based on the application name, such as <TT>IDR_<I>xxx</I>TYPE</TT>, where<I><TT>xxx</TT></I> is replaced by the program's name. For example, <TT>IDR_FOOTYPE</TT>is the second menu resource created for a program named Foo.</P><P>SDI applications, such as the Menu example, have a single menu created by AppWizardnamed <TT>IDR_MAINFRAME</TT>. This is the menu displayed by default for single-documentapplications. Every AppWizard program begins with the same menu; supplying any modificationsthat are required for your application is up to you.<H3><FONT COLOR="#000077"><B>Editing the Menu Resource</B></FONT></H3><P>Open the menu resource by double-clicking the menu resource icon. The menu isdisplayed in the resource editor ready for editing. When the menu is initially loadedinto the editor, only the top-level menu bar is displayed. Clicking any top-levelmenu item displays the pop-up menu associated with that item, as shown in Figure10.3.</P><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 10.3.</B></A> <I><BR>Using the Developer Studio resource editor to edit a menu resource.</I></P><P>The last item of every menu is an empty box. This box is used to add new menuitems to the menu resource. All menu items are initially added to the end of a menuresource and then moved to their proper position. To add a new menu item, followthese steps:<DL>	<DD>1. Double-click the empty box on the File menu to display the Menu Properties	dialog box.<BR>	<BR>	2. To add a menu item, provide a menu ID and caption for the new menu item. By convention,	menu IDs begin with <TT>ID_</TT> and then you include the name of the top-level menu.	For this example, enter <TT>ID_FILE_HELLO</TT> as the menu ID and &amp;Hello as the	menu caption.<BR>	<BR>	3. Optionally, you can provide a prompt that is displayed in the status bar when	the new menu item is highlighted.<BR>	<BR>	4. Click anywhere outside the Properties dialog box to return to the editor.</DL><P>After you've added the new menu item you can move it to a new position by draggingit with the mouse. Changing the menu position does not change any of its attributes.<H3><FONT COLOR="#000077"><B>Menu Item Properties</B></FONT></H3><P>Several optional properties can be applied to a menu item via the Properties dialogbox:<UL>	<LI><I>ID</I> is used for the menu's resource ID. This ID is sent as part of the	<TT>WM_COMMAND</TT> message to your application and is used by ClassWizard to identify	the menu item.<BR>	<BR>		<LI><I>Caption</I> is the name used to identify the menu item. The mnemonic letter	is preceded by an ampersand (<TT>&amp;</TT>) and is used to select the item without	using the mouse.<BR>	<BR>		<LI><I>Separator</I> is used to indicate that this menu item is a separator, or horizontal	line that divides logical sections of a menu. This check box is usually cleared.<BR>	<BR>		<LI><I>Checked</I> is used to indicate that the menu item should display a check	mark to indicate the menu item is selected. This check box is usually cleared.<BR>	<BR>		<LI><I>Pop-up</I> is used to indicate that this menu item is the top level of a pop-up	or submenu. This option is usually cleared except on the top-level menu bar.<BR>	<BR>		<LI><I>Grayed</I> indicates that this menu item is grayed. This check box is usually	cleared.<BR>	<BR>		<LI><I>Inactive</I> indicates that this menu item is inactive. This check box is	usually cleared.<BR>	<BR>		<LI><I>Help</I> places the menu item to the far right side of the menu bar. This	option is rarely used, even for the Help menu.<BR>	<BR>		<LI><I>Break</I> is used to split the menu at this menu item. The default choice	is none and is used in almost all cases.<BR>	<BR>		<LI><I>Prompt</I> is used to specify the text that will be displayed in the status

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品久久久| 高清久久久久久| 欧美激情艳妇裸体舞| 欧美亚洲禁片免费| 国产成a人亚洲精品| 亚洲图片欧美色图| 日本一二三不卡| 欧美肥大bbwbbw高潮| 99久久久国产精品| 国产精品一区二区久久精品爱涩 | 亚洲欧美在线aaa| 日韩欧美一级特黄在线播放| 色婷婷香蕉在线一区二区| 国产美女在线观看一区| 天天综合色天天综合色h| 中文文精品字幕一区二区| 欧美一区二区三区免费视频| 91成人在线精品| 91亚洲精品久久久蜜桃| 国产精品18久久久久久vr| 日韩国产欧美在线观看| 一区二区三区成人| 中文字幕在线观看一区二区| 久久精品亚洲国产奇米99| 日韩欧美不卡一区| 日韩一区二区在线看| 欧美女孩性生活视频| 一本久久综合亚洲鲁鲁五月天| 懂色av一区二区三区免费看| 国产伦精品一区二区三区在线观看 | 国产高清成人在线| 国产综合色精品一区二区三区| 日韩国产高清在线| 日韩精品一二三四| 舔着乳尖日韩一区| 日韩电影在线一区二区三区| 天堂一区二区在线| 亚洲高清免费视频| 日韩一区精品字幕| 蜜臀av亚洲一区中文字幕| 毛片不卡一区二区| 国内不卡的二区三区中文字幕| 免费三级欧美电影| 久久国产人妖系列| 国产在线视频不卡二| 看电影不卡的网站| 国产美女精品一区二区三区| 紧缚捆绑精品一区二区| 国产一区二区三区在线看麻豆| 久久精品国产第一区二区三区| 蜜臀a∨国产成人精品| 免费日韩伦理电影| 精品一区二区三区在线播放| 麻豆精品视频在线观看视频| 国产综合色产在线精品| 粉嫩av一区二区三区在线播放| 国产成人免费视频网站高清观看视频| 久久精品国产秦先生| 国产精品一区二区视频| 不卡一区二区在线| 欧美午夜精品免费| 91精品国产综合久久久蜜臀图片| 日韩欧美黄色影院| 国产欧美一区二区三区鸳鸯浴 | 在线精品观看国产| 69堂成人精品免费视频| 欧美成人video| 欧美国产一区二区| 亚洲一卡二卡三卡四卡无卡久久 | 欧美主播一区二区三区| 日韩欧美久久一区| 国产精品色哟哟| 香蕉成人啪国产精品视频综合网| 另类人妖一区二区av| 成人午夜免费视频| 精品视频免费看| 久久综合色鬼综合色| 中文一区二区在线观看| 亚洲线精品一区二区三区| 久久99精品久久久| 99re免费视频精品全部| 9191精品国产综合久久久久久| 欧美成人三级在线| 亚洲精品福利视频网站| 狠狠色综合色综合网络| 在线这里只有精品| 久久久久久久久岛国免费| 亚洲午夜免费电影| 国产成人午夜电影网| 538prom精品视频线放| 中文字幕的久久| 日韩二区三区在线观看| 972aa.com艺术欧美| 精品少妇一区二区三区在线播放 | 一区二区三区四区亚洲| 九九热在线视频观看这里只有精品| 99久久精品国产毛片| 欧美大片国产精品| 亚洲尤物在线视频观看| 国产·精品毛片| 这里只有精品99re| 亚洲欧美日韩系列| 激情五月播播久久久精品| 欧美色电影在线| 中文字幕亚洲综合久久菠萝蜜| 麻豆精品一区二区综合av| 在线观看91视频| 国产精品每日更新| 国产激情一区二区三区四区| 欧美一区二区视频免费观看| 一区二区三区在线免费| 成人丝袜高跟foot| 国产视频一区二区三区在线观看| 午夜欧美视频在线观看| 91久久久免费一区二区| 亚洲欧美一区二区视频| 国产成人日日夜夜| 久久久一区二区三区捆绑**| 美腿丝袜亚洲色图| 日韩视频在线永久播放| 午夜精品影院在线观看| 在线日韩av片| 亚洲一级二级在线| 欧美专区日韩专区| 亚洲一区二区中文在线| 一本色道综合亚洲| 亚洲少妇30p| 91理论电影在线观看| 国产精品毛片久久久久久久| 粉嫩嫩av羞羞动漫久久久| 国产三级三级三级精品8ⅰ区| 精品一区二区三区久久久| 日韩一级大片在线| 麻豆国产一区二区| 欧美zozozo| 激情久久久久久久久久久久久久久久 | www.成人在线| 中文字幕的久久| av电影一区二区| 日韩毛片一二三区| 91玉足脚交白嫩脚丫在线播放| 亚洲欧美日韩国产成人精品影院 | 丝袜美腿高跟呻吟高潮一区| 日本韩国视频一区二区| 亚洲美女淫视频| 欧美午夜不卡视频| 日本sm残虐另类| 久久久久久免费网| av在线不卡电影| 亚洲主播在线观看| 欧美精品九九99久久| 麻豆精品视频在线观看视频| 久久久久久久一区| 91亚洲精品一区二区乱码| 亚洲高清免费观看高清完整版在线观看| 欧美日韩一区二区欧美激情| 日韩国产欧美在线播放| 久久久精品蜜桃| 93久久精品日日躁夜夜躁欧美| 亚洲国产成人91porn| 日韩精品专区在线影院观看| 国产原创一区二区三区| 亚洲欧洲日韩在线| 欧美美女黄视频| 国产剧情在线观看一区二区| 亚洲男人电影天堂| 日韩一区二区在线看片| 成人高清免费观看| 亚洲一区二区四区蜜桃| 日韩欧美亚洲国产另类| 成人av在线看| 五月天一区二区三区| 国产欧美综合色| 精品视频在线免费观看| 国产一区二区三区视频在线播放| 最新国产成人在线观看| 欧美一区二区三区免费观看视频| 成人污污视频在线观看| 婷婷开心久久网| 中文字幕不卡三区| 欧美日韩国产影片| 成人性视频免费网站| 视频一区视频二区中文字幕| 国产欧美日产一区| 欧美日韩高清在线播放| 国产福利精品导航| 视频一区二区中文字幕| 国产精品欧美综合在线| 欧美精三区欧美精三区| aaa欧美日韩| 精品亚洲欧美一区| 亚洲国产aⅴ成人精品无吗| 国产喂奶挤奶一区二区三区| 欧美放荡的少妇| 色综合夜色一区| 国产成人精品影视| 蜜桃精品在线观看| 亚洲成年人网站在线观看| 国产精品国产自产拍高清av王其 | 亚洲一区二区三区免费视频|