diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-04 12:35:45 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-04 12:35:45 -0430 |
commit | cca67621756705365365eb904dff4171bfb5020d (patch) | |
tree | 562bdb01115b5b80b37f639e997c6834566a534a /sfx2 | |
parent | 7887eeba65abbc19f912a4c5fc67e9699e3f438b (diff) |
Connect button click handlers and end dialog with the desired result.
Change-Id: Ib87bd61c1cc7da906304c8ca43cd38d9a7bb1fcf
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/inputdlg.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/inc/inputdlg.hxx | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sfx2/source/dialog/inputdlg.cxx b/sfx2/source/dialog/inputdlg.cxx index 74405c884b15..c1bd5055a0a5 100644 --- a/sfx2/source/dialog/inputdlg.cxx +++ b/sfx2/source/dialog/inputdlg.cxx @@ -55,6 +55,9 @@ InputDialog::InputDialog (const rtl::OUString &rLabelText, Window *pParent) aBtnPos.setX(aBtnPos.getX() - aBtnSize.getWidth() - LABEL_TEXT_SPACE); mpOK->SetPosPixel(aBtnPos); + + mpOK->SetClickHdl(LINK(this,InputDialog,ClickHdl)); + mpCancel->SetClickHdl(LINK(this,InputDialog,ClickHdl)); } InputDialog::~InputDialog() @@ -70,6 +73,12 @@ rtl::OUString InputDialog::getEntryText () const return mpEntry->GetText(); } +IMPL_LINK(InputDialog,ClickHdl,PushButton*, pButton) +{ + EndDialog(pButton == mpOK ? true : false); + return 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/inputdlg.hxx b/sfx2/source/inc/inputdlg.hxx index 0df999db8678..1dce2fb2baa9 100644 --- a/sfx2/source/inc/inputdlg.hxx +++ b/sfx2/source/inc/inputdlg.hxx @@ -28,6 +28,10 @@ public: private: + DECL_LINK(ClickHdl, PushButton*); + +private: + Edit *mpEntry; FixedText *mpLabel; PushButton *mpOK; |