コード例 #1
0
ファイル: user_stats.cpp プロジェクト: DINKIN/omim
UserStatsLoader::UserStatsLoader()
  : m_lastUpdate(my::SecondsSinceEpochToTimeT(0))
{
  if (!LoadFromSettings())
    LOG(LINFO, ("There is no cached user stats info in settings"));
  else
    LOG(LINFO, ("User stats info was loaded successfully"));
}
コード例 #2
0
ファイル: propperf.cpp プロジェクト: hjgode/ceTSC
int CPropPerf::DialogProc(HWND hwndDlg, UINT uMsg,WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
	case WM_INITDIALOG:
	{
		if (!CDlgBase::DialogProc(hwndDlg, uMsg, wParam, lParam))
			return FALSE;

		InitCombo(_hInst, _hwndDlg, IDC_CBO_PERF_OPTIMIZE, gaPerfCombo, sizeof(gaPerfCombo)/sizeof(ComboItem));

		return LoadFromSettings();
		break;
	}

	case WM_COMMAND:
	{	
		if (HIWORD(wParam) == CBN_SELCHANGE)
		{
			int nSel = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
			if (nSel < 0)
				break;

			for (int i=0; i<MAX_PERF_CHECK_BOXES; i++)
			{
				BOOL fCheck = (nSel == MAX_COMBO_ITEMS - 1) ?  (HIWORD(gaPerfCombo[nSel].dwVal) & (1 << i) ) : (i < LOWORD(gaPerfCombo[nSel].dwVal) );
				SendDlgItemMessage(_hwndDlg, gadwPerfChkBox[i], BM_SETCHECK, fCheck ? BST_CHECKED : BST_UNCHECKED, 0);
			}
			break;
		}

		if (HIWORD(wParam) == BN_CLICKED)
		{
			UpdatePerfComboBox();
			break;
		}

		break;
	}

	case MSG_TSC_CONNECT:
	{
		SaveToSettings();
		EnableControls(_hwndDlg, gadwDisableCtls, sizeof(gadwDisableCtls)/sizeof(gadwDisableCtls[0]), FALSE);
		return TRUE;
	}

	case MSG_TSC_DISCONNECTED:
	{
		EnableControls(_hwndDlg, gadwDisableCtls, sizeof(gadwDisableCtls)/sizeof(gadwDisableCtls[0]), TRUE);
		return TRUE;
	}

	case WM_DESTROY:
	{
		return SaveToSettings();
	}

	default:
		break;
	}
	return CDlgBase::DialogProc(hwndDlg, uMsg, wParam, lParam);

}