📄 resourcesymbolmanager.h
字号:
m_nResources = 0;
m_nAccelerators = 0;
m_nBitmaps = 0;
m_nIcons = 0;
m_nMenus = 0;
m_nPrompts = 0;
m_nStrings = 0;
m_nDialogs = 0;
m_nToolbars = 0;
m_nOtherResources = 0;
m_nCommands = 0;
m_uMinResource = 0;
m_uMaxResource = 0;
m_uMinCommand = 0;
m_uMaxCommand = 0;
}
int m_nControls;
int m_nResources;
int m_nAccelerators;
int m_nBitmaps;
int m_nIcons;
int m_nMenus;
int m_nPrompts;
int m_nStrings;
int m_nDialogs;
int m_nToolbars;
int m_nOtherResources;
int m_nCommands;
UINT m_uMinResource;
UINT m_uMaxResource;
UINT m_uMinCommand;
UINT m_uMaxCommand;
};
/////////////////////////////////////////////////////////////////////////////
// CResourceSymbolManager class
#define CResourceSymbolManager_BASE CObject
class RESORGCORE_EXT_CLASS CResourceSymbolManager : public CObject
{
DECLARE_DYNAMIC(CResourceSymbolManager)
public:
CResourceSymbolManager(bool bAutoDelete = false);
CResourceSymbolManager(const CResourceSymbolManager& src);
virtual ~CResourceSymbolManager(void);
// Attributes
protected:
bool m_bAutoDelete; ///< Only used if created by CResourceSymbolConflictManager. Normally false
CString m_sResourceFileName; ///< The pathname of the resource file directly associated with this symbol
CString m_sPathName; ///< The pathname of the resource symbol file in which this symbol is defined
int m_nConflicts; ///< How many symbols with conflicting values
int m_nOutOfRangeSymbols; ///< Count of symbols whose value is outside defined ranges
int m_nProblemSymbols; ///< The total number of symbols with "problems"
bool m_bCheckForOutOfRangeSymbols; ///< Determines whether the range of values of symbols is validated
bool m_bModified;
bool m_b3dControls;
UINT m_uBaseResourceValue;
UINT m_uBaseControlValue;
UINT m_uBaseCommandValue;
UINT m_uNextResourceValue;
UINT m_uNextControlValue;
UINT m_uNextSymedValue;
UINT m_uNextCommandValue;
protected:
// The main list of symbols
CResourceSymbolList m_listSymbols;
// Used to keep track of how many symbols are using a given name/value
CResourceSymbolNamesMap m_mapNames;
CResourceSymbolValuesMap m_mapValues;
// Operators
public:
void operator=(const CResourceSymbolManager& src);
// Operations
public:
bool AutoDelete(void) const
{ return m_bAutoDelete; }
CString GetPathName(void) const
{ return m_sPathName; }
CString GetFileName(void) const;
CString GetResourceFileName(void) const
{ return m_sResourceFileName; }
int GetSymbols(CResourceSymbolList& rlistSymbols) const;
int GetSymbols( const CString& sName,
CResourceSymbolList& rlistSymbols) const;
int GetSymbols( UINT uValue,
CResourceSymbolList& rlistSymbols) const;
bool ReadSymbolFile(const CString& sPathName);
virtual bool Set( CResourceSymbol* pSymbol,
const CString& sName,
UINT uValue,
bool bReadOnly = false);
bool SetModifiedFlag(bool bModified);
bool IsModified(void) const
{ return m_bModified; }
bool Renumber( CResourceSymbolList* plistSymbols,
UINT uBaseResource,
UINT uBaseCommand,
UINT uBaseControl,
bool bIgnoreFixedStatus = false,
bool bSortByName = true);
bool Renumber( UINT uBaseResource,
UINT uBaseCommand,
UINT uBaseControl,
bool bIgnoreFixedStatus = false,
bool bSortByName = true);
bool CalculateBaseValues(UINT& ruBaseResource,
UINT& ruBaseCommand,
UINT& ruBaseControl) const;
virtual bool AreNextSymbolValuesInUse(void) const;
virtual bool FixNextSymbolValues(void);
bool CalculateNextSymbolValues( UINT& ruNextResourceValue,
UINT& ruNextControlValue,
UINT& ruNextCommandValue,
UINT& ruNextSymedValue);
bool UpdateNextSymbolValues(void);
void CountConflicts(void);
UINT GetBaseValue(int eSymbolType) const;
UINT GetBaseResourceValue(void) const
{ return m_uBaseResourceValue; }
UINT GetBaseControlValue(void) const
{ return m_uBaseControlValue; }
UINT GetBaseCommandValue(void) const
{ return m_uBaseCommandValue; }
UINT GetBaseSymbolValue(int eSymbolType) const;
bool Get3dControlsValue(void) const
{ return m_b3dControls; }
bool Set3dControlsValue(bool b3dControls);
UINT GetNextResourceValue(void) const
{ return m_uNextResourceValue; }
UINT GetNextCommandValue(void) const
{ return m_uNextCommandValue; }
UINT GetNextControlValue(void) const
{ return m_uNextControlValue; }
UINT GetNextSymedValue(void) const
{ return m_uNextSymedValue; }
bool SetBaseResourceValue(UINT uValue);
bool SetBaseControlValue(UINT uValue);
bool SetBaseCommandValue(UINT uValue);
bool SetNextResourceValue(UINT uValue);
bool SetNextCommandValue(UINT uValue);
bool SetNextControlValue(UINT uValue);
bool SetNextSymedValue(UINT uValue);
bool CheckForOutOfRangeSymbols(void) const
{ return m_bCheckForOutOfRangeSymbols; }
bool CheckForOutOfRangeSymbols(bool bCheck);
CResourceSymbol* Add( const CString& sSymbolName,
UINT uSymbolValue,
int nLineNo,
bool bUpdateMetrics = true);
bool Add( CResourceSymbol* pSymbol,
bool bUpdateMetrics = true);
bool Remove( CResourceSymbol* pSymbol,
bool bUpdateMetrics = true);
virtual void RemoveAll(void);
POSITION GetFirstSymbolPosition(void) const
{ return m_listSymbols.GetHeadPosition(); }
CResourceSymbol* GetNextSymbol(POSITION& rPos) const
{ return m_listSymbols.GetNext(rPos); }
int GetSymbolCount(void) const
{ return (int)m_listSymbols.GetCount(); }
int GetSymbolCount(CResourceSymbolCounts& rInfo) const;
void SortByName(void)
{ m_listSymbols.SortByName(); }
void SortByValue(void)
{ m_listSymbols.SortByValue(); }
CString GetDisplayedStatus(CResourceSymbol* pSymbol) const;
// Methods for dealing with symbols with "problems"
int GetConflicts(CResourceSymbolList& rlistConflicts) const;
int GetConflicts( CResourceSymbol* pSymbol,
CResourceSymbolList& rlistConflicts) const;
int GetConflictCount(void) const
{ return m_nConflicts; }
int GetOutOfRangeSymbols(CResourceSymbolList& rlistSymbols) const;
int GetOutOfRangeSymbolCount(void) const
{ return m_nOutOfRangeSymbols; }
int GetProblemSymbolCount(void) const
{ return m_nProblemSymbols; }
virtual bool IsOutOfRange(CResourceSymbol* pSymbol) const;
bool IsOutOfRange(int eSymbolType, UINT uValue) const;
bool IsUnique(const CString& sName) const;
bool IsUnique(UINT uValue) const;
bool IsInUse(const CString& sName) const;
bool IsInUse(UINT uValue) const;
CString GetUnusedName(int eType) const;
UINT GetNextFreeValue(UINT uValue) const;
// Virtual Overrides
public:
virtual void Serialize(CArchive& ar);
// Implementation
protected:
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -