Click here to Skip to main content
15,885,309 members
Articles / Desktop Programming / MFC

ControlObjectList

Rate me:
Please Sign up or sign in to vote.
3.00/5 (6 votes)
16 Aug 2002CPOL 62.6K   2.1K   25  
Add/Remove/Scroll/Sort Object List (CButton, CStatic, etc..)
#if !defined(AFX_FORMATDLG_H__22EA9061_7647_4E9A_BB85_3B98E535A1BF__INCLUDED_)
#define AFX_FORMATDLG_H__22EA9061_7647_4E9A_BB85_3B98E535A1BF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FormatDlg.h : header file
//
#include "ScrollDialog.h"

#define BORDER_BOX 8
#define BOX_WIDTH 126
#define OFFSET_BOTTOM 3

#include "SortableObList.h"

class CFormatIcon;

/////////////////////////////////////////////////////////////////////////////
// CFormatDlg dialog

class CFormatDlg : public CScrollDialog
{
// Construction
public:
	CFormatDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CFormatDlg)
	enum { IDD = IDD_FORMAT_DIALOG };
	//}}AFX_DATA
private:
	CTypedSortableObList<CFormatIcon*> m_FormatIconList;
	CSize m_nCurrentPos;
	BOOL m_bCanScroll;
	int m_nLastEntryID;
	int m_nSelectedFormat;

public:
	void AddFormat(CSize Size, int nColor);
	void ScrollTo(int nPos, int nSelectedFormat = -1);
	BOOL FormatExist(CSize Size, int nColor);
	BOOL RemoveSelected();

private:
	void RepositionFormat();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFormatDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CFormatDlg)
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FORMATDLG_H__22EA9061_7647_4E9A_BB85_3B98E535A1BF__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)


Written By
CEO
Canada Canada

Comments and Discussions