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

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

?? pages.cpp

?? 英文版的 想要的話可以下載了 為大家服務
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*
 * PAGES.CPP
 * Patron Chapter 20
 *
 * Implementation of the CPages class.  See PAGEWIN.CPP and PRINT.CPP
 * for additional member functions.
 *
 * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
 *
 * Kraig Brockschmidt, Microsoft
 * Internet  :  kraigb@microsoft.com
 * Compuserve:  >INTERNET:kraigb@microsoft.com
 */


#include "patron.h"


/*
 * CPages:CPages
 * CPages::~CPages
 *
 * Constructor Parameters:
 *  hInst           HINSTANCE of the application we're in.
 *  cf              UINT application clipboard format.
 */

CPages::CPages(HINSTANCE hInst, UINT cf)
    : CWindow(hInst)
    {
    m_pPageCur=NULL;
    m_iPageCur=NOVALUE;  //Pages are 0 indexed, this is one before
    m_cPages=0;
    m_hWndPageList=NULL;
    m_hFont=NULL;
    m_fSystemFont=FALSE;

    //Initialize to 8.5*11 inch with .25 inch margins as a default.
    m_cx=(LOMETRIC_PER_INCH*17)/2;
    m_cy=LOMETRIC_PER_INCH*11;

    m_xMarginLeft=LOMETRIC_PER_INCH/4;
    m_xMarginRight=LOMETRIC_PER_INCH/4;
    m_yMarginTop=LOMETRIC_PER_INCH/4;
    m_yMarginBottom=LOMETRIC_PER_INCH/4;

    m_xPos=0L;
    m_yPos=0L;

    m_dwIDNext=0;
    m_pIStorage=NULL;

    m_fDirty=FALSE;
    m_cf=cf;

    m_fDragSource=FALSE;
    m_fMoveInPage=FALSE;
    //CHAPTER20MOD
    m_fLinkAllowed=FALSE;
    //End CHAPTER20MOD

    m_fDragRectShown=FALSE;

    m_uScrollInset=GetProfileInt(TEXT("windows")
        , TEXT("DragScrollInset"), DD_DEFSCROLLINSET);

    m_uScrollDelay=GetProfileInt(TEXT("windows")
        , TEXT("DragScrollDelay"), DD_DEFSCROLLDELAY);

    m_uHScrollCode=0;
    m_uVScrollCode=0;

    //CHAPTER20MOD
    m_fShowTypes=FALSE;
    //End CHAPTER20MOD

    return;
    }


CPages::~CPages(void)
    {
    //Ensure memory cleaned up in list; do final IStorage::Release
    StorageSet(NULL, FALSE, FALSE);

    if (NULL!=m_hFont && !m_fSystemFont)
        DeleteObject(m_hFont);

    if (NULL!=m_hWndPageList)
        DestroyWindow(m_hWndPageList);

    //m_hWnd destroyed with the document.
    return;
    }



/*
 * CPages::FIsDirty
 *
 * Purpose:
 *  Tells the caller (document) if anything's happened to dirty us.
 *
 * Parameters:
 *  None
 *
 * Return Value:
 *  None
 */

BOOL CPages::FIsDirty(void)
    {
    return m_fDirty;
    }



/*
 * CPages::Init
 *
 * Purpose:
 *  Instantiates a pages window within a given parent.  The
 *  parent may be a main application window, could be an MDI child
 *  window. We really do not care.
 *
 * Parameters:
 *  hWndParent      HWND of the parent of this window
 *  pRect           LPRECT that this window should occupy
 *  dwStyle         DWORD containing the window's style flags.
 *                  Should contain WS_CHILD | WS_VISIBLE in
 *                  typical circumstances.
 *  uID             UINT ID to associate with this window
 *  pv              LPVOID unused for now.
 *
 * Return Value:
 *  BOOL            TRUE if the function succeeded, FALSE otherwise.
 */

BOOL CPages::Init(HWND hWndParent, LPRECT pRect, DWORD dwStyle
    , UINT uID, LPVOID pv)
    {
    int     cy;

    m_hWnd=CreateWindowEx(WS_EX_NOPARENTNOTIFY, SZCLASSPAGES
        , SZCLASSPAGES, dwStyle, pRect->left, pRect->top
        , pRect->right-pRect->left, pRect->bottom-pRect->top
        , hWndParent, (HMENU)uID, m_hInst, this);

    if (NULL==m_hWnd)
        return FALSE;

    /*
     * Create the hidden listbox we'll use to track pages.  We give
     * it the owner-draw style so we can just store pointers in it.
     */
    m_hWndPageList=CreateWindow(TEXT("listbox"), TEXT("Page List")
        , WS_POPUP | LBS_OWNERDRAWFIXED, 0, 0, 100, 100
        , HWND_DESKTOP, NULL, m_hInst, NULL);

    if (NULL==m_hWndPageList)
        return FALSE;

    //Create a 14 point Arial font, or use the system variable font.
    cy=MulDiv(-14, LOMETRIC_PER_INCH, 72);
    m_hFont=CreateFont(cy, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE
        , ANSI_CHARSET, OUT_TT_PRECIS, CLIP_TT_ALWAYS, PROOF_QUALITY
        , VARIABLE_PITCH | FF_SWISS, TEXT("Arial"));

    if (NULL==m_hFont)
        {
        m_hFont=(HFONT)GetStockObject(ANSI_VAR_FONT);
        m_fSystemFont=TRUE;
        }

    return TRUE;
    }






/*
 * CPages::StorageSet
 *
 * Purpose:
 *  Provides the document's IStorage to the pages for its own use.
 *  If this is a new storage, we initalize it with streams that we
 *  want to always exists.  If this is an open, then we create
 *  our page list from the PageList string we wrote before.
 *
 * Parameters:
 *  pIStorage       LPSTORAGE to the new or opened storage.  If
 *                  NULL, we just clean up and exit.
 *  fChange         BOOL indicating is this was a Save As operation,
 *                  meaning that we have the structure already and
 *                  just need to change the value of m_pIStorage.
 *  fInitNew        BOOL indicating if this is a new storage or one
 *                  opened from a previous save.
 *
 * Return Value:
 *  BOOL            TRUE if successful, FALSE otherwise.
 */

BOOL CPages::StorageSet(LPSTORAGE pIStorage, BOOL fChange
    , BOOL fInitNew)
    {
    DWORD           dwMode=STGM_DIRECT | STGM_READWRITE
                        | STGM_SHARE_EXCLUSIVE;
    HRESULT         hr;
    PCPage          pPage;
    BOOL            fRet=FALSE;
    ULONG           cbRead;
    PAGELIST        pgList;
    LPSTREAM        pIStream;
    LPMALLOC        pIMalloc;
    LPDWORD         pdwID;
    UINT            i;

    //If we're changing saved roots, simply open current page again
    if (fChange)
        {
        if (NULL==pIStorage)
            return FALSE;

        m_pIStorage->Release();
        m_pIStorage=pIStorage;
        m_pIStorage->AddRef();

        PageGet(m_iPageCur, &m_pPageCur, TRUE);
        m_fDirty=FALSE;
        return TRUE;
        }

    if (NULL!=m_hWndPageList)
        {
        //On new or open, clean out whatever it is we have.
        for (i=0; i < m_cPages; i++)
            {
            if (PageGet(i, &pPage, FALSE))
                delete pPage;
            }

        SendMessage(m_hWndPageList, LB_RESETCONTENT, 0, 0L);
        }

    if (NULL!=m_pIStorage)
        m_pIStorage->Release();

    m_pIStorage=NULL;

    //If we're just cleaning up, then we're done.
    if (NULL==pIStorage)
        return TRUE;

    m_pIStorage=pIStorage;
    m_pIStorage->AddRef();

    //If this is a new storage, create the streams we require
    if (fInitNew)
        {
        //Page list header.
        hr=m_pIStorage->CreateStream(SZSTREAMPAGELIST, dwMode
            | STGM_CREATE, 0, 0, &pIStream);

        if (FAILED(hr))
            return FALSE;

        pIStream->Release();

        //Device Configuration
        hr=m_pIStorage->CreateStream(SZSTREAMDEVICECONFIG, dwMode
            | STGM_CREATE, 0, 0, &pIStream);

        if (FAILED(hr))
            return FALSE;

        pIStream->Release();
        return TRUE;
        }


    /*
     * We're opening an existing file:
     *  1)  Configure for the device we're on
     *  2)  Read the Page List and create page entries for each.
     */

    ConfigureForDevice();

    //Read the page list.
    hr=m_pIStorage->OpenStream(SZSTREAMPAGELIST, NULL, dwMode, 0
        , &pIStream);

    if (FAILED(hr))
        return FALSE;

    if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pIMalloc)))
        {
        pIStream->Read(&pgList, sizeof(PAGELIST), &cbRead);
        m_cPages  =(UINT)pgList.cPages;
        m_iPageCur=(UINT)pgList.iPageCur;
        m_dwIDNext=pgList.dwIDNext;

        fRet=TRUE;
        cbRead=pgList.cPages*sizeof(DWORD);

        if (0!=cbRead)
            {
            pdwID=(LPDWORD)pIMalloc->Alloc(cbRead);

            if (NULL!=pdwID)
                {
                pIStream->Read(pdwID, cbRead, &cbRead);

                for (i=0; i < m_cPages; i++)
                    fRet &=PageAdd(NOVALUE, *(pdwID+i), FALSE);

                pIMalloc->Free(pdwID);
                }
            }

        pIMalloc->Release();
        }

    pIStream->Release();

    if (!fRet)
        return FALSE;

    PageGet(m_iPageCur, &m_pPageCur, TRUE);
    m_fDirty=FALSE;

    InvalidateRect(m_hWnd, NULL, FALSE);
    UpdateWindow(m_hWnd);

    return TRUE;
    }





/*
 * CPages::StorageUpdate
 *
 * Purpose:
 *  Insures that all pages are committed before a root save.
 *
 * Parameters:
 *  fCloseAll       BOOL directing us to close all open storages
 *                  and streams.
 *
 * Return Value:
 *  BOOL            TRUE if successful, FALSE otherwise.
 */

BOOL CPages::StorageUpdate(BOOL fCloseAll)
    {
    PCPage          pPage;
    LPSTREAM        pIStream;
    LPMALLOC        pIMalloc;
    LPDWORD         pdwID;
    ULONG           cb;
    HRESULT         hr;
    PAGELIST        pgList;
    BOOL            fRet=FALSE;
    UINT            i;

    //We only need to close the current page--nothing else is open.
    if (NULL!=m_pPageCur)
        {
        m_pPageCur->Update();

        if (fCloseAll)
            m_pPageCur->Close(FALSE);
        }

    //We don't hold anything else open, so write the page list.
    hr=m_pIStorage->OpenStream(SZSTREAMPAGELIST, NULL, STGM_DIRECT
        | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &pIStream);

    if (FAILED(hr))
        return FALSE;

    if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pIMalloc)))
        {
        pgList.cPages=m_cPages;
        pgList.iPageCur=m_iPageCur;
        pgList.dwIDNext=m_dwIDNext;

        pIStream->Write(&pgList, sizeof(PAGELIST), &cb);

        cb=m_cPages*sizeof(DWORD);
        pdwID=(LPDWORD)pIMalloc->Alloc(cb);

        if (NULL!=pdwID)
            {
            for (i=0; i < m_cPages; i++)
                {
                PageGet(i, &pPage, FALSE);
                *(pdwID+i)=pPage->GetID();
                }

            pIStream->Write(pdwID, cb, &cb);
            pIMalloc->Free(pdwID);
            fRet=TRUE;
            }
        pIMalloc->Release();
        }

    pIStream->Release();

    //Clean up the dirty flag when we do an update.
    m_fDirty=!fRet;
    return fRet;
    }







/*
 * CPages::RectGet
 *
 * Purpose:
 *  Returns the rectangle of the Pages window in parent coordinates.
 *
 * Parameters:
 *  pRect           LPRECT in which to return the rectangle.
 *
 * Return Value:
 *  None
 */

void CPages::RectGet(LPRECT pRect)
    {
    RECT        rc;
    POINT       pt;

    //Retrieve the size of our rectangle in parent coordinates.
    GetWindowRect(m_hWnd, &rc);
    SETPOINT(pt, rc.left, rc.top);
    ScreenToClient(GetParent(m_hWnd), &pt);

    SetRect(pRect, pt.x, pt.y, pt.x+(rc.right-rc.left)
        , pt.y+(rc.bottom-rc.top));

    return;
    }






/*
 * CPages::RectSet
 *
 * Purpose:
 *  Sets a new rectangle for the Pages window which sizes to fit.
 *  Coordinates are given in parent terms.
 *
 * Parameters:
 *  pRect           LPRECT containing the new rectangle.
 *  fNotify         BOOL indicating if we're to notify anyone of
 *                  the change.
 *
 * Return Value:
 *  None
 */

void CPages::RectSet(LPRECT pRect, BOOL fNotify)
    {
    UINT        cx, cy;

    if (NULL==pRect)
        return;

    cx=pRect->right-pRect->left;
    cy=pRect->bottom-pRect->top;

    SetWindowPos(m_hWnd, NULL, pRect->left, pRect->top
        , (UINT)cx, (UINT)cy, SWP_NOZORDER);

    UpdateScrollRanges();
    return;
    }




/*
 * CPages::SizeGet
 *
 * Purpose:
 *  Retrieves the size of the pages window in parent coordinates.
 *
 * Parameters:
 *  pRect           LPRECT in which to return the size.  The right
 *                  and bottom fields will contain the dimensions.
 *
 * Return Value:
 *  None
 */

void CPages::SizeGet(LPRECT pRect)
    {
    RectGet(pRect);
    return;
    }







/*
 * CPages::SizeSet
 *
 * Purpose:
 *  Sets a new size in parent coordinates for the Pages window.
 *
 * Parameters:
 *  pRect           LPRECT containing the new rectangle.
 *  fNotify         BOOL indicating if we're to notify anyone of
 *                  the change.
 *
 * Return Value:
 *  None
 */

void CPages::SizeSet(LPRECT pRect, BOOL fNotify)
    {
    UINT        cx, cy;

    if (NULL==pRect)
        return;

    cx=pRect->right-pRect->left;
    cy=pRect->bottom-pRect->top;

    SetWindowPos(m_hWnd, NULL, 0, 0, (UINT)cx, (UINT)cy
        , SWP_NOMOVE | SWP_NOZORDER);

    UpdateScrollRanges();
    return;
    }






/*
 * CPages::ActivePage
 *
 * Purpose:
 *  Returns a CPage pointer to the current page.
 *
 * Parameters:
 *  None
 *
 * Return Value:
 *  PCPage          Pointer to the current page.
 */

PCPage CPages::ActivePage(void)
    {
    PCPage      pPage;
    BOOL        fRet;

    fRet=PageGet(m_iPageCur, &pPage, FALSE);
    return fRet ? pPage : NULL;
    }





/*
 * CPages::PageInsert
 *
 * Purpose:
 *  Creates a new page immediately after the current page.  If
 *  there are no pages then this creates page 1.
 *
 * Parameters:
 *  uReserved       UINT unused
 *
 * Return Value:
 *  UINT            Index of the new page, 0 on failure.
 */

UINT CPages::PageInsert(UINT uReserved)
    {
    if (0!=m_cPages && NULL!=m_pPageCur)
        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产区一| 欧美中文字幕一区二区三区 | 成人h版在线观看| 中文字幕一区免费在线观看 | 99久久国产综合精品麻豆| 亚洲免费在线视频一区 二区| 在线免费观看日本一区| 香蕉影视欧美成人| 日韩三级精品电影久久久 | 欧美老肥妇做.爰bbww视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 精品国产乱码久久久久久图片| 国产精品456| 自拍av一区二区三区| 欧美三级日韩在线| 麻豆专区一区二区三区四区五区| 久久精品在这里| 色婷婷激情综合| 精品一区二区三区在线视频| 午夜激情久久久| 一区二区三区国产精华| 国产免费观看久久| 久久人人97超碰com| 精品少妇一区二区三区日产乱码| 欧美在线短视频| 欧洲在线/亚洲| 色av成人天堂桃色av| 色一情一乱一乱一91av| 99国产精品99久久久久久| 精品免费99久久| 99视频超级精品| 三级久久三级久久久| 国产欧美va欧美不卡在线| 欧美性猛片aaaaaaa做受| 国精产品一区一区三区mba视频 | 欧美变态tickling挠脚心| www.日韩在线| 欧美a一区二区| 自拍偷拍亚洲激情| 精品电影一区二区三区| 色综合久久中文综合久久97| 精品在线观看免费| 9人人澡人人爽人人精品| 亚欧色一区w666天堂| 国产亚洲欧美日韩日本| 欧美日韩国产成人在线免费| 成人性生交大片免费看在线播放| 午夜亚洲福利老司机| 国产精品欧美久久久久无广告| 欧美精品18+| 99国产精品国产精品毛片| 精品亚洲成a人在线观看| 亚洲精品国产精华液| 国产欧美一区二区三区鸳鸯浴 | 久久一夜天堂av一区二区三区| 91丝袜高跟美女视频| 国模无码大尺度一区二区三区| 亚洲老妇xxxxxx| 国产亚洲va综合人人澡精品| 91精品国产麻豆| 亚洲一区二区三区激情| 亚洲成人1区2区| 97精品视频在线观看自产线路二| 欧美视频一区二区三区四区| 久久人人爽人人爽| 偷偷要91色婷婷| 国产sm精品调教视频网站| 欧美无人高清视频在线观看| 久久九九99视频| 91视频精品在这里| 欧美性猛交xxxx黑人交 | 日韩欧美自拍偷拍| 91麻豆.com| 国产91丝袜在线观看| 精品中文字幕一区二区| 天天爽夜夜爽夜夜爽精品视频| 亚洲蜜臀av乱码久久精品蜜桃| 中文一区二区在线观看| 亚洲精品一区在线观看| 91精品福利在线一区二区三区| 在线视频国内一区二区| 不卡的av电影| 国产成人精品免费一区二区| 精品制服美女丁香| 麻豆精品久久精品色综合| 亚洲国产精品视频| 一区二区三区日本| 亚洲女厕所小便bbb| 中文字幕 久热精品 视频在线| 久久综合九色综合欧美亚洲| 欧美一级高清片| 欧美精品在线一区二区| 欧美日韩成人综合| 欧美日韩一区二区在线观看| 91麻豆福利精品推荐| 91女厕偷拍女厕偷拍高清| 不卡的av中国片| 成人禁用看黄a在线| 成人免费高清视频在线观看| 国产精品2024| 国产乱妇无码大片在线观看| 国产一区二区美女| 国产黄色91视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美日本一区二区在线观看| 欧美视频在线观看一区二区| 欧美午夜精品免费| 欧美日韩在线一区二区| 欧美精品在欧美一区二区少妇| 欧美性三三影院| 精品一区二区三区不卡| 国产视频一区二区在线| 欧美在线播放高清精品| 性久久久久久久| 26uuu国产在线精品一区二区| 国产精品白丝jk白祙喷水网站 | 成人午夜av电影| 国产精品久久精品日日| 91小视频免费看| 日韩1区2区日韩1区2区| 亚洲成人动漫一区| 国产精品久久久久久久久图文区| 国产日韩欧美电影| 中文字幕不卡在线播放| 中文字幕一区av| 亚洲一区二区三区四区在线观看 | 岛国精品在线观看| 久久久精品tv| 中文字幕一区二区三区四区不卡| 亚洲女同一区二区| 三级久久三级久久| 激情五月激情综合网| 成人在线综合网站| 色综合久久综合网欧美综合网 | 欧美一区二区三区成人| 26uuu精品一区二区| 国产精品二三区| 亚洲一区在线看| 蜜臀av一区二区| 粉嫩一区二区三区性色av| 色综合天天综合网国产成人综合天| 欧美日韩综合色| 欧美mv和日韩mv的网站| 国产精品区一区二区三| 一区二区三区精品视频在线| 日韩精品色哟哟| 国产一区二区三区视频在线播放| 不卡av在线免费观看| 精品视频全国免费看| 欧美成人免费网站| 亚洲欧洲av色图| 三级欧美在线一区| 粗大黑人巨茎大战欧美成人| 欧美视频精品在线观看| 精品福利一区二区三区| 中文字幕在线播放不卡一区| 丝袜亚洲另类丝袜在线| 国产成人自拍在线| 欧美日韩中文国产| 国产日韩av一区二区| 亚洲影院理伦片| 国产91精品露脸国语对白| 久久不见久久见中文字幕免费| 久久99精品国产麻豆不卡| 午夜欧美大尺度福利影院在线看| 日本va欧美va精品发布| 午夜激情综合网| 日本伊人午夜精品| 天堂精品中文字幕在线| 香港成人在线视频| 亚洲成在线观看| 日日摸夜夜添夜夜添国产精品| 亚洲国产精品影院| 精品在线观看免费| 韩国午夜理伦三级不卡影院| 粉嫩嫩av羞羞动漫久久久| 欧美精品亚洲二区| 国产亚洲精品7777| 日韩国产在线一| 成人国产在线观看| 欧美久久一二区| 中文字幕亚洲在| 久久97超碰国产精品超碰| 在线免费观看日本一区| 亚洲国产高清aⅴ视频| 天天操天天色综合| 99精品国产热久久91蜜凸| 日韩精品中文字幕一区二区三区| 亚洲男人的天堂在线aⅴ视频| 精久久久久久久久久久| 欧美美女视频在线观看| 一区二区中文视频| 国产一区美女在线| 91精品欧美久久久久久动漫| 亚洲精品一二三四区| 粉嫩蜜臀av国产精品网站| 精品国产第一区二区三区观看体验 | 欧美精品第1页| 亚洲女厕所小便bbb| 国产成人精品亚洲777人妖|