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

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

?? splitter.html

?? windows系統編程 一本很好的書!值得看哦!
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<html>
<head>
<title>Splitter Bar</title>
<meta  name="description" content="Reliable software Win32 Tutorial">
<meta name="keywords" content="splitter, mouse capture, reliable, software, windows, cplusplus">
</head>

<body background="../images/grid.gif" bgcolor="white" text="black">
<script language="JAVASCRIPT">
<!--
if (navigator.onLine){
document.write("<!-- Spidersoft WebZIP Ad Banner Insert -->");
document.write("<TABLE width=100% border=0 cellpadding=0 cellspacing=0>");
document.write("<TR>");
document.write("<TD>");
document.write("<ILAYER id=ad1 visibility=hidden height=60></ILAYER>");
document.write("<NOLAYER>");
document.write("<IFRAME SRC='http://www.spidersoft.com/ads/bwz468_60.htm' width=100% height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></IFRAME>");
document.write("</NOLAYER>");
document.write("</TD>");
document.write("</TR>");
document.write("</TABLE>");
document.write("<!-- End of Spidersoft WebZIP Ad Banner Insert-->");
}
 //-->
</script>

<table cellpadding=10 width="100%">
<tr>
   <td width=100 align="center" valign="middle">
      <a href="../index.htm">
      <img src="../images/rsbullet.gif" alt="RS" border=0 width=39 height=39>
      <br>Home</a>
   </td>
   <td><font face="arial" color="#009966">
       <h1 align=center>Splitter Bar</h1>
       </font>
   </td>
   </tr>
</table>


<table width="100%"><!-- main table -->
<tr>
   <td width=10> <!-- Left margin -->&nbsp;</td>
   <td> <!-- Middle column, there is also the right margin at the end -->

   <table cellpadding=10 cellspacing=0 width="100%">
   <tr>
   <td bgcolor=white>
<hr>
<img src="images/splitter.gif" width=242 height=137 border=0 alt="splitter" align="left" hspace=10>

A splitter bar is a useful control that is not part of the Windows' common bag of controls. How difficult is it to implement it? Not so difficult, as it turns out, once you know the basics of Windows API. The description that follows might seem complicated at first, but you'll be learning several very important techniques that can be used over and over in a variety of situations. Working with child windows, mouse capture, drawing using xor mode, just to mention a few.

<p>A splitter bar is a window. More precisely, it's a child window. It is positioned between two other child windows--we'll call these left and right panes, respectively (or top and bottom, for a horizontal splitter). There must also be a main window that fathers the three children.

<p>Without farther ado, here's the code in WinMain that sets up the stage.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080">
<pre>// Create top window class
TopWinClassMaker topWinClass (WndProcMain, ID_MAIN, hInst, ID_MAIN);
topWinClass.Register ();

// Create child pane classes
WinClassMaker paneClass (WndProcPane, IDC_PANE , hInst);
paneClass.SetSysCursor (IDC_IBEAM);
paneClass.SetDblClicks ();
paneClass.Register ();

<font color="Red">Splitter::RegisterClass (hInst);</font>

// Create top window
ResString caption (hInst, ID_CAPTION);
TopWinMaker topWin (caption, ID_MAIN, hInst);
topWin.Create ();
topWin.Show (cmdShow);</pre>
<!--End Code-->
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
First, we register classes. The top window class is associated with its window procedure <font color="#cc0066"><b>WndProcMain</b></font>, which we'll examine in a moment. The two child panes share the same window class associated with <font color="#cc0066"><b>WndProcPane</b></font>. Next, our own splitter class is registered (we'll see the code soon). Finally, the top window is created and displayed. Child windows are created dynamically during the initialization of the parent window.
<p>Here's the window procedure of the top window.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>LRESULT CALLBACK <font color="#cc0066"><b>WndProcMain</b></font> (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    Controller * pCtrl = GetWinLong&lt;Controller *&gt; (hwnd);

    switch (message)
    {
    case WM_CREATE:
        try
        {
            pCtrl = new Controller (hwnd, reinterpret_cast&lt;<font color="#009966">CREATESTRUCT</font> *&gt;(lParam));
            SetWinLong&lt;Controller *&gt; (hwnd, pCtrl);
        }
        catch (char const * msg)
        {
            <font color="#000099"><b>MessageBox</b></font> (hwnd, msg, "Initialization", 
                MB_ICONEXCLAMATION | MB_OK);
            return -1;
        }
        catch (...)
        {
            <font color="#000099"><b>MessageBox</b></font> (hwnd, "Unknown Error", "Initialization", 
                MB_ICONEXCLAMATION | MB_OK);
            return -1;
        }
        return 0;
    case WM_SIZE:
        pCtrl-&gt;Size (LOWORD(lParam), HIWORD(lParam));
        return 0;
    <font color="Red">case MSG_MOVESPLITTER:
        pCtrl-&gt;MoveSplitter (wParam);
        return 0;</font>
    case WM_DESTROY:
        SetWinLong&lt;Controller *&gt; (hwnd, 0);
        delete pCtrl;
        return 0;
    }

    return ::<font color="#000099"><b>DefWindowProc</b></font> (hwnd, message, wParam, lParam);
}</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>It's a pretty standard window procedure, except for one message, <b>MSG_MOVESPLITTER</b>. This is our own, user-defined message that is sent by the splitter control to the parent window. But first, let's have a look at the main window controller.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>class <font color="#cc0066"><b>Controller</b></font>
{
public:
    Controller (HWND hwnd, CREATESTRUCT * pCreat);
    ~Controller ();
    void Size (int cx, int cy);
    <font color="Red">void MoveSplitter (int x);</font>

private:

    <font color="Red">enum { splitWidth = 8 }</font>;    // width of splitter

    // User Interface
    HWnd            _hwnd;          //Main controller window
    HWnd            _leftWin;
    HWnd            _rightWin;
    <font color="Red">HWnd            _splitter;</font>
    <font color="Red">int             _splitRatio;</font>    // in per cent
    int             _cx;
    int             _cy;

};
</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
It has a handle to itself, the two child panes, and the splitter window. It also stores the current split ratio, in percent.

<p>The controller's constructor is responsible for the creation of child windows.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre><font color="#cc0066"><b>Controller::Controller</b></font> (HWND hwnd, CREATESTRUCT * pCreat)
   :
    _hwnd (hwnd),
    _leftWin (0),
    _rightWin (0),
    _splitter (0),
    _splitRatio (50)
{
    // Create child windows
    {
        ChildWinMaker     leftWinMaker (IDC_PANE, _hwnd, ID_LEFT_WINDOW);
        leftWinMaker.Create ();
        _leftWin.Init (leftWinMaker);

        leftWinMaker.Show ();
    }

    {
        ChildWinMaker  rightWinMaker (IDC_PANE, _hwnd, ID_RIGHT_WINDOW);
        rightWinMaker.Create ();
        _rightWin.Init (rightWinMaker);

        rightWinMaker.Show ();
    }

    <font color="Red">Splitter::MakeWindow (_splitter, _hwnd, ID_SPLITTER);</font>
}
</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
When the user drags the splitter bar, the parent receives the <b>MSG_MOVESPLITTER</b> messages. The parameter <b>wParam</b> contains the new distance of the splitter bar from the left edge of the parent window. In response to such a message, the parent has to resize both child panes and move the splitter. It does it by calling the <font color="#cc0066"><b>Size</b></font> method.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>void <font color="#cc0066"><b>Controller::MoveSplitter</b></font> (int x)
{
    _splitRatio = x * 100 / _cx;
    if (_splitRatio &lt; 0)
        _splitRatio = 0;
		
    else if (_splitRatio &gt; 100)
        _splitRatio = 100;
    Size (_cx, _cy);
}
</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
In general, <font color="#cc0066"><b>Size</b></font> is called whenever the user resizes the main window, but as you've just seen, we also call it when the splitter is moved.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>void <font color="#cc0066"><b>Controller::Size</b></font> (int cx, int cy)
{
    _cx = cx;
    _cy = cy;
    int xSplit = (_cx * _splitRatio) / 100;
    if (xSplit &lt; 0)
        xSplit = 0;
    if (xSplit + splitWidth &gt;= _cx)
        xSplit = _cx - splitWidth;

    <font color="Red">_splitter.MoveDelayPaint (xSplit, 0, splitWidth, cy);</font>
    _leftWin.Move (0, 0, xSplit, cy);
    _rightWin.Move (xSplit + splitWidth, 0, cx - xSplit - splitWidth, cy);

    <font color="Red">_splitter.ForceRepaint ();</font>
}</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
Notice an important trick here. We move the splitter, but delay its repainting until both panes, to its left and to its right, are resized. This technique eliminates some nasty <i>smudging</i>.


<hr size="6" color="Blue">
<b><font size="+1">That's it as far as client code goes. Now you might be interested to see the implementation of the splitter.</font></b>
<hr>
First of all, we like to combine related functions into namespaces. You've seen the calls to <b>Splitter::RegisterClass</b> and <b>Splitter::MakeWindow</b>. The <b>Splitter</b> part of these names is the namespace.
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>namespace <font color="#cc0066"><b>Splitter</b></font>
{
    void <font color="#cc0066"><b>RegisterClass</b></font> (HINSTANCE hInst);
    void <font color="#cc0066"><b>MakeWindow</b></font> (HWnd &amp; hwndSplitter /* out */, HWnd hwndParent, int childId);
};</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>
Here's how these functions are implemented
<hr>
         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>&nbsp;</td>
                      <td bgcolor="#e0e080"><font color="#000000">
<pre>LRESULT CALLBACK WndProcSplitter (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

void <font color="#cc0066"><b>Splitter::RegisterClass</b></font> (HINSTANCE hInst)
{
    WinClassMaker splitterClass (WndProcSplitter, "RsSplitterClass", hInst);
    splitterClass.SetSysCursor (IDC_SIZEWE);
    splitterClass.SetBgSysColor (COLOR_3DFACE);
    splitterClass.Register ();
}

void <font color="#cc0066"><b>Splitter::MakeWindow</b></font> (HWnd &amp; hwndSplitter, HWnd hwndParent, int childId)
{
    ChildWinMaker splitterMaker ("RsSplitterClass", hwndParent, childId);
    splitterMaker.Create ();
    hwndSplitter.Init (splitterMaker);
    splitterMaker.Show ();
}</pre>
<!--End Code--></font>
                       </td>
                       <td width=20>&nbsp;</td>
        </tr>
        </table>
        <!--End of yellow background-->
<hr>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
极品少妇xxxx精品少妇| 国内成+人亚洲+欧美+综合在线| 成人精品在线视频观看| 日韩码欧中文字| 日韩欧美一区电影| 一本大道久久a久久综合婷婷| 五月天丁香久久| 国产精品久久久久影院老司 | 欧美一区二区成人6969| 国产一区二区三区观看| 亚洲成人在线网站| 中文字幕不卡在线观看| 日韩一卡二卡三卡四卡| av电影一区二区| 国产伦精品一区二区三区视频青涩 | 国产精品一二一区| 午夜视频在线观看一区二区| 日韩影院精彩在线| 亚洲图片一区二区| 亚洲久草在线视频| 中文字幕一区二区三区四区 | 精品视频1区2区| 91丝袜美腿高跟国产极品老师 | 欧美精品色一区二区三区| 成人精品鲁一区一区二区| 亚洲午夜一区二区三区| 日本系列欧美系列| 视频一区在线播放| 国产露脸91国语对白| 92国产精品观看| 色狠狠色噜噜噜综合网| 91小视频在线免费看| 欧美一级免费大片| 中文一区二区在线观看| 日韩不卡免费视频| 成人的网站免费观看| 91精品国产综合久久久久久久| 在线看一区二区| 欧美影片第一页| 欧美久久一区二区| 国产欧美一区二区三区鸳鸯浴 | 国产伦精品一区二区三区免费 | 久久久www免费人成精品| 日韩精品一区二| 亚洲欧美电影一区二区| 亚洲主播在线播放| 日韩精品乱码免费| 不卡一二三区首页| 精品粉嫩超白一线天av| 国产日产欧美一区| 男女视频一区二区| 国产91丝袜在线观看| 97精品超碰一区二区三区| 欧美mv日韩mv国产| 国产精品久久久久桃色tv| 蜜臀91精品一区二区三区 | 亚洲国产精品麻豆| av色综合久久天堂av综合| 欧美岛国在线观看| 日韩不卡手机在线v区| 欧美三级日韩三级| 亚洲一区免费在线观看| 色综合久久66| 伊人婷婷欧美激情| 在线观看亚洲成人| 亚洲女爱视频在线| 一本色道久久综合亚洲aⅴ蜜桃| 国产亚洲成年网址在线观看| 亚洲日本一区二区| 成人h精品动漫一区二区三区| 久久精品一区二区三区不卡牛牛 | k8久久久一区二区三区| 国产偷国产偷精品高清尤物| 久久99精品久久久久久国产越南| 欧美亚洲一区二区在线观看| 一区二区三区免费在线观看| 蜜臀精品久久久久久蜜臀 | 亚洲免费观看高清完整版在线观看熊 | 一区二区不卡在线视频 午夜欧美不卡在 | 日韩理论片在线| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 精品制服美女丁香| 精品国产免费人成电影在线观看四季| 美女尤物国产一区| 亚洲精品一线二线三线| 国产99久久久久久免费看农村| 中文字幕成人av| 91国产免费看| 五月天国产精品| 久久久久久久久蜜桃| eeuss国产一区二区三区| 亚洲综合一区二区三区| 欧美精品 日韩| 国产精品一区二区久激情瑜伽 | 国产精品18久久久久久vr| 欧洲av在线精品| 丝袜脚交一区二区| 久久精品视频在线看| 91在线视频观看| 日日夜夜免费精品| 久久精品无码一区二区三区| 91老师片黄在线观看| 偷窥少妇高潮呻吟av久久免费| 日韩视频免费观看高清完整版在线观看 | 中文字幕一区二区三区在线观看 | 精品国产一区二区三区四区四 | 成人的网站免费观看| 亚洲午夜久久久久中文字幕久| 制服丝袜国产精品| 懂色一区二区三区免费观看| 亚洲激情欧美激情| www国产成人免费观看视频 深夜成人网| 午夜电影久久久| 久久精品一区八戒影视| 欧美视频在线不卡| 国产69精品久久久久毛片| 一区二区三区成人| 久久综合九色综合欧美98| 欧美在线观看视频在线| 成人毛片视频在线观看| 日本不卡一二三区黄网| 亚洲丝袜美腿综合| 2020国产精品久久精品美国| 欧美午夜寂寞影院| 成人小视频免费在线观看| 男人的j进女人的j一区| 亚洲一区在线播放| 亚洲婷婷在线视频| 国产日产欧美精品一区二区三区| 欧美高清hd18日本| 一本久道中文字幕精品亚洲嫩| 久久66热偷产精品| 首页欧美精品中文字幕| 亚洲一卡二卡三卡四卡无卡久久| 国产精品日韩成人| 欧美日本乱大交xxxxx| 激情久久五月天| 天天av天天翘天天综合网色鬼国产 | 国产成人aaaa| 国产在线视频不卡二| 免费观看在线综合| 日韩专区中文字幕一区二区| 亚洲精品免费在线| 亚洲欧美视频在线观看| 国产精品乱码久久久久久| 久久久国产综合精品女国产盗摄| 日韩一卡二卡三卡| 日韩精品一区二区三区在线播放| 欧美精品色综合| 欧美肥妇bbw| 91精品国产全国免费观看| 欧美日高清视频| 日韩视频一区在线观看| 日韩欧美美女一区二区三区| 精品国产成人系列| 国产欧美一区二区精品久导航| 国产拍揄自揄精品视频麻豆| 中文成人综合网| 亚洲精品水蜜桃| 五月天激情小说综合| 极品瑜伽女神91| 国产成人精品午夜视频免费| 成人激情图片网| 在线观看亚洲精品| 欧美一二三四区在线| 2020日本不卡一区二区视频| 国产精品欧美极品| 亚洲男人天堂av| 日日夜夜精品视频免费 | 国产欧美久久久精品影院| 欧美激情一二三区| 亚洲一区二区三区三| 天天影视网天天综合色在线播放| 麻豆中文一区二区| 成人av在线看| 欧美日韩国产精品成人| 久久嫩草精品久久久精品一| 综合亚洲深深色噜噜狠狠网站| 一区二区在线看| 精油按摩中文字幕久久| 成人精品电影在线观看| 欧美日韩性生活| 久久精品日韩一区二区三区| 亚洲综合色婷婷| 国产剧情在线观看一区二区| 91麻豆国产精品久久| 日韩一区二区高清| 亚洲精品第一国产综合野| 久久99精品国产.久久久久久| 丁香婷婷综合激情五月色| 欧美群妇大交群的观看方式| 国产片一区二区三区| 日韩电影在线免费看| av一区二区三区在线| 日韩欧美国产午夜精品| 一区二区三区高清在线| voyeur盗摄精品| 日韩女优av电影在线观看| 亚洲老司机在线| 成人性生交大片|