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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch23.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1">	<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 23 -- Advanced Views</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><H1 ALIGN="CENTER"><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><P><A HREF="../ch22/ch22.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch24/ch24.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><H1 ALIGN="CENTER"><FONT COLOR="#000077">- Hour 23 -<BR>Advanced Views</FONT></H1><P>In this hour you learn more about MFC and Document/View, expanding on the materialcovered in Hour 9, &quot;The Document/View Architecture.&quot; In this hour, youwill learn about<UL>	<LI>Form views, a convenient way to use controls in your views, much like dialog	boxes	<LI>The MFC <TT>CFormView</TT> class that supports form views	<LI>How to associate multiple views with one document</UL><P>In this hour, you will also modify the DVTest project from Hour 9 so that it includesform views as well as multiple views for a document.<H2><FONT COLOR="#000077"><B>What Is a Form View?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>form view</I> is a viewthat can contain controls, much like a dialog box.</P><P>You usually add controls to a form view using a dialog resource, the same wayyou build dialog boxes. However, unlike dialog boxes, a form view is never modal;in fact, several form views can be open simultaneously, just like other views.</P><P>The most common reason to use a form view is because it's an easy-to-use viewthat looks like a dialog box. With practice, you can create a form view in a fewminutes. You can add controls used in a form view to the form view's dialog resource,just as you add controls to a resource used by a normal dialog box. After you addthe controls, you can associate them with MFC objects and class member variables,just as you associate controls with dialog boxes.</P><P>Using form views enables you to easily adapt the DDX and DDV routines used bydialog boxes to a view. Unlike a modal dialog box, several different form views canbe open at once, making your program much more flexible. Like other views, a formview has access to all the Document/View interfaces, giving it direct access to thedocument class.</P><P>It's common for a form view to be one of several possible views for a document.In an MDI application, it's common to have more than one view for each document type.For example, a form view can be used as a data entry view, and another type of viewcan be used for display purposes. Figure 23.1 presents a class diagram showing someof the classes derived from <TT>CView</TT>.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 23.1.</B></A> <I><BR>The MFC view classes.</I><H3><FONT COLOR="#000077"><B>What Are the Other Types of Views?</B></FONT></H3><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>scroll view</I> is aview that can be larger than its visible area.</P><P>In a scroll view, the invisible part of the view can be made visible using scrollbarsassociated with the view. An easy way to visualize how scrolling works is to imaginea large virtual view, hidden except for a small window used as a viewport, as shownin Figure 23.2.</P><P>Only a portion of the entire view is visible in Figure 23.2. The view window scrollsto different parts of the document; the underlying large view retains its originalposition. Although you can implement scrolling yourself for any class derived from<TT>CView</TT>, much of the work is done for you if you use <TT>CScrollView</TT>.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 23.2.</B></A> <BR><I>Scrolling a view using <TT>CScrollView</TT>.</I></P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>The <I>edit view</I> is aview that consists of an edit control. The edit view automatically supports printing,using the clipboard cut, paste, and copy functions, and Find and Replace. The editview is supported by the <TT>CEditView</TT> class, so it can be associated with adocument just like any other view.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>The edit view does	not support true what-you-see-is-what-you-get (WYSIWYG) editing; only one font is	supported for the entire view, and the display is not always 100 percent accurate	with regard to a printed page. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Using a Form View</B></FONT></H3><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Using a form view	requires only a few more steps than using a dialog box. All the hard work is handled	by the framework and the MFC <TT>CFormView</TT> class. Using ClassWizard, you can	add a form view to a project using 30 or 40 lines of your own code. <HR></BLOCKQUOTE><P>To illustrate how form views are used, add a form view to a project that was builtusing AppWizard. To reduce the amount of code that must be entered, you can reusethe DVTest project built in Hour 9. To recap, the DVTest project stored a collectionof names in its document class. In this hour, you will associate a form view withthe document and use it to display and input names into the program. For now, theform view is the only view associated with the document; you will learn about multipleviews later this hour.<H3><FONT COLOR="#000077"><B>Creating a Dialog Resource for a Form View</B></FONT></H3><P>Although a form view uses a dialog resource to lay out its controls, a form viewisn't really a dialog box; instead, a form view uses the dialog resource as a templatewhen the view is created. For this reason, the <TT>CFormView</TT> class has specialrequirements for the dialog resources it uses. Use the properties shown in Table23.1 for dialog resources used by form views.<H4><FONT COLOR="#000077">Table 23.1. Properties for dialog resources used by formviews.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Property</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Value</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Style</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Child</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Border</TD>		<TD ALIGN="LEFT" VALIGN="TOP">None</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Visible</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Unchecked</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Titlebar</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Unchecked</TD>	</TR></TABLE></P><P>Other than the values listed in Table 23.1, there are no other limitations fordialog box properties or controls. Any controls you can add to a dialog box can beused in a form view.</P><P>Developer Studio enables you to add a dialog box resource to your project thathas all of the properties needed for a form view. Follow these steps:<DL>	<DD>1. Right-click the tree inside the ResourceView window.<BR>	<BR>	2. Select Insert from the context menu. A dialog box will be displayed containing	a tree of resources that can be added to your project.<BR>	<BR>	3. Expand the Dialog tree; a list of dialog box templates is displayed.<BR>	<BR>	4. Select the <TT>IDD_FORMVIEW</TT> template, and click the New button.</DL><P>To get started on the form view example, add a dialog resource to the DVTest project.This dialog resource will be used in a form view, as shown in Figure 23.3.</P><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 23.3.</B> </A><I><BR>The dialog resource used as a form view in the CDVTest sample project.</I></P><P>Set the dialog resource and control resource IDs as listed in Table 23.2. Thelist box should not be automatically sorted by Windows for this example, so clearthe Sort attribute for the list box control. Use default properties for all othercontrols.<H4><FONT COLOR="#000077">Table 23.2. Properties for the CDVTest form view dialogresource.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Property</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>ID</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Dialog</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDD_FORM_VIEW</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Edit Control</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_EDIT</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">List Control</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_LIST</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Close Button</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CLOSE</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Apply Button</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_APPLY</TT></TD>	</TR></TABLE><H3><FONT COLOR="#000077"><B>Adding a Form View Class to a Project</B></FONT></H3><P>Use ClassWizard to add a form view class to a project, much as you would add adialog box class to a project. After creating the dialog resource, add the form viewclass using the following steps:<DL>	<DD>1. Open ClassWizard. Because ClassWizard knows that a new resource has been added,	a dialog box prompts you to choose between two options for the new dialog resource.	Select the option labeled Create a New Class.<BR>	<BR>	2. Fill in the Add Class dialog box using the values from Table 23.3, then click	OK.</DL><H4><FONT COLOR="#000077">Table 23.3. Sample values for the Add Class dialog box.</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>CFormTest</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Base Class</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CFormView</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">File</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>FormTest.cpp</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Dialog ID</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDD_FORM_VIEW</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Automation</TD>		<TD ALIGN="LEFT" VALIGN="TOP">None</TD>	</TR></TABLE></P><P>Use ClassWizard to add two member variables to the <TT>CFormTest</TT> class, asshown in Table 23.4.<H4><FONT COLOR="#000077">Table 23.4. Control variables added to the CFormTest class.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control Type</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Variable Type</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Variable Name</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_LIST</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Control</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CListCtrl</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_lbNames</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_EDIT</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Control</TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>CEdit</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_edNames</TT></TD>	</TR></TABLE><H3><FONT COLOR="#000077"><B>Using <TT>CFormView</TT> Instead of <TT>CView</TT></B></FONT></H3><P>Because <TT>CFormView</TT> is a subclass derived from <TT>CView</TT>, you cansubstitute it for <TT>CView</TT> in most cases. As was discussed in Hour 9, a documentclass is associated with a view class using a <TT>CMultiDocTemplate</TT> object inMDI programs. You can change the view associated with a particular document by editingthe parameters used when the <TT>CMultiDocTemplate</TT> object is constructed.</P><P>Listing 23.1 associates the <TT>CFormTest</TT> view class with the <TT>CDVTestDoc</TT>document class. Update the code that creates the document template in the <TT>CDVTestApp::InitInstance</TT>function, found in the <TT>CDVTestApp.cpp</TT> source file. You must change onlythe fourth parameter to the constructor, as shown by the comment.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区不卡在线观看| 日日夜夜精品视频免费| 成人av网址在线| 中文字幕在线视频一区| 99re成人精品视频| 午夜影院在线观看欧美| 日韩视频永久免费| 国产精品中文字幕欧美| 综合色中文字幕| 欧美日韩高清影院| 捆绑调教一区二区三区| 国产嫩草影院久久久久| 色天使久久综合网天天| 六月丁香婷婷色狠狠久久| 国产色91在线| 在线观看免费视频综合| 老司机精品视频导航| 国产精品免费视频一区| 在线不卡欧美精品一区二区三区| 精品一二三四区| 亚洲日本va午夜在线电影| 欧美主播一区二区三区| 日本不卡一区二区三区| 久久综合999| 色婷婷久久综合| 麻豆精品一区二区三区| 自拍视频在线观看一区二区| 欧美日韩电影一区| 国产不卡在线播放| 午夜精品福利一区二区蜜股av| 久久久久免费观看| 在线视频欧美精品| 国产精品99久久久久| 亚洲国产日韩在线一区模特| 久久久精品一品道一区| 欧美日韩二区三区| k8久久久一区二区三区| 蜜臂av日日欢夜夜爽一区| 亚洲欧美日韩在线| 国产色产综合色产在线视频| 欧美性猛交xxxxxx富婆| 亚洲aⅴ怡春院| 国产欧美精品区一区二区三区| 粉嫩嫩av羞羞动漫久久久| 亚洲成人自拍偷拍| 欧美国产成人精品| 欧美喷潮久久久xxxxx| 成a人片国产精品| 国产一区二区三区在线观看免费视频 | 中文字幕亚洲成人| 欧美变态tickling挠脚心| 在线观看视频一区二区| 国产91高潮流白浆在线麻豆| 免费成人在线观看| 亚洲伊人色欲综合网| 国产精品嫩草影院av蜜臀| 久久久久国产精品麻豆ai换脸| 欧美精品第一页| 欧美午夜不卡在线观看免费| 99久久精品国产一区二区三区 | 国产伦精品一区二区三区在线观看| 亚洲成人动漫在线免费观看| 亚洲欧美电影院| 日韩美女视频19| 国产精品污www在线观看| 久久久久久一二三区| 日韩免费视频一区| 日韩三级.com| 日韩一区二区视频| 日韩视频123| 日韩一级精品视频在线观看| 欧美日韩国产首页| 7777精品伊人久久久大香线蕉的 | 亚洲免费观看高清| 中文字幕日韩一区| 亚洲人成在线播放网站岛国| 亚洲欧美在线视频| 亚洲欧美日韩国产另类专区| 亚洲天堂精品视频| 一区二区三区欧美在线观看| 亚洲久本草在线中文字幕| 亚洲精品水蜜桃| 亚洲一区二区美女| 日韩成人一区二区| 精品一区二区三区免费播放| 狠狠色伊人亚洲综合成人| 国产原创一区二区| 国产成人高清视频| aaa欧美色吧激情视频| 91美女福利视频| 欧美日韩aaa| 精品国产a毛片| 中文字幕不卡三区| 亚洲欧美日韩久久| 日本女优在线视频一区二区| 久久精品国产澳门| 丰满白嫩尤物一区二区| 91麻豆精品秘密| 欧美日韩第一区日日骚| 精品国产伦理网| 国产精品免费视频一区| 亚洲国产一区二区三区青草影视| 日韩av不卡一区二区| 国产乱人伦精品一区二区在线观看| 国产成人精品一区二区三区网站观看| 99久久国产综合精品色伊| 欧美日韩国产一区二区三区地区| 欧美变态凌虐bdsm| 亚洲色图欧洲色图婷婷| 日本麻豆一区二区三区视频| 国产成人精品免费在线| 欧美中文字幕亚洲一区二区va在线 | 国产精品原创巨作av| 色噜噜夜夜夜综合网| 精品国产99国产精品| 一区二区三区不卡视频| 精品在线观看视频| 欧美在线一二三| 国产亚洲视频系列| 亚洲成人福利片| 不卡一区在线观看| 欧美电影免费提供在线观看| 亚洲欧美另类久久久精品| 精品一区免费av| 欧美性受xxxx| 国产性天天综合网| 日本午夜精品视频在线观看| 成人av在线资源网站| 日韩一级免费一区| 亚洲主播在线观看| 不卡视频在线观看| 精品国产sm最大网站| 亚洲成人自拍偷拍| 色综合天天综合网国产成人综合天| 欧美精品一区二区高清在线观看| 一区二区久久久久| 国产成人a级片| 日韩欧美黄色影院| 亚洲成人免费视| 色哦色哦哦色天天综合| 久久精品人人爽人人爽| 久草热8精品视频在线观看| 欧美日韩一卡二卡| 夜夜夜精品看看| 色综合久久综合网欧美综合网 | 日本午夜精品一区二区三区电影| 色综合久久中文字幕| 国产精品理论片| 国产成人在线视频网址| 精品精品国产高清a毛片牛牛| 亚洲一区二区在线播放相泽| 99久久精品国产麻豆演员表| 欧美极品xxx| 成人午夜私人影院| 久久亚洲综合色| 国产一区二区三区观看| 久久综合色之久久综合| 久久99精品国产91久久来源| 欧美一区二区三区不卡| 香蕉成人伊视频在线观看| 欧美色男人天堂| 亚洲午夜在线视频| 欧美日韩在线免费视频| 亚洲午夜视频在线观看| 欧美三级电影网站| 午夜伦理一区二区| 日韩一区二区三区在线| 婷婷综合另类小说色区| 欧美男同性恋视频网站| 日韩成人一级片| 日韩欧美国产高清| 韩国午夜理伦三级不卡影院| 欧美精品一区二区三区久久久| 精品一区免费av| 欧美经典一区二区| 91蝌蚪porny九色| 一区二区成人在线| 欧美日本高清视频在线观看| 日韩主播视频在线| 欧美tickling网站挠脚心| 国产传媒久久文化传媒| 国产精品免费丝袜| 欧美综合在线视频| 久久精品免费看| 久久只精品国产| 91麻豆国产在线观看| 午夜精品在线视频一区| 精品欧美乱码久久久久久| 国产高清视频一区| 一区二区三区日本| 日韩欧美一区二区免费| 丁香啪啪综合成人亚洲小说| 一区二区三区资源| 91精品国产福利| 国产传媒一区在线| 亚洲午夜私人影院| 久久久国产精品午夜一区ai换脸| 成人精品国产福利| 日韩经典一区二区| 欧美经典三级视频一区二区三区|