📄 labelededitdisplayitem.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 __LABELEDEDITDISPLAYITEM_HPP__
#define __LABELEDEDITDISPLAYITEM_HPP__
#include "DisplayItem.hpp"
#include "Controls.hpp"
#include "string.hxx"
class LabeledEditDisplayItem_t :
public CVoIPDisplayItem,
public IVoIPDisplayControl,
public IVoIPLabeledEditDisplayItem
{
public:
LabeledEditDisplayItem_t(
DWORD EditStyle,
int EditTextLimit,
int DefaultLabelWidth,
UINT DefaultInputMode
);
virtual ~LabeledEditDisplayItem_t();
//IVoIPDisplayItem
HRESULT
QueryInterface(
REFIID riid,
__deref_out void** ppvObject
);
HRESULT
Draw(
HDC hdc,
__in const RECT* pRectangle,
BOOL IsSelected,
BOOL IsTopItem = FALSE
);
HRESULT
SetText(
__in const WCHAR* pText
);
HRESULT
GetText(
__out_ecount(cchBuffer) WCHAR* pBuffer,
int cchBuffer
);
HRESULT
GetSubItemText(
int Index,
__out_ecount(cchBuffer) WCHAR* pBuffer,
UINT cchBuffer
);
BOOL
NeedsToolTip(
__in RECT* pRectangle
);
//IVoIPDisplayControl
HRESULT
PositionControls(
HWND VirtualListBox,
__in RECT* pRectangle
);
HRESULT
ShowControls(
BOOL Visible
);
HRESULT
RemoveControls(
void
);
BOOL
SetFocus(
void
);
//IVoIPLabeledEditDisplayItem
HRESULT
SetLabelText(
__in const WCHAR* pBuffer
);
HRESULT
SetNumbersOnly(
BOOL NumbersOnly
);
HRESULT
SetReadOnly(
BOOL ReadOnly
);
private:
enum SubItemIndex_e
{
SubItemLabel = 0,
SubItemEdit,
};
ce::wstring m_LabelText;
int m_LabelWidth;
Edit_t m_Edit;
ce::wstring m_DefaultEditText;
DWORD m_EditStyle;
int m_EditTextLimit;
UINT m_DefaultInputMode;
bool m_RemovingEditControl;
};
#endif //!defined __LABELEDEDITDISPLAYITEM_HPP__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -