From c5740ff43bea7ab7362812cb6fd77507ba100359 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 6 Aug 2013 23:06:11 +0200 Subject: convert label options tabpage to .ui Change-Id: I3fd082bc3a8989f6099ee826f61240d9227b2afe --- sw/AllLangResTarget_sw.mk | 1 - sw/UIConfig_swriter.mk | 1 + sw/inc/helpid.h | 1 - sw/source/ui/envelp/labprt.cxx | 98 +++++----- sw/source/ui/envelp/labprt.hrc | 49 ----- sw/source/ui/envelp/labprt.hxx | 27 ++- sw/source/ui/envelp/labprt.src | 122 ------------- sw/uiconfig/swriter/ui/labeloptionspage.ui | 284 +++++++++++++++++++++++++++++ 8 files changed, 340 insertions(+), 243 deletions(-) delete mode 100644 sw/source/ui/envelp/labprt.hrc delete mode 100644 sw/source/ui/envelp/labprt.src create mode 100644 sw/uiconfig/swriter/ui/labeloptionspage.ui diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 091679315e1b..0d1cc07b0b59 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -102,7 +102,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/envelp/envprt.src \ sw/source/ui/envelp/label.src \ sw/source/ui/envelp/labfmt.src \ - sw/source/ui/envelp/labprt.src \ sw/source/ui/envelp/mailmrge.src \ sw/source/ui/fldui/flddb.src \ sw/source/ui/fldui/flddinf.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 8e7f21706ed2..34ea76f05c12 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -102,6 +102,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/insertsectiondialog \ sw/uiconfig/swriter/ui/insertscript \ sw/uiconfig/swriter/ui/inserttable \ + sw/uiconfig/swriter/ui/labeloptionspage \ sw/uiconfig/swriter/ui/linenumbering \ sw/uiconfig/swriter/ui/mailconfigpage \ sw/uiconfig/swriter/ui/mailmergedialog \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 612792084fd8..0a4014c847f5 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -145,7 +145,6 @@ #define HID_FRM_STD "SW_HID_FRM_STD" #define HID_GRF_EXT "SW_HID_GRF_EXT" #define HID_LAB_LAB "SW_HID_LAB_LAB" -#define HID_LAB_PRT "SW_HID_LAB_PRT" #define HID_ENV_PRT "SW_HID_ENV_PRT" #define HID_LAB_FMT "SW_HID_LAB_FMT" #define HID_ENV_ENV "SW_HID_ENV_ENV" diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index de6a37ed61d3..c59b3593fa38 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -27,44 +27,36 @@ #include "swuilabimp.hxx" #include -#include - -SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) : - - SfxTabPage(pParent, SW_RES(TP_LAB_PRT), rSet), - - pPrinter( 0 ), - aFLDontKnow (this, SW_RES(FL_DONTKNOW)), - aPageButton (this, SW_RES(BTN_PAGE )), - aSingleButton (this, SW_RES(BTN_SINGLE )), - aColText (this, SW_RES(TXT_COL )), - aColField (this, SW_RES(FLD_COL )), - aRowText (this, SW_RES(TXT_ROW )), - aRowField (this, SW_RES(FLD_ROW )), - aSynchronCB (this, SW_RES(CB_SYNCHRON)), - aFLPrinter (this, SW_RES(FL_PRINTER )), - aPrinterInfo (this, SW_RES(INF_PRINTER)), - aPrtSetup (this, SW_RES(BTN_PRTSETUP)) +SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "LabelOptionsPage", + "modules/swriter/ui/labeloptionspage.ui", rSet) + , pPrinter(0) { - FreeResource(); + get(m_pPageButton, "entirepage"); + get(m_pSingleButton, "singlelabel"); + get(m_pSingleGrid, "singlegrid"); + get(m_pColField, "cols"); + get(m_pRowField, "rows"); + get(m_pSynchronCB, "synchronize"); + get(m_pPrinterFrame, "printerframe"); + get(m_pPrinterInfo, "printername"); + get(m_pPrtSetup, "setup"); SetExchangeSupport(); // Install handlers Link aLk = LINK(this, SwLabPrtPage, CountHdl); - aPageButton .SetClickHdl( aLk ); - aSingleButton.SetClickHdl( aLk ); + m_pPageButton->SetClickHdl( aLk ); + m_pSingleButton->SetClickHdl( aLk ); - aPrtSetup.SetClickHdl( aLk ); + m_pPrtSetup->SetClickHdl( aLk ); SvtCommandOptions aCmdOpts; if ( aCmdOpts.Lookup( SvtCommandOptions::CMDOPTION_DISABLED, OUString( "Print" ) ) ) { - aPrinterInfo.Hide(); - aPrtSetup.Hide(); - aFLPrinter.Hide(); + m_pPrinterFrame->Hide(); } } @@ -75,7 +67,7 @@ SwLabPrtPage::~SwLabPrtPage() IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) { - if (pButton == &aPrtSetup) + if (pButton == m_pPrtSetup) { // Call printer setup if (!pPrinter) @@ -86,20 +78,17 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) pDlg->Execute(); delete pDlg; GrabFocus(); - aPrinterInfo.SetText(pPrinter->GetName()); + m_pPrinterInfo->SetText(pPrinter->GetName()); return 0; } - const sal_Bool bEnable = pButton == &aSingleButton; - aColText .Enable(bEnable); - aColField.Enable(bEnable); - aRowText .Enable(bEnable); - aRowField.Enable(bEnable); - aSynchronCB.Enable(!bEnable); - - OSL_ENSURE(!bEnable || pButton == &aPageButton, "NewButton?" ); + const bool bEnable = pButton == m_pSingleButton; + m_pSingleGrid->Enable(bEnable); + m_pSynchronCB->Enable(!bEnable); + + OSL_ENSURE(!bEnable || pButton == m_pPageButton, "NewButton?" ); if ( bEnable ) { - aColField.GrabFocus(); + m_pColField->GrabFocus(); } return 0; } @@ -124,10 +113,10 @@ int SwLabPrtPage::DeactivatePage(SfxItemSet* _pSet) void SwLabPrtPage::FillItem(SwLabItem& rItem) { - rItem.bPage = aPageButton.IsChecked(); - rItem.nCol = (sal_uInt16) aColField.GetValue(); - rItem.nRow = (sal_uInt16) aRowField.GetValue(); - rItem.bSynchron = aSynchronCB.IsChecked() && aSynchronCB.IsEnabled(); + rItem.bPage = m_pPageButton->IsChecked(); + rItem.nCol = (sal_uInt16) m_pColField->GetValue(); + rItem.nRow = (sal_uInt16) m_pRowField->GetValue(); + rItem.bSynchron = m_pSynchronCB->IsChecked() && m_pSynchronCB->IsEnabled(); } sal_Bool SwLabPrtPage::FillItemSet(SfxItemSet& rSet) @@ -145,38 +134,35 @@ void SwLabPrtPage::Reset(const SfxItemSet& ) SwLabItem aItem; GetParentSwLabDlg()->GetLabItem(aItem); - aColField.SetValue (aItem.nCol); - aRowField.SetValue (aItem.nRow); + m_pColField->SetValue (aItem.nCol); + m_pRowField->SetValue (aItem.nRow); if (aItem.bPage) { - aPageButton.Check(); - aPageButton.GetClickHdl().Call(&aPageButton); + m_pPageButton->Check(); + m_pPageButton->GetClickHdl().Call(m_pPageButton); } else { - aSingleButton.GetClickHdl().Call(&aSingleButton); - aSingleButton.Check(); + m_pSingleButton->GetClickHdl().Call(m_pSingleButton); + m_pSingleButton->Check(); } if (pPrinter) { // show printer - aPrinterInfo.SetText(pPrinter->GetName()); + m_pPrinterInfo->SetText(pPrinter->GetName()); } else - aPrinterInfo.SetText(Printer::GetDefaultPrinterName()); + m_pPrinterInfo->SetText(Printer::GetDefaultPrinterName()); - aColField.SetMax(aItem.nCols); - aRowField.SetMax(aItem.nRows); + m_pColField->SetMax(aItem.nCols); + m_pRowField->SetMax(aItem.nRows); - aColField.SetLast(aColField.GetMax()); - aRowField.SetLast(aRowField.GetMax()); + m_pColField->SetLast(m_pColField->GetMax()); + m_pRowField->SetLast(m_pRowField->GetMax()); - aSynchronCB.Check(aItem.bSynchron); + m_pSynchronCB->Check(aItem.bSynchron); } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labprt.hrc b/sw/source/ui/envelp/labprt.hrc deleted file mode 100644 index c47a47c56d1c..000000000000 --- a/sw/source/ui/envelp/labprt.hrc +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 _LABPRT_HRC -#define _LABPRT_HRC - -#include "envelp.hrc" - -// local resources ********************************************************* - -#define BTN_PAGE 1 -#define BTN_SINGLE 2 -#define INF_PRINTER 3 -#define TXT_COL 4 -#define FLD_COL 5 -#define TXT_ROW 6 -#define FLD_ROW 7 -#define BTN_PRTSETUP 8 -#define FL_PRINTER 9 -#define FL_DONTKNOW 10 -#define CB_SYNCHRON 11 - -// overflow check ******************************************************** - -#define LABPRT_ACT_END 0 - -#if LABPRT_ACT_END > RC_LABPRT_END -#error Resource-Ueberlauf in #file, #line -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx index da793ca797bc..33d950b56e8e 100644 --- a/sw/source/ui/envelp/labprt.hxx +++ b/sw/source/ui/envelp/labprt.hxx @@ -19,10 +19,11 @@ #ifndef _LABPRT_HXX #define _LABPRT_HXX -#include +#include #include +#include +#include #include -#include #include @@ -35,18 +36,16 @@ class SwLabPrtPage : public SfxTabPage { Printer* pPrinter; // for the shaft setting - unfortunately - FixedLine aFLDontKnow; - RadioButton aPageButton; - RadioButton aSingleButton; - FixedText aColText; - NumericField aColField; - FixedText aRowText; - NumericField aRowField; - CheckBox aSynchronCB; - - FixedLine aFLPrinter; - FixedInfo aPrinterInfo; - PushButton aPrtSetup; + RadioButton* m_pPageButton; + RadioButton* m_pSingleButton; + VclContainer* m_pSingleGrid; + VclContainer* m_pPrinterFrame; + NumericField* m_pColField; + NumericField* m_pRowField; + CheckBox* m_pSynchronCB; + + FixedText* m_pPrinterInfo; + PushButton* m_pPrtSetup; SwLabPrtPage(Window* pParent, const SfxItemSet& rSet); ~SwLabPrtPage(); diff --git a/sw/source/ui/envelp/labprt.src b/sw/source/ui/envelp/labprt.src deleted file mode 100644 index b55a94973f7c..000000000000 --- a/sw/source/ui/envelp/labprt.src +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 "labprt.hrc" -#include "helpid.h" - // TP_LAB_PRT --------------------------------------------------------------- -TabPage TP_LAB_PRT -{ - HelpID = HID_LAB_PRT ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Hide = TRUE ; - RadioButton BTN_PAGE - { - HelpID = "sw:RadioButton:TP_LAB_PRT:BTN_PAGE"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - TabStop = TRUE ; - Group = TRUE ; - Text [ en-US ] = "~Entire page" ; - }; - RadioButton BTN_SINGLE - { - HelpID = "sw:RadioButton:TP_LAB_PRT:BTN_SINGLE"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "~Single label" ; - }; - FixedText TXT_COL - { - Pos = MAP_APPFONT ( 127 , 29 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "Colu~mn" ; - Left = TRUE ; - }; - NumericField FLD_COL - { - HelpID = "sw:NumericField:TP_LAB_PRT:FLD_COL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 160 , 27 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - }; - FixedText TXT_ROW - { - Pos = MAP_APPFONT ( 191 , 29 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "Ro~w" ; - Left = TRUE ; - }; - NumericField FLD_ROW - { - HelpID = "sw:NumericField:TP_LAB_PRT:FLD_ROW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 224 , 27 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - }; - CheckBox CB_SYNCHRON - { - HelpID = "sw:CheckBox:TP_LAB_PRT:CB_SYNCHRON"; - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Synchroni~ze contents" ; - }; - FixedLine FL_DONTKNOW - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Distribute"; - }; - FixedText INF_PRINTER - { - Pos = MAP_APPFONT ( 12 , 73 ) ; - Size = MAP_APPFONT ( 182 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Printer Name" ; - }; - PushButton BTN_PRTSETUP - { - HelpID = "sw:PushButton:TP_LAB_PRT:BTN_PRTSETUP"; - Pos = MAP_APPFONT ( 198 , 70 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Setup..." ; - }; - FixedLine FL_PRINTER - { - Pos = MAP_APPFONT ( 6 , 59 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = " Printer " ; - }; -}; - // ************************************************************************** - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/labeloptionspage.ui b/sw/uiconfig/swriter/ui/labeloptionspage.ui new file mode 100644 index 000000000000..528e7d1079dd --- /dev/null +++ b/sw/uiconfig/swriter/ui/labeloptionspage.ui @@ -0,0 +1,284 @@ + + + + + 1 + 100 + 1 + 1 + 10 + + + True + False + 6 + vertical + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + _Entire page + True + True + False + True + 0 + True + True + singlelabel + + + 0 + 0 + 2 + 1 + + + + + _Single label + True + True + False + True + True + 0 + True + entirepage + + + 0 + 1 + 1 + 1 + + + + + True + False + 18 + + + True + False + 12 + + + True + False + 0 + Colu_mn + True + cols + + + 0 + 0 + 1 + 1 + + + + + True + True + + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + True + False + 12 + + + True + False + 0 + Ro_w + True + rows + + + 0 + 0 + 1 + 1 + + + + + True + True + + adjustment1 + + + 1 + 0 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + + + + + Synchroni_ze contents + True + True + False + True + 0 + True + + + 0 + 2 + 2 + 1 + + + + + + + + + True + False + Distribute + + + + + + + + False + True + 0 + + + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + 12 + + + Setup... + True + True + True + True + + + 1 + 0 + 1 + 1 + + + + + True + False + True + 0 + Printer Name + True + setup + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Printer + + + + + + + + False + True + 1 + + + + -- cgit