CSimpleSetting Class Reference

#include <Setting.h>

Inheritance diagram for CSimpleSetting:

Inheritance graph
[legend]
Collaboration diagram for CSimpleSetting:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CSimpleSetting (LPCSTR DisplayName, long Default, long Min, long Max, LPCSTR Section, LPCSTR Entry, long StepValue, CSettingGroup *pGroup=NULL)
 CSimpleSetting (SETTING *pSetting, CSettingGroup *pGroup=NULL)
long GetDefault ()
void SetDefault ()
void ChangeDefault (long NewDefault, BOOL bDontSetValue=FALSE)
void SetStepValue (long Step)
void SetMin (long Min)
void SetMax (long Max)
long GetMin ()
long GetMax ()
long GetValue ()
 operator long ()
void SetValue (long NewValue, BOOL bSupressOnChange=FALSE)
void Up ()
void Down ()
void ChangeValue (eCHANGEVALUE NewValue)
void OSDShow ()
LPCSTR GetDisplayName ()
void SetSection (LPCSTR NewValue)
LPCSTR GetSection ()
void SetEntry (LPCSTR NewValue)
LPCSTR GetEntry ()
BOOL ReadFromIni ()
void WriteToIni (BOOL bOptimizeFileAccess)
void SetGroup (CSettingGroup *pGroup)
CSettingGroupGetGroup ()
BOOL ReadFromIniSubSection (LPCSTR szSubSection)
void WriteToIniSubSection (LPCSTR szSubSection, BOOL bOptimizeFileAccess=TRUE)
SETTING * GetSETTING ()
virtual void OnChange (long NewValue, long OldValue)
void DisableOnChange ()
void EnableOnChange ()
virtual void GetDisplayText (LPSTR szBuffer)=0

Protected Member Functions

BOOL DoOnChange (long NewValue, long OldValue)
 Check flags and decide if onchange should be called.


Protected Attributes

std::string m_DisplayName
 Internal storage for display name.

std::string m_Section
 Internal storage for default ini section.

std::string m_Entry
 Internal storage for ini entry.

std::string m_SectionLastSavedValueIniSection
 Internal storage for ini section of the last read/written value.

long m_SectionLastSavedValue
 Internal storage for value of the last read/written value.

std::string m_sLastSavedValueIniSection
 Internal storage for ini section of the last read/written value.

long m_StoreValue
 Internal storage for the actual value of the setting.

BOOL m_bFreeSettingOnExit
 Set to TRUE to free m_pSetting at destruction.

long m_ReadWriteFlags
 Internal read/write flags.

SETTING * m_pSetting
 Actual setting info.

CSettingGroupm_pGroup
 Setting group.

BOOL m_EnableOnChange
 OnChange calls enabled/disabled.


Detailed Description

Base class for settings that can be represented as a long


Constructor & Destructor Documentation

CSimpleSetting::CSimpleSetting LPCSTR  DisplayName,
long  Default,
long  Min,
long  Max,
LPCSTR  Section,
LPCSTR  Entry,
long  StepValue,
CSettingGroup pGroup = NULL
 

Constructor

Specify setting parameters: Display name, default value, minimum value, maximum value, default ini section, ini entry, step value, (optional:) Setting group, setting flags, GUI info, static callback function, pointer for callback function

CSimpleSetting::CSimpleSetting SETTING *  pSetting,
CSettingGroup pGroup = NULL
 

Constructor

Specify setting parameters: Pointer to SETTING structure, (optional:) Setting group, Setting flags, GUI info, static callback function, pointer for callback function


Member Function Documentation

void CSimpleSetting::ChangeDefault long  NewDefault,
BOOL  bDontSetValue = FALSE
[virtual]
 

Change default value

Implements ISetting.

Reimplemented in CStringSetting.

BOOL CSimpleSetting::DoOnChange long  NewValue,
long  OldValue
[protected]
 

Check flags and decide if onchange should be called.

Check if the setting should do an OnChange call

void CSimpleSetting::OnChange long  NewValue,
long  OldValue
[virtual]
 

Default OnChange function Child class can override

This function calls the pfnExOnChange function or the pfnOnChange function of the setting if one of them is not NULL

Reimplemented from ISetting.

BOOL CSimpleSetting::ReadFromIni  )  [virtual]
 

Read value from default location in .ini file

Implements ISetting.

Reimplemented in CStringSetting.

BOOL CSimpleSetting::ReadFromIniSubSection LPCSTR  szSubSection  )  [virtual]
 

Read value from sub section in .ini file

Parameters:
szSubSection Set to NULL to read from the default location
bSetDefaultOnFailure If the setting was not in the .ini file, set the setting's value to the default value
pSettingFlags Override setting flags of current setting if not NULL
Returns:
TRUE if value was in .ini file

Implements ISetting.

Reimplemented in CStringSetting.

void CSimpleSetting::SetDefault  )  [virtual]
 

Set default value.

Implements ISetting.

Reimplemented in CStringSetting.

void CSimpleSetting::SetValue long  NewValue,
BOOL  bSupressOnChange = FALSE
[virtual]
 

Set value

Implements ISetting.

Reimplemented in CStringSetting.

void CSimpleSetting::WriteToIniSubSection LPCSTR  szSubSection,
BOOL  bOptimizeFileAccess = TRUE
[virtual]
 

Write value to szSubsection in .ini file Override value and setting flags if Value and/or pSettingFlags is not NULL.

Implements ISetting.

Reimplemented in CStringSetting.


The documentation for this class was generated from the following files:
Generated on Mon Oct 27 09:54:53 2003 for DScaler by doxygen 1.3.4