bump product version to 5.0.4.1
[LibreOffice.git] / sfx2 / source / dialog / inputdlg.cxx
blobfaa591d89f6a0a85e22d086e4c22af04abaf10a6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "inputdlg.hxx"
12 #include <sfx2/sfxresid.hxx>
13 #include <vcl/button.hxx>
14 #include <vcl/edit.hxx>
15 #include <vcl/fixed.hxx>
17 InputDialog::InputDialog(const OUString &rLabelText, vcl::Window *pParent)
18 : ModalDialog(pParent, "InputDialog", "sfx/ui/inputdialog.ui")
20 get(m_pEntry, "entry");
21 get(m_pLabel, "label");
22 get(m_pOK, "ok");
23 get(m_pCancel, "cancel");
24 m_pLabel->SetText(rLabelText);
25 m_pOK->SetClickHdl(LINK(this,InputDialog,ClickHdl));
26 m_pCancel->SetClickHdl(LINK(this,InputDialog,ClickHdl));
29 InputDialog::~InputDialog()
31 disposeOnce();
34 void InputDialog::dispose()
36 m_pEntry.clear();
37 m_pLabel.clear();
38 m_pOK.clear();
39 m_pCancel.clear();
40 ModalDialog::dispose();
43 OUString InputDialog::getEntryText() const
45 return m_pEntry->GetText();
48 IMPL_LINK(InputDialog,ClickHdl,PushButton*, pButton)
50 EndDialog(pButton == m_pOK ? RET_OK : RET_CANCEL);
51 return 0;
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */