update dev300-m57
[ooovba.git] / sc / source / ui / dbgui / langchooser.cxx
blobd5fd72b6ce0e3ebdf563508b4a1087a2c900b90b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: langbox.hxx,v $
10 * $Revision: 1.4.242.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
34 #undef SC_DLLIMPLEMENTATION
36 //------------------------------------------------------------------------
38 #include "langchooser.hxx"
39 #include "langchooser.hrc"
41 #include "scresid.hxx"
42 #include "vcl/window.hxx"
43 #include "vcl/msgbox.hxx"
44 #include "vcl/svapp.hxx"
46 ScLangChooserDlg::ScLangChooserDlg(Window* pParent) :
47 ModalDialog(pParent, ScResId(RID_SCDLG_LANG_CHOOSER)),
49 maBtnOk(this, ScResId(BTN_OK)),
50 maBtnCancel(this, ScResId(BTN_CANCEL)),
51 maBtnHelp(this, ScResId(BTN_HELP)),
52 maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)),
53 maRbAutomatic(this, ScResId(RB_AUTOMATIC)),
54 maRbCustom(this, ScResId(RB_CUSTOM)),
55 maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)),
56 maFlOption(this, ScResId(FL_OPTION)),
57 maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE))
59 init();
62 ScLangChooserDlg::~ScLangChooserDlg()
66 short ScLangChooserDlg::Execute()
68 return ModalDialog::Execute();
71 LanguageType ScLangChooserDlg::getLanguageType() const
73 if (maRbAutomatic.IsChecked())
74 return LANGUAGE_SYSTEM;
76 return maLbCustomLang.GetSelectLanguage();
79 bool ScLangChooserDlg::isDateConversionSet() const
81 return maBtnConvertDate.IsChecked();
84 void ScLangChooserDlg::init()
86 Link aLink = LINK( this, ScLangChooserDlg, OKHdl );
87 maBtnOk.SetClickHdl(aLink);
88 aLink = LINK( this, ScLangChooserDlg, RadioHdl );
89 maRbAutomatic.SetClickHdl(aLink);
90 maRbCustom.SetClickHdl(aLink);
92 maRbAutomatic.Check(true);
94 maLbCustomLang.SetLanguageList(
95 LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false, false);
97 LanguageType eLang = Application::GetSettings().GetLanguage();
98 maLbCustomLang.SelectLanguage(eLang);
99 maLbCustomLang.Disable();
102 IMPL_LINK( ScLangChooserDlg, OKHdl, OKButton*, EMPTYARG )
104 EndDialog(RET_OK);
105 return 0;
108 IMPL_LINK( ScLangChooserDlg, RadioHdl, RadioButton*, pBtn )
110 if (pBtn == &maRbAutomatic)
112 maLbCustomLang.Disable();
114 else if (pBtn == &maRbCustom)
116 maLbCustomLang.Enable();
118 return 0;