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

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

?? wtl for mfc programmers, part iii.mht

?? 大家知道wtl是window UI庫
?? MHT
?? 第 1 頁 / 共 5 頁
字號:
      step is to add the <CODE>UPDUI_TOOLBAR</CODE> flag to each =
macro:</P><PRE>BEGIN_UPDATE_UI_MAP(CMainFrame)
    UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP <B>| =
UPDUI_TOOLBAR</B>)
    UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP <B>| =
UPDUI_TOOLBAR</B>)
END_UPDATE_UI_MAP()</PRE>
      <P>There are two other functions to call to hook up toolbar button =

      updating, but fortunately the AppWizard code already does them, so =
if you=20
      build the project at this point, the menu items and toolbar =
buttons will=20
      both be updated.</P>
      <H3><A name=3Denabletbupdate></A>Enabling toolbar UI updating</H3>
      <P>If you look in <CODE>CMainFrame::OnCreate()</CODE>, you'll see =
a new=20
      block of code that sets up the initial state of the two =
<I>View</I> menu=20
      items:</P><PRE>LRESULT CMainFrame::OnCreate( ... )
{
<SPAN class=3Dcpp-comment>// ...</SPAN>
    m_hWndClient =3D m_view.Create(...);
=20
    UIAddToolBar(m_hWndToolBar);
    UISetCheck(ID_VIEW_TOOLBAR, <SPAN class=3Dcpp-literal>1</SPAN>);
    UISetCheck(ID_VIEW_STATUS_BAR, <SPAN class=3Dcpp-literal>1</SPAN>);
<SPAN class=3Dcpp-comment>// ...</SPAN>
}</PRE>
      <P><CODE>UIAddToolBar()</CODE> tells <CODE>CUpdateUI</CODE> the=20
      <CODE>HWND</CODE> of our toolbar, so it knows what window to send =
messages=20
      to when it needs to update the button states. The other important =
call is=20
      in <CODE>OnIdle()</CODE>:</P><PRE>BOOL CMainFrame::OnIdle()
{
    UIUpdateToolBar();
    <SPAN class=3Dcpp-keyword>return</SPAN> FALSE;
}</PRE>
      <P>Recall that <CODE>OnIdle()</CODE> is called by=20
      <CODE>CMessageLoop::Run()</CODE> when it has no messages waiting =
in the=20
      message queue. <CODE>UIUpdateToolBar()</CODE> goes through the =
update UI=20
      map, looks for elements with the <CODE>UPDUI_TOOLBAR</CODE> flag =
that have=20
      been changed with calls such as <CODE>UISetCheck()</CODE>, and =
changes the=20
      state of the buttons accordingly. Note that we didn't need these =
two steps=20
      when we were just updating popup menu items, because=20
      <CODE>CUpdateUI</CODE> handles <CODE>WM_INITMENUPOPUP</CODE> and =
updates=20
      the menu when that message is sent.</P>
      <P>If you check out the sample project, it also shows how to UI =
update=20
      top-level menu items in the frame's menu bar. There is an item =
that=20
      executes the <I>Start</I> and <I>Stop</I> commands to start and =
stop the=20
      clock. While this is not a common (or even recommended) thing to =
do --=20
      items in the menu bar should always be popups -- I included it for =
the=20
      sake of completeness in covering <CODE>CUpdateUI</CODE>. Look for =
the=20
      calls to <CODE>UIAddMenuBar()</CODE> and=20
      <CODE>UIUpdateMenuBar()</CODE>.</P>
      <H2><A name=3Duserebar></A>Using a Rebar Instead of a Plain =
Toolbar</H2>
      <P><CODE>CFrameWindowImpl</CODE> also supports using a rebar to =
give your=20
      app a look similar to Internet Explorer. Using a rebar is also the =
way to=20
      go if you need multiple toolbars. To use a rebar, check the Rebar =
box in=20
      the second page of the AppWizard, as shown here:</P>
      <P><IMG height=3D387 alt=3D" [AppWizard pg 2 with rebar checked - =
21K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/appwiz3.png" =
width=3D477=20
      align=3Dbottom border=3D0></P>
      <P>The second sample project, WTLClock3, was made with this option =

      checked. If you're following along in the sample code, open =
WTLClock3=20
      now.</P>
      <P>The first thing you'll notice is that the code to create the =
toolbar is=20
      different. This makes sense since we're using a rebar in this app. =
Here is=20
      the relevant code:</P><PRE>LRESULT CMainFrame::OnCreate(...)
{
    HWND hWndToolBar =3D CreateSimpleToolBarCtrl ( m_hWnd,=20
                           IDR_MAINFRAME, FALSE,=20
                           ATL_SIMPLE_TOOLBAR_PANE_STYLE );
=20
    CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
    AddSimpleReBarBand(hWndToolBar);
<SPAN class=3Dcpp-comment>// ...</SPAN>
}</PRE>
      <P>It begins by creating a toolbar, but using a different style,=20
      <CODE>ATL_SIMPLE_TOOLBAR_PANE_STYLE</CODE>. This is a #define in=20
      atlframe.h that is similar to =
<CODE>ATL_SIMPLE_TOOLBAR_STYLE</CODE>, but=20
      has additional styles such as <CODE>CCS_NOPARENTALIGN</CODE> that =
are=20
      necessary for the toolbar to work properly as the child of the =
rebar.</P>
      <P>The next line calls <CODE>CreateSimpleReBar()</CODE>, which =
creates a=20
      rebar and stores its <CODE>HWND</CODE> in =
<CODE>m_hWndToolBar</CODE>.=20
      Next, <CODE>AddSimpleReBarBand()</CODE> adds a band to the rebar, =
and=20
      tells the rebar that the toolbar will be contained in that =
band.</P>
      <P><IMG height=3D206 alt=3D" [App with rebar - 4K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/rebar.png" =
width=3D252=20
      align=3Dbottom border=3D0></P>
      <P><CODE>CMainFrame::OnViewToolBar()</CODE> is also different. =
Instead of=20
      hiding <CODE>m_hWndToolBar</CODE> (that would hide the entire =
rebar, not=20
      just the one toolbar), it hides the band that contains the =
toolbar.</P>
      <P>If you want to have multiple toolbars, you can create them and =
call=20
      <CODE>AddSimpleReBarBand()</CODE> in <CODE>OnCreate()</CODE> just =
like the=20
      wizard-generated code does for the first toolbar. Since=20
      <CODE>CFrameWindowImpl</CODE> uses the standard rebar control, =
there is no=20
      support for dockable toolbars like in MFC; all the user can do is=20
      rearrange the positions of the toolbars within the rebar.</P>
      <H2><A name=3Dmultipanesb></A>Multi-Pane Status Bars</H2>
      <P>WTL has another status bar class that implements a bar with =
multiple=20
      panes, similar to the default MFC status bar that has CAPS LOCK =
and NUM=20
      LOCK indicators. The class is =
<CODE>CMultiPaneStatusBarCtrl</CODE>, and is=20
      demonstrated in the WTLClock3 sample project. This class supports =
limited=20
      UI updating, as well as a "default" pane that stretches to the =
full width=20
      of the bar to show flyby help when a popup menu is displayed.</P>
      <P>The first step is to declare a =
<CODE>CMultiPaneStatusBarCtrl</CODE>=20
      member variable in <CODE>CMainFrame</CODE>:</P><PRE><SPAN =
class=3Dcpp-keyword>class</SPAN> CMainFrame : <SPAN =
class=3Dcpp-keyword>public</SPAN> ...
{
<SPAN class=3Dcpp-comment>//...</SPAN>
<SPAN class=3Dcpp-keyword>protected</SPAN>:
    CMultiPaneStatusBarCtrl m_wndStatusBar;
};</PRE>
      <P>Then in <CODE>OnCreate()</CODE>, we create the bar and set it =
up for UI=20
      updating:</P><PRE>    m_hWndStatusBar =3D m_wndStatusBar.Create ( =
*<SPAN class=3Dcpp-keyword>this</SPAN> );
    UIAddStatusBar ( m_hWndStatusBar );</PRE>
      <P>Notice that we store the status bar handle in=20
      <CODE>m_hWndStatusBar</CODE>, just like=20
      <CODE>CreateSimpleStatusBar()</CODE> would.</P>
      <P>The next step is to set up the panes by calling=20
      <CODE>CMultiPaneStatusBarCtrl::SetPanes()</CODE>:</P><PRE>    BOOL =
SetPanes(<SPAN class=3Dcpp-keyword>int</SPAN>* pPanes, <SPAN =
class=3Dcpp-keyword>int</SPAN> nPanes, <SPAN =
class=3Dcpp-keyword>bool</SPAN> bSetText =3D <SPAN =
class=3Dcpp-keyword>true</SPAN>);</PRE>
      <P>The parameters are:</P>
      <DL>
        <DT><CODE>pPanes</CODE>=20
        <DD>An array of pane IDs=20
        <DT><CODE>nPanes</CODE>=20
        <DD>The number of elements in <CODE>pPanes</CODE>=20
        <DT><CODE>bSetText</CODE>=20
        <DD>If true, all panes have their text set immediately. This is=20
        explained below. </DD></DL>
      <P>The pane IDs can either be <CODE>ID_DEFAULT_PANE</CODE> to =
create the=20
      flyby help pane, or IDs of strings in the string table. For the=20
      non-default panes, WTL loads up the string and calculates its =
width, then=20
      sets the corresponding pane to the same width. This is the same =
logic that=20
      MFC uses.</P>
      <P><CODE>bSetText</CODE> controls whether the panes show the =
strings=20
      immediately. If it is set to true, <CODE>SetPanes()</CODE> shows =
the=20
      strings in each pane, otherwise the panes are left blank.</P>
      <P>Here's our call to <CODE>SetPanes()</CODE>:</P><PRE>    <SPAN =
class=3Dcpp-comment>// Create the status bar panes.</SPAN>
<SPAN class=3Dcpp-keyword>int</SPAN> anPanes[] =3D { ID_DEFAULT_PANE, =
IDPANE_STATUS,=20
                  IDPANE_CAPS_INDICATOR };
=20
    m_wndStatusBar.SetPanes ( anPanes, <SPAN =
class=3Dcpp-literal>3</SPAN>, <SPAN class=3Dcpp-keyword>false</SPAN> =
);</PRE>
      <P>The string <CODE>IDPANE_STATUS</CODE> is "@@@@", which should=20
      (hopefully) be enough space to show the two clock status strings =
"Running"=20
      and "Stopped". Just as with MFC, you have to approximate how much =
space=20
      you'll need for the pane. The string =
<CODE>IDPANE_CAPS_INDICATOR</CODE> is=20
      "CAPS".</P>
      <H3><A name=3Duiupdatesb></A>UI updating the panes</H3>
      <P>In order for us to update the pane text, we'll need entries in =
the=20
      update UI map:</P><PRE>    BEGIN_UPDATE_UI_MAP(CMainFrame)
        <SPAN class=3Dcpp-comment>//...</SPAN>
        UPDATE_ELEMENT(<SPAN class=3Dcpp-literal>1</SPAN>, =
UPDUI_STATUSBAR)  <SPAN class=3Dcpp-comment>// clock status</SPAN>
        UPDATE_ELEMENT(<SPAN class=3Dcpp-literal>2</SPAN>, =
UPDUI_STATUSBAR)  <SPAN class=3Dcpp-comment>// CAPS indicator</SPAN>
    END_UPDATE_UI_MAP()</PRE>
      <P>The first parameter in the macro is the <I>index</I> of the =
pane, not=20
      its ID. This is unfortunate because if you rearrange the panes, =
you need=20
      to remember to update the numbers in the map.</P>
      <P>Since we pass false as the third parameter to =
<CODE>SetPanes()</CODE>,=20
      the panes are initially empty. Our next step is to set the initial =
text of=20
      the clock status pane to "Running".</P><PRE>    <SPAN =
class=3Dcpp-comment>// Set the initial text for the clock status =
pane.</SPAN>
    UISetText ( <SPAN class=3Dcpp-literal>1</SPAN>, _T(<SPAN =
class=3Dcpp-string>"Running"</SPAN>) );</PRE>
      <P>Again, the first parameter is the index of the pane.=20
      <CODE>UISetText()</CODE> is the only UI update call that works on =
status=20
      bars.</P>
      <P>Finally, we need to add a call to =
<CODE>UIUpdateStatusBar()</CODE> in=20
      <CODE>CMainFrame::OnIdle()</CODE> so that the status bar panes are =
updated=20
      at idle time:</P><PRE>BOOL CMainFrame::OnIdle()
{
    UIUpdateToolBar();
    <B>UIUpdateStatusBar();</B>
    <SPAN class=3Dcpp-keyword>return</SPAN> FALSE;
}</PRE>
      <P>There is a problem in <CODE>CUpdateUI</CODE> that appears when =
you use=20
      <CODE>UIUpdateStatusBar()</CODE> - text in menu items is not =
updated after=20
      you use <CODE>UISetText()</CODE>! If you look at the WTLClock3 =
project,=20
      the clock start/stop menu item has been moved to a <I>Clock</I> =
menu, and=20
      the handler for that command sets the menu item's text. However, =
if the=20
      call to <CODE>UIUpdateStatusBar()</CODE> is present, the=20
      <CODE>UISetText()</CODE> call does not take effect. I have not=20
      investigated whether this can be fixed, so keep it in mind if you =
plan on=20
      updating the text in menu items.</P>
      <P>Finally, we need to check the state of the CAPS LOCK key and =
update=20
      pane 2 accordingly. This code can go right in =
<CODE>OnIdle()</CODE>, so=20
      the state will get checked every time the app goes =
idle.</P><PRE>BOOL CMainFrame::OnIdle()
{
    <B><SPAN class=3Dcpp-comment>// Check the current Caps Lock state, =
and if it is on, show the</SPAN>
    <SPAN class=3Dcpp-comment>// CAPS indicator in pane 2 of the status =
bar.</SPAN>
    <SPAN class=3Dcpp-keyword>if</SPAN> ( GetKeyState(VK_CAPITAL) &amp; =
<SPAN class=3Dcpp-literal>1</SPAN> )
        UISetText ( <SPAN class=3Dcpp-literal>2</SPAN>, =
CString(LPCTSTR(IDPANE_CAPS_INDICATOR)) );
    <SPAN class=3Dcpp-keyword>else</SPAN>
        UISetText ( <SPAN class=3Dcpp-literal>2</SPAN>, _T(<SPAN =
class=3Dcpp-string>""</SPAN>) );</B>
=20
    UIUpdateToolBar();
    UIUpdateStatusBar();
    <SPAN class=3Dcpp-keyword>return</SPAN> FALSE;
}</PRE>
      <P>The first <CODE>UISetText()</CODE> call loads the "CAPS" string =
from=20
      the string table using a neat (but fully documented) trick in the=20
      <CODE>CString</CODE> constructor.</P>
      <P>So after all that code, here's what the status bar looks =
like:</P>
      <P><IMG height=3D218 alt=3D" [Multipane status bar - 4K] "=20
      src=3D"http://www.codeproject.com/wtl/WTL4MFC3/multipanesb.png" =
width=3D265=20
      align=3Dbottom border=3D0></P>
      <H2><A name=3Dupnext></A>Up Next: All About Dialogs</H2>
      <P>In Part IV, I'll cover dialogs (both the ATL classes and WTL=20
      enhancements), control wrappers, and more WTL message handling=20
      improvements that relate to dialogs and controls.</P>
      <H2><A name=3Dreferences></A>References</H2>
      <P><A =
href=3D"http://www.codeproject.com/wtl/multipanestatusbar.asp">"How to=20
      use the WTL multipane status bar control"</A> by Ed Gadziemski =
goes into=20
      more detail on the <CODE>CMultiPaneStatusBarCtrl</CODE> class.=20
      <H2><A name=3Drevisionhistory></A>Revision History</H2>
      <P>April 11, 2003: Article first published.=20
</P><!-- Article Ends --></DIV>
      <H2>About Michael Dunn</H2>
      <TABLE width=3D"100%" border=3D0>
        <TBODY>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色94色欧美sute亚洲线路一ni | 亚洲va韩国va欧美va| 亚洲自拍偷拍综合| 男女视频一区二区| 粉嫩13p一区二区三区| 色婷婷综合激情| 日韩一区二区三区免费看| 国产欧美日本一区二区三区| 成人欧美一区二区三区小说| 亚洲影院理伦片| 国产一区二区美女| 91国偷自产一区二区开放时间 | 亚洲国产精品欧美一二99| 奇米综合一区二区三区精品视频| 国产精品一区二区在线看| 91浏览器打开| 欧美电视剧免费全集观看| 国产精品国产自产拍在线| 偷拍一区二区三区| 成人国产精品免费网站| 欧美日韩高清在线| 国产精品三级久久久久三级| 天天综合日日夜夜精品| 成人国产视频在线观看| 日韩欧美在线影院| 中文字幕在线不卡一区二区三区| 免费在线视频一区| 91麻豆国产在线观看| 精品国产sm最大网站免费看| 亚洲乱码一区二区三区在线观看| 国模娜娜一区二区三区| 欧美性大战久久久久久久| 国产欧美视频一区二区| 日韩高清中文字幕一区| 99久久精品国产一区| 日韩欧美自拍偷拍| 一区二区三区日韩| 懂色av中文一区二区三区| 欧美一区二区三区人| 亚洲乱码国产乱码精品精98午夜 | 精品日韩av一区二区| 岛国精品在线播放| 宅男噜噜噜66一区二区66| 亚洲色图另类专区| 国产精品一区二区男女羞羞无遮挡| 欧美日韩情趣电影| 亚洲精选在线视频| 成人午夜视频免费看| 精品美女一区二区| 奇米影视7777精品一区二区| 欧美在线视频全部完| 中文字幕一区二区5566日韩| 极品瑜伽女神91| 欧美电影一区二区| 一二三四社区欧美黄| 99久久精品国产麻豆演员表| 国产三级一区二区三区| 九九九久久久精品| 日韩一二三区视频| 亚洲国产精品久久久男人的天堂| 91婷婷韩国欧美一区二区| 国产欧美日韩综合精品一区二区 | 欧美va日韩va| 日韩精品免费视频人成| 欧美日韩另类国产亚洲欧美一级| 亚洲免费观看视频| thepron国产精品| 国产精品美女久久久久久久 | 亚洲手机成人高清视频| 国产+成+人+亚洲欧洲自线| 精品少妇一区二区三区免费观看 | 欧美性欧美巨大黑白大战| 亚洲卡通动漫在线| 色琪琪一区二区三区亚洲区| 亚洲欧美一区二区三区极速播放| www.久久精品| 亚洲少妇中出一区| 色哦色哦哦色天天综合| 亚洲精品视频观看| 日本韩国欧美三级| 亚洲国产精品久久久久秋霞影院| 在线免费av一区| 五月天激情小说综合| 欧美绝品在线观看成人午夜影视| 日韩精品1区2区3区| 欧美一级欧美一级在线播放| 久久不见久久见免费视频1| 精品国精品国产| 国产精品影音先锋| 国产精品久久久久久久岛一牛影视| 99久免费精品视频在线观看| 亚洲欧美电影一区二区| 欧美系列亚洲系列| 奇米影视在线99精品| 精品国产免费人成电影在线观看四季| 国产一区二区精品久久| 亚洲国产精品成人综合| 91麻豆6部合集magnet| 香蕉成人啪国产精品视频综合网| 9191国产精品| 国产精品一区二区三区四区| 亚洲欧洲精品天堂一级 | 亚洲3atv精品一区二区三区| 日韩亚洲欧美中文三级| 国产高清不卡一区| 一区二区三区在线观看国产| 欧美精品第1页| 韩日精品视频一区| 中文字幕一区日韩精品欧美| 欧美日韩一区高清| 国产又粗又猛又爽又黄91精品| 国产精品视频九色porn| 欧美日韩亚洲高清一区二区| 老司机午夜精品| 中文字幕一区二区三区av| 欧美日韩国产123区| 国产成人免费在线观看| 亚洲一区二区三区精品在线| 精品av久久707| 一本大道综合伊人精品热热| 麻豆精品精品国产自在97香蕉| 国产精品区一区二区三区| 欧美体内she精高潮| 国产乱码精品一区二区三区av | 欧美中文字幕一二三区视频| 捆绑变态av一区二区三区| 亚洲天堂成人网| 精品国偷自产国产一区| 色www精品视频在线观看| 激情综合色播激情啊| 亚洲精品免费在线观看| 精品国产乱码久久久久久浪潮| 91小视频在线| 美女诱惑一区二区| 亚洲美女视频在线观看| 久久亚洲精华国产精华液 | 丝袜诱惑制服诱惑色一区在线观看 | 国产亲近乱来精品视频| 欧美日韩一区二区三区视频| 国产传媒日韩欧美成人| 日韩av在线播放中文字幕| 亚洲视频在线观看一区| 欧美本精品男人aⅴ天堂| 色偷偷一区二区三区| 国产乱码精品一区二区三区忘忧草| 亚洲国产一区视频| 中文字幕在线一区二区三区| 日韩久久免费av| 欧美日韩你懂的| 93久久精品日日躁夜夜躁欧美| 国内外精品视频| 日韩精品久久理论片| 一区二区久久久| 国产精品二区一区二区aⅴ污介绍| 日韩美女视频一区二区在线观看| 欧美系列亚洲系列| 色综合一个色综合| 懂色一区二区三区免费观看| 九九精品视频在线看| 五月天视频一区| 一区二区欧美在线观看| 国产精品久久久久久久蜜臀| 久久天堂av综合合色蜜桃网| 日韩视频免费观看高清完整版在线观看 | 久久久.com| 精品少妇一区二区三区视频免付费 | 久久久99精品久久| 日韩三级精品电影久久久| 欧美人妖巨大在线| 欧美三级日韩在线| 色婷婷久久综合| 97精品久久久久中文字幕| 丰满放荡岳乱妇91ww| 国产成人日日夜夜| 国产成人啪免费观看软件| 国产美女在线精品| 国产主播一区二区三区| 久久精品免费观看| 精品一区二区三区在线播放| 免费欧美在线视频| 免费精品视频在线| 美女高潮久久久| 久久精品国产色蜜蜜麻豆| 六月丁香综合在线视频| 免费看日韩精品| 麻豆免费精品视频| 麻豆精品视频在线| 紧缚捆绑精品一区二区| 国产一区二区主播在线| 国产精品亚洲一区二区三区在线 | 久久久www成人免费毛片麻豆| 欧美va在线播放| 日韩精品一区二区三区视频| 精品毛片乱码1区2区3区| 欧美精品一区二区在线观看| 26uuu精品一区二区在线观看| 精品国产电影一区二区| 精品电影一区二区| 中文字幕免费不卡在线| 亚洲欧洲国产日本综合|