Kaydet (Commit) fbf0988d authored tarafından Csikós Tamás's avatar Csikós Tamás Kaydeden (comit) Caolán McNamara

modern .ui widgetlayout for pagenumber

widget found at: database/insert/report -> insert/page numbers

Change-Id: Ibc0336a5a61cea44451e9a30b7dba5666dbc0fed
Reviewed-on: https://gerrit.libreoffice.org/5211Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 44cd56e0
......@@ -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:
......@@ -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 )
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "PageNumber.hxx"
#include "PageNumber.hrc"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <tools/debug.hxx>
#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<awt::Size>(m_xHoldAlive,PROPERTY_PAPERSIZE);
switch ( m_aAlignmentLst.GetSelectEntryPos() )
switch ( m_pAlignmentLst->GetSelectEntryPos() )
{
case 0: // left
nPosX = getStyleProperty<sal_Int32>(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);
}
......
/* -*- 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: */
......@@ -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 <svx/globlmn.hrc>
#include <svx/svxids.hrc>
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#" ;
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment