summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@edx.srv.br>2013-08-05 13:39:17 -0300
committerCaolán McNamara <caolanm@redhat.com>2013-08-06 17:51:59 +0000
commita9770af052e5c3d9de893ef84c608479c03f06a7 (patch)
tree7881550e501389c418ac6a33b5c2a675f421dc9f /cui/source
parent653cdcf50c760ac026931c156c69cdc791a6f0f5 (diff)
Convert line dialog to widget UI
Change-Id: Idbad94c9f2f946f4d2be9b0a88ac2fdbbbd71e2b Reviewed-on: https://gerrit.libreoffice.org/5287 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/inc/cuitabline.hxx5
-rw-r--r--cui/source/tabpages/tabline.cxx119
-rw-r--r--cui/source/tabpages/tabline.hrc29
-rw-r--r--cui/source/tabpages/tabline.src72
-rw-r--r--cui/source/tabpages/tpline.cxx1
-rw-r--r--cui/source/tabpages/tplnedef.cxx1
-rw-r--r--cui/source/tabpages/tplneend.cxx1
7 files changed, 64 insertions, 164 deletions
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 0a03598ba3d9..19f47b395e27 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -25,6 +25,11 @@
class SvxLineTabDialog : public SfxTabDialog
{
+ sal_uInt16 m_nLineTabPage;
+ sal_uInt16 m_nShadowTabPage;
+ sal_uInt16 m_nStyleTabPage;
+ sal_uInt16 m_nEndTabPage;
+
private:
SdrModel* pDrawModel;
const SdrObject* pObj;
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index f213077d6296..fdc2cbe47ce9 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -25,7 +25,6 @@
#include <svx/dialogs.hrc>
#include <cuires.hrc>
-#include "tabline.hrc"
#include "cuitabarea.hxx"
#include "cuitabline.hxx"
@@ -44,7 +43,14 @@ SvxLineTabDialog::SvxLineTabDialog
sal_Bool bHasObj
) :
- SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_LINE ), pAttr ),
+ SfxTabDialog ( pParent
+ , "LineDialog"
+ , "cui/ui/linedialog.ui"
+ , pAttr ),
+ m_nLineTabPage(0),
+ m_nShadowTabPage(0),
+ m_nStyleTabPage(0),
+ m_nEndTabPage(0),
pDrawModel ( pModel ),
pObj ( pSdrObj ),
rOutAttrs ( *pAttr ),
@@ -64,8 +70,6 @@ SvxLineTabDialog::SvxLineTabDialog
nPosLineEndLb( 0 ),
mbAreaTP( sal_False )
{
- FreeResource();
-
bool bLineOnly = false;
if( pObj && pObj->GetObjInventor() == SdrInventor )
{
@@ -85,16 +89,16 @@ SvxLineTabDialog::SvxLineTabDialog
}
- AddTabPage( RID_SVXPAGE_LINE, SvxLineTabPage::Create, 0);
+ m_nLineTabPage = AddTabPage( "RID_SVXPAGE_LINE", SvxLineTabPage::Create, 0);
if( bLineOnly )
- AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 );
+ m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, 0 );
else
- RemoveTabPage( RID_SVXPAGE_SHADOW );
+ RemoveTabPage( "RID_SVXPAGE_SHADOW" );
- AddTabPage( RID_SVXPAGE_LINE_DEF, SvxLineDefTabPage::Create, 0);
- AddTabPage( RID_SVXPAGE_LINEEND_DEF, SvxLineEndDefTabPage::Create, 0);
+ m_nStyleTabPage = AddTabPage( "RID_SVXPAGE_LINE_DEF", SvxLineDefTabPage::Create, 0);
+ m_nEndTabPage = AddTabPage( "RID_SVXPAGE_LINEEND_DEF", SvxLineEndDefTabPage::Create, 0);
- SetCurPageId( RID_SVXPAGE_LINE );
+ SetCurPageId( "RID_SVXPAGE_LINE" );
CancelButton& rBtnCancel = GetCancelButton();
rBtnCancel.SetClickHdl( LINK( this, SvxLineTabDialog, CancelHdlImpl ) );
@@ -194,58 +198,53 @@ IMPL_LINK_NOARG_INLINE_END(SvxLineTabDialog, CancelHdlImpl)
void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
- switch( nId )
+ if( nId == m_nLineTabPage)
{
- case RID_SVXPAGE_LINE:
- ( (SvxLineTabPage&) rPage ).SetColorList( pColorList );
- ( (SvxLineTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineTabPage&) rPage ).SetDlgType( nDlgType );
- ( (SvxLineTabPage&) rPage ).SetPageType( nPageType );
- ( (SvxLineTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineTabPage&) rPage ).Construct();
- ( (SvxLineTabPage&) rPage ).SetColorChgd( &mnColorListState );
- // ActivatePage() is not called the first time
- ( (SvxLineTabPage&) rPage ).ActivatePage( rOutAttrs );
- break;
-
- case RID_SVXPAGE_LINE_DEF:
- ( (SvxLineDefTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineDefTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxLineDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineDefTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineDefTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineDefTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_LINEEND_DEF:
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineEndDefTabPage&) rPage ).SetPolyObj( pObj );
- ( (SvxLineEndDefTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxLineEndDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineEndDefTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineEndDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineEndDefTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_SHADOW:
- {
- ( (SvxShadowTabPage&) rPage ).SetColorList( pColorList );
- ( (SvxShadowTabPage&) rPage ).SetPageType( nPageType );
- ( (SvxShadowTabPage&) rPage ).SetDlgType( nDlgType );
- ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxShadowTabPage&) rPage ).Construct();
- }
- break;
+ ( (SvxLineTabPage&) rPage ).SetColorList( pColorList );
+ ( (SvxLineTabPage&) rPage ).SetDashList( pDashList );
+ ( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList );
+ ( (SvxLineTabPage&) rPage ).SetDlgType( nDlgType );
+ ( (SvxLineTabPage&) rPage ).SetPageType( nPageType );
+ ( (SvxLineTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
+ ( (SvxLineTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
+ ( (SvxLineTabPage&) rPage ).SetDashChgd( &nDashListState );
+ ( (SvxLineTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
+ ( (SvxLineTabPage&) rPage ).SetObjSelected( bObjSelected );
+ ( (SvxLineTabPage&) rPage ).Construct();
+ ( (SvxLineTabPage&) rPage ).SetColorChgd( &mnColorListState );
+ // ActivatePage() is not called the first time
+ ( (SvxLineTabPage&) rPage ).ActivatePage( rOutAttrs );
+ }
+ else if(nId == m_nStyleTabPage)
+ {
+ ( (SvxLineDefTabPage&) rPage ).SetDashList( pDashList );
+ ( (SvxLineDefTabPage&) rPage ).SetDlgType( &nDlgType );
+ ( (SvxLineDefTabPage&) rPage ).SetPageType( &nPageType );
+ ( (SvxLineDefTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
+ ( (SvxLineDefTabPage&) rPage ).SetDashChgd( &nDashListState );
+ ( (SvxLineDefTabPage&) rPage ).SetObjSelected( bObjSelected );
+ ( (SvxLineDefTabPage&) rPage ).Construct();
+ }
+ else if(nId == m_nEndTabPage)
+ {
+ ( (SvxLineEndDefTabPage&) rPage ).SetLineEndList( pLineEndList );
+ ( (SvxLineEndDefTabPage&) rPage ).SetPolyObj( pObj );
+ ( (SvxLineEndDefTabPage&) rPage ).SetDlgType( &nDlgType );
+ ( (SvxLineEndDefTabPage&) rPage ).SetPageType( &nPageType );
+ ( (SvxLineEndDefTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
+ ( (SvxLineEndDefTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
+ ( (SvxLineEndDefTabPage&) rPage ).SetObjSelected( bObjSelected );
+ ( (SvxLineEndDefTabPage&) rPage ).Construct();
+ }
+ else if (nId == m_nShadowTabPage)
+ {
+ ( (SvxShadowTabPage&) rPage ).SetColorList( pColorList );
+ ( (SvxShadowTabPage&) rPage ).SetPageType( nPageType );
+ ( (SvxShadowTabPage&) rPage ).SetDlgType( nDlgType );
+ ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
+ ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorListState );
+ ( (SvxShadowTabPage&) rPage ).Construct();
}
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tabline.hrc b/cui/source/tabpages/tabline.hrc
deleted file mode 100644
index b4b2ee9ee112..000000000000
--- a/cui/source/tabpages/tabline.hrc
+++ /dev/null
@@ -1,29 +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 .
- */
-
-#define TAB_CONTROL 1
-#define STR_START_TYPE 36
-#define STR_END_TYPE 37
-#define STR_START_NUM 38
-#define STR_END_NUM 39
-#define STR_START_LENGTH 40
-#define STR_END_LENGTH 41
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tabline.src b/cui/source/tabpages/tabline.src
deleted file mode 100644
index 3f6ffd8e3fc9..000000000000
--- a/cui/source/tabpages/tabline.src
+++ /dev/null
@@ -1,72 +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 <cuires.hrc>
-#include "helpid.hrc"
-#include "tabline.hrc"
-#include <svx/dialogs.hrc>
-
-// Selecting LineStyle / Color / Width --------------------
-
-#define MASKCOLOR MaskColor = Color{ Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
- // RID_SVXDLG_LINE ----------------------------------------------------------
-TabDialog RID_SVXDLG_LINE
-{
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 289 , 176 ) ;
- Text [ en-US ] = "Line" ;
- Moveable = TRUE ;
- TabControl TAB_CONTROL
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_LINE ;
- Text [ en-US ] = "Line" ;
- PageResID = RID_SVXPAGE_LINE ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SHADOW ;
- PageResID = RID_SVXPAGE_SHADOW ;
- Text [ en-US ] = "Shadow" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_LINE_DEF ;
- Text [ en-US ] = "Line Styles" ;
- PageResID = RID_SVXPAGE_LINE_DEF ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_LINEEND_DEF ;
- Text [ en-US ] = "Arrow Styles" ;
- PageResID = RID_SVXPAGE_LINEEND_DEF ;
- };
- };
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 4aa9f57ba6fa..458b6b920d93 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -24,7 +24,6 @@
#include <sfx2/module.hxx>
#include <cuires.hrc>
-#include "tabline.hrc"
#include "svx/xattr.hxx"
#include <svx/xpool.hxx>
#include <svx/xtable.hxx>
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 399994ca9fcc..5adb24710999 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -27,7 +27,6 @@
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
#include <cuires.hrc>
-#include "tabline.hrc"
#include "helpid.hrc"
#include "svx/xattr.hxx"
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 5ac75388000f..9623f38f65d9 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -26,7 +26,6 @@
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
#include <cuires.hrc>
-#include "tabline.hrc"
#include "helpid.hrc"
#include <svx/dialmgr.hxx>
#include <svx/svdobj.hxx>