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

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

?? ch23.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
new interfaces:<UL>	<LI><TT>OnInitialUpdate</TT>, called when the view is first created<BR>	<BR>		<LI><TT>OnUpdate</TT>, called when the document updates its views</UL><P>To create a new view to add to the CDVTest project, follow these steps:<DL>	<DD>1. Open ClassWizard.<BR>	<BR>	2. Press the button labeled Add Class and select the New option from the drop-down	menu.<BR>	<BR>	3. Use the values from Table 23.6 to fill in the Add Class dialog box.<BR>	<BR>	4. Click OK and close ClassWizard.</DL><H4><FONT COLOR="#000077">Table 23.6. Values used to add the CDisplayView class.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Value</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CDisplayView</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Base Class</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CView</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">OLE Automation</TD>		<TD ALIGN="LEFT" VALIGN="TOP">None</TD>	</TR></TABLE></P><P>ClassWizard adds the new view to the project and creates some default initializationfunctions. However, the view class isn't useful until you do some additional workto associate it with the document class and define how it displays information.</P><P>When you create a new view using ClassWizard, you must add functions to handlethe Document/View interfaces; they aren't automatically created as they are for viewscreated by AppWizard when a new project is created. Using ClassWizard, add two message-handlingfunctions to the <TT>CDisplayView</TT> class using the values from Table 23.7.<H4><FONT COLOR="#000077">Table 23.7. New member functions for the CDisplayView class.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Class Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Object ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Message</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CDisplayView</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CDisplayView</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>OnInitialUpdate</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CDisplayView</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CDisplayView</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>OnUpdate</TT></TD>	</TR></TABLE><H3><FONT COLOR="#000077"><B>Modifying the <TT>OnDraw</TT> Function</B></FONT></H3><P>As discussed earlier, when you complete it, the <TT>CDisplayView</TT> class willlist the names contained in the <TT>CDVTestDoc</TT> document class. Like other <TT>OnDraw</TT>functions, <TT>CDisplayView::OnDraw</TT> retrieves a pointer to the document classand collects information about the items to be displayed in the view. The sourcecode for <TT>CDisplayView::OnDraw</TT> is provided in Listing 23.5.<H4><FONT COLOR="#000077">TYPE: Listing 23.5. Source code for CDisplayView::OnDraw.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CDisplayView::OnDraw(CDC* pDC)</TT><TT>{</TT><TT>    CDVTestDoc* pDoc = (CDVTestDoc*)GetDocument();</TT><TT>    ASSERT_VALID(pDoc);</TT><TT>    // Calculate the space required for a single</TT><TT>    // line of text, including the inter-line area.</TT><TT>    TEXTMETRIC  tm;</TT><TT>    pDC-&gt;GetTextMetrics( &amp;tm );</TT><TT>    int nLineHeight = tm.tmHeight + tm.tmExternalLeading;</TT><TT>    CPoint  ptText( 0, 0 );</TT><TT>    for( int nIndex = 0; nIndex &lt; pDoc-&gt;GetCount(); nIndex++ )</TT><TT>    {</TT><TT>        CString szName = pDoc-&gt;GetName( nIndex );</TT><TT>        pDC-&gt;TextOut( ptText.x, ptText.y, szName );</TT><TT>        ptText.y += nLineHeight;</TT><TT>    }</TT></FONT></PRE><P><TT>}</TT> Notice that the <TT>OnDraw</TT> function used in <TT>CDisplayView</TT>is the same as the <TT>CDVTestView::OnDraw</TT> function in Listing 9.14. Althoughthat view had exclusive access to its document, the same source code works when thedocument is shared by multiple views. You add the code for the <TT>OnInitialUpdate</TT>and <TT>OnUpdate</TT> member functions later, in the section &quot;Adding the <TT>OnInitialUpdate</TT>and <TT>OnUpdate</TT> Member Functions.&quot;</P><P>Because the <TT>OnDraw</TT> function must access the <TT>CDVTestDoc</TT> class,add this <TT>#include</TT> directive for the <TT>CDVTestDoc</TT> class:</P><PRE><FONT COLOR="#0066FF"><TT>#include &quot;DVTestDoc.h&quot;</TT></FONT></PRE><P>Add this include statement after the other include statements near the beginningof the <TT>DisplayView.cpp</TT> source file.<H3><FONT COLOR="#000077"><B>Creating and Maintaining Multiple Document Templates</B></FONT></H3><P>When a single view and document are associated with each other, a <TT>CMultiDocTemplate</TT>is passed to the MFC framework, and the application never sees it again. When multipleviews are created, the application class must keep track of the document templatesused for the document and view associations. The application class stores these pointersand provides them to the <TT>CMainFrame</TT> class when needed. Add the source codein Listing 23.6 to the implementation section of the <TT>CDVTestApp</TT> class declaration.These additions declare two member variables that are used to cache pointers to thedocument templates and two member functions used to get access to the pointers.<H4><FONT COLOR="#000077">TYPE: Listing 23.6. Changes to the CDVTestApp class declaration.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>public:</TT><TT>    CDocTemplate* GetDisplayTemplate() const;</TT><TT>    CDocTemplate* GetFormTemplate() const;</TT><TT>private:</TT><TT>    CDocTemplate* m_pDisplayTemplate;</TT></FONT></PRE><P><TT>CDocTemplate* m_pFormTemplate;</TT> The two document template pointers areset during the <TT>CDVTestApp::InitInstance</TT> member function. Instead of creatinga <TT>CMultiDocTemplate</TT> object and passing it immediately to the <TT>AddDocTemplate</TT>function, <TT>CMultiDocTemplate</TT> objects are created, and their pointers arestored in the new member variables. Replace the current code used to create the documenttemplates in <TT>CDVTestApp::InitInstance</TT> with the source code provided in Listing23.7.<H4><FONT COLOR="#000077">TYPE: Listing 23.7. Changes to CDVTestApp::InitInstancecreating two document templates.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>m_pFormTemplate = new CMultiDocTemplate(</TT><TT>                                   IDR_DVTESTTYPE,</TT><TT>                                   RUNTIME_CLASS(CDVTestDoc),</TT><TT>                                   RUNTIME_CLASS(CChildFrame),</TT><TT>                                   RUNTIME_CLASS(CFormTest) );</TT><TT> m_pDisplayTemplate = new CMultiDocTemplate(</TT><TT>                                   IDR_DISPLAYTYPE,</TT><TT>                                   RUNTIME_CLASS(CDVTestDoc),</TT><TT>                                   RUNTIME_CLASS(CChildFrame),</TT><TT>                                   RUNTIME_CLASS(CDisplayView) );</TT></FONT></PRE><P><TT>AddDocTemplate( m_pFormTemplate );</TT> Each of the document templates createdin Listing 23.7 describes views associated with the <TT>CDVTestDoc</TT> class. Oneof the document templates uses the <TT>CFormTest</TT> class from earlier this hour,whereas the other template uses the <TT>CDisplayView</TT> class. Because this classis new to the <TT>DVTest.cpp</TT> file, add an <TT>#include</TT> directive for the<TT>CDisplayView</TT> class:</P><PRE><FONT COLOR="#0066FF"><TT>#include &quot;DisplayView.h&quot;</TT></FONT></PRE><P>Listing 23.8 contains the source for the new <TT>CDVTestApp</TT> functions thatreturn pointers to the <TT>CDocTemplate</TT> pointers created during <TT>CDVTest::OnInitInstance</TT>.The <TT>CMainFrame</TT> class uses these pointers when creating new views. Add thesource code in Listing 23.8 to the <TT>DVTest.cpp</TT> file.<H4><FONT COLOR="#000077">TYPE: Listing 23.8. CDVTestApp functions used to returnpointers to the document templates.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>CDocTemplate* CDVTestApp::GetDisplayTemplate() const</TT><TT>{</TT><TT>    return m_pDisplayTemplate;</TT><TT>}</TT><TT>CDocTemplate* CDVTestApp::GetFormTemplate() const</TT><TT>{</TT><TT>    return m_pFormTemplate;</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Adding Shared Resources</B></FONT></H3><P>One of the parameters used when creating a document template is the <I>shared-resourceidentifier</I>. This resource ID is used to identify several different resourcesused by the view:<UL>	<LI>A resource string; specifying the file type, file extension, and document name	for the document template<BR>	<BR>		<LI>An icon for the view<BR>	<BR>		<LI>A menu used when the view is active</UL><P>Each of these resources must be created for a new view. Although sharing an existingresource ID is possible, providing at least a customized icon for the new view isa much better practice. The name of the current shared resource ID is <TT>IDR_DVTESTTYPE</TT>;for the new view, you will create a shared resource ID named <TT>IDR_DISPLAYTYPE</TT>.<H4><FONT COLOR="#000077">Creating a Menu for the New View</FONT></H4><P>Click the <TT>IDR_DVTESTTYPE</TT> menu item, and use Copy and Paste to createa new menu item. Rename the new item as <TT>IDR_DISPLAYTYPE</TT>; you can open theproperty page by right-clicking the icon and selecting Properties from the pop-upmenu.<H4><FONT COLOR="#000077">Creating an Icon for the New View</FONT></H4><P>Create an <TT>IDR_DISPLAYTYPE</TT> icon by opening the Icon folder on the resourcetree. Create a copy of the existing <TT>IDR_DVTESTTYPE</TT> icon by using the Editmenu to copy and paste the icon, or by pressing Ctrl+C, then Ctrl+V.<H4><FONT COLOR="#000077">Using a Resource String</FONT></H4><P>The resource string for each document template is stored in a String Table resource.Go to the ResourceView window and click the String Table icon. In the DVTest project,the resource string for the current document template is stored under the name <TT>IDR_DVTESTTYPE</TT>.You can add a new string to the String Table by pressing the Insert key on the keyboard.Create a new string resource named <TT>IDR_DISPLAYTYPE</TT> with the following stringvalue:</P><PRE><FONT COLOR="#0066FF"><TT>\nDVTest\n\n\n\nDVTest.Document\nDVTest Document</TT></FONT></PRE><P>The contents of the resource string are split into seven sections, and each sectionis separated by <TT>\n</TT>. Each of the seven sections has a particular purpose,as shown in Table 23.8.<H4><FONT COLOR="#000077">Table 23.8. Values for subsections of resource stringsused in DVTest.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Section</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDR_DVTEST</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDR_DISPLAYTYPE</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Title</TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Document Name</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">New File Name</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest</TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Filter Name</TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Filter Extension</TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>		<TD ALIGN="LEFT" VALIGN="TOP"></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Type ID</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest.Document</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest.Document</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Type Name</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest Document</TD>		<TD ALIGN="LEFT" VALIGN="TOP">DVTest Document</TD>	</TR></TABLE></P><P>The new resource string is almost the same as the original string. The only differenceis that there is no entry for the section marked New File Name. This is a clue tothe MFC framework that this document template is not used to create new documents;instead, it is used only to open a new view on an existing document. You don't haveto worry too much about the purpose of each segment. The MFC framework uses thesesegments when registering your application with Windows, and when opening new viewsand documents.<H3><FONT COLOR="#000077"><B>Adding Menu Items for New Views</B></FONT></H3><P>You add new views by selecting a menu item from the Window menu. Add the menuitems using the Developer Studio resource editor, as you learned in Hour 10, &quot;Menus.&quot;Use the values from Table 23.9 to add the menu items to the <TT>IDR_DISPLAYTYPE</TT>and <TT>IDR_DVTESTTYPE</TT> menus, and to add message-handling functions to the <TT>CMainFrame</TT>class.<H4><FONT COLOR="#000077">Table 23.9. New member functions for the CMainFrame class.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Menu ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Caption</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Event</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Function Name</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>ID_WINDOW_DISPLAY</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">&amp;Display View</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>COMMAND</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>OnWindowDisplay</TT></TD>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区中文免费| 久久久国产精品午夜一区ai换脸| 久久综合久久鬼色中文字| 亚洲精品美国一| 国产精品综合在线视频| 欧美日韩一区二区在线视频| 国产日韩欧美精品一区| 手机精品视频在线观看| 99在线精品视频| 精品三级在线观看| 亚洲成人精品一区二区| heyzo一本久久综合| 亚洲精品一区二区三区蜜桃下载| 亚洲一区二区三区四区五区中文| 豆国产96在线|亚洲| 精品国偷自产国产一区| 婷婷综合久久一区二区三区| 91色综合久久久久婷婷| 国产日韩成人精品| 国产又粗又猛又爽又黄91精品| 欧美精品日韩一区| 一区二区三区精密机械公司| caoporen国产精品视频| 欧美精品一区二区蜜臀亚洲| 美女在线观看视频一区二区| 欧洲国内综合视频| 亚洲免费色视频| 97精品久久久久中文字幕| 国产日产欧产精品推荐色 | 中文子幕无线码一区tr| 久久不见久久见中文字幕免费| 欧美日韩国产影片| 亚洲综合免费观看高清在线观看| 99久久精品久久久久久清纯| 国产精品视频麻豆| 成人深夜视频在线观看| www国产亚洲精品久久麻豆| 人人爽香蕉精品| 欧美一区二区视频在线观看2020| 亚洲第四色夜色| 欧美日韩国产成人在线免费| 亚洲综合视频在线| 欧美日韩免费电影| 亚洲成av人片一区二区三区| 欧美性大战久久久久久久蜜臀| 亚洲美女免费在线| 日本乱人伦aⅴ精品| 一区二区三区视频在线观看| 欧美在线免费观看视频| 亚洲国产精品精华液网站| 欧美日韩一区在线观看| 日韩av不卡一区二区| 91精品国产91久久久久久一区二区| 香蕉乱码成人久久天堂爱免费| 欧美人牲a欧美精品| 日本中文字幕一区二区视频| 欧美一区二区三区性视频| 免费在线一区观看| 欧美本精品男人aⅴ天堂| 韩国欧美一区二区| 中文字幕国产一区| 91毛片在线观看| 香蕉影视欧美成人| 欧美不卡一区二区| 国产成人av一区二区| 久久精品综合网| 日本不卡一二三| 日韩欧美一区二区不卡| 国产麻豆精品在线| 亚洲欧美另类久久久精品2019| av毛片久久久久**hd| 亚洲黄色尤物视频| 在线电影国产精品| 狠狠狠色丁香婷婷综合激情| 国产日本一区二区| av电影在线观看完整版一区二区| 国产精品国产三级国产有无不卡 | 成人一级视频在线观看| 亚洲免费观看高清| 欧美一区二区三区视频在线| 国产夫妻精品视频| 亚洲美女电影在线| 日韩一二三区视频| a在线播放不卡| 日韩电影在线观看电影| 国产日韩精品久久久| 欧美三级资源在线| 国产毛片精品一区| 亚洲美女视频在线| 欧美精品一区在线观看| 92精品国产成人观看免费 | 日韩午夜av一区| 18欧美亚洲精品| 91麻豆精品国产91久久久久久久久 | 国产不卡视频在线播放| 中文字幕的久久| 色婷婷香蕉在线一区二区| 日一区二区三区| 久久亚洲综合av| 国产91精品精华液一区二区三区| 一区二区三区日韩精品| 日韩亚洲欧美中文三级| 成人免费高清在线观看| 亚洲国产精品视频| 久久综合久久综合久久| 91麻豆自制传媒国产之光| 亚洲另类在线一区| 久久久精品黄色| 日本精品免费观看高清观看| 蜜臂av日日欢夜夜爽一区| 亚洲欧洲色图综合| 91精品国产综合久久久久久久| 福利一区在线观看| 图片区小说区国产精品视频| 久久久国产一区二区三区四区小说| 91一区二区三区在线观看| 日本不卡的三区四区五区| 国产精品午夜春色av| 欧美日韩电影在线播放| 成人福利在线看| 亚洲aⅴ怡春院| 国产日产精品1区| 日韩欧美二区三区| 欧洲av在线精品| 成人在线综合网| 青青草国产精品97视觉盛宴| 成人免费一区二区三区在线观看| 久久综合一区二区| 欧美三级日韩在线| 成人午夜电影小说| 美女尤物国产一区| 亚洲一区在线视频| 久久久久久亚洲综合| 日韩午夜精品视频| 91福利国产成人精品照片| 国产精品亚洲人在线观看| 天天射综合影视| 亚洲男女一区二区三区| 国产精品人成在线观看免费| 日韩欧美视频在线| 欧美三级一区二区| 91在线丨porny丨国产| 国内一区二区视频| 亚洲国产乱码最新视频| 一区二区三区四区在线| 久久先锋影音av| 日韩一区二区在线免费观看| 在线一区二区视频| 成人app在线| 国产成人综合网| 国产一区二区福利| 美女视频一区二区| 日本欧美久久久久免费播放网| 亚洲乱码国产乱码精品精可以看| 久久久久国产成人精品亚洲午夜| 欧美成人伊人久久综合网| 欧美日韩你懂得| 欧美色图免费看| 色视频一区二区| 在线观看网站黄不卡| 99久久精品国产观看| 丁香婷婷综合激情五月色| 激情五月婷婷综合| 狠狠色丁香久久婷婷综| 久88久久88久久久| 美女爽到高潮91| 久久99久久精品欧美| 六月丁香婷婷色狠狠久久| 免费在线看一区| 国产一区中文字幕| 国产在线视频精品一区| 久久精品国产999大香线蕉| 日本伊人色综合网| 麻豆精品久久精品色综合| 理论电影国产精品| 久久精品国产精品青草| 久久99国产乱子伦精品免费| 麻豆精品视频在线观看| 精品一区二区三区免费播放 | 欧美男生操女生| 欧美日韩精品福利| 欧美一区二区三区免费在线看| 欧美男人的天堂一二区| 69堂成人精品免费视频| 欧美一卡二卡在线| 亚洲精品一区二区三区四区高清| 欧美国产精品劲爆| 国产精品毛片无遮挡高清| 中文字幕中文字幕一区| 1024成人网| 亚洲国产一二三| 九色porny丨国产精品| 国产精品一级在线| 成人国产精品免费观看动漫| gogogo免费视频观看亚洲一| 成人一区二区三区中文字幕| 欧美在线你懂得| 久久久精品免费观看| 中文字幕在线不卡| 亚洲综合免费观看高清完整版|