summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-06-29 13:02:48 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-06-29 13:07:47 -0430
commitea508ce93296a56a537c219879d3b5aa11f969fa (patch)
tree9eb9c01defb631c60d0b94073a36335cb1871e66 /sfx2/source
parentfd4ba654170c7142fb05f2183ec43384f55dfbda (diff)
Add a close button to the dialog.
Change-Id: I2bf1006107b29ce2b105830b3daf41870c5629ba
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/templatedlg.cxx18
-rw-r--r--sfx2/source/doc/templatedlg.hrc2
-rw-r--r--sfx2/source/doc/templatedlg.src7
3 files changed, 27 insertions, 0 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 4a3eb3717d4a..fb48b905d56b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -68,6 +68,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
aButtonPresents(this,SfxResId(BTN_SELECT_PRESENTATIONS)),
aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)),
aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)),
+ maButtonClose(this,SfxResId(BTN_TEMPLATE_CLOSE)),
maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)),
mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
mpViewBar( new ToolBox(this, SfxResId(TBX_ACTION_VIEW))),
@@ -166,11 +167,22 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView->setTemplateStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl));
maView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
+ // Set OK button position
+ Point aBtnPos;
+ Size aBtnSize = maButtonClose.GetSizePixel();
+ aBtnPos.setX(aWinSize.getWidth() - PADDING_DLG_BORDER - aBtnSize.getWidth());
+ aBtnPos.setY(aViewPos.getY()+aThumbSize.getHeight() + PADDING_TOOLBAR_VIEW);
+ maButtonClose.SetPosPixel(aBtnPos);
+
+ if (aWinSize.getHeight() != aBtnPos.getY() + aBtnSize.getHeight() + PADDING_DLG_BORDER )
+ aWinSize.setHeight(aBtnPos.getY() + aBtnSize.getHeight() + PADDING_DLG_BORDER);
+
aButtonAll.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewAllHdl));
aButtonDocs.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDocsHdl));
aButtonPresents.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewPresentsHdl));
aButtonSheets.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewSheetsHdl));
aButtonDraws.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDrawsHdl));
+ maButtonClose.SetClickHdl(LINK(this,SfxTemplateManagerDlg,CloseHdl));
maButtonSelMode.SetClickHdl(LINK(this,SfxTemplateManagerDlg,OnClickSelectionMode));
// Set dialog to correct dimensions
@@ -233,6 +245,12 @@ void SfxTemplateManagerDlg::MouseButtonDown( const MouseEvent& rMEvt )
maView->showOverlay(false);
}
+IMPL_LINK_NOARG (SfxTemplateManagerDlg, CloseHdl)
+{
+ Close();
+ return 0;
+}
+
IMPL_LINK (SfxTemplateManagerDlg, OnClickSelectionMode, ImageButton*, pButton)
{
maView->setSelectionMode(pButton->GetState() == STATE_CHECK);
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index 5fbbfab04b0c..a978f3150fc9 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -36,6 +36,8 @@
#define MNI_ACTION_SORT_NAME 23
+#define BTN_TEMPLATE_CLOSE 24
+
#define STR_CREATE_TEXT 260
#define STR_CREATE_SHEET 261
#define STR_CREATE_PRESENT 262
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 48bee92f4436..38763964b02c 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -106,6 +106,13 @@ ModalDialog DLG_TEMPLATE_MANAGER
QuickHelpText [en-US] = "Enables selecting items by just clicking in the thumbnail or title.";
};
+ PushButton BTN_TEMPLATE_CLOSE
+ {
+ Size = MAP_APPFONT(50,14);
+ TabStop = TRUE;
+ Text [en-US] = "Close";
+ };
+
Control TEMPLATE_VIEW
{
Pos = MAP_APPFONT(5,30);