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

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

?? polywin.cpp

?? 英文版的 想要的話可以下載了 為大家服務(wù)
?? CPP
字號:
/*
 * POLYWIN.CPP
 * Polyline Component Chapter 19
 *
 * Window procedure for the polyline drawing window and support
 * functions.
 *
 * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
 *
 * Kraig Brockschmidt, Microsoft
 * Internet  :  kraigb@microsoft.com
 * Compuserve:  >INTERNET:kraigb@microsoft.com
 */


#include "polyline.h"


/*
 * PolylineWndProc
 *
 * Purpose:
 *  Window procedure for the polyline drawing window.
 */

LRESULT APIENTRY PolylineWndProc(HWND hWnd, UINT iMsg
    , WPARAM wParam, LPARAM lParam)
    {
    PCPolyline      ppl;
    PAINTSTRUCT     ps;
    HDC             hDC;
    POINTS          pt;
    RECT            rc;

    ppl=(PCPolyline)GetWindowLong(hWnd, PLWL_STRUCTURE);

    switch (iMsg)
        {
        case WM_CREATE:
            ppl=(PCPolyline)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLong(hWnd, PLWL_STRUCTURE, (LONG)ppl);

            //CHAPTER19MOD
            //Moved call to New() to Init.
            ppl->m_hWnd=hWnd;
            //End CHAPTER19MOD
            break;


        case WM_PAINT:
            hDC=BeginPaint(hWnd, &ps);
            //CHAPTER19MOD
            //Modified Draw a little
            GetClientRect(hWnd, &rc);
            ppl->Draw(hDC, FALSE, TRUE, &rc, NULL);
            //End CHAPTER19MOD
            EndPaint(hWnd, &ps);
            break;


        case WM_LBUTTONDOWN:
            //Stop if we are already at the limit.
            if (CPOLYLINEPOINTS==ppl->m_pl.cPoints)
                {
                MessageBeep(0);
                break;
                }

            //Convert the points into 0-32767 range
            GetClientRect(hWnd, &rc);
            pt=MAKEPOINTS(lParam);
            ppl->PointScale(&rc, &pt, FALSE);

            ppl->m_pl.rgpt[ppl->m_pl.cPoints++]=pt;

            //Draw the lines to this new point only.
            hDC=GetDC(hWnd);
            //CHAPTER19MOD
            ppl->Draw(hDC, FALSE, FALSE, &rc, NULL);
            //End CHAPTER19MOD
            ReleaseDC(hWnd, hDC);

            if (NULL!=ppl->m_pAdv)
                ppl->m_pAdv->OnPointChange();

            //CHAPTER19MOD
            //Notifications necessary to support compound documents.
            ppl->SendAdvise(OBJECTCODE_DATACHANGED);
            //End CHAPTER19MOD
            break;


        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }

    return 0L;
    }







/*
 * CPolyline::Draw
 *
 * Purpose:
 *  Paints the current line in the polyline window.
 *
 * Parameters:
 *  hDC             HDC to draw on, a metafile or printer DC.
 *  fMetafile       BOOL indicating if hDC is a metafile or not,
 *                  so we can avoid operations that RIP.
 *  fEntire         BOOL indicating if we should draw the entire
 *                  figure or not.
 *  pRect           LPRECT defining the bounds in which to draw.
 *  ppl             PPOLYLINEDATA to draw.  If NULL, use current.
 *
 * Return Value:
 *  None
 */

void CPolyline::Draw(HDC hDC, BOOL fMetafile, BOOL fEntire
    , LPRECT pRect, PPOLYLINEDATA ppl)
    {
    //CHAPTER19MOD
    HBRUSH          hBrush;
    HPEN            hPen;
    HGDIOBJ         hObj1, hObj2;
    UINT            i, j;
    int             nDC;
    POINTS          pt1,pt2;
    POINT           rgpt[CPOLYLINEPOINTS];

    if (NULL==ppl)
        ppl=&m_pl;

    nDC=SaveDC(hDC);

    for (i=0; i < ppl->cPoints; i++)
        {
        rgpt[i].x=ppl->rgpt[i].x;
        rgpt[i].y=ppl->rgpt[i].y;
        }

    //Printer and frozen differences handled in IViewObject::Draw

    hPen=CreatePen(ppl->iLineStyle, 1, ppl->rgbLine);
    hObj1=SelectObject(hDC, hPen);

    hBrush=CreateSolidBrush(ppl->rgbBackground);
    hObj2=SelectObject(hDC, hBrush);
    SetBkColor(hDC, ppl->rgbBackground);

    /*
     * Either draw the entire figure or just a single point.  The
     * entire figure also includes erasing the background completely,
     * since hDC may be a metafile DC.  Drawing a single point just
     * updates the figure for that new point.
     */
    if (fEntire || 0==ppl->cPoints)
        {
        //Erase the background for bitmaps and metafiles.
        SelectObject(hDC, GetStockObject(NULL_PEN));
        Rectangle(hDC, pRect->left, pRect->top, pRect->right+1
            , pRect->bottom+1);
        SelectObject(hDC, hPen);

        /*
         * If we are drawing the entire figure, then loop through
         * each point drawing a line to each successive point.
         */

        for (i=0; i < ppl->cPoints; i++)
            {
            for (j=i; j < ppl->cPoints; j++)
                {
                pt1.x=(short)rgpt[i].x;
                pt1.y=(short)rgpt[i].y;
                pt2.x=(short)rgpt[j].x;
                pt2.y=(short)rgpt[j].y;

                PointScale(pRect, &pt1, TRUE);
                PointScale(pRect, &pt2, TRUE);
                MoveToEx(hDC, pt1.x, pt1.y, NULL);
                LineTo(hDC, pt2.x, pt2.y);
                }
            }
        }
    else
        {
        /*
         * If we are only drawing the last point, just cycle once
         * through previous points.
         */

        //Get the last point entered in the array.
        j=ppl->cPoints-1;
        pt1.x=(short)rgpt[j].x;
        pt1.y=(short)rgpt[j].y;
        PointScale(pRect, &pt1, TRUE);

        for (i=0; i < j; i++)
            {
            pt2.x=(short)rgpt[i].x;
            pt2.y=(short)rgpt[i].y;
            PointScale(pRect, &pt2, TRUE);

            MoveToEx(hDC, pt1.x, pt1.y, NULL);
            LineTo(hDC, pt2.x, pt2.y);
            }
        }

    //If we have one point, draw a dot to indicate it's position.
    if (1==ppl->cPoints)
        {
        pt1.x=(short)rgpt[0].x;
        pt1.y=(short)rgpt[0].y;
        PointScale(pRect, &pt1, TRUE);
        SetPixel(hDC, pt1.x, pt1.y, m_pl.rgbLine);
        }

    SelectObject(hDC, hObj1);
    SelectObject(hDC, hObj2);
    DeleteObject(hBrush);
    DeleteObject(hPen);

    RestoreDC(hDC, nDC);
    return;
    //End CHAPTER19MOD
    }







/*
 * CPolyline::PointScale
 *
 * Purpose:
 *  Scales a point to or from a relative window coordinate to a
 *  0-32767 coordinate.
 *
 * Parameters:
 *  pRect           LPRECT of the window.
 *  ppt             LPPOINTS to convert
 *  fScaleToWindow  BOOL indicating direction of scaling.
 *
 * Return Value:
 *  None
 */

void CPolyline::PointScale(LPRECT pRect, LPPOINTS ppt
    , BOOL fScaleToWindow)
    {
    DWORD   cx, cy;

    //Window size
    cx=(DWORD)(pRect->right-pRect->left);
    cy=(DWORD)(pRect->bottom-pRect->top);

    //Prevent crashes
    if (0L==cx) cx=1;
    if (0L==cy) cy=1;

    //Must use DWORD to insure proper scaling.
    //CHAPTER19MOD
    /*
     * As an in-proc server we may not have a rectangle where the
     * top left was (0,0) which was always true when we drew to
     * a Polyline window.  But this may be a container's hDC in
     * which case we'd better place the points in the container's
     * rectangle.  That is, we have to add/subtract pRect->left
     * and ->top in these calculations.
     */

    if (fScaleToWindow)
        {
        ppt->x=pRect->left+(UINT)(((DWORD)ppt->x*cx) >> 15);
        ppt->y=pRect->top+(UINT)(((DWORD)ppt->y*cy)  >> 15);
        }
    else
        {
        ppt->x=(UINT)(((DWORD)(ppt->x - pRect->left) << 15)/cx);
        ppt->y=(UINT)(((DWORD)(ppt->y - pRect->top)  << 15)/cy);
        }
    //End CHAPTER19MOD

    return;
    }



//CHAPTER19MOD
/*
 * PolyDlgProc
 *
 * Purpose:
 *  Dialog procedure for a window in which to display the Polyline
 *  for editing.  This pretty much handles all editing functionality
 *  for the embedded object.
 */

BOOL APIENTRY PolyDlgProc(HWND hDlg, UINT iMsg
    , WPARAM wParam, LPARAM lParam)
    {
    PCPolyline      ppl=NULL;
    HWND            hWnd;
    RECT            rc;
    POINT           pt;
    UINT            uID, uTemp;
    UINT            cx, cy;

   #ifdef WIN32
    ppl=(PCPolyline)GetProp(hDlg, PROP_POINTER);
   #else
    WORD            w1, w2;

    w1=(WORD)GetProp(hDlg, PROP_SELECTOR);
    w2=(WORD)GetProp(hDlg, PROP_OFFSET);

    ppl=(PCPolyline)MAKELP(w1, w2);
   #endif

    switch (iMsg)
        {
        case WM_INITDIALOG:
            ppl=(PCPolyline)lParam;
            ppl->m_hDlg=hDlg;

           #ifdef WIN32
            //Properties are 32-bits in Win32
            SetProp(hDlg, PROP_POINTER, (HANDLE)ppl);
           #else
            SetProp(hDlg, PROP_SELECTOR, (HANDLE)SELECTOROF(ppl));
            SetProp(hDlg, PROP_OFFSET,   (HANDLE)OFFSETOF(ppl));
           #endif

            //Create the Polyline to exactly cover the static rect.
            hWnd=GetDlgItem(hDlg, ID_POLYLINERECT);
            GetWindowRect(hWnd, &rc);
            SETPOINT(pt, rc.left, rc.top);
            ScreenToClient(hDlg, &pt);

            //Set the polyline just within the black frame
            SetRect(&rc, pt.x, pt.y, pt.x+(rc.right-rc.left)
                , pt.y+(rc.bottom-rc.top));
            InflateRect(&rc, -1, -1);

            //Try to create the window.
            ppl->m_pImpIPolyline->Init(hDlg, &rc, WS_CHILD | WS_VISIBLE
                , ID_POLYLINE);

            //Set the initial line style radiobutton.
            ppl->m_pImpIPolyline->LineStyleGet(&uTemp);
            CheckRadioButton(hDlg, ID_LINESOLID, ID_LINEDASHDOTDOT
                , uTemp+ID_LINEMIN);

            //Don't set focus--it takes it away from the container.
            return FALSE;


        case WM_SHOWWINDOW:
            if (LOWORD(wParam))
                {
                //Center the dialog on the screen
                cx=GetSystemMetrics(SM_CXSCREEN);
                cy=GetSystemMetrics(SM_CYSCREEN);
                GetWindowRect(hDlg, &rc);
                SetWindowPos(hDlg, NULL, (cx-(rc.right-rc.left))/2
                    , (cy-(rc.bottom-rc.top))/2, 0, 0, SWP_NOZORDER
                    | SWP_NOSIZE);

                //We didn't SetFocus from WM_INITDIALOG.  Do it now.
                SetFocus(GetDlgItem(hDlg, IDOK));
                }

            break;


        case WM_COMMAND:
            uID=LOWORD(wParam);

            switch (uID)
                {
                case IDOK:
                    //Close the dialog, but save first.
                    if (NULL!=ppl)
                        {
                        //IOleObject::Close does what we want
                        ppl->m_pImpIOleObject->Close
                            (OLECLOSE_SAVEIFDIRTY);
                        }

                    break;

                case ID_UNDO:
                    if (NULL!=ppl)
                        ppl->m_pImpIPolyline->Undo();
                    break;

                case ID_COLORLINE:
                case ID_COLORBACK:
                    if (NULL!=ppl)
                        {
                        UINT            i;
                        COLORREF        rgColors[16];
                        CHOOSECOLOR     cc;

                        //Invoke the color chooser for either color
                        uTemp=(ID_COLORBACK==uID)
                            ? POLYLINECOLOR_BACKGROUND
                            : POLYLINECOLOR_LINE;

                        for (i=0; i<16; i++)
                            rgColors[i]=RGB(0, 0, i*16);

                        memset(&cc, 0, sizeof(CHOOSECOLOR));
                        cc.lStructSize=sizeof(CHOOSECOLOR);
                        cc.lpCustColors=rgColors;
                        cc.hwndOwner=hDlg;
                        cc.Flags=CC_RGBINIT;
                        ppl->m_pImpIPolyline->ColorGet(uTemp
                            , &cc.rgbResult);

                        if (ChooseColor(&cc))
                            {
                            //rgColor is just some COLORREF pointer
                            ppl->m_pImpIPolyline->ColorSet(uTemp
                                , cc.rgbResult, rgColors);
                            }
                        }
                    break;

                case ID_LINESOLID:
                case ID_LINEDASH:
                case ID_LINEDOT:
                case ID_LINEDASHDOT:
                case ID_LINEDASHDOTDOT:
                    if (NULL!=ppl)
                        {
                        ppl->m_pImpIPolyline
                            ->LineStyleSet(uID-ID_LINEMIN, &uTemp);
                        }

                    break;
                }
            break;

        case WM_DESTROY:
           #ifdef WIN32
            RemoveProp(hDlg, PROP_POINTER);
           #else
            RemoveProp(hDlg, PROP_SELECTOR);
            RemoveProp(hDlg, PROP_OFFSET);
           #endif
            break;

        case WM_CLOSE:
            //This will do the IDOK handling, then send POLYM_CLOSE
            SendCommand(hDlg, IDOK, 0, NULL);
            break;

        case POLYM_CLOSE:
            ShowWindow(hDlg, SW_HIDE);
            ppl->SendAdvise(OBJECTCODE_HIDEWINDOW);
            break;
        }

    return FALSE;
    }

//End CHAPTER19MOD

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品欧美一区二区三区不卡| 91视频你懂的| 天天操天天色综合| 91精品国产91热久久久做人人| 亚洲无人区一区| 欧美一区二区在线免费观看| 国产呦萝稀缺另类资源| 国产精品第一页第二页第三页| 91国偷自产一区二区开放时间| 日日夜夜精品视频天天综合网| 3d成人动漫网站| 岛国av在线一区| 亚洲卡通欧美制服中文| 日韩美女一区二区三区| 不卡av在线网| 国精产品一区一区三区mba视频| 亚洲天堂av老司机| 精品久久久久久久一区二区蜜臀| 91丨porny丨中文| 国产乱码字幕精品高清av| 亚洲成av人片在线观看| 18欧美亚洲精品| 精品国产一区二区三区av性色| 97国产精品videossex| 国产乱子伦视频一区二区三区| 性做久久久久久| 91毛片在线观看| 成人免费看视频| 国产69精品久久777的优势| 日本在线不卡一区| 亚洲 欧美综合在线网络| 亚洲麻豆国产自偷在线| 欧美经典一区二区三区| 亚洲综合偷拍欧美一区色| 久久蜜桃av一区二区天堂 | 日韩一区二区三区免费看 | 亚洲欧洲国产日本综合| 国产精品二三区| 1000精品久久久久久久久| 中文字幕在线一区免费| 国产精品色哟哟| 日韩美女久久久| 亚洲午夜久久久久| 天堂成人免费av电影一区| 全部av―极品视觉盛宴亚洲| 男女视频一区二区| 成人午夜激情在线| 在线一区二区视频| 精品国产sm最大网站| 中文字幕高清不卡| 亚洲欧美日韩国产综合| 五月天久久比比资源色| 韩国三级电影一区二区| 99久久久国产精品免费蜜臀| 欧美日韩一区二区在线视频| 成人欧美一区二区三区1314| 国产精品一色哟哟哟| 成人动漫精品一区二区| 久久亚洲一区二区三区明星换脸| 亚洲免费观看高清完整| 国产精品99久久久久久久女警 | 日韩中文欧美在线| 性感美女极品91精品| 日韩国产在线观看一区| 国产精品99久久久久久似苏梦涵 | 欧美手机在线视频| 这里只有精品99re| 精品欧美乱码久久久久久1区2区| 欧美xxxx老人做受| 国产精品久久久久久久久免费桃花| 亚洲男人的天堂一区二区| 亚洲成av人片一区二区三区| 极品美女销魂一区二区三区免费 | 2023国产精华国产精品| 亚洲电影在线播放| 国产成人午夜精品影院观看视频| 欧美主播一区二区三区美女| 久久久久97国产精华液好用吗| 一区二区三区成人在线视频| 丁香六月综合激情| 26uuu精品一区二区三区四区在线| 一区二区三区精密机械公司| 丁香六月综合激情| 久久在线免费观看| 美女视频黄频大全不卡视频在线播放| jizzjizzjizz欧美| 国产欧美一区二区三区鸳鸯浴 | 欧美天天综合网| 亚洲欧洲精品一区二区精品久久久| 国产麻豆成人传媒免费观看| 精品理论电影在线观看| 久久99热这里只有精品| 婷婷国产在线综合| 国产一区二区伦理片| 亚洲欧洲日产国产综合网| 欧美日韩国产三级| 成年人国产精品| 国产精品一区二区x88av| 亚洲精品国产无天堂网2021| 在线播放日韩导航| 99久久国产综合精品女不卡| 国产欧美精品在线观看| 色婷婷综合久久久| 日本午夜一区二区| 亚洲精品在线电影| 色狠狠桃花综合| 免费在线观看一区二区三区| 国产午夜精品美女毛片视频| 91麻豆国产在线观看| 五月天国产精品| 亚洲国产精品二十页| 欧美性受极品xxxx喷水| 国产传媒一区在线| 亚洲一卡二卡三卡四卡| 精品国产一区二区亚洲人成毛片| 懂色一区二区三区免费观看| 一区二区日韩电影| 欧美成人vr18sexvr| 欧美日韩成人高清| 91丝袜国产在线播放| 国产成人亚洲综合a∨婷婷图片| 综合亚洲深深色噜噜狠狠网站| 91精品啪在线观看国产60岁| 成人成人成人在线视频| 国产在线播精品第三| 青青草97国产精品免费观看| 亚洲三级电影网站| 国产精品视频第一区| 亚洲精品一区二区三区四区高清 | 亚洲精品少妇30p| 久久久久9999亚洲精品| 精品日韩一区二区三区 | 色诱亚洲精品久久久久久| 国产成人亚洲综合a∨猫咪| 久久99精品国产麻豆不卡| 日韩高清在线不卡| 调教+趴+乳夹+国产+精品| 亚洲与欧洲av电影| 一区二区三区在线播放| 国产精品黄色在线观看| 国产精品久久久久久久午夜片| 久久久亚洲精品石原莉奈| 精品国产乱码久久久久久久| 国产精品美女一区二区| 中文在线一区二区| 亚洲人成网站精品片在线观看| 亚洲综合免费观看高清在线观看| 午夜电影网一区| 成人丝袜视频网| 制服丝袜亚洲精品中文字幕| 中文字幕av一区 二区| 亚洲一级在线观看| caoporn国产精品| 91精品国产aⅴ一区二区| 18欧美乱大交hd1984| 国内精品国产成人国产三级粉色 | 色婷婷亚洲一区二区三区| 日韩欧美视频在线| 亚洲综合激情网| 成人视屏免费看| 精品99一区二区| 亚洲成人免费观看| 一本大道久久a久久精二百| 欧美精品一区在线观看| 亚洲123区在线观看| 99vv1com这只有精品| 久久综合色婷婷| 天天免费综合色| 欧美日韩免费观看一区二区三区| 国产视频一区不卡| 韩国欧美一区二区| 日韩三级在线观看| 国产91精品精华液一区二区三区| 国产福利精品一区二区| 中文在线资源观看网站视频免费不卡 | 国产精品综合视频| 国产丝袜在线精品| 欧美在线高清视频| 一区二区三区欧美亚洲| 日韩亚洲欧美一区二区三区| 久久久精品免费免费| 69久久夜色精品国产69蝌蚪网| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 中文字幕国产一区二区| 欧美精品一区二区三区在线| 欧美日韩在线播| 色诱视频网站一区| av电影在线观看一区| 国产激情偷乱视频一区二区三区| 日本欧美一区二区三区| 五月婷婷久久综合| 亚洲狠狠爱一区二区三区| 亚洲美女免费在线| 亚洲欧美电影一区二区| 国产精品久久久一区麻豆最新章节| 精品国产乱码久久| 精品1区2区在线观看| 日韩久久久精品| 日韩欧美亚洲国产精品字幕久久久| 7777精品伊人久久久大香线蕉 |