Kaydet (Commit) a9770af0 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert line dialog to widget UI

Change-Id: Idbad94c9f2f946f4d2be9b0a88ac2fdbbbd71e2b
Reviewed-on: https://gerrit.libreoffice.org/5287Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 653cdcf5
......@@ -77,7 +77,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/tabpages/paragrph.src \
cui/source/tabpages/strings.src \
cui/source/tabpages/swpossizetabpage.src \
cui/source/tabpages/tabline.src \
cui/source/tabpages/textanim.src \
cui/source/tabpages/textattr.src \
cui/source/tabpages/transfrm.src \
......
......@@ -40,6 +40,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/insertrowcolumn \
cui/uiconfig/ui/linedialog \
cui/uiconfig/ui/linetabpage \
cui/uiconfig/ui/lineendstabpage \
cui/uiconfig/ui/linestyletabpage \
......
......@@ -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;
......
......@@ -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: */
/* -*- 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: */
/* -*- 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: */
......@@ -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>
......
......@@ -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"
......
......@@ -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>
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="LineDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Line</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="RID_SVXPAGE_LINE">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Line</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="RID_SVXPAGE_SHADOW">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Shadow</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="RID_SVXPAGE_LINE_DEF">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Line Styles</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="RID_SVXPAGE_LINEEND_DEF">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Arrow Styles</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets>
</object>
</interface>
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