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
// ResizeCtrl.h: interface for the CNGResizeCtrl class.
//
//
// Written by Herbert Menke (h.menke@gmx.de)
// Copyright (c) 2000.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. If 
// the source code in  this file is used in any commercial application 
// then acknowledgement must be made to the author of this file 
// (in whatever form you wish).
//
// This file is provided "as is" with no expressed or implied warranty.
//
// Expect bugs.
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this
// file. 
//
// -----------------------------------------------------------------------
// 1.0  2000-07-11  Bug in CalcValue corrected
//                  Support for PropertyPages and Wizard added
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_RESIZECTRL_H__3CD44893_48A2_11D4_880C_00902755BD88__INCLUDED_)
#define AFX_RESIZECTRL_H__3CD44893_48A2_11D4_880C_00902755BD88__INCLUDED_

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

class CResizeArray;

struct CResizeInfo
{
  int ctlID;  // Specifies the identifier of the control 
  int left;   // Specifies the  change in the position of the left edge 
              // of the object relative to the total change in the parent window�s width. 
  int top;    // Specifies the  change in the position of the top 
              // of the object relative to the total change in the parent window�s height.
  int width;  // Specifies the  change in the width of the object 
              // relative to the total change in the parent window�s width.
  int height; // Specifies the  change in the height of the object 
              // relative to the total change in the parent window�s height.
};

class NGLIB_EXT_CLASS CNGResizeCtrl
{
public:

  //
  // Add Method
  //

  // Adds a control window to the list to be resized

  // left, top, width and height determines how the size and position of the control window
  // will change when the size of the parent window changes.

  // In general, the formula is	
  //
  //    newValue = oldValue + (( deltaValueParent * partValue) / maxPart );
  //
  // newValue          - new left or top position or new width or height
  // oldValue          - old left or top position or old width or height 
  // deltaValueParent  - changes in parent width or height
  // partValue         - left, top, width or height value specified in the Add Method
  // maxPart           - value specified by the maxPart parameter of the constructor
  //                     or the Create method

  //
  // left   - Specifies the change in the position of the left edge 
  //          of the object relative to the total change in the parent window�s width. 
  //          For example: suppose that left is 50 and the width of the window increases by 200 pixels. 
  //          Then the left edge of the object moves right by 100 pixels (50% of 200).
  // top    - Specifies the change in the top position
  //          of the object relative to the total change in the parent window�s height.
  // width  - Specifies the  change in the width of the object 
  //          relative to the total change in the parent window�s width.
  //          For example: suppose that width is zero. Then the width of the object does not change, 
  //                       regardless of how much the width of the parent window changes.
  //                       suppose that width is 100 and the width of the window decreases by 50 pixels. 
  //                       Then the width of the object also decreases by 50 pixels (100% of 50).
  // height - Specifies the  change in the height of the object 
  //          relative to the total change in the parent window�s height.

	BOOL Add( HWND hWndCtl,  int left, int top, int width, int height );
	BOOL Add( int ctlID,     int left, int top, int width, int height );
	BOOL Add( CWnd * wndCtl, int left, int top, int width, int height );

  // resizeInfo is a null terminated array of CResizeInfo

	BOOL Add( const CResizeInfo * resizeInfo );

  //
  // Remove Method
  //

  // Removes a control window from the list to be resized
  
	BOOL Remove( HWND hWndCtl  );
	BOOL Remove( int ctlID     );
	BOOL Remove( CWnd * wndCtl );

  // enabled
  // TRUE    returns the position and size before resizing was enabled
  // FALSE   returns the last position and size before resizing was disabled

  BOOL GetWindowRect( RECT * rect );

  //
  // Construction
  //

	BOOL Create( HWND hWndParent,  BOOL enabled = TRUE, int maxPart = 100, BOOL isPropetyPage = FALSE );
	BOOL Create( CWnd * wndParent, BOOL enabled = TRUE, int maxPart = 100 );

  CNGResizeCtrl();
  CNGResizeCtrl( HWND hWndParent,  BOOL enabled = TRUE, int maxPart = 100, BOOL isPropetyPage = FALSE );
	CNGResizeCtrl( CWnd * wndParent, BOOL enabled = TRUE, int maxPart = 100 );
	virtual ~CNGResizeCtrl();

  //
  // Enabled Property
  //

  // enable or disable resizing

  BOOL SetEnabled( BOOL enable );
  BOOL GetEnabled() const;

  //
  // GripEnabled Property
  //

  BOOL SetGripEnabled( BOOL showGrip );
  BOOL GetGripEnabled() const ;

  ///////////////////////////////////////////////////////////////////////
  //
  // MinMax Support
  //
  BOOL  SetMinimumTrackingSize( const CSize & size );
  BOOL  SetMinimumTrackingSize( );
  CSize GetMinimumTrackingSize( );

  BOOL  SetMaximumTrackingSize( const CSize & size );
  CSize GetMaximumTrackingSize( );

  //
  // GetResizeCtrl Method
  //

  static CNGResizeCtrl * GetResizeCtrl( CWnd * wnd );
  static CNGResizeCtrl * GetResizeCtrl( HWND hWnd );

  //
  // Support for CPropertySheet and Wizard
  //

  // Prepares the propertysheet to ensure that
  // all pages are created , should be called
  // before the control is enabled 
  BOOL PropertySheetPrepare( CPropertySheet * sheet );

  // Adds the buttons of PropertySheet or Wizard
  BOOL PropertySheetAddButtons( CPropertySheet * sheet, int left, int top, int width, int height );
  // Adds the pages of PropertySheet or Wizard
  BOOL PropertySheetAddPages( CPropertySheet * sheet, int left, int top, int width, int height );
  // Adds the etched bar beneath the pages
  BOOL WizardAddEtchedBar( CPropertySheet * sheet, int left, int top, int width, int height );

  // saves the the delta-size between the wizard-size and a page-size
  // because WizBack and WizNext resizes a page to the initial Size
  BOOL WizardSaveMargins( CPropertySheet * sheet );
  // restores propertypage size after WizBack or WizNext
  BOOL WizardAdjustPage( CPropertySheet * sheet );

private:
	void GetGripRect( RECT & rect, BOOL redraw );
  // Resize the controls
  void Resize(int cx, int cy) ;
  // processes the messages for resizing
  BOOL ProcessMessage( UINT message, WPARAM wParam, LPARAM lParam, LRESULT & result );
  // adds or removes style WS_THICKFRAME of the aprent window
  void ChangeStyle( BOOL enable );
  // initialise the control
  // calculates the new left, top, width or height 
  BOOL CalcValue(int delta, int part, int & pending, long & position, BOOL isSize);
  // subclass window proc
	static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );

  BOOL                              m_hasResizingBorder; // TRUE if the parent has a resizing border
  WNDPROC                           m_prevWndProc;       // previous Window Proc 
  BOOL                              m_enabled;           // parent is subclassed
  int                               m_maxPart;           // max PartValue
  HWND                              m_hWndParent;        // handle of the paretn window
  CSize                             m_size;              // width and heigth of the parent window
  CResizeArray                    * m_array;             // parameters of registered controls
  /////////////////////////////////////////////////
	CSize                             m_maxTracking;       // parameters for max Tracking
	CSize                             m_minTracking;       // parameters for min Tracking
  /////////////////////////////////////////////////
	BOOL                              m_inResize;          // flag to prevent recursion in WM_SIZE
  /////////////////////////////////////////////////
  int                               m_hitCode;           // stored hitCode from WM_NCLBUTTONDOWN
  CSize                             m_delta;             // stored delta Size from WM_NCLBUTTONDOWN 
  BOOL                              m_inMouseMove;       // flag to prevent recursion in WM_MOUSEMOVE
  /////////////////////////////////////////////////
  CRect                             m_gripRect;          // position and size of the grip rect
  BOOL                              m_gripEnabled;       // TRUE, if grip is enabled
  /////////////////////////////////////////////////
  CRect                             m_windowRect;        // last Window position and Size
  CRect                           * m_margins;           // margins for wizard
};

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

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 | Mobile
Web04 | 2.8.141022.2 | Last Updated 10 Jan 2005
Article Copyright 2001 by Anna-Jayne Metcalfe
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid