📄 renumwizoptionspage.cpp
字号:
/************************************************************************
*
* Resource ID Organiser Utility Library
*
* (c) Copyright 2001 by Andy Metcalfe (andy.metcalfe@lineone.net)
* All rights reserved.
*
************************************************************************
*
* Filename : RenumWizOptionsPage.cpp
*
* Description : CRenumWizOptionsPage - Symbol Renumbering Wizard
* "Options" page class
*
* Compiler : Microsoft Visual C++ 6.0, Service Pack 3 or 4
*
* Target
* Environment : Windows 98/NT
*
* NOTE:
*
* This software is provided "as is" free for personal use. All
* title and copyrights in and to the software, including but not
* limited to any images, text, etc. incorporated into it, are
* owned by Andy Metcalfe, except where acknowledged otherwise.
*
* Your may freely to use this code in your own products, PROVIDED
* this notice is not removed or modified.
*
*
* Visit http://www.resorg.co.uk for latest updates
*
************************************************************************
*
* MODIFICATION HISTORY:
*
* This is a controlled document. See project configuration
* control tool for latest version and full version history.
*
* $Archive: /Projects/AddIns/ResOrg/ResOrgUtils/RenumWizOptionsPage.cpp $
* $Revision: 3 $
* $Date: 23/05/01 16:34 $
* $Author: Andy $
*
* $History: RenumWizOptionsPage.cpp $
*
* ***************** Version 3 *****************
* User: Andy Date: 23/05/01 Time: 16:34
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Better handling of Symbol Selection options
*
* ***************** Version 2 *****************
* User: Andy Date: 4/05/01 Time: 22:37
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Implemented resizing
*
* ***************** Version 1 *****************
* User: Andy Date: 21/04/01 Time: 7:13
* Created in $/Projects/AddIns/ResOrg/ResOrgUtils
*
* $Nokeywords: $
*
************************************************************************/
// RenumWizOptionsPage.cpp : implementation file
//
#include "StdAfx.h"
#include "ResOrgUtils_Priv.h"
#include "RenumWizOptionsPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRenumWizOptionsPage property page
IMPLEMENT_DYNCREATE(CRenumWizOptionsPage, CRenumWizOptionsPage_BASE)
CRenumWizOptionsPage::CRenumWizOptionsPage(void)
: CRenumWizOptionsPage_BASE( CRenumWizOptionsPage::IDD,
IDS_RENUMWIZ,
IDS_RENUMWIZ_OPTIONS_PAGE_TITLE,
IDS_RENUMWIZ_OPTIONS_PAGE_SUBTITLE)
{
//{{AFX_DATA_INIT(CRenumWizOptionsPage)
m_eSymbolSelection = -1;
m_eSymbolOrder = -1;
//}}AFX_DATA_INIT
}
CRenumWizOptionsPage::~CRenumWizOptionsPage(void)
{
}
void CRenumWizOptionsPage::DoDataExchange(CDataExchange* pDX)
{
CRenumWizOptionsPage_BASE::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRenumWizOptionsPage)
DDX_Radio(pDX, IDC_RENUMWIZ_SELECT, m_eSymbolSelection);
DDX_Radio(pDX, IDC_RENUMWIZ_SORT, m_eSymbolOrder);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRenumWizOptionsPage, CRenumWizOptionsPage_BASE)
//{{AFX_MSG_MAP(CRenumWizOptionsPage)
ON_COMMAND( IDC_RENUMWIZ_SELECT, OnCmdSymbolSelection)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CRenumWizOptionsPage::OnInitDialog(void)
{
CRenumWizOptionsPage_BASE::OnInitDialog();
if (IsResizeable())
{
m_Resizer.Add( IDC_RENUMWIZ_SELECT_CAPTION, 50, 10, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SELECT, 50, 20, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SELECT_MANUAL, 50, 30, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SELECT_CONFLICTS, 50, 40, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SEPARATOR, 0, 50, 100, 0);
m_Resizer.Add( IDC_RENUMWIZ_SORT_CAPTION, 50, 60, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SORT, 50, 70, 0, 0);
m_Resizer.Add( IDC_RENUMWIZ_SORT_CAUTIOUS, 50, 80, 0, 0);
}
return TRUE;
}
BOOL CRenumWizOptionsPage::OnSetActive(void)
{
if (!IsInitialising())
{
if (NULL != m_pEngine)
{
m_eSymbolSelection = m_pEngine->m_eSymbolSelection;
m_eSymbolOrder = m_pEngine->m_eSymbolOrder;
// Only enable the "Conflicts only" option if there actually are some...
CResourceSymbolList listConflicts;
m_pEngine->m_pResourceSymbolBuffer->GetConflicts(listConflicts);
if (0 == listConflicts.GetCount() )
{
// No conflicts
if (RENUMWIZ_CONFLICTING_SYMBOLS == m_eSymbolSelection)
{
m_eSymbolSelection = RENUMWIZ_SELECTED_SYMBOLS;
}
EnableDlgControl(IDC_RENUMWIZ_SELECT_CONFLICTS, FALSE);
}
else
{
EnableDlgControl(IDC_RENUMWIZ_SELECT_CONFLICTS, TRUE);
}
UpdateData(FALSE);
}
}
return TRUE;
}
BOOL CRenumWizOptionsPage::OnKillActive(void)
{
if (!IsInitialising())
{
if (NULL != m_pEngine)
{
// Update the renumbering engine with our settings
m_pEngine->m_eSymbolSelection = m_eSymbolSelection;
m_pEngine->m_eSymbolOrder = m_eSymbolOrder;
switch (m_eSymbolSelection)
{
case RENUMWIZ_CONFLICTING_SYMBOLS: // Conflicting symbols
// TO DO: Move this to a wrapper method (SetSymbolSelection?) in the engine
m_pEngine->m_pResourceSymbolBuffer->GetConflicts(m_pEngine->m_listSelectedSymbols);
break;
default:
break;
}
}
}
return TRUE;
}
LRESULT CRenumWizOptionsPage::OnWizardBack(void)
{
return IDD_RENUMWIZ_WAFFLE_PAGE;
}
LRESULT CRenumWizOptionsPage::OnWizardNext(void)
{
LRESULT lPageID = -1;
switch (m_eSymbolSelection)
{
case RENUMWIZ_ALL_SYMBOLS: // All symbols
case RENUMWIZ_CONFLICTING_SYMBOLS: // Conflicting symbols
lPageID = IDD_RENUMWIZ_BASE_VALUES_PAGE;
break;
case RENUMWIZ_SELECTED_SYMBOLS: // Selected symbols
lPageID = IDD_RENUMWIZ_SELECT_SYMBOLS_PAGE;
break;
default:
ASSERT(FALSE);
break;
}
return lPageID;
}
/////////////////////////////////////////////////////////////////////////////
// CRenumWizOptionsPage message handlers
void CRenumWizOptionsPage::OnCmdSymbolSelection(void)
{
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -