コード例 #1
0
void InterfaceConfigPane::LoadGUIValues()
{
  const SConfig& startup_params = SConfig::GetInstance();

  m_confirm_stop_checkbox->SetValue(startup_params.bConfirmStop);
  m_panic_handlers_checkbox->SetValue(startup_params.bUsePanicHandlers);
  m_osd_messages_checkbox->SetValue(startup_params.bOnScreenDisplayMessages);
  m_pause_focus_lost_checkbox->SetValue(SConfig::GetInstance().m_PauseOnFocusLost);

  const std::string exact_language = SConfig::GetInstance().m_InterfaceLanguage;
  const std::string loose_language = exact_language.substr(0, exact_language.find('_'));
  size_t exact_match_index = std::numeric_limits<size_t>::max();
  size_t loose_match_index = std::numeric_limits<size_t>::max();
  for (size_t i = 0; i < language_ids.size(); i++)
  {
    if (language_ids[i] == exact_language)
    {
      exact_match_index = i;
      break;
    }
    else if (language_ids[i] == loose_language)
    {
      loose_match_index = i;
    }
  }
  if (exact_match_index != std::numeric_limits<size_t>::max())
    m_interface_lang_choice->SetSelection(exact_match_index);
  else if (loose_match_index != std::numeric_limits<size_t>::max())
    m_interface_lang_choice->SetSelection(loose_match_index);

  LoadThemes();
}
コード例 #2
0
void InterfaceConfigPane::LoadGUIValues()
{
	const SConfig& startup_params = SConfig::GetInstance();

	m_confirm_stop_checkbox->SetValue(startup_params.bConfirmStop);
	m_panic_handlers_checkbox->SetValue(startup_params.bUsePanicHandlers);
	m_osd_messages_checkbox->SetValue(startup_params.bOnScreenDisplayMessages);
	m_pause_focus_lost_checkbox->SetValue(SConfig::GetInstance().m_PauseOnFocusLost);

	for (size_t i = 0; i < sizeof(language_ids) / sizeof(wxLanguage); i++)
	{
		if (language_ids [i] == SConfig::GetInstance().m_InterfaceLanguage)
		{
			m_interface_lang_choice->SetSelection(i);
			break;
		}
	}

	LoadThemes();
}
コード例 #3
0
ファイル: appearance.c プロジェクト: hoangduit/reactos
static INT_PTR
AppearancePage_OnInit(HWND hwndDlg)
{
    INT iListIndex;
    HWND hwndTheme;
    GLOBALS *g;
    RECT rcPreview;
    HDC hdcScreen;
    PTHEME pTheme;

    g = (GLOBALS*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBALS));
    if (g == NULL)
        return FALSE;

    SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)g);

    g->bInitializing = TRUE;

    if (!LoadCurrentScheme(&g->Scheme))
        return FALSE;

    g->pThemes = LoadThemes();
    if (g->pThemes)
    {
        if (!GetActiveTheme(g->pThemes, &g->ActiveTheme))
            g->ActiveTheme.ThemeActive = FALSE;

        /* 
         * Keep a copy of the selected classic theme in order to select this
         * when user selects the classic theme (and not a horrible random theme )
         */
        if (!GetActiveClassicTheme(g->pThemes, &g->ClassicTheme))
        {
            g->ClassicTheme.Theme = g->pThemes;
            g->ClassicTheme.Color = g->pThemes->ColoursList;
            g->ClassicTheme.Size = g->ClassicTheme.Color->ChildStyle;
        }

        if (g->ActiveTheme.ThemeActive == FALSE)
            g->ActiveTheme = g->ClassicTheme;

        GetClientRect(GetDlgItem(hwndDlg, IDC_APPEARANCE_PREVIEW), &rcPreview);

        hdcScreen = GetDC(NULL);
        g->hbmpThemePreview = CreateCompatibleBitmap(hdcScreen, rcPreview.right, rcPreview.bottom);
        g->hdcThemePreview = CreateCompatibleDC(hdcScreen);
        SelectObject(g->hdcThemePreview, g->hbmpThemePreview);
        ReleaseDC(NULL, hdcScreen);

        hwndTheme = GetDlgItem(hwndDlg, IDC_APPEARANCE_VISUAL_STYLE);

        for (pTheme = g->pThemes; pTheme; pTheme = pTheme->NextTheme)
        {
            iListIndex = SendMessage(hwndTheme, CB_ADDSTRING, 0, (LPARAM)pTheme->DisplayName);
            SendMessage(hwndTheme, CB_SETITEMDATA, iListIndex, (LPARAM)pTheme);
            if (pTheme == g->ActiveTheme.Theme)
            {
                SendMessage(hwndTheme, CB_SETCURSEL, (WPARAM)iListIndex, 0);
            }
        }

        if (g->ActiveTheme.Theme)
        {
            AppearancePage_ShowColorSchemes(hwndDlg, g);
            AppearancePage_ShowSizes(hwndDlg, g);
            AppearancePage_UpdateThemePreview(hwndDlg, g);
        }
    }
    g->bInitializing = FALSE;

    return FALSE;
}