diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-29 22:17:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:41 +0100 |
commit | d499ecfe451d3fcb4dc47b2c4f104ca6faa81e62 (patch) | |
tree | 5d91d60843c8572516dd35dd1090df90f05f375e /sw | |
parent | dfbaba92e53a91d08bcde392d616f1fc48e220e2 (diff) |
Drop hard-coded layout for wordcount and use Gokul's .ui
Take the opportunity to merge SwWordCountDialog and SwWordCountFloatDlg
together.
Now the cycle is complete, .src -> manual layout -> .ui
Change-Id: I4fb7840b8786ede82ffa1591effc9e4ff444504c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/inc/dialog.hrc | 2 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.cxx | 126 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.hrc | 41 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.src | 156 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountwrapper.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/wordcountdialog.hxx | 65 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/wordcount.ui | 107 |
12 files changed, 101 insertions, 433 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 566ce4b7edd8..5e6ae48aea31 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -115,7 +115,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/dialog/dialog.src \ sw/source/ui/dialog/docstdlg.src \ sw/source/ui/dialog/regionsw.src \ - sw/source/ui/dialog/wordcountdialog.src \ sw/source/ui/dochdl/dochdl.src \ sw/source/ui/dochdl/selglos.src \ sw/source/ui/docvw/annotation.src \ diff --git a/sw/inc/dialog.hrc b/sw/inc/dialog.hrc index e7757a864d42..687c7a1cbcf2 100644 --- a/sw/inc/dialog.hrc +++ b/sw/inc/dialog.hrc @@ -27,7 +27,7 @@ #define DLG_PASSWD (RC_DIALOG_BEGIN + 3) #define DLG_INSERT_ABSTRACT (RC_DIALOG_BEGIN + 8) #define DLG_ASCII_FILTER (RC_DIALOG_BEGIN + 9) -#define DLG_WORDCOUNT (RC_DIALOG_BEGIN + 10) + #define RID_QB_SPELL_CONTINUE (RC_DIALOG_BEGIN + 11) #define STR_SPELLING_COMPLETED (RC_DIALOG_BEGIN + 12) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index caf526978b86..48d13bf29555 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -519,7 +519,6 @@ #define HID_MM_SENDMAILS_STATUSLB "SW_HID_MM_SENDMAILS_STATUSLB" #define HID_MAILMERGECHILD "SW_HID_MAILMERGECHILD" #define HID_MM_CUSTOMFIELDS "SW_HID_MM_CUSTOMFIELDS" -#define HID_DLG_WORDCOUNT "SW_HID_DLG_WORDCOUNT" #define HID_MM_MAILSTATUS_TLB "SW_HID_MM_MAILSTATUS_TLB" #define HID_RETURN_TO_MAILMERGE "SW_HID_RETURN_TO_MAILMERGE" #define HID_MM_SAVEWARNING "SW_HID_MM_SAVEWARNING" diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 016202c96f52..e8b10df1c8b9 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -354,11 +354,8 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame, sal_uInt32 nResId ) = 0; - virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo) = 0; + virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings, + SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo) = 0; virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg ( Window* pParent, int nResId) = 0; // add for SwInsertAbstractDlg virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 868b487701b3..f684751a51df 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1539,24 +1539,14 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( int return 0; } -AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( int nResId, +AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, - SfxChildWinInfo* pInfo ) + SfxChildWinInfo* pInfo) { - SwWordCountFloatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_WORDCOUNT : - pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractSwWordCountFloatDlg_Impl( pDlg ); - return 0; + SwWordCountFloatDlg* pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo ); + return new AbstractSwWordCountFloatDlg_Impl( pDlg ); } //add for SwIndexMarkModalDlg begin diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 159f6e3633b0..c28fe03446dd 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -439,11 +439,8 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame, sal_uInt32 nResId ); - virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo); + virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings, + SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo); virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg( Window* pParent,int nResId ); virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index e89bc1eb4d33..b943ab15dfbe 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -30,7 +30,6 @@ #include <wordcountdialog.hxx> #include <docstat.hxx> #include <dialog.hrc> -#include <wordcountdialog.hrc> #include <cmdid.h> #include "vcl/msgbox.hxx" // RET_CANCEL #include <swmodule.hxx> @@ -39,89 +38,7 @@ #include <swwait.hxx> #include <wrtsh.hxx> -//TODO, add asian/non-asian word count to UI when CJK mode is enabled. -SwWordCountDialog::SwWordCountDialog(Dialog* pParent) - : vbox(pParent) - , content_area(&vbox) - , aCurrentSelection(&content_area, false, 3) - , aCurrentSelectionText(&aCurrentSelection, SW_RES(FT_CURRENT)) - , aCurrentSelectionLine(&aCurrentSelection, SW_RES(FL_CURRENT)) - , aSelectionBox(&content_area, false, 7) - , aSelectionRow1(&aSelectionBox) - , aCurrentWordFT(&aSelectionRow1, SW_RES(FT_CURRENTWORD)) - , aCurrentWordFI(&aSelectionRow1, SW_RES(FI_CURRENTWORD)) - , aSelectionRow2(&aSelectionBox) - , aCurrentCharacterFT(&aSelectionRow2, SW_RES(FT_CURRENTCHARACTER)) - , aCurrentCharacterFI(&aSelectionRow2, SW_RES(FI_CURRENTCHARACTER)) - , aSelectionRow3(&aSelectionBox) - , aCurrentCharacterExcludingSpacesFT(&aSelectionRow3, SW_RES(FT_CURRENTCHARACTEREXCLUDINGSPACES)) - , aCurrentCharacterExcludingSpacesFI(&aSelectionRow3, SW_RES(FI_CURRENTCHARACTEREXCLUDINGSPACES)) - , aDoc(&content_area, false, 3) - , aDocText(&aDoc, SW_RES(FT_DOC)) - , aDocLine(&aDoc, SW_RES(FL_DOC)) - , aDocBox(&content_area, false, 7) - , aDocRow1(&aDocBox) - , aDocWordFT(&aDocRow1, SW_RES(FT_DOCWORD)) - , aDocWordFI(&aDocRow1, SW_RES(FI_DOCWORD)) - , aDocRow2(&aDocBox) - , aDocCharacterFT(&aDocRow2, SW_RES(FT_DOCCHARACTER)) - , aDocCharacterFI(&aDocRow2, SW_RES(FI_DOCCHARACTER)) - , aDocRow3(&aDocBox) - , aDocCharacterExcludingSpacesFT(&aDocRow3, SW_RES(FT_DOCCHARACTEREXCLUDINGSPACES)) - , aDocCharacterExcludingSpacesFI(&aDocRow3, SW_RES(FI_DOCCHARACTEREXCLUDINGSPACES)) - , aBottomFL(&vbox, SW_RES(FL_BOTTOM)) - , action_area(&vbox) - , aOK(&action_area, SW_RES(PB_OK)) - , aHelp(&action_area, SW_RES(PB_HELP)) -{ - rtl::OUString sForceInitialSize(RTL_CONSTASCII_USTRINGPARAM(" ")); - aCurrentWordFI.SetText(sForceInitialSize); - aCurrentCharacterFI.SetText(sForceInitialSize); - aCurrentCharacterExcludingSpacesFI.SetText(sForceInitialSize); - aDocWordFI.SetText(sForceInitialSize); - aDocCharacterFI.SetText(sForceInitialSize); - aDocCharacterExcludingSpacesFI.SetText(sForceInitialSize); - - content_area.set_expand(true); - - aCurrentSelectionLine.set_expand(true); - - aSelectionBox.set_border_width(7); - - aSelectionRow1.set_expand(true); - aCurrentWordFI.set_expand(true); - - aSelectionRow2.set_expand(true); - aCurrentCharacterFI.set_expand(true); - aSelectionRow3.set_expand(true); - aCurrentCharacterExcludingSpacesFI.set_expand(true); - - aDocLine.set_expand(true); - - aDocBox.set_border_width(7); - - aDocRow1.set_expand(true); - aDocWordFT.set_expand(true); - - aDocRow2.set_expand(true); - aDocCharacterFI.set_expand(true); - aDocRow3.set_expand(true); - aDocCharacterExcludingSpacesFI.set_expand(true); - - aOK.set_pack_type(VCL_PACK_END); - aHelp.set_pack_type(VCL_PACK_END); - - aOK.SetClickHdl(LINK(this, SwWordCountDialog, OkHdl)); - - pParent->SetMinOutputSizePixel(vbox.GetOptimalSize(WINDOWSIZE_PREFERRED)); - -#if OSL_DEBUG_LEVEL > 2 - aDocCharacterExcludingSpacesFT.SetControlBackground(Color(180,0,0)); - aDocCharacterExcludingSpacesFI.SetControlBackground(Color(0,180,0)); -#endif -} - -IMPL_LINK_NOARG(SwWordCountDialog, OkHdl) +IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl) { SfxViewFrame* pVFrame = ::GetActiveView()->GetViewFrame(); if (pVFrame != NULL) @@ -131,37 +48,40 @@ IMPL_LINK_NOARG(SwWordCountDialog, OkHdl) return 0; } -SwWordCountDialog::~SwWordCountDialog() +SwWordCountFloatDlg::~SwWordCountFloatDlg() { ViewShell::SetCareWin( 0 ); } -void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) +void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) { - aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord )); - aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar )); - aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces )); - aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord )); - aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar )); - aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces )); + m_pCurrentWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nWord))); + m_pCurrentCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nChar))); + m_pCurrentCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nCharExcludingSpaces))); + m_pDocWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nWord))); + m_pDocCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nChar))); + m_pDocCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nCharExcludingSpaces))); } - +//TODO, add asian/non-asian word count to UI when CJK mode is enabled. SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo) - : SfxModelessDialog(_pBindings, pChild, pParent, SW_RES(DLG_WORDCOUNT)), -#if defined _MSC_VER -#pragma warning (disable : 4355) -#endif - aDlg(this) -#if defined _MSC_VER -#pragma warning (default : 4355) -#endif + : SfxModelessDialog(_pBindings, pChild, pParent, "WordCountDialog", "modules/swriter/ui/wordcount.ui") { - FreeResource(); + m_pUIBuilder->get(m_pCurrentWordFT, "selectwords"); + m_pUIBuilder->get(m_pCurrentCharacterFT, "selectchars"); + m_pUIBuilder->get(m_pCurrentCharacterExcludingSpacesFT, "selectcharsnospaces"); + m_pUIBuilder->get(m_pDocWordFT, "docwords"); + m_pUIBuilder->get(m_pDocCharacterFT, "docchars"); + m_pUIBuilder->get(m_pDocCharacterExcludingSpacesFT, "doccharsnospaces"); + m_pUIBuilder->get(m_pClosePB, "close"); + Initialize(pInfo); + + m_pClosePB->SetClickHdl(LINK(this, SwWordCountFloatDlg, CloseHdl)); + m_pClosePB->GrabFocus(); } void SwWordCountFloatDlg::Activate() @@ -181,7 +101,7 @@ void SwWordCountFloatDlg::UpdateCounts() aDocStat = rSh.GetUpdatedDocStat(); rSh.EndAction(); } - aDlg.SetValues(aCurrCnt, aDocStat); + SetValues(aCurrCnt, aDocStat); } void SwWordCountFloatDlg::SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat) diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc deleted file mode 100644 index 7fcceb30093d..000000000000 --- a/sw/source/ui/dialog/wordcountdialog.hrc +++ /dev/null @@ -1,41 +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 . - */ -#ifndef SW_WORDCOUNTDIALOG_HRC -#define SW_WORDCOUNTDIALOG_HRC -#define FL_CURRENT 1 -#define FT_CURRENTWORD 2 -#define FI_CURRENTWORD 3 -#define FT_CURRENTCHARACTER 4 -#define FI_CURRENTCHARACTER 5 -#define FT_CURRENTCHARACTEREXCLUDINGSPACES 6 -#define FI_CURRENTCHARACTEREXCLUDINGSPACES 7 -#define FL_DOC 8 -#define FT_DOCWORD 9 -#define FI_DOCWORD 10 -#define FT_DOCCHARACTER 11 -#define FI_DOCCHARACTER 12 -#define FT_DOCCHARACTEREXCLUDINGSPACES 13 -#define FI_DOCCHARACTEREXCLUDINGSPACES 14 -#define FL_BOTTOM 15 -#define PB_OK 16 -#define PB_HELP 17 -#define WINDOW_DLG 18 -#define FT_CURRENT 19 -#define FT_DOC 20 - -#endif diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src deleted file mode 100644 index 267563300e9e..000000000000 --- a/sw/source/ui/dialog/wordcountdialog.src +++ /dev/null @@ -1,156 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <helpid.h> -#include <dialog.hrc> -#include <wordcountdialog.hrc> -ModelessDialog DLG_WORDCOUNT -{ - HelpID = HID_DLG_WORDCOUNT ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 170 , 136 ) ; - Text [ en-US ] = "Word Count" ; - Moveable = TRUE ; - - Closeable = TRUE; - Sizeable = TRUE ; - Hide = TRUE ; - - FixedText FT_CURRENT - { - Pos = MAP_APPFONT ( 5 , 5 ) ; - Size = MAP_APPFONT ( 160 , 8 ) ; - Text [ en-US ] = "Current selection"; - }; - FixedLine FL_CURRENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 158 , 8 ) ; - }; - FixedText FT_CURRENTWORD - { - Pos = MAP_APPFONT ( 10 , 16 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Words:"; - }; - FixedText FI_CURRENTWORD - { - Pos = MAP_APPFONT ( 114 , 16 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_CURRENTCHARACTER - { - Pos = MAP_APPFONT ( 10 , 28 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Characters:"; - }; - FixedText FI_CURRENTCHARACTER - { - Pos = MAP_APPFONT ( 114 , 28 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_CURRENTCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 10 , 40 ) ; - Size = MAP_APPFONT ( 98 , 8 ) ; - Text [ en-US ] = "Characters excluding spaces:"; - }; - FixedText FI_CURRENTCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 114 , 40 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_DOC - { - Pos = MAP_APPFONT ( 5, 54 ) ; - Size = MAP_APPFONT ( 160 , 8 ) ; - Text [ en-US ] = "Whole document"; - }; - FixedLine FL_DOC - { - Pos = MAP_APPFONT ( 6, 52 ) ; - Size = MAP_APPFONT ( 158 , 8 ) ; - }; - FixedText FT_DOCWORD - { - Pos = MAP_APPFONT ( 10, 65 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Words:"; - }; - FixedText FI_DOCWORD - { - Pos = MAP_APPFONT ( 114 , 65 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_DOCCHARACTER - { - Pos = MAP_APPFONT ( 10 , 77 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Characters:"; - }; - FixedText FI_DOCCHARACTER - { - Pos = MAP_APPFONT ( 114, 77 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Right = TRUE; - }; - FixedText FT_DOCCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 10 , 89 ) ; - Size = MAP_APPFONT ( 98 , 8 ) ; - Text [ en-US ] = "Characters excluding spaces:"; - }; - FixedText FI_DOCCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 114, 89 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Right = TRUE; - }; - FixedLine FL_BOTTOM - { - Pos = MAP_APPFONT ( 0 , 103 ) ; - Size = MAP_APPFONT ( 170 , 8 ) ; - }; - HelpButton PB_HELP - { - HelpID = HID_DLG_WORDCOUNT ; - Pos = MAP_APPFONT ( 5 , 114 ) ; - Size = MAP_APPFONT ( 50 , 15 ) ; - }; - OKButton PB_OK - { - HelpID = HID_DLG_WORDCOUNT ; - Pos = MAP_APPFONT ( 115 , 114 ) ; - Size = MAP_APPFONT ( 50 , 15 ) ; - DefButton = TRUE ; - Text [ en-US ] = "~Close"; - }; -}; diff --git a/sw/source/ui/dialog/wordcountwrapper.cxx b/sw/source/ui/dialog/wordcountwrapper.cxx index 2fb4b8da2bf5..6a0c8a3d9427 100644 --- a/sw/source/ui/dialog/wordcountwrapper.cxx +++ b/sw/source/ui/dialog/wordcountwrapper.cxx @@ -28,7 +28,6 @@ #include <wordcountdialog.hxx> #include <docstat.hxx> #include <dialog.hrc> -#include <wordcountdialog.hrc> #include <cmdid.h> SFX_IMPL_CHILDWINDOW_WITHID(SwWordCountWrapper, FN_WORDCOUNT_DIALOG) @@ -41,7 +40,7 @@ SwWordCountWrapper::SwWordCountWrapper( Window *pParentWindow, { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pAbstDlg = pFact->CreateSwWordCountDialog( DLG_WORDCOUNT, pBindings, this, pParentWindow, pInfo ); + pAbstDlg = pFact->CreateSwWordCountDialog(pBindings, this, pParentWindow, pInfo); OSL_ENSURE(pAbstDlg, "Dialog construction failed!"); pWindow = pAbstDlg->GetWindow(); diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx index 02015c19b8aa..47e7a98a08d8 100644 --- a/sw/source/ui/inc/wordcountdialog.hxx +++ b/sw/source/ui/inc/wordcountdialog.hxx @@ -35,67 +35,26 @@ struct SwDocStat; #include <sfx2/childwin.hxx> #include "swabstdlg.hxx" -class SwWordCountDialog +class SwWordCountFloatDlg : public SfxModelessDialog { - VclVBox vbox; - VclVBox content_area; - - VclHBox aCurrentSelection; - FixedText aCurrentSelectionText; - FixedLine aCurrentSelectionLine; - - VclVBox aSelectionBox; - VclHBox aSelectionRow1; - FixedText aCurrentWordFT; - FixedInfo aCurrentWordFI; - VclHBox aSelectionRow2; - FixedText aCurrentCharacterFT; - FixedInfo aCurrentCharacterFI; - VclHBox aSelectionRow3; - FixedText aCurrentCharacterExcludingSpacesFT; - FixedInfo aCurrentCharacterExcludingSpacesFI; - - VclHBox aDoc; - FixedText aDocText; - FixedLine aDocLine; - - VclVBox aDocBox; - VclHBox aDocRow1; - FixedText aDocWordFT; - FixedInfo aDocWordFI; - VclHBox aDocRow2; - FixedText aDocCharacterFT; - FixedInfo aDocCharacterFI; - VclHBox aDocRow3; - FixedText aDocCharacterExcludingSpacesFT; - FixedInfo aDocCharacterExcludingSpacesFI; - - FixedLine aBottomFL; - - VclHButtonBox action_area; - OKButton aOK; - HelpButton aHelp; - - void InitControls(); - -public: - SwWordCountDialog(Dialog* pParent); - ~SwWordCountDialog(); - + virtual void Activate(); void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc); - SW_DLLPRIVATE DECL_LINK( OkHdl, void* ); -}; + FixedText* m_pCurrentWordFT; + FixedText* m_pCurrentCharacterFT; + FixedText* m_pCurrentCharacterExcludingSpacesFT; + FixedText* m_pDocWordFT; + FixedText* m_pDocCharacterFT; + FixedText* m_pDocCharacterExcludingSpacesFT; + PushButton* m_pClosePB; -class SwWordCountFloatDlg : public SfxModelessDialog -{ - SwWordCountDialog aDlg; - virtual void Activate(); - public: + SW_DLLPRIVATE DECL_LINK( CloseHdl, void* ); +public: SwWordCountFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo); + ~SwWordCountFloatDlg(); void UpdateCounts(); void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat); diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui index 486e57464397..ef9617f9e88d 100644 --- a/sw/uiconfig/swriter/ui/wordcount.ui +++ b/sw/uiconfig/swriter/ui/wordcount.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> - <object class="GtkDialog" id="dialog1"> + <object class="GtkDialog" id="WordCountDialog"> <property name="can_focus">False</property> <property name="border_width">5</property> <property name="type_hint">dialog</property> @@ -13,8 +13,9 @@ <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="can_focus">False</property> + <property name="layout_style">end</property> <child> - <object class="GtkButton" id="101"> + <object class="GtkButton" id="help"> <property name="label">gtk-help</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> @@ -31,7 +32,7 @@ </packing> </child> <child> - <object class="GtkButton" id="102"> + <object class="GtkButton" id="close"> <property name="label">gtk-close</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> @@ -73,15 +74,15 @@ <property name="top_padding">7</property> <property name="bottom_padding">5</property> <property name="left_padding">5</property> - <property name="right_padding">5</property> <child> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="row_spacing">2</property> - <property name="column_spacing">100</property> + <property name="column_spacing">10</property> <child> - <object class="GtkLabel" id="3"> + <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -96,77 +97,77 @@ </packing> </child> <child> - <object class="GtkLabel" id="4"> + <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">center</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> - <property name="justify">right</property> + <property name="xalign">0</property> + <property name="xpad">10</property> + <property name="label" translatable="yes">Characters:</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left_attach">0</property> + <property name="top_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="5"> + <object class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> <property name="xpad">10</property> - <property name="label" translatable="yes">Characters:</property> + <property name="label" translatable="yes">Characters excluding spaces:</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">2</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="6"> + <object class="GtkLabel" id="selectwords"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">end</property> + <property name="halign">end</property> + <property name="hexpand">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> + <property name="label"> 0</property> <property name="justify">right</property> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">0</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="7"> + <object class="GtkLabel" id="selectchars"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Characters excluding spaces:</property> + <property name="halign">end</property> + <property name="hexpand">True</property> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left_attach">1</property> + <property name="top_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="GtkLabel" id="8"> + <object class="GtkLabel" id="selectcharsnospaces"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">end</property> + <property name="halign">end</property> + <property name="hexpand">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> + <property name="label"> 0</property> <property name="justify">right</property> </object> <packing> @@ -181,10 +182,10 @@ </object> </child> <child type="label"> - <object class="GtkLabel" id="1"> + <object class="GtkLabel" id="label4"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes"><b>Current selection </b></property> + <property name="label" translatable="yes">Current selection</property> <property name="use_markup">True</property> </object> </child> @@ -212,10 +213,11 @@ <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="row_spacing">2</property> - <property name="column_spacing">100</property> + <property name="column_spacing">10</property> <child> - <object class="GtkLabel" id="9"> + <object class="GtkLabel" id="label5"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -230,7 +232,7 @@ </packing> </child> <child> - <object class="GtkLabel" id="10"> + <object class="GtkLabel" id="label6"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -245,7 +247,7 @@ </packing> </child> <child> - <object class="GtkLabel" id="11"> + <object class="GtkLabel" id="label7"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -260,12 +262,13 @@ </packing> </child> <child> - <object class="GtkLabel" id="12"> + <object class="GtkLabel" id="docwords"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> + <property name="halign">end</property> + <property name="hexpand">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> + <property name="label"> 0</property> <property name="justify">right</property> </object> <packing> @@ -276,12 +279,13 @@ </packing> </child> <child> - <object class="GtkLabel" id="13"> + <object class="GtkLabel" id="docchars"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> + <property name="halign">end</property> + <property name="hexpand">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> + <property name="label"> 0</property> <property name="justify">right</property> </object> <packing> @@ -292,12 +296,13 @@ </packing> </child> <child> - <object class="GtkLabel" id="14"> + <object class="GtkLabel" id="doccharsnospaces"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> + <property name="halign">end</property> + <property name="hexpand">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes">0</property> + <property name="label"> 0</property> <property name="justify">right</property> </object> <packing> @@ -312,10 +317,10 @@ </object> </child> <child type="label"> - <object class="GtkLabel" id="2"> + <object class="GtkLabel" id="label8"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes"><b>Whole document</b></property> + <property name="label" translatable="yes">Whole document</property> <property name="use_markup">True</property> </object> </child> @@ -338,8 +343,8 @@ </object> </child> <action-widgets> - <action-widget response="0">101</action-widget> - <action-widget response="0">102</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">close</action-widget> </action-widgets> </object> </interface> |