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

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

?? menubutton.cpp

?? 一個WinCE6。0下的IP phone的源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:

    //load the background bitmap
    Bitmap_t& BitmapToUse = (m_IsPressedDown ? m_ButtonDown : m_Button);

    if (!BitmapToUse)
    {
        hr = BitmapToUse.LoadBitmap(
            GlobalData_t::s_ModuleInstance,
            (m_IsPressedDown ? IDB_BUTTONDOWN : IDB_BUTTON)
            );
        if (FAILED(hr))
        {
            return 0;
        }
    }

    //offset the rectangle to leave space for the connector line
    ClientRect.bottom -= Layout_t::ButtonConnectorLine();

    //draw the background
    hr = paint.TileBlt(
        &BitmapToUse,
        &ClientRect,
        NULL,
        Layout_t::ButtonTileLeft(),
        Layout_t::ButtonTileTop(),
        Layout_t::ButtonTileRight(),
        Layout_t::ButtonTileBottom(),
        Colors_t::DefaultTransparentColor()
        );
    ASSERT(SUCCEEDED(hr));

    paint.SetBkMode(TRANSPARENT);

    BOOL IsSIPButton = (m_Data.IsInputButton && (! Input_IsIMEEnabled() || Input_IsInputPanelVisible()));
    
    //do we need to draw the popup arrow?
    if (
        (m_Data.IsMenu && ! m_Data.IsInputButton) 
        || (IsSIPButton && Input_IsIMEEnabled())
        )
    {
        Bitmap_t PopupArrow;
        hr = PopupArrow.Attach(
            GlobalData_t::s_GDICacheObject.LoadCachedBitmap(IDB_POPUPMENU_UP_ARROW)
            );
        ASSERT(SUCCEEDED(hr));

        ClientRect.right -= (PopupArrow.Width() + Layout_t::PopupUpArrowRightMargin());

        TransparentImage(
            paint,
            ClientRect.right,
            ClientRect.top + Layout_t::PopupUpArrowTopMargin(),
            PopupArrow.Width(),
            PopupArrow.Height(),
            PopupArrow,
            0,
            0,
            PopupArrow.Width(),
            PopupArrow.Height(),
            Colors_t::DefaultTransparentColor()
            );
    }

    if (m_Data.IsInputButton)
    {
        UINT BitmapID = IsSIPButton ?
            IDB_SIP_ICON :
            IDB_IME_BACKGROUND;

        Bitmap_t InputIcon;
        hr = InputIcon.Attach(
            GlobalData_t::s_GDICacheObject.LoadCachedBitmap(BitmapID)
            );
        ASSERT(SUCCEEDED(hr));

        //Draw the sip icon centered in the button
        TransparentImage(
            paint,
            (ClientRect.left + ClientRect.right - InputIcon.Width())/2,
            (ClientRect.top + ClientRect.bottom - InputIcon.Height())/2,
            InputIcon.Width(),
            InputIcon.Height(),
            InputIcon,
            0,
            0,
            InputIcon.Width(),
            InputIcon.Height(),
            Colors_t::DefaultTransparentColor()
            );

        if (!IsSIPButton && GetInputButtonText(TextBuffer, _countof(TextBuffer)) > 0)
        {
            paint.SetFont(Fonts_t::StandardText());
            paint.SetTextColor(
                m_IsPressedDown ?
                    Colors_t::MenuButtonDownTextColor() :
                    Colors_t::MenuButtonUpTextColor()
                );

            RECT DrawRect;
            DrawRect = ClientRect;

            DrawRect.left = Layout_t::PopupTextMargin() +
                (ClientRect.left + ClientRect.right - InputIcon.Width())/2;

            paint.DrawText(
                TextBuffer,
                -1,
                &DrawRect,
                DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX
                );
        }
    }
    else
    {
        //get the window text and draw it
        if (GetWindowText(m_hwnd, TextBuffer, _countof(TextBuffer)) > 0)
        {
            ASSERT(TextBuffer[0] != L'\0');

            paint.SetFont(Fonts_t::StandardText());
            paint.SetTextColor(
                m_IsPressedDown ?
                    Colors_t::MenuButtonDownTextColor() :
                    Colors_t::MenuButtonUpTextColor()
                );

            RECT DrawRect;
            DrawRect = ClientRect;

            // Subtract margin
            InflateRect(&DrawRect, -Layout_t::PopupTextMargin(), 0);

            paint.DrawText(
                TextBuffer,
                -1,
                &ClientRect,
                DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_END_ELLIPSIS
                );
        }
    }

    ClientRect.bottom += Layout_t::ButtonConnectorLine();

    //Draw the connector line
    POINT ConnectorLine[2];
    ConnectorLine[0].x = ClientRect.left + Layout_t::ButtonWidth()/2;
    ConnectorLine[0].y = ClientRect.bottom - Layout_t::ButtonConnectorLine();
    ConnectorLine[1].x = ConnectorLine[0].x;
    ConnectorLine[1].y = ClientRect.bottom;

    //create the pen with which to draw
    ce::auto_hpen Pen = CreatePen(
        PS_SOLID,
        -1, 
        m_IsPressedDown ?
            Colors_t::ButtonDownConnectorLineColor() :
            Colors_t::ButtonUpConnectorLineColor()
        );
    paint.SetPen(Pen);

    Polyline(
        paint,
        ConnectorLine,
        _countof(ConnectorLine)
        );

    paint.End();
    return 0;
}

/*------------------------------------------------------------------------------
    MenuButtonImpl_t::OnLButtonDown

    Handle a left button down press in our client area
------------------------------------------------------------------------------*/
LRESULT
MenuButtonImpl_t::OnLButtonDown(
    WPARAM wParam,
    LPARAM lParam
    )
{
    //ignore this is we are already 'down'
    if (m_IsPressedDown)
    {
        return 0;
    }

    m_IsPressedDown = true;

    //capture mouse movements
    SetCapture(m_hwnd);

    if (m_Data.IsMenu && IsWindowVisible(m_Data.Value.PopupMenu))
    {
        m_PopupIsVisible = true;
    }

    //force a redraw
    InvalidateRect(m_hwnd, NULL, FALSE);

    return 0;
}

/*------------------------------------------------------------------------------
    MenuButtonImpl_t::OnLostCapture

    Handle losing capture because another window has grabbed capture
    or the mouse has moved outside of our client area
------------------------------------------------------------------------------*/
LRESULT
MenuButtonImpl_t::OnLostCapture(
    void
    )
{
    if (! m_IsPressedDown)
    {
        return 0;
    }

    m_IsPressedDown  = false;
    m_PopupIsVisible = false;
    
    //trigger repaint
    InvalidateRect(m_hwnd, NULL, FALSE);

    return 0;
}

/*------------------------------------------------------------------------------
    MenuButtonImpl_t::OnLButtonUp

    Handle the left-button up event within our client area
------------------------------------------------------------------------------*/
LRESULT
MenuButtonImpl_t::OnLButtonUp(
    WPARAM wParam,
    LPARAM lParam
    )
{
    if (! m_IsPressedDown)
    {
        return 0;
    }

    m_IsPressedDown = false;
    
    ReleaseCapture();

    bool WasMenuAlreadyUp = m_PopupIsVisible;

    m_PopupIsVisible = false;
    
    //trigger repaint
    InvalidateRect(m_hwnd, NULL, FALSE);

    //we were clicked - generate a command!
    if (! m_Data.IsMenu)
    {
        if (m_Data.IsInputButton)
        {
            Input_ToggleInputPanel();
        }
        else
        {
            SendMessage(
                GetParent(m_hwnd),
                WM_COMMAND,
                MAKELONG(m_Data.Value.ControlId, BN_CLICKED),
                reinterpret_cast<LPARAM>(m_hwnd)
                );
        }
    }
    else 
    {
        PopupMenu_t Menu;
        Menu = m_Data.Value.PopupMenu;

        if (! IsWindow((HWND)Menu))
        {
            ASSERT(FALSE);
            return 0;
        }

        //if the menu was already up tell the current focused menu 
        //(the menus may be cascading) to hide all the menus
        if (WasMenuAlreadyUp)
        {
            SendMessage(GetFocus(), WM_POPUPMENU_HIDEMENUS, 0, 0);
            return 0;
        }
        
        SIZE Dimensions = {0};
        RECT WindowRect = {0};

        //get the length and width of the popup menu
        Menu.CalculateDimensions(&Dimensions);

        GetWindowRect(m_hwnd, &WindowRect);
        MapWindowRect(NULL, GetParent(m_hwnd), &WindowRect);

        SetWindowPos(
            (HWND)Menu,
            HWND_TOP,
            WindowRect.left,
            WindowRect.top - Dimensions.cy,
            Dimensions.cx,
            Dimensions.cy,
            SWP_SHOWWINDOW
            );

        SetFocus((HWND)Menu);
    }

    return 0;
}

/*------------------------------------------------------------------------------
    MenuButtonImpl_t::OnMouseMove

    Track the mouse moving while we have been pressed

    Parameters:
        xPos: current x-coordinate of the mouse
        yPos: current y-coordinate of the mouse
------------------------------------------------------------------------------*/
LRESULT
MenuButtonImpl_t::OnMouseMove(
    WPARAM wParam,
    LPARAM lParam
    )
{
    //if we aren't pressed down, ignore this
    if (! m_IsPressedDown)
    {
        return 0;
    }

    RECT ClientRect;
    GetClientRect(m_hwnd, &ClientRect);

    WORD xPos = LOWORD(lParam);
    WORD yPos = HIWORD(lParam);

    //if the mouse has moved outside of our client area,
    //release the mouse capture and mark ourself as 'not down'
    if (xPos < ClientRect.left || xPos > ClientRect.right ||
        yPos < ClientRect.top  || yPos > ClientRect.bottom
        )
    {
        ReleaseCapture();
        OnLostCapture();
    }

    return 0;
}

/*------------------------------------------------------------------------------
    MenuButtonImpl_t::OnShow

    Show / hide the button

    Parameters:
        BOOL: indicates whether the button should be visible or not
------------------------------------------------------------------------------*/
HRESULT
MenuButtonImpl_t::OnShow(
    BOOL Visible
    )
{
    if (Visible)
    {
        return ShowWindow(m_hwnd, SW_SHOW) ? S_FALSE : S_OK;
    }
    else
    {
        return ShowWindow(m_hwnd, SW_HIDE) ? S_OK : S_FALSE;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美放荡的少妇| 欧美综合久久久| 一区二区三区中文在线| **性色生活片久久毛片| 久久人人爽爽爽人久久久| 精品国产91久久久久久久妲己| 91精品国产91久久综合桃花| 精品福利一二区| 亚洲欧洲三级电影| 首页国产欧美久久| www.欧美日韩| 精品福利在线导航| 日韩中文字幕不卡| 国产精品一线二线三线精华| 欧美亚一区二区| 国产欧美日产一区| 欧美aaa在线| 91成人免费在线视频| 精品久久久久久久久久久久包黑料 | 欧美日韩在线播放三区| 久久日韩粉嫩一区二区三区| 亚洲成av人综合在线观看| 成人黄色片在线观看| 日韩欧美的一区| 亚洲最大成人综合| 99国产精品99久久久久久| 国产一区二区三区不卡在线观看| jvid福利写真一区二区三区| 久久久久久亚洲综合影院红桃| 免费一级片91| 日韩一区二区三区视频| 视频在线观看91| 精品视频在线免费看| 亚洲午夜免费电影| 色88888久久久久久影院按摩| 26uuu亚洲| 午夜精品久久久久久久久久久| 色老综合老女人久久久| 亚洲黄色av一区| 91精品国产入口| 国精品**一区二区三区在线蜜桃| 日韩欧美中文字幕公布| 国产精品一区二区久激情瑜伽 | 精品国产第一区二区三区观看体验 | 国产一区二区中文字幕| 国产午夜精品在线观看| 91蜜桃在线免费视频| 日本在线不卡视频一二三区| 精品久久久久久久久久久久久久久久久 | 18欧美乱大交hd1984| 在线亚洲欧美专区二区| 免费日韩伦理电影| 亚洲欧美一区二区三区久本道91 | 欧美国产一区二区| 黄色小说综合网站| 亚洲国产成人自拍| 欧美精品一级二级三级| 国产69精品久久777的优势| 亚洲伊人伊色伊影伊综合网| 26uuuu精品一区二区| 欧美无砖砖区免费| 在线不卡欧美精品一区二区三区| 国产毛片精品视频| 天天射综合影视| 久久久99精品久久| 欧美色视频在线| 成人精品视频一区二区三区尤物| 亚洲韩国精品一区| 国产精品久久毛片| 2023国产精品| 精品日韩av一区二区| 欧美日韩国产综合久久| 欧美视频在线一区| 91蜜桃网址入口| 粉嫩aⅴ一区二区三区四区五区| 日韩精品一级中文字幕精品视频免费观看 | 国产精品久久久久aaaa| 日韩欧美电影一区| 欧美福利电影网| 91免费版pro下载短视频| 国产不卡视频在线观看| 国产成人午夜高潮毛片| 国产成人午夜精品影院观看视频 | 欧美精选一区二区| 日韩午夜电影在线观看| 日韩一区二区影院| 久久亚洲精品小早川怜子| 国产亚洲人成网站| 中文字幕亚洲精品在线观看| 亚洲特黄一级片| 性久久久久久久久久久久| 麻豆久久一区二区| 欧美在线制服丝袜| 欧美成人精精品一区二区频| 国产色产综合产在线视频| 国产精品人妖ts系列视频| 国产精品嫩草99a| 蜜桃一区二区三区四区| 国产成人精品亚洲日本在线桃色| 中文字幕欧美一区| 国产精品久久久久久久久久久免费看| 久久综合久久99| 欧美高清视频一二三区| 久久99久国产精品黄毛片色诱| 丝袜美腿一区二区三区| 一区二区三区美女视频| 亚洲影院久久精品| 最新热久久免费视频| 成人午夜免费视频| 亚洲成人黄色小说| 欧美日本在线播放| 成人一区二区视频| 亚洲影院理伦片| 国产精品第一页第二页第三页| 欧洲在线/亚洲| 国产成人综合视频| 亚洲国产美女搞黄色| 粉嫩av一区二区三区| 欧美成人精品福利| 日韩精品一区二区三区四区视频| 日韩欧美电影在线| 久久影院视频免费| 国产精品传媒视频| 亚洲综合小说图片| 国产精品久久久久久久久免费桃花 | 精品国产区一区| 久久精品欧美日韩| 亚洲日本在线天堂| 国产另类ts人妖一区二区| 日韩精品中文字幕一区 | av成人免费在线观看| 欧美国产激情一区二区三区蜜月 | 亚洲精品一区二区在线观看| 秋霞国产午夜精品免费视频| 久久久国产午夜精品| 伊人婷婷欧美激情| 91麻豆精品91久久久久久清纯| 热久久国产精品| 国产夜色精品一区二区av| 欧美日韩国产高清一区| 99re这里都是精品| 亚洲va在线va天堂| 亚洲国产精品传媒在线观看| 99久久免费精品高清特色大片| 亚洲一区二区三区四区在线免费观看 | av在线播放一区二区三区| 亚洲一区二区精品视频| 狠狠色狠狠色综合日日91app| 依依成人精品视频| 精品久久久久久久人人人人传媒| 91亚洲精品一区二区乱码| 日本中文字幕一区二区视频 | 97精品国产露脸对白| 老司机免费视频一区二区| 另类小说一区二区三区| 国产一区欧美日韩| a美女胸又www黄视频久久| 日韩 欧美一区二区三区| 国产九九视频一区二区三区| 国产精品夜夜嗨| 色婷婷精品大在线视频| 制服视频三区第一页精品| 欧美三级中文字幕在线观看| 欧美不卡一区二区| 国产精品嫩草久久久久| 成人激情文学综合网| 欧美三级日韩三级国产三级| 91精品国产综合久久精品麻豆| 一区二区三区成人| 亚洲国产精品久久不卡毛片 | 欧美一二三在线| 久久精品国产成人一区二区三区| av在线播放成人| 久久亚洲精华国产精华液| 一区二区三区四区乱视频| 精品亚洲免费视频| 欧美日韩成人一区| 一区二区三区美女| 一区二区三区精品| 福利视频网站一区二区三区| 欧美一区二区三区精品| 亚洲欧美日本在线| 成人午夜激情影院| 精品av久久707| 免费观看日韩av| 欧美精品电影在线播放| 亚洲精品成人少妇| 国产91精品免费| 日韩欧美国产综合一区 | 91一区二区三区在线播放| 久久综合狠狠综合久久激情| 奇米综合一区二区三区精品视频| 91免费视频网| 亚洲伊人伊色伊影伊综合网| 欧美亚洲另类激情小说| 一区二区三区四区不卡在线| 日本乱码高清不卡字幕| 亚洲国产精品嫩草影院| 日韩欧美国产一区二区三区| 蜜桃一区二区三区在线|