本文整理汇总了C++中AppSettings::Write方法的典型用法代码示例。如果您正苦于以下问题:C++ AppSettings::Write方法的具体用法?C++ AppSettings::Write怎么用?C++ AppSettings::Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppSettings
的用法示例。
在下文中一共展示了AppSettings::Write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveSettings
void HotKeyManager::SaveSettings()
{
TRACEST(_T("HotKeyManager::SaveSettings."));
PrgAPI* pAPI = PRGAPI();
AppSettings* appSettings = pAPI->GetAppSettings();
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyPlay, (INT) m_HotKeys[HK_Play - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyStop, (INT) m_HotKeys[HK_Stop - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyPrev, (INT) m_HotKeys[HK_Prev - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyNext, (INT) m_HotKeys[HK_Next - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyMiniPlayer, (INT) m_HotKeys[HK_ToggleMiniPlayer - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyTooltip, (INT) m_HotKeys[HK_Tooltip - HK_First - 1]);
appSettings->Write(HotKeyManagerSettingsCategory, cHotkeyQuickSearch, (INT) m_HotKeys[HK_QuickSearch - HK_First - 1]);
}
示例2: SaveSettings
void CTeenSpiritDlg::SaveSettings()
{
PrgAPI* pAPI = PRGAPI();
AppSettings* params = pAPI->GetAppSettings();
WINDOWPLACEMENT pl;
GetWindowPlacement(&pl);
params->Write(SettingsCategory, _T("CMDSHOW"), (int&) pl.showCmd);
params->Write(SettingsCategory, _T("LEFT"), (int&) pl.rcNormalPosition.left);
params->Write(SettingsCategory, _T("TOP"), (int&) pl.rcNormalPosition.top);
params->Write(SettingsCategory, _T("RIGHT"), (int&) pl.rcNormalPosition.right);
params->Write(SettingsCategory, _T("BOTTOM"), (int&) pl.rcNormalPosition.bottom);
m_PaneController.SaveSettings();
BOOL bIsPlayerVisible = FALSE;
CMiniPlayerDlg* pMPDlg = pAPI->GetMiniPlayerDlg(FALSE);
if (pMPDlg != NULL)
bIsPlayerVisible = pMPDlg->IsWindowVisible();
pAPI->SetOption(OPT_MINIPLR_ShowAtStartup, bIsPlayerVisible);
}
示例3: SetState
void CQuizRunningDlg::SetState(FormStates st)
{
m_curState = st;
PrgAPI* pAPI = PRGAPI();
DisplayRunningResult();
switch (st)
{
case ST_Start:
SetCurrentGame(m_curGameIdx);
m_pPlayer->Stop();
m_curTime = 0;
m_correctAnswers = 0;
m_totalAnswers = 0;
m_lastResponseTime = 0;
if (m_poolCount < 4)
{
m_subTitle.SetWindowText(pAPI->GetString(IDS_NOTENOUGHTRACKSTOPLAYTHEQUIZ));
}
else
{
HideAll();
m_pButtons[BT_Start]->ShowWindow(SW_SHOW);
m_pButtons[BT_SelectNext]->ShowWindow(SW_SHOW);
m_pButtons[BT_SelectPrev]->ShowWindow(SW_SHOW);
m_pButtons[BT_Exit]->ShowWindow(SW_SHOW);
m_subTitle.SetWindowText(pAPI->GetString(IDS_RECOGNISESONG));
//m_subTitle.SetColor(CLabelEx::COL_Text, RGB(200,200,200));
}
break;
case ST_DisplayingQuestionsAndWait:
{
KillTimer(TIMER_CONTINUOUS);
if (m_pButtons[BT_Start] ->IsWindowVisible())
HideAll();
INT numTimes = 0;
while (!DisplayNextQuestion() && numTimes<4)
numTimes++;
for (INT i = BT_Answer1; i <= BT_AnswerNo; i++)
{
m_pButtons[i]->SetState(CMillionaireButton::ST_Disabled);
m_pButtons[i]->SetTextAlign(DT_LEFT);
m_pButtons[i]->EnableWindow(FALSE);
m_pButtons[i]->ShowWindow(SW_SHOW);
m_pButtons[i]->Invalidate();
}
m_progress.ShowWindow(SW_SHOW);
m_pButtons[BT_EndGame]->ShowWindow(SW_SHOW);
if (numTimes == 4)
SetState(ST_GameOver);
SetTimer(TIMER_DISPLAYQUESTIONSTIMER, TIMER_DISPLAYQUESTIONSTIMER_DELAY, NULL);
}
break;
case ST_RunningQuestions:
SetFocus();
for (int i = BT_Answer1; i <= BT_AnswerNo; i++)
{
m_pButtons[i]->SetState(CMillionaireButton::ST_Normal);
m_pButtons[i]->EnableWindow(TRUE);
m_pButtons[i]->Invalidate();
}
m_pPlayer->Start();
m_progress.ShowWindow(SW_SHOW);
m_LastTickCount = GetTickCount();
SetTimer(TIMER_CONTINUOUS, 25, NULL);
break;
case ST_DisplayingResultsAndWait:
KillTimer(TIMER_CONTINUOUS);
for (int i = BT_Answer1; i <= BT_AnswerNo; i++)
{
//m_pButtons[i]->SetState(CMillionaireButton::ST_Normal);
m_pButtons[i]->EnableWindow(FALSE);
//m_pButtons[i]->Invalidate();
}
SetTimer(TIMER_DISPLAYRESULTSTIMER, TIMER_DISPLAYRESULTSTIMER_DELAY, NULL);
break;
case ST_GameOver:
m_pPlayer->SetVolume(40);
KillTimer(TIMER_CONTINUOUS);
KillTimer(TIMER_DISPLAYRESULTSTIMER);
KillTimer(TIMER_DISPLAYQUESTIONSTIMER);
HideAll();
m_pButtons[BT_Submit]->ShowWindow(SW_SHOW);
m_pButtons[BT_NewGame]->ShowWindow(SW_SHOW);
m_pButtons[BT_Exit]->ShowWindow(SW_SHOW);
SYSTEMTIME st;
GetSystemTime(&st);
m_gameTimeStamp = SystemTime2UnixTimeStamp(st);
if (m_curGameBestScore < m_correctAnswers)
{
m_curGameBestScore = m_correctAnswers;
AppSettings* pSettings = pAPI->GetAppSettings();
TCHAR bf[500];
_sntprintf(bf, 500, _T("%s.best"), m_curGame.gameName);
pSettings->Write(SettingsCategory, bf, m_curGameBestScore);
_sntprintf(bf, 500, _T("%s.bestdate"), m_curGame.gameName);
TCHAR dateBuffer[200];
::GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, 0, 0, dateBuffer, 200);
//.........这里部分代码省略.........