From 621d1fba84e13a28843fb7a7befb28e26a6d0a15 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 19 Jan 2013 16:22:18 +0000 Subject: convert split cells dialog to our 99th .ui file Change-Id: If1a37074400540e3adce42de2bb7c88c2c599382 --- cui/AllLangResTarget_cui.mk | 1 - cui/UI_cui.mk | 1 + cui/source/dialogs/splitcelldlg.cxx | 57 ++++---- cui/source/dialogs/splitcelldlg.hrc | 29 ---- cui/source/dialogs/splitcelldlg.src | 118 ---------------- cui/source/inc/splitcelldlg.hxx | 14 +- cui/uiconfig/ui/splitcellsdialog.ui | 275 ++++++++++++++++++++++++++++++++++++ 7 files changed, 305 insertions(+), 190 deletions(-) delete mode 100644 cui/source/dialogs/splitcelldlg.hrc delete mode 100644 cui/source/dialogs/splitcelldlg.src create mode 100644 cui/uiconfig/ui/splitcellsdialog.ui (limited to 'cui') diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index f8a133ed0f58..967d702ad5b7 100644 --- a/cui/AllLangResTarget_cui.mk +++ b/cui/AllLangResTarget_cui.mk @@ -73,7 +73,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/dialogs/scriptdlg.src \ cui/source/dialogs/sdrcelldlg.src \ cui/source/dialogs/showcols.src \ - cui/source/dialogs/splitcelldlg.src \ cui/source/dialogs/srchxtra.src \ cui/source/dialogs/svuidlg.src \ cui/source/dialogs/tbxform.src \ diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk index d041c02fbb89..e67ffac8047a 100644 --- a/cui/UI_cui.mk +++ b/cui/UI_cui.mk @@ -33,6 +33,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ cui/uiconfig/ui/select_persona_dialog \ cui/uiconfig/ui/specialcharacters \ cui/uiconfig/ui/spellingdialog \ + cui/uiconfig/ui/splitcellsdialog \ cui/uiconfig/ui/thesaurus \ cui/uiconfig/ui/twolinespage \ cui/uiconfig/ui/zoomdialog \ diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx index d1566a529514..f8d37b92bf42 100644 --- a/cui/source/dialogs/splitcelldlg.cxx +++ b/cui/source/dialogs/splitcelldlg.cxx @@ -23,40 +23,33 @@ #include "dialmgr.hxx" #include "splitcelldlg.hxx" #include "cuires.hrc" -#include "splitcelldlg.hrc" -SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal ) -: SvxStandardDialog(pParent, CUI_RES(RID_SVX_SPLITCELLDLG)) -, maCountFL(this, CUI_RES(FL_COUNT)) -, maCountLbl(this, CUI_RES(FT_COUNT)) -, maCountEdit(this, CUI_RES(ED_COUNT)) -, maDirFL(this, CUI_RES(FL_DIR)) -, maHorzBox(this, CUI_RES(RB_HORZ)) -, maVertBox(this, CUI_RES(RB_VERT)) -, maPropCB(this, CUI_RES(CB_PROP)) -, maOKBtn(this, CUI_RES(BT_OK)) -, maCancelBtn(this, CUI_RES(BT_CANCEL)) -, maHelpBtn( this, CUI_RES( BT_HELP ) ) -, mnMaxVertical( nMaxVertical ) -, mnMaxHorizontal( nMaxHorizontal ) +SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, + long nMaxVertical, long nMaxHorizontal ) + : SvxStandardDialog(pParent, "SplitCellsDialog", "cui/ui/splitcellsdialog.ui") + , mnMaxVertical(nMaxVertical) + , mnMaxHorizontal(nMaxHorizontal) { - FreeResource(); - maHorzBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); - maPropCB.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); - maVertBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); + get(m_pCountEdit, "countnf"); + get(m_pHorzBox, "hori"); + get(m_pVertBox, "vert"); + get(m_pPropCB, "prop"); + m_pHorzBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); + m_pPropCB->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); + m_pVertBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl )); if( mnMaxVertical < 2 ) - maVertBox.Enable(sal_False); + m_pVertBox->Enable(sal_False); //exchange the meaning of horizontal and vertical for vertical text if(bIsTableVertical) { - Image aTmpImg(maHorzBox.GetModeRadioImage()); - String sTmp(maHorzBox.GetText()); - maHorzBox.SetText(maVertBox.GetText()); - maHorzBox.SetModeRadioImage(maVertBox.GetModeRadioImage()); - maVertBox.SetText(sTmp); - maVertBox.SetModeRadioImage(aTmpImg); + Image aTmpImg(m_pHorzBox->GetModeRadioImage()); + String sTmp(m_pHorzBox->GetText()); + m_pHorzBox->SetText(m_pVertBox->GetText()); + m_pHorzBox->SetModeRadioImage(m_pVertBox->GetModeRadioImage()); + m_pVertBox->SetText(sTmp); + m_pVertBox->SetModeRadioImage(aTmpImg); } } @@ -66,26 +59,26 @@ SvxSplitTableDlg::~SvxSplitTableDlg() IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton ) { - const bool bIsVert = pButton == &maVertBox ; + const bool bIsVert = pButton == m_pVertBox ; long nMax = bIsVert ? mnMaxVertical : mnMaxHorizontal; - maPropCB.Enable(!bIsVert); - maCountEdit.SetMax( nMax ); + m_pPropCB->Enable(!bIsVert); + m_pCountEdit->SetMax( nMax ); return 0; } bool SvxSplitTableDlg::IsHorizontal() const { - return maHorzBox.IsChecked(); + return m_pHorzBox->IsChecked(); } bool SvxSplitTableDlg::IsProportional() const { - return maPropCB.IsChecked() && maHorzBox.IsChecked(); + return m_pPropCB->IsChecked() && m_pHorzBox->IsChecked(); } long SvxSplitTableDlg::GetCount() const { - return sal::static_int_cast( maCountEdit.GetValue() ); + return sal::static_int_cast( m_pCountEdit->GetValue() ); } short SvxSplitTableDlg::Execute() diff --git a/cui/source/dialogs/splitcelldlg.hrc b/cui/source/dialogs/splitcelldlg.hrc deleted file mode 100644 index 5ce498454356..000000000000 --- a/cui/source/dialogs/splitcelldlg.hrc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#define FT_COUNT 1 -#define ED_COUNT 2 -#define FL_COUNT 3 - -#define RB_HORZ 10 -#define CB_PROP 11 -#define RB_VERT 12 -#define FL_DIR 12 - -#define BT_OK 100 -#define BT_CANCEL 101 -#define BT_HELP 102 diff --git a/cui/source/dialogs/splitcelldlg.src b/cui/source/dialogs/splitcelldlg.src deleted file mode 100644 index 86fd9b011752..000000000000 --- a/cui/source/dialogs/splitcelldlg.src +++ /dev/null @@ -1,118 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include "splitcelldlg.hrc" - -ModalDialog RID_SVX_SPLITCELLDLG -{ - HelpID = "cui:ModalDialog:RID_SVX_SPLITCELLDLG"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 169 , 108 ) ; - Text [ en-US ] = "Split Cells" ; - Moveable = TRUE ; - - OKButton BT_OK - { - Pos = MAP_APPFONT ( 115 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 115 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 115 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedText FT_COUNT - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 67 , 8 ) ; - Text [ en-US ] = "~Split cell into" ; - Left = TRUE ; - }; - NumericField ED_COUNT - { - HelpID = "cui:NumericField:RID_SVX_SPLITCELLDLG:ED_COUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 82 , 14 ) ; - Size = MAP_APPFONT ( 21 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 20 ; - First = 2 ; - Last = 5 ; - }; - FixedLine FL_COUNT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 103 , 8 ) ; - Text [ en-US ] = "Split" ; - }; - ImageRadioButton RB_HORZ - { - HelpID = "cui:ImageRadioButton:RID_SVX_SPLITCELLDLG:RB_HORZ"; - Pos = MAP_APPFONT ( 12 , 47 ) ; - Size = MAP_APPFONT ( 90 , 18 ) ; - Group = TRUE; - Text [ en-US ] = "H~orizontally" ; - RadioButtonImage = Image - { - ImageBitmap = Bitmap { File = "zetlhor2.bmp" ; }; - }; - TabStop = TRUE ; - Check = TRUE ; - }; - CheckBox CB_PROP - { - HelpID = "cui:CheckBox:RID_SVX_SPLITCELLDLG:CB_PROP"; - Pos = MAP_APPFONT ( 18 , 68 ) ; - Size = MAP_APPFONT ( 91 , 12 ) ; - Text [ en-US ] = "~Into equal proportions"; - }; - ImageRadioButton RB_VERT - { - HelpID = "cui:ImageRadioButton:RID_SVX_SPLITCELLDLG:RB_VERT"; - Pos = MAP_APPFONT ( 12 , 84 ) ; - Size = MAP_APPFONT ( 90 , 18 ) ; - Text [ en-US ] = "~Vertically" ; - RadioButtonImage = Image - { - ImageBitmap = Bitmap { File = "zetlver2.bmp" ; }; - }; - TabStop = TRUE ; - }; - FixedLine FL_DIR - { - Pos = MAP_APPFONT ( 6 , 36 ) ; - Size = MAP_APPFONT ( 103 , 8 ) ; - Text [ en-US ] = "Direction" ; - }; -}; diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx index d1c1ba97f13e..0cf0351aa236 100644 --- a/cui/source/inc/splitcelldlg.hxx +++ b/cui/source/inc/splitcelldlg.hxx @@ -28,16 +28,10 @@ class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public SvxStandardDialog { - FixedLine maCountFL; - FixedText maCountLbl; - NumericField maCountEdit; - FixedLine maDirFL; - ImageRadioButton maHorzBox; - ImageRadioButton maVertBox; - CheckBox maPropCB; - OKButton maOKBtn; - CancelButton maCancelBtn; - HelpButton maHelpBtn; + NumericField* m_pCountEdit; + RadioButton* m_pHorzBox; + RadioButton* m_pVertBox; + CheckBox* m_pPropCB; long mnMaxVertical; long mnMaxHorizontal; diff --git a/cui/uiconfig/ui/splitcellsdialog.ui b/cui/uiconfig/ui/splitcellsdialog.ui new file mode 100644 index 000000000000..cf08eaedc5e5 --- /dev/null +++ b/cui/uiconfig/ui/splitcellsdialog.ui @@ -0,0 +1,275 @@ + + + + + 2 + 20 + 2 + 1 + 5 + + + True + False + svx/res/zetlhor2.png + + + True + False + svx/res/zetlver2.png + + + False + 5 + Split Cells + dialog + + + False + 2 + + + False + vertical + start + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + vertical + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 12 + + + True + False + _Split cell into + True + + + 0 + 0 + 1 + 1 + + + + + True + True + + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + + + + + True + False + Split + + + + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 12 + + + H_orizontally + True + True + False + image1 + True + 0 + True + True + vert + + + 0 + 0 + 1 + 1 + + + + + _Vertically + True + True + False + image2 + True + 0 + True + hori + + + 0 + 2 + 1 + 1 + + + + + True + False + 12 + + + _Into equal proportions + True + True + False + True + 0 + True + + + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Direction + + + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + + button1 + button2 + button3 + + + -- cgit v1.2.3