⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menubutton.hpp

📁 一个WinCE6。0下的IP phone的源代码
💻 HPP
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#pragma once

#ifndef __MENUBUTTON_HPP__
#define __MENUBUTTON_HPP__

#include "Controls.hpp"
#include "CommonControl.hpp"
#include "PaintHelper.hpp"


class MenuButtonImpl_t :
    public CommonControlImpl_t<MenuButtonImpl_t, MenuButton_t>
{
public:
    static const WCHAR INPUT_BUTTON[];

public:
    MenuButtonImpl_t();
   ~MenuButtonImpl_t();

    DECLARE_NO_SUPERCLASS();

    static
    const UINT
    GetWindowClassStyle(
        void
        );

    LRESULT ControlWindowProc(
        UINT Message,
        WPARAM wParam,
        LPARAM lParam,
        bool& Handled
        );

private:
    int
    GetInputButtonText(
        __out_ecount(cchBuffer) WCHAR* pBuffer,
        int cchBuffer
        );

    //message handlers
    LRESULT
    OnCalculateDimensions(
        __out SIZE* pDimensions
        );

    LRESULT
    OnLButtonDown(
        WPARAM wParam,
        LPARAM lParam
        );

    LRESULT
    OnLButtonUp(
        WPARAM wParam,
        LPARAM lParam
        );

    LRESULT
    OnLostCapture(
        void
        );

    LRESULT
    OnMouseMove(
        WPARAM wParam,
        LPARAM lParam
        );

    LRESULT
    OnPaint(
        HDC hdc
        );

    LRESULT
    OnGetData(
        __out MenuButton_t::ButtonData_t* pData,
        UINT SizeInBytes
        ) const;

    LRESULT
    OnSetData(
        __in const MenuButton_t::ButtonData_t* pData,
        UINT SizeInBytes
        );

    LRESULT
    OnSetText(
        __in const WCHAR* pText
        );

    HRESULT
    OnShow(
        BOOL Visible
        );

private:
    MenuButton_t::ButtonData_t  m_Data;
    bool                        m_IsPressedDown;
    bool                        m_IsInputButton;
    bool                        m_PopupIsVisible;
    
    Bitmap_t                    m_Button;
    Bitmap_t                    m_ButtonDown;
};

#endif //!defined __MENUBUTTON_HPP__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -