亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
婷婷开心久久网| 91麻豆产精品久久久久久| 国产69精品久久99不卡| 91极品视觉盛宴| 国产女主播视频一区二区| 亚洲国产美国国产综合一区二区| 国内精品久久久久影院一蜜桃| 91欧美一区二区| 久久久久久久电影| 五月婷婷欧美视频| 91尤物视频在线观看| 久久精品日产第一区二区三区高清版| 亚洲福利一二三区| 91免费看片在线观看| 久久久久国产精品免费免费搜索| 亚洲成人免费av| 在线看不卡av| 中文字幕欧美日韩一区| 精品一区二区三区免费毛片爱 | 日韩电影在线一区二区| 91免费在线视频观看| 中文字幕第一页久久| 国产一区二区毛片| 欧美一个色资源| 日韩成人免费在线| 欧美精品国产精品| 婷婷久久综合九色国产成人| 91福利精品视频| 悠悠色在线精品| 色婷婷av久久久久久久| 亚洲免费伊人电影| 日本福利一区二区| 亚洲国产中文字幕在线视频综合| 91国偷自产一区二区开放时间| 亚洲免费在线看| 欧美亚洲动漫精品| 亚洲不卡一区二区三区| 欧美性videosxxxxx| 亚洲小说欧美激情另类| 在线播放亚洲一区| 日韩专区在线视频| 欧美一区二区视频观看视频| 蜜臀a∨国产成人精品| 欧美一区午夜视频在线观看| 蜜臀精品一区二区三区在线观看 | 欧美大胆人体bbbb| 美国十次了思思久久精品导航| 欧美精品久久一区二区三区 | 亚洲欧美在线高清| 欧美自拍偷拍午夜视频| 亚洲一区二区综合| 91精品国产综合久久久久| 久久草av在线| 国产亚洲婷婷免费| 91丨porny丨首页| 亚洲国产精品久久人人爱蜜臀| 欧美日韩亚洲综合一区 | 精品午夜久久福利影院| 亚洲精品在线观看网站| 国产成人免费视| 国产精品成人一区二区三区夜夜夜 | 中文字幕av一区二区三区免费看| 成人av免费在线观看| 亚洲视频免费在线| 欧美日韩精品一二三区| 国产在线精品一区二区| 中文字幕亚洲电影| 欧美一级高清大全免费观看| 国产成人免费在线视频| 亚洲自拍都市欧美小说| 精品乱人伦小说| av中文字幕不卡| 三级欧美韩日大片在线看| 久久精品视频网| 精品1区2区3区| 成人免费av资源| 亚洲国产日韩一级| 国产福利一区二区三区视频| 精品视频一区 二区 三区| 日本一区二区成人在线| 久久91精品国产91久久小草| 91在线观看污| 国产精品欧美综合在线| 国产一区二区三区四| 欧美日韩一区二区在线观看视频| 国产精品麻豆久久久| 国内精品写真在线观看| 2020国产精品| 国产91清纯白嫩初高中在线观看 | 日韩免费观看高清完整版| 亚洲小少妇裸体bbw| k8久久久一区二区三区 | 91在线精品一区二区三区| 色综合视频在线观看| 91精品国产手机| 日韩影院在线观看| 国产午夜精品一区二区三区四区| 在线91免费看| 欧美国产一区视频在线观看| 久久精品夜夜夜夜久久| 69精品人人人人| 在线一区二区观看| 成人app在线| 国产一本一道久久香蕉| 日本三级亚洲精品| 亚洲成人黄色影院| 亚洲成人一区二区在线观看| 亚洲欧美自拍偷拍色图| 2020日本不卡一区二区视频| 91精品婷婷国产综合久久性色 | 在线免费观看日本一区| 99精品欧美一区二区三区小说| 国内精品视频一区二区三区八戒| 日产精品久久久久久久性色| 亚洲一区二区三区精品在线| 一区二区三区美女| 一片黄亚洲嫩模| 亚洲午夜久久久久久久久久久 | 日韩精品一区二区三区三区免费| 色综合中文字幕| 色综合久久久久网| 91影视在线播放| 欧洲色大大久久| 在线播放国产精品二区一二区四区| 在线免费观看日本一区| 欧美三级日本三级少妇99| 日本精品视频一区二区| 91免费版pro下载短视频| 99国产精品久久| 一本大道av一区二区在线播放| 91免费国产在线| 欧洲一区二区三区在线| 欧美日韩国产乱码电影| 日韩一区二区高清| 久久综合九色综合97婷婷| 国产欧美日韩激情| 亚洲激情校园春色| 午夜久久久久久电影| 久久99精品国产.久久久久| 国产一区二区三区在线观看精品| 国产成人精品在线看| 99久久99精品久久久久久| 欧美亚洲国产bt| 精品日韩欧美在线| 一区在线观看视频| 婷婷中文字幕一区三区| 国产91精品露脸国语对白| 在线观看免费亚洲| 精品少妇一区二区三区在线视频| 中文字幕高清不卡| 日本在线不卡视频| 成人国产精品免费网站| 欧美久久久久久久久中文字幕| 日韩欧美卡一卡二| 亚洲欧美另类小说| 免费观看成人av| 色婷婷国产精品| 欧美电视剧在线观看完整版| 亚洲精选视频在线| 久久精品国产久精国产| 91蝌蚪porny九色| 精品国产网站在线观看| 亚洲精品视频在线观看网站| 国模大尺度一区二区三区| 99v久久综合狠狠综合久久| 在线播放国产精品二区一二区四区| 精品国产乱码久久久久久免费| 亚洲日本va午夜在线影院| 日本aⅴ精品一区二区三区| 成人av综合在线| 亚洲精品在线电影| 亚洲福利视频一区| 大陆成人av片| 精品国内二区三区| 午夜视频一区二区三区| 97久久精品人人爽人人爽蜜臀 | 国产精品日韩精品欧美在线| 免费黄网站欧美| 在线观看欧美黄色| 国产精品久久国产精麻豆99网站| 日本欧美在线观看| 91国偷自产一区二区三区观看| 国产欧美日韩另类视频免费观看| 国产精品九色蝌蚪自拍| av一二三不卡影片| 久久婷婷一区二区三区| 日本不卡一区二区三区高清视频| 欧洲亚洲精品在线| 视频一区国产视频| 精品久久国产字幕高潮| 国模大尺度一区二区三区| 国产三级精品三级| 国产suv精品一区二区883| 国产精品美女久久久久久| 91在线精品一区二区三区| 亚洲欧美日韩人成在线播放| 91精品福利视频| 美腿丝袜亚洲色图| 国产精品久久二区二区| 91免费小视频|