Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / client / client_config / general_dlg.cpp
blob6043bd3e1cb0b671b37f0d5d71f345d790b0c68a
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // general_dlg.cpp : implementation file
20 #include "stdafx.h"
21 #include "client_config.h"
22 #include "general_dlg.h"
23 #include "cfg_file.h"
24 #include "client_configdlg.h"
26 // ***************************************************************************
27 // CGeneralDlg dialog
28 // ***************************************************************************
30 CGeneralDlg::CGeneralDlg(CWnd* pParent /*=NULL*/)
31 : CBaseDialog(CGeneralDlg::IDD, pParent)
33 //{{AFX_DATA_INIT(CGeneralDlg)
34 Sleep = FALSE;
35 SaveConfig = FALSE;
36 Language = -1;
37 //}}AFX_DATA_INIT
40 // ***************************************************************************
42 void CGeneralDlg::DoDataExchange(CDataExchange* pDX)
44 CDialog::DoDataExchange(pDX);
45 //{{AFX_DATA_MAP(CGeneralDlg)
46 DDX_Check(pDX, IDC_SLEEP, Sleep);
47 DDX_Check(pDX, IDC_SAVE_CONFIG, SaveConfig);
48 DDX_CBIndex(pDX, IDC_LANGUAGE, Language);
49 //}}AFX_DATA_MAP
52 // ***************************************************************************
54 BEGIN_MESSAGE_MAP(CGeneralDlg, CDialog)
55 //{{AFX_MSG_MAP(CGeneralDlg)
56 ON_BN_CLICKED(IDC_SLEEP, OnSleep)
57 ON_BN_CLICKED(IDC_SAVE_CONFIG, OnSaveConfig)
58 ON_CBN_SELENDOK(IDC_LANGUAGE, OnSelendokLanguage)
59 //}}AFX_MSG_MAP
60 END_MESSAGE_MAP()
62 // ***************************************************************************
63 // CGeneralDlg message handlers
64 // ***************************************************************************
66 void CGeneralDlg::OnSleep()
68 UpdateData (TRUE);
69 updateState ();
70 UpdateData (FALSE);
71 InvalidateConfig ();
74 // ***************************************************************************
76 void CGeneralDlg::updateState ()
80 // ***************************************************************************
82 void CGeneralDlg::OnSaveConfig()
84 InvalidateConfig ();
87 // ***************************************************************************
89 BOOL CGeneralDlg::OnInitDialog()
91 CDialog::OnInitDialog();
93 updateState ();
95 return TRUE; // return TRUE unless you set the focus to a control
96 // EXCEPTION: OCX Property Pages should return FALSE
99 // ***************************************************************************
101 void CGeneralDlg::OnSelendokLanguage()
103 InvalidateConfig ();
105 // Localize the windows
106 CClient_configDlg *dlg = (CClient_configDlg*)theApp.m_pMainWnd;
107 dlg->UpdateData (TRUE);
108 dlg->changeLanguage (::GetIntForceLanguage()?"en" : (dlg->GeneralDlg.Language==2)?"de":(dlg->GeneralDlg.Language==1)?"fr":"en");
111 // ***************************************************************************