view src/win32/LangSelect.cpp @ 2:3549bbe597ed

adding makefile.am
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:47 -0600
parents f9f4f1b99eed
children
line wrap: on
line source
1 // LangSelect.cpp : implementation file
2 //
4 #include "stdafx.h"
5 #include "resource.h"
6 #include "LangSelect.h"
7 #include "VBA.h"
9 /////////////////////////////////////////////////////////////////////////////
10 // LangSelect dialog
12 LangSelect::LangSelect(CWnd*pParent /*=NULL*/)
13 : CDialog(LangSelect::IDD, pParent)
14 {
15 //{{AFX_DATA_INIT(LangSelect)
16 // NOTE: the ClassWizard will add member initialization here
17 //}}AFX_DATA_INIT
18 }
20 void LangSelect::DoDataExchange(CDataExchange*pDX)
21 {
22 CDialog::DoDataExchange(pDX);
23 //{{AFX_DATA_MAP(LangSelect)
24 DDX_Control(pDX, IDC_LANG_STRING, m_langString);
25 DDX_Control(pDX, IDC_LANG_NAME, m_langName);
26 //}}AFX_DATA_MAP
27 }
29 BEGIN_MESSAGE_MAP(LangSelect, CDialog)
30 //{{AFX_MSG_MAP(LangSelect)
31 ON_BN_CLICKED(ID_CANCEL, OnCancel)
32 ON_BN_CLICKED(ID_OK, OnOk)
33 //}}AFX_MSG_MAP
34 END_MESSAGE_MAP()
36 /////////////////////////////////////////////////////////////////////////////
37 // LangSelect message handlers
39 void LangSelect::OnCancel()
40 {
41 EndDialog(FALSE);
42 }
44 void LangSelect::OnOk()
45 {
46 m_langString.GetWindowText(theApp.languageName);
47 EndDialog(TRUE);
48 }
50 BOOL LangSelect::OnInitDialog()
51 {
52 CDialog::OnInitDialog();
54 char lbuffer[10];
55 if (GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME,
56 lbuffer, 10))
57 {
58 m_langName.SetWindowText(lbuffer);
59 }
60 else
61 {
62 m_langName.SetWindowText("???");
63 }
65 if (!theApp.languageName.IsEmpty())
66 m_langString.SetWindowText(theApp.languageName);
68 m_langString.LimitText(3);
70 CenterWindow();
72 return TRUE; // return TRUE unless you set the focus to a control
73 // EXCEPTION: OCX Property Pages should return FALSE
74 }