Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.0 KiB

  1. // LcidPick.cpp : implementation file
  2. //
  3. #include "precomp.hxx"
  4. #ifdef _DEBUG
  5. #define new DEBUG_NEW
  6. #undef THIS_FILE
  7. static char THIS_FILE[] = __FILE__;
  8. #endif
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CLcidPick dialog
  11. CLcidPick::CLcidPick(CWnd* pParent /*=NULL*/)
  12. : CDialog(CLcidPick::IDD, pParent)
  13. {
  14. //{{AFX_DATA_INIT(CLcidPick)
  15. // NOTE: the ClassWizard will add member initialization here
  16. //}}AFX_DATA_INIT
  17. }
  18. void CLcidPick::DoDataExchange(CDataExchange* pDX)
  19. {
  20. CDialog::DoDataExchange(pDX);
  21. //{{AFX_DATA_MAP(CLcidPick)
  22. // NOTE: the ClassWizard will add DDX and DDV calls here
  23. //}}AFX_DATA_MAP
  24. }
  25. BEGIN_MESSAGE_MAP(CLcidPick, CDialog)
  26. //{{AFX_MSG_MAP(CLcidPick)
  27. ON_BN_CLICKED(IDC_BUTTON1, OnRemove)
  28. //}}AFX_MSG_MAP
  29. END_MESSAGE_MAP()
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CLcidPick message handlers
  32. void CLcidPick::OnRemove()
  33. {
  34. CListBox * pList = (CListBox *)GetDlgItem(IDC_LIST1);
  35. int iSel = pList->GetCurSel();
  36. if (iSel != LB_ERR)
  37. {
  38. pList->DeleteString(iSel);
  39. std::set<LCID>::iterator i = m_psLocales->begin();
  40. while (iSel--)
  41. {
  42. i++;
  43. }
  44. m_psLocales->erase(*i);
  45. }
  46. }
  47. BOOL CLcidPick::OnInitDialog()
  48. {
  49. CListBox * pList = (CListBox *)GetDlgItem(IDC_LIST1);
  50. TCHAR szBuffer[256];
  51. // for every item in m_psLocales
  52. std::set<LCID>::iterator i;
  53. for (i = m_psLocales->begin(); i != m_psLocales->end(); i++)
  54. {
  55. // UNDONE - convert to a human readable string (not a number)
  56. CString sz;
  57. GetLocaleInfo(*i, LOCALE_SLANGUAGE, szBuffer, 256);
  58. sz += szBuffer;
  59. sz += _T(" - ");
  60. GetLocaleInfo(*i, LOCALE_SCOUNTRY, szBuffer, 256);
  61. sz += szBuffer;
  62. pList->AddString(sz);
  63. }
  64. CDialog::OnInitDialog();
  65. return TRUE; // return TRUE unless you set the focus to a control
  66. // EXCEPTION: OCX Property Pages should return FALSE
  67. }