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

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

?? ch08.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
    //{{AFX_MSG(COptionsDialog)
        // NOTE: The ClassWizard will add member functions here
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
</PRE>
<PRE>};
</PRE>
<P>There are an awful lot of comments here to help ClassWizard find its way around
in the file when the time comes to add more functionality, but there is only one
member variable, m_string; one constructor; and one member function, DoDataExchange(),
which gets the control value into the member variable, or vice versa. The source
file isn't much longer; it's shown in Listing 8.6.</P>
<P>
<H4>Listing 8.6&#160;&#160;OPTIONSDIALOG.CPP--Implementation File for COptionsDialog</H4>
<PRE>// OptionsDialog.cpp : implementation file
//
#include &quot;stdafx.h&quot;
#include &quot;ShowString.h&quot;
#include &quot;OptionsDialog.h&quot;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COptionsDialog dialog
COptionsDialog::COptionsDialog(CWnd* pParent /*=NULL*/)
    : CDialog(COptionsDialog::IDD, pParent)
{
    //{{AFX_DATA_INIT(COptionsDialog)
    m_string = _T(&quot;&quot;);
    //}}AFX_DATA_INIT
}
void COptionsDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(COptionsDialog)
    DDX_Text(pDX, IDC_OPTIONS_STRING, m_string);
    //}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COptionsDialog, CDialog)
    //{{AFX_MSG_MAP(COptionsDialog)
        // NOTE: The ClassWizard will add message map macros here
    //}}AFX_MSG_MAP
</PRE>
<PRE>END_MESSAGE_MAP()
</PRE>
<P>The constructor sets the string to an empty string; this code is surrounded by
special ClassWizard comments that enable it to add other variables later. The DoDataExchange()
function calls DDX_Text() to transfer data from the control with the resource ID
IDC_OPTIONS_STRING to the member variable m_string, or vice versa. This code, too,
is surrounded by ClassWizard comments. Finally, there is an empty message map because
COptionsDialog doesn't catch any messages.</P>
<P>
<H3><A NAME="Heading10"></A>Catching the Message</H3>
<P>The next step in building ShowString is to catch the command message sent when
the user chooses Tools, Options. There are seven classes in ShowString: CAboutDlg,
CChildFrame, CMainFrame, COptionsDialog, CShowStringApp, CShowStringDoc, and CShowStringView.
Which one should catch the command? The string and the options will be saved in the
document and displayed in the view, so one of those two classes should handle the
changing of the string. The document owns the private variable and will not let the
view change the string unless you implement a public function to set the string.
So, it makes the most sense to have the document catch the message.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> Often the hardest part of catching these messages is deciding which
	class should catch them. The decision between View and Document is frequently a very
	difficult one. If the message handler will need access to a private member of either
	class, that's the class to catch the message.&#160;
<HR>


</BLOCKQUOTE>

<P>To catch the message, follow these steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Open ClassWizard (if it isn't already open).
	<P>
	<DT></DT>
	<DD><B>2. </B>Click the Message Maps tab.
	<P>
	<DT></DT>
	<DD><B>3. </B>Select CShowStringDoc from the Class Name drop-down list box.
	<P>
	<DT></DT>
	<DD><B>4. </B>Select ID_TOOLS_OPTIONS from the Object IDs list box on the left, and
	select COMMAND from the Messages list box on the right.
	<P>
	<DT></DT>
	<DD><B>5. </B>Click Add Function to add a function to handle this command.
	<P>
	<DT></DT>
	<DD><B>6. </B>The Add Member Function dialog box, shown in Figure 8.13, appears,
	giving you an op-portunity to change the function name from the usual one. Do not
	change it; just click OK.
	<P>
</DL>

<P><A HREF="javascript:popUp('08uvc13.gif')"><B>FIG. 8.13</B></A><B> </B><I>ClassWizard
suggests a good name for the message-catching function.</I></P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>TIP:</strong> You should almost never change the names that ClassWizard suggests
	for message catchers. If you find that you have to (perhaps because the suggested
	name is too long or conflicts with another function name in the same object), be
	sure to choose a name that starts with <I>On</I>. Otherwise the next developer to
	work on your project is going to have a very hard time finding the message handlers.
	
<HR>


</BLOCKQUOTE>

<P>Click Edit Code to close ClassWizard and edit the newly added function. What happened
to CShowStringDoc when you arranged for the ID_TOOLS_OPTIONS message to be caught?
The new message map in the header file is shown in Listing 8.7.</P>
<P>
<H4>Listing 8.7&#160;&#160;SHOWSTRINGDOC.H--Message Map for CShowStringDoc</H4>
<PRE>// Generated message map functions
protected:
    //{{AFX_MSG(CShowStringDoc)
    afx_msg void OnToolsOptions();
    //}}AFX_MSG
</PRE>
<PRE>    DECLARE_MESSAGE_MAP()
</PRE>
<P>This is just declaring the function. In the source file, ClassWizard changed the
message maps shown in Listing 8.8.</P>
<P>
<H4>Listing 8.8&#160;&#160;SHOWSTRINGDOC.CPP--Message Map for CShowStringDoc</H4>
<PRE>BEGIN_MESSAGE_MAP(CShowStringDoc, CDocument)
    //{{AFX_MSG_MAP(CShowStringDoc)
    ON_COMMAND(ID_TOOLS_OPTIONS, OnToolsOptions)
    //}}AFX_MSG_MAP
</PRE>
<PRE>END_MESSAGE_MAP()
</PRE>
<P>This arranges for OnToolsOptions() to be called when the command ID_TOOLS_OPTIONS
is sent. ClassWizard also added a skeleton for OnToolsOptions():</P>
<P>
<PRE>void CShowStringDoc::OnToolsOptions() 
{
    // TODO: Add your command handler code here
    
}
</PRE>
<H2><A NAME="Heading11"></A>Making the Dialog Box Work</H2>
<P>OnToolsOptions() should initialize and display the dialog box and then do something
with the value that the user provided. (This process was first discussed in Chapter
2. You have already connected the edit box to a member variable, m_string, of the
dialog box class. You initialize this member variable before displaying the dialog
box and use it afterwards.</P>
<P>OnToolsOptions(), shown in Listing 8.9, displays the dialog box. Add this code
to the empty function ClassWizard generated for you when you arranged to catch the
message.</P>
<P>
<H4>Listing 8.9&#160;&#160;SHOWSTRINGDOC.CPP--OnToolsOptions()</H4>
<PRE>void CShowStringDoc::OnToolsOptions() 
{
    COptionsDialog dlg;
    dlg.m_string = string;
    if (dlg.DoModal() == IDOK)
    {
        string = dlg.m_string;
        SetModifiedFlag();
        UpdateAllViews(NULL);
    }
</PRE>
<PRE>}
</PRE>
<P>This code fills the member variable of the dialog box with the document's member
variable (ClassWizard added m_string as a public member variable of COptionsDialog,
so the document can change it) and then brings up the dialog box by calling DoModal().
If the user clicks OK, the member variable of the document changes, the modified
flag is set (so that the user is prompted to save the document on exit), and the
view is asked to redraw itself with a call to UpdateAllViews(). For this to compile,
of course, the compiler must know what a COptionsDialog is, so add this line at the
beginning of ShowStringDoc.cpp:</P>
<P>
<PRE>#include &quot;OptionsDialog.h&quot;
</PRE>
<P>At this point, you can build the application and run it. Choose Tools, Options
and change the string. Click OK and you see the new string in the view. Exit the
application; you are asked whether to save the file. Save it, restart the application,
and open the file again. The default &quot;Hello, world!&quot; document remains open,
and the changed document is open with a different string. The application works,
as you can see in Figure 8.14 (the windows are resized to let them both fit in the
figure).</P>
<P><A HREF="javascript:popUp('08uvc14.gif')"><B>FIG. 8.14</B></A><B> </B><I>ShowString
can change the string, save it to a file, and reload it.</I></P>
<H2><I></I></H2>
<H2><A NAME="Heading12"></A>Adding Appearance Options to the Options Dialog Box</H2>
<P>ShowString doesn't have much to do, just demonstrate menus and dialog boxes. However,
the only dialog box control that ShowString uses is an edit box. In this section,
you add a set of radio buttons and check boxes to change the way the string is drawn
in the view.</P>
<P>
<H3><A NAME="Heading13"></A>Changing the Options Dialog Box</H3>
<P>It is quite simple to incorporate a full-fledged Font dialog box into an application,
but the example in this section is going to do something much simpler. A group of
radio buttons will give the user a choice of several colors. One check box will enable
the user to specify that the text should be centered horizontally, and another that
the text be centered vertically. Because these are check boxes, the text can be either,
neither, or both.</P>
<P>Open the IDD_OPTIONS dialog box by double-clicking it in the ResourceView window,
and then add the radio buttons by following these steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Stretch the dialog box taller to make room for the new controls.
	<P>
	<DT></DT>
	<DD><B>2. </B>Click the radio button in the Controls floating toolbar, and then click
	the Options dialog box to drop the control.
	<P>
	<DT></DT>
	<DD><B>3. </B>Choose View, Properties and then pin the Properties dialog box in place.
	<P>
	<DT></DT>
	<DD><B>4. </B>Change the resource ID of the first radio button to <B>IDC_OPTIONS_BLACK</B>,
	and change the caption to <B>&amp;Black</B>.
	<P>
	<DT></DT>
	<DD><B>5. </B>Select the Group box to indicate that this is the first of a group
	of radio buttons.
	<P>
	<DT></DT>
	<DD><B>6. </B>Add another radio button with resource ID<B> IDC_OPTIONS_RED</B> and
	<B>&amp;Red</B> as the caption. Do not select the Group box because the Red radio
	button doesn't start a new group but is part of the group that started with the Black
	radio button.
	<P>
	<DT></DT>
	<DD><B>7. </B>Add a third radio button with resource ID <B>IDC_OPTIONS_GREEN</B>
	and <B>&amp;Green</B> as the caption. Again, do not select Group.
	<P>
	<DT></DT>
	<DD><B>8. </B>Drag the three radio buttons into a horizontal arrangement, and select
	all three by clicking on one and then holding Ctrl while clicking the other two.
	<P>
	<DT></DT>
	<DD><B>9. </B>Choose Layout, Align Controls, Bottom (to even them up).
	<P>
	<DT></DT>
	<DD><B>10. </B>Choose Layout, Space Evenly, Across to space the controls across the
	dialog box.
	<P>
</DL>

<P>Next, add the check boxes by following these steps:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Click the check box in the Controls floating toolbar and then click
	the Options dialog box, dropping a check box onto it.
	<P>
	<DT></DT>
	<DD><B>2. </B>Change the resource ID of this check box to <B>IDC_OPTIONS_HORIZCENTER</B>
	and the caption to <B>Center &amp;Horizontally</B>.
	<P>
	<DT></DT>
	<DD><B>3. </B>Select the Group box to indicate the start of a new group after the
	radio buttons.
	<P>
	<DT></DT>
	<DD><B>4. </B>Drop another check box onto the dialog box as in step 1 and give it
	the resource ID <B>IDC_OPTIONS_VERTCENTER</B> and the caption <B>Center &amp;Vertically</B>.
	<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情久久五月天| 婷婷国产在线综合| 久久国产精品免费| 91久久香蕉国产日韩欧美9色| 日韩免费视频线观看| 最新国产成人在线观看| 九九在线精品视频| 欧美无砖砖区免费| 一区视频在线播放| 国产乱码精品一区二区三区忘忧草| 欧美在线不卡视频| 中文字幕一区二区三区色视频 | 精品久久久久久久人人人人传媒 | 亚洲免费av高清| 粉嫩13p一区二区三区| 日韩欧美中文一区| 亚洲一区视频在线| 色综合久久久久综合体| 国产精品黄色在线观看| 激情久久久久久久久久久久久久久久| 欧美日韩国产一区| 亚洲综合视频网| 99精品视频一区二区三区| 久久久久久99久久久精品网站| 同产精品九九九| 欧美日韩亚洲高清一区二区| 亚洲精品国产高清久久伦理二区| 不卡的电影网站| 中文字幕av在线一区二区三区| 国产一区二三区好的| 日韩视频在线你懂得| 日韩影院免费视频| 欧美高清视频不卡网| 亚洲一区二区三区免费视频| 在线视频综合导航| 一区二区三区美女视频| 在线一区二区三区做爰视频网站| 亚洲激情校园春色| 一本到三区不卡视频| 亚洲欧美日本在线| 色老综合老女人久久久| 亚洲在线成人精品| 欧美日本在线观看| 日韩电影在线免费| 日韩免费观看2025年上映的电影| 琪琪一区二区三区| 日韩免费观看2025年上映的电影| 九九久久精品视频| 久久久91精品国产一区二区精品 | 99视频精品在线| 综合电影一区二区三区| 日本高清视频一区二区| 亚洲chinese男男1069| 欧美一级电影网站| 精品亚洲国产成人av制服丝袜| 26uuu成人网一区二区三区| 国产精品自拍在线| 国产精品久久久久9999吃药| 色综合天天综合网天天看片| 亚洲免费观看在线观看| 欧美日韩亚洲综合在线| 免费一级欧美片在线观看| 亚洲素人一区二区| 日本丶国产丶欧美色综合| 亚洲图片自拍偷拍| 日韩欧美一区在线| 国产美女精品人人做人人爽| 国产精品五月天| 欧美综合亚洲图片综合区| 日韩av一级片| 国产精品视频九色porn| 色拍拍在线精品视频8848| 日韩高清中文字幕一区| 久久综合九色综合97婷婷女人 | 91视频在线看| 无码av中文一区二区三区桃花岛| 精品国产一区二区在线观看| 成人性生交大合| 亚洲电影一区二区三区| 精品久久久久久久久久久久久久久久久 | 香蕉久久一区二区不卡无毒影院| 日韩欧美亚洲国产另类| 成人av网站在线| 午夜视频一区在线观看| 久久综合99re88久久爱| 色香色香欲天天天影视综合网| 水野朝阳av一区二区三区| 久久久精品蜜桃| 在线免费观看不卡av| 精品亚洲aⅴ乱码一区二区三区| 国产精品久久毛片a| 欧美日韩中文字幕一区二区| 韩国成人精品a∨在线观看| 亚洲欧美色图小说| 日韩久久免费av| 92精品国产成人观看免费| 奇米色777欧美一区二区| 中文一区二区在线观看| 欧美久久一区二区| 成人高清视频在线| 看电视剧不卡顿的网站| 亚洲男女一区二区三区| 精品欧美一区二区三区精品久久| 不卡的av电影在线观看| 青青草国产精品97视觉盛宴| 亚洲欧美日本在线| 久久久久高清精品| 欧美区一区二区三区| 成人高清免费观看| 麻豆成人久久精品二区三区红| 中文字幕亚洲一区二区av在线| 欧美一区二区久久| 在线视频综合导航| 成人黄色a**站在线观看| 久草在线在线精品观看| 亚洲成人免费电影| 亚洲男人天堂av网| 亚洲国产岛国毛片在线| 日韩精品最新网址| 精品视频一区三区九区| 99re视频精品| 国产成人综合网| 捆绑调教一区二区三区| 亚洲.国产.中文慕字在线| 亚洲私人影院在线观看| 日本一区二区三区在线观看| 欧美xxxxx牲另类人与| 欧美日韩免费电影| 在线观看中文字幕不卡| 成人av在线播放网站| 国产麻豆精品95视频| 日精品一区二区| 亚洲午夜免费电影| 亚洲丝袜自拍清纯另类| 中文字幕 久热精品 视频在线| 欧美精品一区二区蜜臀亚洲| 欧美一区二区三区影视| 欧美日韩激情在线| 日本精品裸体写真集在线观看| a美女胸又www黄视频久久| 国产福利一区二区三区视频 | 亚洲午夜精品久久久久久久久| 国产精品久久久久久久久搜平片| 久久久综合网站| 久久久综合精品| 26uuu亚洲综合色| 欧美tk—视频vk| 日韩女优视频免费观看| 91精品啪在线观看国产60岁| 欧美日韩精品福利| 5858s免费视频成人| 欧美日韩免费高清一区色橹橹| 91色在线porny| 色综合久久九月婷婷色综合| 91视频免费看| 在线一区二区三区四区| 欧美日韩综合在线免费观看| 欧美日韩一区国产| 6080日韩午夜伦伦午夜伦| 欧美一区二区三区小说| 日韩欧美激情在线| 精品久久久影院| 久久精子c满五个校花| 欧美国产日韩一二三区| 综合av第一页| 亚洲免费看黄网站| 亚洲第一会所有码转帖| 五月激情综合色| 美洲天堂一区二卡三卡四卡视频| 青青草国产精品97视觉盛宴| 精品影视av免费| 国产成人免费在线观看| 成人性视频网站| 91日韩一区二区三区| 欧美主播一区二区三区美女| 欧美三级电影网| 日韩精品一区二区三区视频| 久久精品无码一区二区三区| 国产精品三级av| 亚洲一区二区三区四区在线免费观看 | 日本亚洲天堂网| 韩国欧美国产一区| 成人av电影在线| 一本一本大道香蕉久在线精品| 欧美亚洲国产一区在线观看网站| 欧美电影影音先锋| 精品国产一区二区三区忘忧草 | 51精品视频一区二区三区| 2021国产精品久久精品| 国产精品乱码一区二三区小蝌蚪| 一区二区在线观看视频在线观看| 精品一区二区三区免费视频| 国产成人av电影在线观看| 91美女在线观看| 91精品国产综合久久蜜臀| 国产午夜亚洲精品羞羞网站| 亚洲欧洲中文日韩久久av乱码| 日韩av不卡一区二区| 成人自拍视频在线观看| 欧美女孩性生活视频|