Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Resource ID Organiser Add-In for Visual C++ 5.0/6.0/.NET

, 10 Jan 2005 CPOL
An application/add-in to organise and renumber resource symbol IDs
resorg103.zip
ResOrg103.exe
resorg104.zip
ResOrg104.exe
resorgaddinsetup.zip
ResOrgAddInSetup.exe
resorgaddin_executables.zip
ResOrg.exe
BXFileDialog.dll
CJ609Lib.dll
NGLib103.dll
ResOrgAddIn.dll
ResOrgCore.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
resorgnetaddinsetup.zip
ResOrgNETAddInSetup.msi
resorgnetaddin_executables.zip
ResOrgNETAddInToolWindows.ocx
ResOrgNET.exe
CJ609LibVc7.dll
NGLib103Vc7.dll
ResOrgNETAddIn.dll
ResOrgNETCore.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
ReadMe.rtf
Licence.rtf
resorgnet_executables.zip
ResOrgNET_executables
CJ609LibVc7.dll
NGLib103Vc7.dll
QHTMLight.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
ResOrgNETAddIn.dll
ResOrgNETAddInToolWindows.ocx
ResOrgNETCore.dll
resorg_demo.zip
ResOrg103.exe
resorg_executables.zip
ResOrgAddIn.dll
BXFileDialog.dll
CJ609Lib.dll
ResOrg.exe
ResOrg.cnt
resorg.fts
ResOrg.hlp
ResOrgCore.dll
NGLib103.dll
resorg_src.zip
BXFileDialog
BXFileDialog.dsp
Lib
Release
Res
bitmap2.bmp
FileOpen.bmp
filesave.bmp
CJLibrary
CJLibrary
CJLibrary.def
CJLibrary.dsp
CJLibrary.dsw
CJLibrarydep.jpg
CJLibraryStatic.dsp
Debug_Unicode
Release
Release_Unicode
res
Include
res
btn_arro.bmp
btn_explorer.bmp
button_images.bmp
cj_logo.bmp
dragging.cur
handcur.cur
headerba.bmp
hsplitba.cur
icr_hand.cur
nodraggi.cur
PushPin.bmp
Toolbar.bmp
vsplitba.cur
Lib
default.doxygen
NGLibrary
Bin
NGLibrary.def
NGLibrary.dsp
NGLibrary.dsw
Release
Res
Drives.bmp
Release
ResOrg.dsw
ResOrgAddIn
Release
Res
HtmlDoc.ico
ResOrg.ico
ResOrgDoc.ico
TBarLrge.bmp
TBarMedm.bmp
Toolbar.bmp
WorkspaceTabs.bmp
ResOrgAddIn.def
ResOrgAddIn.dsp
ResOrgAddIn.odl
ResOrgAddIn_Res.hm
ResOrgApp
Lint
Release
Res
HtmlDoc.ico
MAINFRAM.BMP
ResOrg.ico
ResOrgDoc.ico
TBarLrge.bmp
TBarMedm.bmp
Toolbar.bmp
workspace.ico
WorkspaceTabs.bmp
ResOrgApp.dsp
ResOrgApp_Res.hm
ResOrgApp_Res.resorg
ResOrgCore
Lint
Release
Res
Anna.bmp
BuildOptions.ico
ComCtl Version Prompt.rtf
File Reload Warning Ex.rtf
File Reload Warning.rtf
Global Next Symbol Value Warning Prompt.rtf
information.ico
Invalid Symbol Name.rtf
Mailing List Prompt.rtf
Next Symbol Value Warning Prompt.rtf
project context menu.bmp
project.ico
RenumWiz Completion.rtf
Report.ico
ResOrg Logo.bmp
ResOrg Updated.rtf
ResOrg.ico
resource file.ico
riverblade_logo.bmp
solution.ico
Symbol Delete Warning.rtf
Symbol Name Warning.rtf
Symbol Rename Warning.rtf
SymbolFile.ico
Symbols Delete Warning.rtf
sym_binary.ico
sym_bitmap.ico
sym_command.ico
sym_control.ico
sym_dialog.ico
sym_icon.ico
sym_menu.ico
sym_prompt.ico
sym_resource.ico
sym_string.ico
Toolbar.bmp
VcAddIn.ico
VersionCheck.ico
warning.ico
WizardHeader256.bmp
WizardWatermark256.bmp
ResOrgCore.def
ResOrgCore.dsp
ResOrgCore_Res.hm
ResOrgCore_Res.resorg
Xml
ProblemSymbolReportHtml.xsl
SymbolsReportHtml.xsl
ResOrgNETAddIn
AddIn.def
Release
Res
AddIn.rgs
HtmlDoc.ico
ResOrg.ico
ResOrgDoc.ico
Toolbar.bmp
WorkspaceTabs.bmp
ResOrgNETAddInSetup
Banner.jpg
Intro screen.jpg
Licence.rtf
ReadMe.rtf
Release
ResOrg.ico
ResOrgNETAddInSetup.vdproj
ResOrgNETAddInToolWindows
Release
Res
Edit.ico
Properties.ico
Renumber.ico
ResOrgNETAddInToolWindows.ico
ResOrgNETAddInToolWindowsCtrl.bmp
ResOrgNETAddInToolWindows.def
SatelliteDll
Release
res
AboutBoxCmd.bmp
OpenResOrgCmd.bmp
OptionsCmd.bmp
ViewMainToolWinCmd.bmp
// CJListView.h : header file
// Copyright � 1998-1999 CodeJock.com, All Rights Reserved.
// See ReadMe.txt for TERMS OF USE.
//
// Based on the CListView articles from http://www.codeguru.com/listview
//
/////////////////////////////////////////////////////////////////////////////
/****************************************************************************
 *
 * $Date: 15/12/02 18:03 $
 * $Revision: 4 $
 * $Archive: /Projects/Libraries/CJLibrary/Include/CJListView.h $
 *
 * $History: CJListView.h $
 * 
 * *****************  Version 4  *****************
 * User: Anna         Date: 15/12/02   Time: 18:03
 * Updated in $/Projects/Libraries/CJLibrary/Include
 * Added support for native (ComCtl v6) sort images in header controls
 * 
 *
 * *****************  Version 3  *****************
 * User: Andy         Date: 7/06/02    Time: 22:21
 * Updated in $/Projects/AddIns/ResOrg/CJLibrary/Include
 * Eliminate warnings when compiled with VC.NET
 * 
 * *****************  Version 2  *****************
 * User: Andy         Date: 2/25/02    Time: 4:45p
 * Updated in $/Projects/Libraries/CJLibrary/Include
 * CCJListCtrl::SetRowColors() and CCJListView::SetRowColors() now take
 * default parameters of value CLR_DEFAULT to allow the text/background
 * colours to be reset to system defaults
 * 
 * *****************  Version 6  *****************
 * User: Ajm          Date: 25/02/02   Time: 11:46
 * Updated in $/Third Party Software/CJLibrary 6.09/Include
 * CCJListCtrl::SetRowColors() and CCJListView::SetRowColors() now take
 * default parameters of value CLR_DEFAULT to allow the text/background
 * colours to be reset to system defaults
//
//*****************  Version 5  *****************
//User: Ajm          Date: 19/10/01   Time: 11:08
//Updated in $/Third Party Software/CJLibrary 6.09/Include
//CJLibrary 6.09 updates
 * 
 * *****************  Version 10  *****************
 * User: Kirk Stowell Date: 10/30/99   Time: 2:22p
 * Updated in $/CodeJock/Include
 * Overrode OnEraseBkgnd(...) for flicker free drawing.
 * 
 * *****************  Version 9  *****************
 * User: Kirk Stowell Date: 10/26/99   Time: 10:42p
 * Updated in $/CodeJock/Include
 * Made class methods virtual for inheritance purposes.
 * 
 * *****************  Version 8  *****************
 * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
 * Updated in $/CodeJockey/Include
 * 
 * *****************  Version 7  *****************
 * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
 * Updated in $/CodeJockey/Include
 * 
 * *****************  Version 6  *****************
 * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
 * Updated in $/CodeJockey/Include
 * 
 * *****************  Version 5  *****************
 * User: Kirk Stowell Date: 7/18/99    Time: 10:14p
 * Updated in $/CodeJockey/Include
 * Cleaned up inline functions, and import/export macro so that class will
 * be imported when linked to, and exported at compile time.
 * 
 * *****************  Version 4  *****************
 * User: Kirk Stowell Date: 6/12/99    Time: 2:12a
 * Updated in $/CodeJockey/Include
 * Cleaned up initialization, sorting and column info saving. Removed sort
 * functions, which were replaced with the virtual function SortList(...).
 * Override this function in your derived class to perform custom sorting.
 * See CCJShellList for an implementation of this virtual function.
 * 
 * *****************  Version 3  *****************
 * User: Kirk Stowell Date: 4/03/99    Time: 12:06a
 * Updated in $/CodeJockey/Include
 * Added comments and cleaned up code.
 * 
 * *****************  Version 2  *****************
 * User: Kirk Stowell Date: 3/03/99    Time: 12:06a
 * Updated in $/CodeJockey/Include
 * Added InitializeFlatHeader() in order to initialize the list control
 * manually.
 * 
 * *****************  Version 1  *****************
 * User: Kirk Stowell Date: 1/16/99    Time: 12:06a
 * Created in $/CodeJockey/Include
 * Initial release.
 *
 ***************************************************************************/
/////////////////////////////////////////////////////////////////////////////

#ifndef __CJLISTVIEW_H__
#define __CJLISTVIEW_H__

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

#include <afxcview.h>
#include "CJThemeHelper.h"		// CCJThemeHelper class declaration


class CCJFlatHeaderCtrl;


// CCJListView is a CListView derived class which implements a
// flat header and generic sorting routines.
class _CJX_EXT_CLASS CCJListView : public CListView
{
	DECLARE_DYNCREATE(CCJListView)

public:

	// Default constructor
	//
	CCJListView();

	// Virtual destructor
	//
	virtual ~CCJListView();

protected:

	int					m_nMinColWidth;		// minimum width for columns
	int					m_nMaxColWidth;		// maximum width for columns
	int					m_nSortedCol;		// index of currently selected column
	CCJFlatHeaderCtrl*	m_pHeaderCtrl;		// points to subclassed flat header control.
	CString				m_strSection;		// registry section name.
	CString				m_strEntry;			// registry entry name.
	CString				m_strDefault;		// registry default value.
	CListCtrl*			m_pListCtrl;		// points to the list control associated with this view.
	COLORREF			m_clrText;			// RGB value for row text color.
	COLORREF			m_clrTextBk;		// RGB value for row text background color.
	bool				m_bNoColSizing;		// if true, column sizing is disabled.
	int					m_nMinSize;			// if set, columns will have a minimum size requirement.
	CCJThemeHelper*		m_pTheme;			// WinXP theme helper (AJM 13.12.2002)

private:

	bool				m_bAutoSave;		// true if saving column widths.
	bool				m_bAscending;		// flag to determine sorting order

// Operations
public:
	
	// this member function will return the column width stored in the registry.
	//
	virtual int GetStoredWidth(int nCol);

	// this member function will automatically size a given column.
	//
	virtual void AutoSizeColumn(int nCol=-1);

	// this member function will set the column width from the
	// registry settings.
	//
	virtual void SetColumnWidth(int nCol);

	// this member function loads column widths from the registry.
	//
	virtual void LoadColumnWidths();

	// this member function saves column widths to the registry.
	//
	virtual void SaveColumnWidths();

	// this member function will initialize the autosave feature. If called
	// column widths will be saved to system registry when the list control
	// window is destroyed.
	//
	virtual void AutoSaveColumns(
		// registry section name, if NULL the default is "Settings".
		LPCTSTR lpszSection=NULL,
		// registry entry name, if NULL the default is "Column Info".
		LPCTSTR lpszEntry=NULL,
		// registry default value, if NULL the default id "".
		LPCTSTR lpszDefault=NULL);

	// call this member function to subclass the the flat header control.
	//
	virtual bool SubclassHeader(bool bBoldFont=false);

	// override this member function in your derived class to
	// peform custom sort routines.
	//
	virtual bool SortList(
		// passed in from control, index of column clicked.
		int nCol,
		// passed in from control, true if sort order should be ascending.
		bool bAscending );

	// this member function is called to set extended styles for the list
	// control ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_HEADERDRAGDROP.
	//
	virtual void SetExtendedStyle( DWORD dwExStyle );

	// this member function is called to return the list control extended style.
	//
	virtual DWORD GetExtendedStyle();

	// call this member function to enable/disable column sizing
	//
	virtual void DisableColumnSizing(bool bDisable);

	// call this member function to set a minimum column size
	//
	virtual void SetMinimumColSize(int nSize);

	// call this member function to determine the row index and column index for a point.
	// returns the row index or -1 if point is not over a row.
	//
	virtual int HitTestEx(
		// point to be tested.
		CPoint &point,
		// to hold the column index
		int *col) const;

	// adds column after the right most column.
	//
	virtual int AddColumn(
		// the column's heading
		LPCTSTR lpszColHeading,
		// Width of the column, in pixels. If this parameter is -1, 
		// the column width is the same as previous column
		int nWidth = -1,
		// the alignment of the column. Can be LVCFMT_LEFT,
		// LVCFMT_RIGHT, or LVCFMT_CENTER.
		int nFormat=LVCFMT_LEFT);
	
	// this member function will build the columns for the list control. Returns
	// false if an error occured.
	//
	virtual bool BuildColumns(
		// number of columns the list control contains
		int nCols,
		// int array containing the column widths
		int* nWidth,
		// CString array containing the string for each column
		CString* strColString );
	
	// this member function will build the columns for the list control. Returns
	// false if an error occured.
	//
	virtual bool BuildColumns(
		// number of columns the list control contains
		int nCols,
		// int array containing the column widths
		int* nWidth,
		// int array containing the  string resource id for each column
		int* nColString );

	// sets the row text and background colors.
	virtual void SetRowColors(COLORREF clrText = CLR_DEFAULT, COLORREF clrTextBk = CLR_DEFAULT);
	
	// returns the number of columns in the list.
	virtual int GetColumnCount() const;

	// copies a row to a new location.
	//
	virtual bool CopyRow(int nFrom, int nTo);

	// moves a row to a new location.
	//
	virtual bool MoveRow(int nFrom, int nTo);

			void SetThemeHelper(CCJThemeHelper* pTheme);
	
	virtual	int SetSortImage(int nCol, bool bAsc);


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCJListView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	//}}AFX_VIRTUAL

// Implementation
protected:
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CCJListView)
	afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDestroy();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
//	Inline Functions
/////////////////////////////////////////////////////////////////////////////

_CJXLIB_INLINE DWORD CCJListView::GetExtendedStyle()
	{ ASSERT(::IsWindow(m_hWnd)); return (DWORD)SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); }

_CJXLIB_INLINE void CCJListView::SetExtendedStyle(DWORD dwExStyle)
	{ ASSERT(::IsWindow(m_hWnd)); SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); }

_CJXLIB_INLINE void CCJListView::SetRowColors(COLORREF clrText, COLORREF clrTextBk)
	{ m_clrText = clrText; m_clrTextBk = clrTextBk; }

_CJXLIB_INLINE void CCJListView::SetMinimumColSize(int nSize)
	{ m_nMinSize = nSize; }

_CJXLIB_INLINE void CCJListView::DisableColumnSizing(bool bDisable)
	{ m_bNoColSizing = bDisable; }

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // __CJLISTVIEW_H__

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

Anna-Jayne Metcalfe
Founder Riverblade Limited
United Kingdom United Kingdom
I haven't always written software for a living. When I graduated from Surrey University in 1989, it was with an Electronic Engineering degree, but unfortunately that never really gave me the opportunity to do anything particularly interesting (with the possible exception of designing Darth Vader's Codpiece * for the UK Army in 1990).
    * Also known as the Standard Army Bootswitch. But that's another story...
Since the opportunity arose to lead a software team developing C++ software for Avionic Test Systems in 1996, I've not looked back. More recently I've been involved in the development of subsea acoustic navigation systems, digital TV broadcast systems, port security/tracking systems, and most recently software development tools with my own company, Riverblade Ltd.
 
One of my personal specialities is IDE plug-in development. ResOrg was my first attempt at a plug-in, but my day to day work is with Visual Lint, an interactive code analysis tool environment with works within the Visual Studio and Eclipse IDEs or on build servers.
 
I love lots of things, but particularly music, photography and anything connected with history or engineering. I despise ignorant, intolerant and obstructive people - and it shows...I can be a bolshy cow if you wind me up the wrong way...Laugh | :laugh:
 
I'm currently based 15 minutes walk from the beach in Bournemouth on the south coast of England. Since I moved here I've grown to love the place - even if it is full of grockles in Summer!
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 10 Jan 2005
Article Copyright 2001 by Anna-Jayne Metcalfe
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid