📄 ospcheckcomboboxex.h
字号:
#if !defined(AFX_OSPCheckComboBoxEx_H__63A46F4B_6C39_4A1C_9FD6_5C60FA9A390C__INCLUDED_)
#define AFX_OSPCheckComboBoxEx_H__63A46F4B_6C39_4A1C_9FD6_5C60FA9A390C__INCLUDED_
class COSPComboBox;
#define COMBOBOX_CHECKED 0x0001
#define COMBOBOX_UNCHECKED 0x0000
class CheckComboBoxItemData {
public:
CheckComboBoxItemData()
{
itemState = COMBOBOX_UNCHECKED;
}
INT itemState;
};
class COSPCheckComboBoxEx : public COSPComboBox
{
public:
void ClearCaption();
COSPCheckComboBoxEx();
virtual ~COSPCheckComboBoxEx();
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
// Selects all/unselects the specified item
INT SetCheck(INT nIndex, BOOL bFlag);
// Returns checked state
BOOL GetCheck(INT nIndex);
// [ Add by P.J.Lee
void DeleteRow(int row);
void DeleteAllRows();
CheckComboBoxItemData* GetAttachedData(int row);
// ]
void RecalcText();
// Selects all/unselects all
void SelectAll(BOOL bCheck = TRUE);
protected:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COSPCheckComboBoxEx)
protected:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
//}}AFX_VIRTUAL
//{{AFX_MSG(COSPCheckComboBoxEx)
afx_msg LRESULT OnCtlColorListBox(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam);
afx_msg void OnDropDown();
afx_msg void OnDblclk();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
// Routine to update the text
// The subclassed COMBOLBOX window (notice the 'L')
HWND m_hListBox;
// The string containing the text to display
CString m_strText;
BOOL m_bTextUpdated;
// A flag used in MeasureItem, see comments there
BOOL m_bItemHeightSet;
};
#endif // !defined(AFX_OSPCheckComboBoxEx_H__63A46F4B_6C39_4A1C_9FD6_5C60FA9A390C__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -