summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2013-03-01 00:44:20 -0300
committerCaolán McNamara <caolanm@redhat.com>2013-03-04 11:20:02 +0000
commit5c2d43d25b98c05af0f9a7f126101c3b8fd7271f (patch)
tree350b95cf29d52b2261671c3358caab0ea8aebaf4 /sc/source/ui
parent35a2f39de795fca22696224d4490224a6cf93d21 (diff)
Convert page header/footer to new widget UI
* The widget UI needs further work for better display, but all elements are there * Fix First page toggle with header/footer on/off * Calculations for Edit button position in Calc discarded. * Some comments in German translated * Need to address helpID's Change-Id: Iab4eec4fb2497d17c8eb1ab2bab7c31b028af7b0 Reviewed-on: https://gerrit.libreoffice.org/2478 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/tphf.hxx8
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx63
-rw-r--r--sc/source/ui/pagedlg/tphf.src28
3 files changed, 29 insertions, 70 deletions
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index 40b822f43e45..e952a410123a 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -20,7 +20,6 @@
#ifndef SC_TPHF_HXX
#define SC_TPHF_HXX
-
#include <svx/hdft.hxx>
class ScStyleDlg;
@@ -40,7 +39,6 @@ public:
protected:
ScHFPage( Window* pParent,
- sal_uInt16 nResId,
const SfxItemSet& rSet,
sal_uInt16 nSetId );
@@ -50,10 +48,10 @@ protected:
virtual int DeactivatePage( SfxItemSet* pSet = 0 );
private:
- PushButton aBtnEdit;
+ PushButton* m_pBtnEdit;
SfxItemSet aDataSet;
- String aStrPageStyle;
- sal_uInt16 nPageUsage;
+ OUString aStrPageStyle;
+ sal_uInt16 nPageUsage;
const ScStyleDlg* pStyleDlg;
#ifdef _TPHF_CXX
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index e0cc29779922..18e23b81b36d 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -49,29 +49,22 @@
// class ScHFPage
//==================================================================
-ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
- const SfxItemSet& rSet, sal_uInt16 nSetId )
+ScHFPage::ScHFPage( Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId )
- : SvxHFPage ( pParent, nResId, rSet, nSetId ),
- aBtnEdit ( this, ScResId( RID_SCBTN_HFEDIT ) ),
+ : SvxHFPage ( pParent, rSet, nSetId ),
aDataSet ( *rSet.GetPool(),
ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
ATTR_PAGE, ATTR_PAGE, 0 ),
nPageUsage ( (sal_uInt16)SVX_PAGE_ALL ),
pStyleDlg ( NULL )
{
+ get(m_pBtnEdit,"buttonEdit");
+
SetExchangeSupport();
SfxViewShell* pSh = SfxViewShell::Current();
ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pSh);
- Point aPos( aBackgroundBtn.GetPosPixel() );
-
- // aBackgroundBtn position not changed anymore
-
- aPos.X() += aBackgroundBtn.GetSizePixel().Width();
- aPos.X() += LogicToPixel( Size(3,0), MAP_APPFONT ).Width();
- aBtnEdit.SetPosPixel( aPos );
- aBtnEdit.Show();
+ m_pBtnEdit->Show();
aDataSet.Put( rSet );
@@ -83,15 +76,15 @@ ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
aStrPageStyle = pDoc->GetPageStyle( pViewData->GetTabNo() );
}
- aBtnEdit.SetClickHdl ( LINK( this, ScHFPage, BtnHdl ) );
- aTurnOnBox.SetClickHdl ( LINK( this, ScHFPage, TurnOnHdl ) );
+ m_pBtnEdit->SetClickHdl ( LINK( this, ScHFPage, BtnHdl ) );
+ m_pTurnOnBox->SetClickHdl ( LINK( this, ScHFPage, TurnOnHdl ) );
if ( nId == SID_ATTR_PAGE_HEADERSET )
- aBtnEdit.SetHelpId( HID_SC_HEADER_EDIT );
+ m_pBtnEdit->SetHelpId( HID_SC_HEADER_EDIT );
else
- aBtnEdit.SetHelpId( HID_SC_FOOTER_EDIT );
+ m_pBtnEdit->SetHelpId( HID_SC_FOOTER_EDIT );
- aBtnEdit.SetAccessibleRelationMemberOf(&aFrm);
+ m_pBtnEdit->SetAccessibleRelationMemberOf(m_pFrm);
}
//------------------------------------------------------------------
@@ -132,7 +125,7 @@ sal_Bool ScHFPage::FillItemSet( SfxItemSet& rOutSet )
void ScHFPage::ActivatePage( const SfxItemSet& rSet )
{
- sal_uInt16 nPageWhich = GetWhich( SID_ATTR_PAGE );
+ sal_uInt16 nPageWhich = GetWhich( SID_ATTR_PAGE );
const SvxPageItem& rPageItem = (const SvxPageItem&)
rSet.Get(nPageWhich);
@@ -173,12 +166,12 @@ void ScHFPage::DeactivatePage()
IMPL_LINK_NOARG(ScHFPage, TurnOnHdl)
{
- SvxHFPage::TurnOnHdl( &aTurnOnBox );
+ SvxHFPage::TurnOnHdl( m_pTurnOnBox );
- if ( aTurnOnBox.IsChecked() )
- aBtnEdit.Enable();
+ if ( m_pTurnOnBox->IsChecked() )
+ m_pBtnEdit->Enable();
else
- aBtnEdit.Disable();
+ m_pBtnEdit->Disable();
return 0;
}
@@ -188,10 +181,9 @@ IMPL_LINK_NOARG(ScHFPage, TurnOnHdl)
IMPL_LINK_NOARG(ScHFPage, BtnHdl)
{
- // Wenn der Bearbeiten-Dialog direkt aus dem Click-Handler des Buttons
- // aufgerufen wird, funktioniert im Bearbeiten-Dialog unter OS/2 das
- // GrabFocus nicht (Bug #41805#).
- // Mit dem neuen StarView sollte dieser Workaround wieder raus koennen!
+ // When the Edit-Dialog is directly called up from the Button's Click-Handler,
+ // the GraveFocus from the Edit-Dialog under OS/2 doesn't work.(Bug #41805#).
+ // With the new StarView, this workaround should be again considered!
Application::PostUserEvent( LINK( this, ScHFPage, HFEditHdl ) );
return 0;
@@ -207,8 +199,8 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
return 0;
}
- if ( aCntSharedBox.IsEnabled()
- && !aCntSharedBox.IsChecked() )
+ if ( m_pCntSharedBox->IsEnabled()
+ && !m_pCntSharedBox->IsChecked() )
{
sal_uInt16 nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
? RID_SCDLG_HFED_HEADER
@@ -227,9 +219,9 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
}
else
{
- String aText;
+ OUString aText;
SfxNoLayoutSingleTabDialog* pDlg = new SfxNoLayoutSingleTabDialog( this, aDataSet, 42 );
- sal_Bool bRightPage = aCntSharedBox.IsChecked()
+ sal_Bool bRightPage = m_pCntSharedBox->IsChecked()
|| ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) );
if ( nId == SID_ATTR_PAGE_HEADERSET )
@@ -252,11 +244,8 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
SvxNumType eNumType = ((const SvxPageItem&)aDataSet.Get(ATTR_PAGE)).GetNumType();
((ScHFEditPage*)pDlg->GetTabPage())->SetNumType(eNumType);
- aText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
- aText += ScGlobal::GetRscString( STR_PAGESTYLE );
- aText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
- aText += aStrPageStyle;
- aText += ')';
+ aText += " (" + ScGlobal::GetRscString( STR_PAGESTYLE );
+ aText += ": " + aStrPageStyle + ")";
pDlg->SetText( aText );
@@ -276,7 +265,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
//==================================================================
ScHeaderPage::ScHeaderPage( Window* pParent, const SfxItemSet& rSet )
- : ScHFPage( pParent, RID_SVXPAGE_HEADER, rSet, SID_ATTR_PAGE_HEADERSET )
+ : ScHFPage( pParent, rSet, SID_ATTR_PAGE_HEADERSET )
{
}
@@ -299,7 +288,7 @@ sal_uInt16* ScHeaderPage::GetRanges()
//==================================================================
ScFooterPage::ScFooterPage( Window* pParent, const SfxItemSet& rSet )
- : ScHFPage( pParent, RID_SVXPAGE_FOOTER, rSet, SID_ATTR_PAGE_FOOTERSET )
+ : ScHFPage( pParent, rSet, SID_ATTR_PAGE_FOOTERSET )
{
}
diff --git a/sc/source/ui/pagedlg/tphf.src b/sc/source/ui/pagedlg/tphf.src
deleted file mode 100644
index 206a697041cb..000000000000
--- a/sc/source/ui/pagedlg/tphf.src
+++ /dev/null
@@ -1,28 +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 "sc.hrc"
-
-PushButton RID_SCBTN_HFEDIT
-{
- TabStop = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
-};