Click here to Skip to main content
15,896,557 members
Articles / Desktop Programming / MFC

Programming Toolbar Chevrons

Rate me:
Please Sign up or sign in to vote.
4.87/5 (18 votes)
8 May 2003 425.8K   6.4K   150  
An introduction to using the cool new toolbar chevrons
#if !defined(AFX_CHEVBAR_H__ADA7D7F6_E2C1_11D3_84C7_0080450EA020__INCLUDED_)
#define AFX_CHEVBAR_H__ADA7D7F6_E2C1_11D3_84C7_0080450EA020__INCLUDED_

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

// Added it here just in case somebody dont have the latest headers 
// Have to update the build environ, copied from commctrl.h
#define RBBS_USECHEVRON				0x00000200 
#define RBN_CHEVRONPUSHED			(RBN_FIRST - 10)
/*
typedef struct tagNMREBARCHEVRON
{
    NMHDR hdr;
    UINT uBand;
    UINT wID;
    LPARAM lParam;
    RECT rc;
    LPARAM lParamNM;

} NMREBARCHEVRON, *LPNMREBARCHEVRON;
*/

#include "ChevDrop.h"

//	This is the rebar class. The rebar to support chevrons have to derive from this class
//	and have to call AddBar( ). It is preferred to have toolbars as child windows. 

class CChevBar : public CReBar
{

	CChevDrop	*m_pDropWindow;

public:
	CChevBar();

	// This method is to add a band to the Rebar
	// Toolbars are preferred now. The iID has to be unique for the toolbars that are added
	BOOL	AddBar( CWnd* pBar, int iID=-1, 
					LPCTSTR lpszText = NULL, 
					DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_USECHEVRON );

public:

	//{{AFX_VIRTUAL(CChevBar)
	//}}AFX_VIRTUAL

public:
	virtual ~CChevBar();

protected:
	//{{AFX_MSG(CChevBar)
	//}}AFX_MSG

	/*
		Reflection handler for the Chevron push
	*/
	void OnChevronPushed( NMHDR * pNotifyStruct, LRESULT* result );

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}

#endif // !defined(AFX_CHEVBAR_H__ADA7D7F6_E2C1_11D3_84C7_0080450EA020__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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions