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

📄 labeledtrackbardisplayitem.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

#include "common.hpp"
#include "DisplayItem.hpp"
#include "string.hxx"
#include "Controls.hpp"

/*------------------------------------------------------------------------------
    LabeledTrackBarDisplayItem_t
    
    Implementation of a labeled item, containing a trackbar
------------------------------------------------------------------------------*/
class LabeledTrackBarDisplayItem_t : 
    public CVoIPDisplayItem,
    public IVoIPDisplayControl
{
public:
    LabeledTrackBarDisplayItem_t(
        const WCHAR *c_wszLabel,
        INT          cxLabelWidth    = -1 // -1 means auto-calculate based on label
        );

   ~LabeledTrackBarDisplayItem_t();
   
public:
    //IVoIPDisplayItem
    HRESULT
    QueryInterface(
        REFIID riid,
        __deref_out void** ppvObject
        );

    __override HRESULT 
    Draw(
        HDC hdc, 
        const RECT * prc, 
        BOOL fSelected, 
        BOOL fTopItem = FALSE
        );

    static HRESULT 
    GetSubItemText(
        UINT idxSubItem, 
        WCHAR * wszBuffer, 
        UINT cchBuffer
        );

    //IVoIPDisplayControl
    __override HRESULT 
    PositionControls(
        HWND   hwndLV,
        RECT * prc
        );

    __override HRESULT 
    ShowControls(
        BOOL fVisible
        );
    
    __override HRESULT 
    RemoveControls(
        void
        );

    __override BOOL 
    SetFocus(
        void
        );
    
public:
    //public functions
    HRESULT SetTrackbarBoundaries(UINT cMin, UINT cMax);
    HRESULT SetTrackbarPosition(UINT cSelection);
    INT     GetTrackbarPosition();
    HRESULT SetCookie(DWORD dwCookie);
    DWORD   GetCookie() const;
    
private:
    ce::wstring     m_wstrText;
    RECT            m_rcPosition;
    BOOL            m_fCreatedControl;
    BOOL            m_fShutdown;
    INT             m_cxLabelWidth;
    TrackBar_t      m_trackbar;
    UINT            m_cMin;
    UINT            m_cMax;
    UINT            m_cPosition;
    DWORD           m_dwCookie;
};

⌨️ 快捷键说明

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