forked from ppescher/resizablelib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
573 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// ResizableComboBox.cpp : implementation file | ||
// | ||
|
||
#include "stdafx.h" | ||
#include "ResizableComboBox.h" | ||
|
||
#ifdef _DEBUG | ||
#define new DEBUG_NEW | ||
#undef THIS_FILE | ||
static char THIS_FILE[] = __FILE__; | ||
#endif | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// CResizableComboBox | ||
|
||
CResizableComboBox::CResizableComboBox() | ||
{ | ||
} | ||
|
||
CResizableComboBox::~CResizableComboBox() | ||
{ | ||
if (m_ctrlListBox.GetSafeHwnd() != NULL) | ||
m_ctrlListBox.UnsubclassWindow(); | ||
} | ||
|
||
|
||
BEGIN_MESSAGE_MAP(CResizableComboBox, CComboBox) | ||
//{{AFX_MSG_MAP(CResizableComboBox) | ||
ON_WM_CTLCOLOR() | ||
//}}AFX_MSG_MAP | ||
END_MESSAGE_MAP() | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// CResizableComboBox message handlers | ||
|
||
HBRUSH CResizableComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) | ||
{ | ||
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor); | ||
|
||
if (nCtlColor == CTLCOLOR_LISTBOX) | ||
{ | ||
if (!(GetStyle() & CBS_SIMPLE) | ||
&& (m_ctrlListBox.GetSafeHwnd() == NULL)) | ||
{ | ||
TRACE("Combo: 0x%08X\n", pWnd->m_hWnd); | ||
|
||
// attach to the owned listbox | ||
m_ctrlListBox.m_pOwnerCombo = this; | ||
m_ctrlListBox.SubclassWindow(pWnd->m_hWnd); | ||
} | ||
} | ||
|
||
return hbr; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#if !defined(AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_) | ||
#define AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_ | ||
|
||
#include "ResizableComboLBox.h" // Added by ClassView | ||
|
||
#if _MSC_VER > 1000 | ||
#pragma once | ||
#endif // _MSC_VER > 1000 | ||
// ResizableComboBox.h : header file | ||
// | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// CResizableComboBox window | ||
|
||
class CResizableComboBox : public CComboBox | ||
{ | ||
// Construction | ||
public: | ||
CResizableComboBox(); | ||
|
||
// Attributes | ||
public: | ||
|
||
protected: | ||
CResizableComboLBox m_ctrlListBox; | ||
|
||
// Operations | ||
public: | ||
|
||
// Overrides | ||
// ClassWizard generated virtual function overrides | ||
//{{AFX_VIRTUAL(CResizableComboBox) | ||
public: | ||
protected: | ||
//}}AFX_VIRTUAL | ||
|
||
// Implementation | ||
public: | ||
virtual ~CResizableComboBox(); | ||
|
||
// Generated message map functions | ||
protected: | ||
//{{AFX_MSG(CResizableComboBox) | ||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); | ||
//}}AFX_MSG | ||
|
||
DECLARE_MESSAGE_MAP() | ||
}; | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
//{{AFX_INSERT_LOCATION}} | ||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. | ||
|
||
#endif // !defined(AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_) |
Oops, something went wrong.