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

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

?? wtl for mfc programmers, part iii.mht

?? 大家知道wtl是window UI庫
?? MHT
?? 第 1 頁 / 共 5 頁
字號:
      <P>On the next page, uncheck <I>Rebar</I> so the wizard creates a =
normal=20
      toolbar:</P>
      <P><IMG height=3D387 alt=3D" [AppWizard pg 2 - 21K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/appwiz2.png" =
width=3D477=20
      align=3Dbottom border=3D0></P>
      <P>After copying the clock code from the app in Part II, the new =
app looks=20
      like this:</P>
      <P><IMG height=3D187 alt=3D" [default toobar - 5K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/defaultapp.png" =
width=3D267=20
      align=3Dbottom border=3D0></P>
      <H3><A name=3Dcreatebars></A>How CMainFrame creates the bars</H3>
      <P>The AppWizard puts more code in =
<CODE>CMainFrame::OnCreate()</CODE> in=20
      this project. Its job is to create the bars and tell=20
      <CODE>CUpdateUI</CODE> to update the toolbar =
buttons.</P><PRE>LRESULT CMainFrame::OnCreate(UINT <SPAN =
class=3Dcpp-comment>/*uMsg*/</SPAN>, WPARAM <SPAN =
class=3Dcpp-comment>/*wParam*/</SPAN>,=20
                             LPARAM <SPAN =
class=3Dcpp-comment>/*lParam*/</SPAN>, BOOL&amp; <SPAN =
class=3Dcpp-comment>/*bHandled*/</SPAN>)
{
    CreateSimpleToolBar();
    CreateSimpleStatusBar();

    m_hWndClient =3D m_view.Create(...);

<SPAN class=3Dcpp-comment>// ...</SPAN>

    <SPAN class=3Dcpp-comment>// register object for message filtering =
and idle updates</SPAN>
    CMessageLoop* pLoop =3D _Module.GetMessageLoop();
    ATLASSERT(pLoop !=3D NULL);
    pLoop-&gt;AddMessageFilter(<SPAN class=3Dcpp-keyword>this</SPAN>);
    pLoop-&gt;AddIdleHandler(<SPAN class=3Dcpp-keyword>this</SPAN>);

    <SPAN class=3Dcpp-keyword>return</SPAN> <SPAN =
class=3Dcpp-literal>0</SPAN>;
}</PRE>
      <P>The new code here is at the beginning.=20
      <CODE>CFrameWindowImpl::CreateSimpleToolBar()</CODE> creates a new =
toolbar=20
      using the toolbar resource IDR_MAINFRAME and stores its handle in=20
      <CODE>m_hWndToolBar</CODE>. Here is the code for=20
      <CODE>CreateSimpleToolBar()</CODE>:</P><PRE>BOOL =
CFrameWindowImpl::CreateSimpleToolBar(
    UINT nResourceID =3D <SPAN class=3Dcpp-literal>0</SPAN>,=20
    DWORD dwStyle =3D ATL_SIMPLE_TOOLBAR_STYLE,=20
    UINT nID =3D ATL_IDW_TOOLBAR)
{
    ATLASSERT(!::IsWindow(m_hWndToolBar));
=20
    <SPAN class=3Dcpp-keyword>if</SPAN>(nResourceID =3D=3D <SPAN =
class=3Dcpp-literal>0</SPAN>)
        nResourceID =3D T::GetWndClassInfo().m_uCommonResourceID;
=20
    m_hWndToolBar =3D T::CreateSimpleToolBarCtrl(m_hWnd, nResourceID, =
TRUE, <BR>                                               dwStyle, nID);
    <SPAN class=3Dcpp-keyword>return</SPAN> (m_hWndToolBar !=3D NULL);
}</PRE>
      <P>The parameters are:</P>
      <DL>
        <DT><CODE>nResourceID</CODE>=20
        <DD>ID of the toolbar resource to use. The default of 0 means to =
use the=20
        ID specified in the <CODE>DECLARE_FRAME_WND_CLASS</CODE> macro. =
This is=20
        IDR_MAINFRAME in the wizard-generated code.=20
        <DT><CODE>dwStyle</CODE>=20
        <DD>Styles for the toolbar. The default value=20
        <CODE>ATL_SIMPLE_TOOLBAR_STYLE</CODE> is defined as=20
        <CODE>TBSTYLE_TOOLTIPS</CODE> plus the usual child and visible =
styles.=20
        This makes the toolbar create a tooltip control for use when the =
cursor=20
        hovers over a button.=20
        <DT><CODE>nID</CODE>=20
        <DD>Window ID for the toolbar, you will usually use the default =
value.=20
        </DD></DL>
      <P><CODE>CreateSimpleToolBar()</CODE> checks that a toolbar hasn't =
been=20
      created yet, then calls <CODE>CreateSimpleToolBarCtrl()</CODE> to =
actually=20
      create the control. The handle returned by=20
      <CODE>CreateSimpleToolBarCtrl()</CODE> is saved in=20
      <CODE>m_hWndToolBar</CODE>. <CODE>CreateSimpleToolBarCtrl()</CODE> =
reads=20
      the resource and creates toolbar buttons accordingly, then returns =
the=20
      toolbar's window handle. The code to do that is rather long, so I =
won't=20
      cover it here. You can find it in atlframe.h if you're =
interested.</P>
      <P>The next call in <CODE>OnCreate()</CODE> is=20
      <CODE>CFrameWindowImpl::CreateSimpleStatusBar()</CODE>. This =
creates a=20
      status bar and stores its handle in <CODE>m_hWndStatusBar</CODE>. =
Here is=20
      the code:</P><PRE>BOOL CFrameWindowImpl::CreateSimpleStatusBar(
    UINT nTextID =3D ATL_IDS_IDLEMESSAGE,=20
    DWORD dwStyle =3D ... SBARS_SIZEGRIP,=20
    UINT nID =3D ATL_IDW_STATUS_BAR)
{
    TCHAR szText[<SPAN class=3Dcpp-literal>128</SPAN>];    <SPAN =
class=3Dcpp-comment>// max text lentgth is 127 for status bars</SPAN>
    szText[<SPAN class=3Dcpp-literal>0</SPAN>] =3D <SPAN =
class=3Dcpp-literal>0</SPAN>;
    ::LoadString(_Module.GetResourceInstance(), nTextID, szText, <SPAN =
class=3Dcpp-literal>128</SPAN>);
    <SPAN class=3Dcpp-keyword>return</SPAN> =
CreateSimpleStatusBar(szText, dwStyle, nID);
}</PRE>
      <P>This loads a string from the string table, which will be shown =
in the=20
      status bar. The parameters are:</P>
      <DL>
        <DT><CODE>nTextID</CODE>=20
        <DD>Resource ID of the string to be initially shown in the =
status bar.=20
        The AppWizard generates the string "Ready" with ID =
ATL_IDS_IDLEMESSAGE.=20
        <DT><CODE>dwStyle</CODE>=20
        <DD>Styles for the status bar. The default includes=20
        <CODE>SBARS_SIZEGRIP</CODE> to have a resizing gripper added to =
the=20
        bottom-right corner.=20
        <DT><CODE>nID</CODE>=20
        <DD>Window ID for the status bar, you will usually use the =
default=20
        value. </DD></DL>
      <P><CODE>CreateSimpleStatusBar()</CODE> calls the other overload =
to do the=20
      work:</P><PRE>BOOL CFrameWindowImpl::CreateSimpleStatusBar(
    LPCTSTR lpstrText,
    DWORD dwStyle =3D ... SBARS_SIZEGRIP,
    UINT nID =3D ATL_IDW_STATUS_BAR)
{
    ATLASSERT(!::IsWindow(m_hWndStatusBar));
    m_hWndStatusBar =3D ::CreateStatusWindow(dwStyle, lpstrText, m_hWnd, =
nID);
    <SPAN class=3Dcpp-keyword>return</SPAN> (m_hWndStatusBar !=3D NULL);
}</PRE>
      <P>This version checks that a status bar has not been created yet, =
then=20
      calls <CODE>CreateStatusWindow()</CODE> to create the status bar. =
The=20
      status bar's handle is then stored in =
<CODE>m_hWndStatusBar</CODE>.</P>
      <H3><A name=3Dbarsshowhide></A>Showing and hiding the bars</H3>
      <P><CODE>CMainFrame</CODE> also has a <I>View</I> menu with two =
commands=20
      to show/hide the toolbar and status bar. These commands have IDs=20
      <CODE>ID_VIEW_TOOLBAR</CODE> and <CODE>ID_VIEW_STATUS_BAR</CODE>.=20
      <CODE>CMainFrame</CODE> has handlers for both commands that show =
or hide=20
      the corresponding bar. Here is the <CODE>OnViewToolBar()</CODE>=20
      handler:</P><PRE>LRESULT CMainFrame::OnViewToolBar(WORD <SPAN =
class=3Dcpp-comment>/*wNotifyCode*/</SPAN>, WORD <SPAN =
class=3Dcpp-comment>/*wID*/</SPAN>,=20
                                  HWND <SPAN =
class=3Dcpp-comment>/*hWndCtl*/</SPAN>, BOOL&amp; <SPAN =
class=3Dcpp-comment>/*bHandled*/</SPAN>)
{
    BOOL bVisible =3D !::IsWindowVisible(m_hWndToolBar);
    ::ShowWindow(m_hWndToolBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE);
    UISetCheck(ID_VIEW_TOOLBAR, bVisible);
    UpdateLayout();
    <SPAN class=3Dcpp-keyword>return</SPAN> <SPAN =
class=3Dcpp-literal>0</SPAN>;
}</PRE>
      <P>This toggles the visible state of the bar, toggles the check =
mark next=20
      to the <I>View|Toolbar</I> menu item, then calls=20
      <CODE>UpdateLayout()</CODE> to position the bar (if it is becoming =

      visible) and resize the view window.</P>
      <H3><A name=3Dbuiltins></A>Built-in features of the bars</H3>
      <P>MFC's framework provides some nice features in its toolbars and =
status=20
      bars, such as tooltips for toolbar buttons and flyby help for menu =
items.=20
      WTL has comparable features implemented in =
<CODE>CFrameWindowImpl</CODE>.=20
      Below are screen shots showing both the tooltip and flyby =
help.</P>
      <P><IMG height=3D233 alt=3D" [Toolbar button tooltip - 4K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/tbtooltip.png" =
width=3D291=20
      align=3Dbottom border=3D0> <IMG height=3D233=20
      alt=3D" [Status bar flyby help - 5K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/tbflyby.png" =
width=3D291=20
      align=3Dbottom border=3D0></P>
      <P><CODE>CFrameWindowImplBase</CODE> has two message handlers that =
are=20
      used for these features. <CODE>OnMenuSelect()</CODE> handles=20
      <CODE>WM_MENUSELECT</CODE>, and it finds the flyby help string =
just like=20
      MFC does - it loads a string resource with the same ID as the=20
      currently-selected menu item, looks for a <CODE>\n</CODE> =
character in the=20
      string, and uses the text preceding the <CODE>\n</CODE> as the =
flyby help.=20
      <CODE>OnToolTipTextA()</CODE> and <CODE>OnToolTipTextW()</CODE> =
handle=20
      <CODE>TTN_GETDISPINFOA</CODE> and <CODE>TTN_GETDISPINFOW</CODE>=20
      respectively to provide tooltip text for toolbar buttons. Those =
handlers=20
      load the same string as <CODE>OnMenuSelect()</CODE>, but use the =
text=20
      <I>following</I> the <CODE>\n</CODE>. (As a side note,=20
      <CODE>OnMenuSelect()</CODE> and <CODE>OnToolTipTextA()</CODE> are =
not=20
      DBCS-safe, as they do not check for DBCS lead/trail bytes when =
looking for=20
      the <CODE>\n</CODE>.) Here's an example of a toolbar button and =
its=20
      associated help string:</P>
      <P><IMG height=3D320 alt=3D" [Toolbar button and help string - 9K] =
"=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/tbbtntext.png" =
width=3D502=20
      align=3Dbottom border=3D0></P>
      <H3><A name=3Ddiffstyles></A>Creating a toolbar with a different =
style</H3>
      <P>If you don't like to have 3D buttons on your toolbar (even =
though flat=20
      UI elements are worse from a usability perspective), then you can =
alter=20
      the toolbar style by passing the style to=20
      <CODE>CreateSimpleToolBar()</CODE>. For example, to create a =
toolbar that=20
      resembles the ones in Internet Explorer, use this code in=20
      <CODE>CMainFrame::OnCreate()</CODE>:</P><PRE>    =
CreateSimpleToolBar ( <SPAN class=3Dcpp-literal>0</SPAN>, =
ATL_SIMPLE_TOOLBAR_STYLE |=20
                               TBSTYLE_FLAT | TBSTYLE_LIST );</PRE>
      <P>Note that if you have the AppWizard add a manifest to your app =
so it=20
      uses common controls version 6 on XP, you don't have a choice with =
the=20
      buttons - toolbars always use flat buttons even if you don't =
specify the=20
      <CODE>TBSTYLE_FLAT</CODE> style when the toolbar is created.</P>
      <H2><A name=3Dtbeditor></A>The Toolbar Editor</H2>
      <P>The AppWizard creates several default buttons as we saw =
earlier. Only=20
      the <I>About</I> button is hooked up, however. You can edit the =
toolbar=20
      just as you do with an MFC project; the editor modifies the =
toolbar=20
      resource that <CODE>CreateSimpleToolBarCtrl()</CODE> uses to build =
the=20
      bar. Here's how the AppWizard-generated toolbar looks in the =
editor:</P>
      <P><IMG height=3D211 alt=3D" [default toolbar in the editor - 7K] =
"=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/tbeditor.png" =
width=3D490=20
      align=3Dbottom border=3D0></P>
      <P>For our clock app, we'll add two buttons to change the colors =
in the=20
      view window, and two buttons that show/hide the toolbar and status =
bar.=20
      Here's our new toolbar:</P>
      <P><IMG height=3D175 alt=3D" [New toolbar buttons - 5K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/newtb.png" =
width=3D438=20
      align=3Dbottom border=3D0></P>
      <P>The buttons are:</P>
      <UL>
        <LI><CODE>IDC_CP_COLORS</CODE>: Change the view to CodeProject =
colors=20
        <LI><CODE>IDC_BW_COLORS</CODE>: Change the view to black and =
white=20
        <LI><CODE>ID_VIEW_STATUS_BAR</CODE>: Show or hide the status bar =

        <LI><CODE>ID_VIEW_TOOLBAR</CODE>: Show or hide the toolbar =
</LI></UL>
      <P>The first two buttons also have items on the <I>View</I> menu. =
They=20
      call a new function in the view class, <CODE>SetColors()</CODE>. =
Each one=20
      passes a foreground and background color that the view will use =
for its=20
      clock display. Handling these two buttons is no different from =
handling=20
      menu items with the <CODE>COMMAND_ID_HANDLER_EX</CODE> macro; =
check out=20
      the sample project if you want to see the details of the message =
handlers.=20
      In the next section, I'll cover UI updating the View Status Bar =
and View=20
      Toolbar buttons so they reflect the current state of the bars.</P>
      <H2><A name=3Duiudpatebtns></A>UI Updating Toolbar Buttons</H2>
      <P>The AppWizard-generated <CODE>CMainFrame</CODE> already has UI =
update=20
      handlers that check and uncheck the <I>View|Toolbar</I> and =
<I>View|Status=20
      Bar</I> menu items. This is done just as the app in Part II - =
there are UI=20
      update macros for each command in =
<CODE>CMainFrame</CODE>:</P><PRE>BEGIN_UPDATE_UI_MAP(CMainFrame)
    UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP)
    UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP)
END_UPDATE_UI_MAP()</PRE>
      <P>Our clock app has toolbar buttons with those same IDs, so the =
first=20

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99国产精品久久久久久久久久| 精品少妇一区二区三区在线播放| 成人综合激情网| 国产一区二区按摩在线观看| 久久精品国产精品青草| 青青青爽久久午夜综合久久午夜| 日本中文字幕一区二区有限公司| 一区二区三区欧美激情| 亚洲在线视频网站| 亚洲免费观看在线视频| 亚洲精品一卡二卡| 亚洲自拍偷拍麻豆| 视频一区在线播放| 麻豆91免费观看| 国产在线播放一区三区四| 国产一区二区不卡老阿姨| 国产精品一级黄| 99视频精品免费视频| 色综合天天狠狠| 欧美色中文字幕| 日韩三级在线免费观看| 精品国产一区a| 国产欧美日本一区视频| 亚洲人成影院在线观看| 一区二区三区免费网站| 亚洲二区在线视频| 久久国产精品99久久人人澡| 国产不卡视频在线观看| 99精品欧美一区二区三区小说 | 3751色影院一区二区三区| 日韩欧美一区二区三区在线| 2021国产精品久久精品| 国产精品久久久久久一区二区三区| 亚洲欧洲制服丝袜| 日本成人中文字幕| 粉嫩嫩av羞羞动漫久久久| 91影院在线免费观看| 欧美日韩久久一区二区| 久久免费电影网| 一级日本不卡的影视| 免费成人小视频| 92精品国产成人观看免费 | 国产精品私人影院| 亚洲影院免费观看| 国产自产高清不卡| 91美女精品福利| 日韩欧美在线1卡| 国产精品成人一区二区三区夜夜夜| 午夜欧美在线一二页| 国产一区二区三区电影在线观看| 99re这里只有精品视频首页| 91精品在线观看入口| 中文字幕国产一区| 日韩电影一区二区三区四区| 成人免费看视频| 91精品国产美女浴室洗澡无遮挡| 国产精品亲子乱子伦xxxx裸| 天天亚洲美女在线视频| 成人18视频在线播放| 日韩三级在线观看| 一区二区国产盗摄色噜噜| 国产一区二区三区| 欧美日韩一区二区在线观看| 日本一区二区成人| 美国十次了思思久久精品导航| 91玉足脚交白嫩脚丫在线播放| 日韩精品中文字幕一区| 曰韩精品一区二区| 国产91精品在线观看| 日韩一卡二卡三卡| 亚洲午夜免费福利视频| 成人午夜短视频| 日韩欧美国产综合在线一区二区三区| 综合在线观看色| 国产中文字幕一区| 91精品国产色综合久久久蜜香臀| 综合激情网...| 国产成人精品免费在线| 日韩一区二区麻豆国产| 亚洲一区二区三区视频在线播放| 成人午夜短视频| 久久青草欧美一区二区三区| 奇米精品一区二区三区在线观看一 | 美女一区二区三区| 欧美午夜电影在线播放| 日韩久久一区二区| 成人在线一区二区三区| 国产亚洲一区二区在线观看| 男人的j进女人的j一区| 欧美伦理视频网站| 午夜影院在线观看欧美| 在线观看www91| 亚洲综合免费观看高清完整版 | 3d动漫精品啪啪| 午夜精品久久久久久久久久| 91福利精品第一导航| 综合网在线视频| 91亚洲精品久久久蜜桃| 最新国产精品久久精品| 国产v综合v亚洲欧| 国产欧美一区二区精品仙草咪| 精品制服美女丁香| 精品国产一区二区三区忘忧草| 麻豆专区一区二区三区四区五区| 欧美日韩国产成人在线91| 午夜精品在线看| 91麻豆精品国产91久久久| 免费高清视频精品| 日韩西西人体444www| 蜜桃视频一区二区三区在线观看| 欧美卡1卡2卡| 久久不见久久见免费视频1| 精品日产卡一卡二卡麻豆| 国产真实乱偷精品视频免| 久久婷婷综合激情| 国产成a人无v码亚洲福利| 国产精品嫩草影院av蜜臀| 91丨porny丨中文| 一区二区激情小说| 在线电影一区二区三区| 久久精品国产精品亚洲红杏| 久久久www免费人成精品| 成人av先锋影音| 亚洲精选一二三| 宅男噜噜噜66一区二区66| 美女任你摸久久| 欧美激情综合在线| 一本到高清视频免费精品| 亚洲成av人影院在线观看网| 日韩一级大片在线观看| 国产成人精品网址| 一区二区三区在线高清| 欧美高清hd18日本| 国产精品自在在线| 亚洲欧美激情在线| 8x福利精品第一导航| 精品一区二区免费视频| 国产精品毛片无遮挡高清| 欧美日韩一区三区四区| 激情综合五月婷婷| 成人免费一区二区三区视频| 欧美人与性动xxxx| 国产乱人伦偷精品视频不卡| 亚洲日本在线a| 日韩午夜在线影院| 成人v精品蜜桃久久一区| 午夜久久久久久久久久一区二区| 精品国产1区二区| 91九色02白丝porn| 久久精品二区亚洲w码| 国产精品久久午夜| 日韩欧美久久久| 99免费精品在线| 免费日本视频一区| 亚洲欧美日韩人成在线播放| 日韩欧美在线网站| 日本黄色一区二区| 国产麻豆视频精品| 丝袜脚交一区二区| 国产精品―色哟哟| 欧美电视剧在线看免费| 色综合激情五月| 国产精品资源在线| 性久久久久久久| 亚洲色大成网站www久久九九| 欧美α欧美αv大片| 日本大香伊一区二区三区| 国产精品香蕉一区二区三区| 亚洲成人一区在线| 国产精品国产三级国产专播品爱网 | 丝袜诱惑亚洲看片| 亚洲三级小视频| 欧美国产精品v| 精品国产污网站| 3d动漫精品啪啪1区2区免费 | 国产精品成人免费| 精品福利一二区| 8v天堂国产在线一区二区| 91香蕉视频污在线| 国产福利不卡视频| 六月丁香综合在线视频| 亚洲福利一二三区| 亚洲精品国产视频| 国产精品福利一区二区| 久久蜜桃av一区精品变态类天堂| 91精品一区二区三区在线观看| 欧美这里有精品| 色香蕉久久蜜桃| 不卡av电影在线播放| 国产成人精品免费网站| 国产精品自在欧美一区| 久久99精品久久久久久国产越南 | 亚洲va欧美va天堂v国产综合| 亚洲视频香蕉人妖| 中文字幕一区二区三区在线观看 | 国产乱妇无码大片在线观看| 免费人成在线不卡| 蜜臀va亚洲va欧美va天堂| 视频一区中文字幕| 视频在线观看国产精品|