From fbf0988d22248b8098a7645b55db383070961b99 Mon Sep 17 00:00:00 2001 From: Csikós Tamás Date: Wed, 31 Jul 2013 11:29:47 +0200 Subject: modern .ui widgetlayout for pagenumber MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit widget found at: database/insert/report -> insert/page numbers Change-Id: Ibc0336a5a61cea44451e9a30b7dba5666dbc0fed Reviewed-on: https://gerrit.libreoffice.org/5211 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- reportdesign/UIConfig_dbreport.mk | 3 + reportdesign/inc/RptResId.hrc | 1 - reportdesign/source/ui/dlg/PageNumber.cxx | 35 +-- reportdesign/source/ui/dlg/PageNumber.hrc | 53 ---- reportdesign/source/ui/dlg/PageNumber.src | 123 -------- reportdesign/source/ui/inc/PageNumber.hxx | 24 +- .../uiconfig/dbreport/ui/pagenumberdialog.ui | 341 +++++++++++++++++++++ 7 files changed, 366 insertions(+), 214 deletions(-) delete mode 100644 reportdesign/source/ui/dlg/PageNumber.hrc create mode 100644 reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk index 45e43b3fdec6..3ede087eec0b 100644 --- a/reportdesign/UIConfig_dbreport.mk +++ b/reportdesign/UIConfig_dbreport.mk @@ -34,4 +34,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/dbreport,\ reportdesign/uiconfig/dbreport/toolbar/toolbar \ )) +$(eval $(call gb_UIConfig_add_uifiles,modules/dbreport,\ + reportdesign/uiconfig/dbreport/ui/pagenumberdialog \ +)) # vim: set noet sw=4 ts=4: diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc index ed80f79a1145..85698630db06 100644 --- a/reportdesign/inc/RptResId.hrc +++ b/reportdesign/inc/RptResId.hrc @@ -39,7 +39,6 @@ // Dialog Control Id's ----------------------------------------------------------- #define RID_GROUPS_SORTING ( RID_DIALOG_START + 0 ) -#define RID_PAGENUMBERS ( RID_DIALOG_START + 1 ) #define RID_DATETIME_DLG ( RID_DIALOG_START + 2 ) #define RID_CONDFORMAT ( RID_DIALOG_START + 3 ) #define WIN_CONDITION ( RID_DIALOG_START + 4 ) diff --git a/reportdesign/source/ui/dlg/PageNumber.cxx b/reportdesign/source/ui/dlg/PageNumber.cxx index 42bd2f2cd49e..1465e32d9d67 100644 --- a/reportdesign/source/ui/dlg/PageNumber.cxx +++ b/reportdesign/source/ui/dlg/PageNumber.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include "PageNumber.hxx" -#include "PageNumber.hrc" #include #include #include "RptResId.hrc" @@ -44,29 +43,21 @@ DBG_NAME( rpt_OPageNumberDialog ) OPageNumberDialog::OPageNumberDialog( Window* _pParent ,const uno::Reference< report::XReportDefinition >& _xHoldAlive ,OReportController* _pController) - : ModalDialog( _pParent, ModuleRes(RID_PAGENUMBERS) ) - ,m_aFormat(this, ModuleRes(FL_FORMAT) ) - ,m_aPageN(this, ModuleRes(RB_PAGE_N) ) - ,m_aPageNofM(this, ModuleRes(RB_PAGE_N_OF_M) ) - ,m_aPosition(this, ModuleRes(FL_POSITION) ) - ,m_aTopPage(this, ModuleRes(RB_PAGE_TOPPAGE) ) - ,m_aBottomPage(this, ModuleRes(RB_PAGE_BOTTOMPAGE) ) - ,m_aMisc(this, ModuleRes(FL_MISC) ) - ,m_aAlignment(this, ModuleRes(FL_ALIGNMENT) ) - ,m_aAlignmentLst(this, ModuleRes(LST_ALIGNMENT) ) - ,m_aShowNumberOnFirstPage(this, ModuleRes(CB_SHOWNUMBERONFIRSTPAGE) ) - ,m_aFl1(this, ModuleRes(FL_SEPARATOR1)) - ,m_aPB_OK(this, ModuleRes(PB_OK)) - ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL)) - ,m_aPB_Help(this, ModuleRes(PB_HELP)) + : ModalDialog( _pParent, "PageNumberDialog" , "modules/dbreport/ui/pagenumberdialog.ui" ) ,m_pController(_pController) ,m_xHoldAlive(_xHoldAlive) { + get(m_pPageN,"pagen"); + get(m_pPageNofM,"pagenofm"); + get(m_pTopPage,"toppage"); + get(m_pBottomPage,"bottompage"); + get(m_pAlignmentLst,"alignment"); + get(m_pShowNumberOnFirstPage,"shownumberonfirstpage"); + DBG_CTOR( rpt_OPageNumberDialog,NULL); - m_aShowNumberOnFirstPage.Hide(); + m_pShowNumberOnFirstPage->Hide(); - FreeResource(); } //------------------------------------------------------------------------ @@ -86,7 +77,7 @@ short OPageNumberDialog::Execute() sal_Int32 nPosX = 0; sal_Int32 nPos2X = 0; awt::Size aRptSize = getStyleProperty(m_xHoldAlive,PROPERTY_PAPERSIZE); - switch ( m_aAlignmentLst.GetSelectEntryPos() ) + switch ( m_pAlignmentLst->GetSelectEntryPos() ) { case 0: // left nPosX = getStyleProperty(m_xHoldAlive,PROPERTY_LEFTMARGIN); @@ -105,7 +96,7 @@ short OPageNumberDialog::Execute() default: break; } - if ( m_aAlignmentLst.GetSelectEntryPos() > 2 ) + if ( m_pAlignmentLst->GetSelectEntryPos() > 2 ) nPosX = nPos2X; sal_Int32 nLength = 0; @@ -114,10 +105,10 @@ short OPageNumberDialog::Execute() aValues[nLength++].Value <<= awt::Point(nPosX,0); aValues[nLength].Name = PROPERTY_PAGEHEADERON; - aValues[nLength++].Value <<= m_aTopPage.IsChecked(); + aValues[nLength++].Value <<= m_pTopPage->IsChecked(); aValues[nLength].Name = PROPERTY_STATE; - aValues[nLength++].Value <<= m_aPageNofM.IsChecked(); + aValues[nLength++].Value <<= m_pPageNofM->IsChecked(); m_pController->executeChecked(SID_INSERT_FLD_PGNUMBER,aValues); } diff --git a/reportdesign/source/ui/dlg/PageNumber.hrc b/reportdesign/source/ui/dlg/PageNumber.hrc deleted file mode 100644 index ea2953ece13a..000000000000 --- a/reportdesign/source/ui/dlg/PageNumber.hrc +++ /dev/null @@ -1,53 +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 RPTUI_PAGENUMBER_HRC -#define RPTUI_PAGENUMBER_HRC - -#define FL_FORMAT (1) -#define RB_PAGE_N (2) -#define RB_PAGE_N_OF_M (3) -#define FL_POSITION (4) -#define RB_PAGE_TOPPAGE (5) -#define RB_PAGE_BOTTOMPAGE (6) -#define FL_ALIGNMENT (7) -#define LST_ALIGNMENT (8) -#define CB_SHOWNUMBERONFIRSTPAGE (9) -#define PB_OK (10) -#define PB_CANCEL (11) -#define PB_HELP (12) -#define FL_SEPARATOR1 (13) -#define FL_MISC (14) - - -#define CHECKBOX_HEIGHT 8 -#define FIXEDTEXT_HEIGHT 8 -#define FIXEDTEXT_WIDTH 60 -#define RELATED_CONTROLS 4 -#define UNRELATED_CONTROLS 7 -#define EDIT_HEIGHT 12 -#define BUTTON_HEIGHT 14 -#define BUTTON_WIDTH 50 -#define BROWSER_HEIGHT 75 -#define PAGE_WIDTH (RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 3*BUTTON_WIDTH) -#define PAGE_HEIGHT ( 8*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT + BUTTON_HEIGHT +1 ) -#define LISTBOX_WIDTH PAGE_WIDTH - 3*UNRELATED_CONTROLS - FIXEDTEXT_WIDTH - -#endif // RPTUI_PAGENUMBER_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/source/ui/dlg/PageNumber.src b/reportdesign/source/ui/dlg/PageNumber.src index 9bc77a4dbb8f..1d932559aa3b 100644 --- a/reportdesign/source/ui/dlg/PageNumber.src +++ b/reportdesign/source/ui/dlg/PageNumber.src @@ -16,134 +16,11 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "PageNumber.hrc" #include "RptResId.hrc" #include "helpids.hrc" #include #include - -ModalDialog RID_PAGENUMBERS -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( PAGE_WIDTH , PAGE_HEIGHT ) ; - Text [ en-US ] = "Page Numbers" ; - HelpId = HID_RPT_PAGENUMBERS_DLG; - Moveable = TRUE ; - Closeable = TRUE ; - - FixedLine FL_FORMAT - { - Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Format"; - }; - - RadioButton RB_PAGE_N - { - HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_N"; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 2*RELATED_CONTROLS + FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Group = TRUE; - Check = TRUE; - Text [ en-US ] = "Page N"; - }; - RadioButton RB_PAGE_N_OF_M - { - HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_N_OF_M"; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 3*RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Page N of M"; - }; - - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( RELATED_CONTROLS , 3*RELATED_CONTROLS + UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Position"; - }; - - RadioButton RB_PAGE_TOPPAGE - { - HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_TOPPAGE"; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 4*RELATED_CONTROLS + UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Group = TRUE; - Check = TRUE; - Text [ en-US ] = "Top of Page (Header)"; - }; - RadioButton RB_PAGE_BOTTOMPAGE - { - HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_BOTTOMPAGE"; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 5*RELATED_CONTROLS + UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Bottom of Page (Footer)"; - }; - - FixedLine FL_MISC - { - Pos = MAP_APPFONT ( RELATED_CONTROLS , 5*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "General"; - }; - - FixedText FL_ALIGNMENT - { - Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Alignment:"; - }; - ListBox LST_ALIGNMENT - { - HelpID = "reportdesign:ListBox:RID_PAGENUMBERS:LST_ALIGNMENT"; - Border = TRUE; - Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT -1); - Size = MAP_APPFONT( LISTBOX_WIDTH, 60 ); - DropDown = TRUE; - TabStop = TRUE; - CurPos = 1 ; - StringList [ en-US ] = - { - < "Left" ; Default ; > ; - < "Center" ; Default ; > ; - < "Right" ; Default ; > ; - }; - }; - CheckBox CB_SHOWNUMBERONFIRSTPAGE - { - HelpID = "reportdesign:CheckBox:RID_PAGENUMBERS:CB_SHOWNUMBERONFIRSTPAGE"; - Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 6*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 8*FIXEDTEXT_HEIGHT) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; - Check = TRUE; - Text [ en-US ] = "Show Number on First Page"; - }; - FixedLine FL_SEPARATOR1 - { - Pos = MAP_APPFONT ( RELATED_CONTROLS , 6*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT ) ; - Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + BUTTON_WIDTH , 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - TabStop = TRUE ; - Pos = MAP_APPFONT ( RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 2*BUTTON_WIDTH , 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - Text [ en-US ] = "~Help"; - }; -}; String STR_RPT_PN_PAGE { Text [ en-US ] = "\"Page \" & #PAGENUMBER#" ; diff --git a/reportdesign/source/ui/inc/PageNumber.hxx b/reportdesign/source/ui/inc/PageNumber.hxx index f9924bd593a2..4dc7bd1c345d 100644 --- a/reportdesign/source/ui/inc/PageNumber.hxx +++ b/reportdesign/source/ui/inc/PageNumber.hxx @@ -37,23 +37,17 @@ class OReportController; \************************************************************************/ class OPageNumberDialog : public ModalDialog { - FixedLine m_aFormat; - RadioButton m_aPageN; - RadioButton m_aPageNofM; + RadioButton* m_pPageN; + RadioButton* m_pPageNofM; - FixedLine m_aPosition; - RadioButton m_aTopPage; - RadioButton m_aBottomPage; - FixedLine m_aMisc; - FixedText m_aAlignment; - ListBox m_aAlignmentLst; - - CheckBox m_aShowNumberOnFirstPage; - FixedLine m_aFl1; - OKButton m_aPB_OK; - CancelButton m_aPB_CANCEL; - HelpButton m_aPB_Help; + RadioButton* m_pTopPage; + RadioButton* m_pBottomPage; + ListBox* m_pAlignmentLst; + CheckBox* m_pShowNumberOnFirstPage; + OKButton* m_pPB_OK; + CancelButton* m_pPB_CANCEL; + HelpButton* m_pPB_Help; ::rptui::OReportController* m_pController; ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> diff --git a/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui b/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui new file mode 100644 index 000000000000..1ffdc8e2c6ac --- /dev/null +++ b/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui @@ -0,0 +1,341 @@ + + + + + False + 6 + Page Numbers + dialog + + + False + vertical + 12 + + + True + False + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 6 + + + _Page N + True + True + False + True + True + 0 + True + True + pagenofm + + + 0 + 0 + 1 + 1 + + + + + Page _N of M + True + True + False + True + True + 0 + True + True + pagen + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Format + + + + + + + + False + True + 0 + + + + + True + False + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 6 + + + _Top of Page (Header) + True + True + False + True + True + 0 + True + True + bottompage + + + 0 + 0 + 1 + 1 + + + + + _Bottom of Page (Footer) + True + True + False + True + True + 0 + True + True + toppage + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Position + + + + + + + + False + True + 1 + + + + + True + False + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 12 + + + True + False + True + 0 + 1 + + Left + Center + Right + + + + 1 + 0 + 1 + 1 + + + + + True + False + True + 0 + _Alignment: + True + alignment + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + General + + + + + + + + False + True + 2 + + + + + Show Number on First Page + True + True + False + 0 + True + + + False + True + 3 + + + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 4 + + + + + + ok + cancel + help + + + -- cgit v1.2.3