Click here to Skip to main content
13,145,939 members (55,058 online)
Click here to Skip to main content

Stats

481.9K views
11.3K downloads
160 bookmarked
Posted 12 Apr 2000

Tree control and Buttons for MFC Grid control

, 25 Apr 2001
A set of classes derived from CGridCtrl that embed a tree control, button controls, and virtual cells within the grid
/*****************************************************************************
    COPYRIGHT (C) 2000-2001, Ken Bertelson <kbertelson@yahoo.com>


*****************************************************************************/
#if !defined(AFX_GRIDBTNCELLCOMBO_H__00C20283_F376_11D3_B761_00C04F6A7AE6__INCLUDED_)
#define AFX_GRIDBTNCELLCOMBO_H__00C20283_F376_11D3_B761_00C04F6A7AE6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GridBtnCell.h"

class CGridBtnCellCombo : public CGridBtnCell
{
    DECLARE_DYNCREATE(CGridBtnCellCombo)
public:
	CGridBtnCellCombo();
	virtual ~CGridBtnCellCombo();

    virtual void Reset();

    virtual void operator=(CGridCellBase& cell)
    {
        CGridBtnCellBase::operator=( cell);
    }

// accessors
public:
    virtual void SetComboStyle( DWORD dwComboStyle) { m_dwComboStyle = dwComboStyle; }
    virtual DWORD GetComboStyle() { return m_dwComboStyle; }

    virtual void SetComboString( const CStringArray& astrAry) { m_StringArrayCombo.Copy( astrAry); }
    virtual void GetComboString( CStringArray* apstrAry) { apstrAry->Copy( m_StringArrayCombo); }

// editing cells
public:
    virtual BOOL Edit(  int nRow, int nCol, CRect rect, CPoint point,
                        UINT nID, UINT nChar);
    virtual void EndEdit();
protected:
    virtual void OnEndEdit();

protected:
    virtual void OnClick( CPoint PointCellRelative);

protected:
    DWORD m_dwComboStyle;
    CStringArray m_StringArrayCombo;    // combo Items

};

#endif // !defined(AFX_GRIDBTNCELLCOMBO_H__00C20283_F376_11D3_B761_00C04F6A7AE6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ken Bertelson
Web Developer
United States United States
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170915.1 | Last Updated 26 Apr 2001
Article Copyright 2000 by Ken Bertelson
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid