Kaydet (Commit) 3183f794 authored tarafından Prashant Pandey's avatar Prashant Pandey Kaydeden (comit) Jan Holesovsky

sidebar: InsertPropertyPanel conversion to .ui

Change-Id: I51df7ade7b5f83124a2a103db3028fbb0b5ea8cc
üst 5c97e88c
...@@ -74,7 +74,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\ ...@@ -74,7 +74,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/sidebar/line/LinePropertyPanel.src \ svx/source/sidebar/line/LinePropertyPanel.src \
svx/source/sidebar/text/TextPropertyPanel.src \ svx/source/sidebar/text/TextPropertyPanel.src \
svx/source/sidebar/paragraph/ParaPropertyPanel.src \ svx/source/sidebar/paragraph/ParaPropertyPanel.src \
svx/source/sidebar/insert/InsertPropertyPanel.src \
svx/source/stbctrls/stbctrls.src \ svx/source/stbctrls/stbctrls.src \
svx/source/svdraw/svdstr.src \ svx/source/svdraw/svdstr.src \
svx/source/table/table.src \ svx/source/table/table.src \
......
...@@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ ...@@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/redlinefilterpage \ svx/uiconfig/ui/redlinefilterpage \
svx/uiconfig/ui/redlineviewpage \ svx/uiconfig/ui/redlineviewpage \
svx/uiconfig/ui/sidebararea \ svx/uiconfig/ui/sidebararea \
svx/uiconfig/ui/sidebarinsert \
svx/uiconfig/ui/sidebarline \ svx/uiconfig/ui/sidebarline \
svx/uiconfig/ui/sidebarparagraph \ svx/uiconfig/ui/sidebarparagraph \
svx/uiconfig/ui/sidebarpossize \ svx/uiconfig/ui/sidebarpossize \
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "InsertPropertyPanel.hxx" #include "InsertPropertyPanel.hxx"
#include "InsertPropertyPanel.hrc"
#include "sfx2/sidebar/CommandInfoProvider.hxx" #include "sfx2/sidebar/CommandInfoProvider.hxx"
#include <sfx2/sidebar/Theme.hxx> #include <sfx2/sidebar/Theme.hxx>
...@@ -42,27 +41,17 @@ using namespace cssu; ...@@ -42,27 +41,17 @@ using namespace cssu;
using ::rtl::OUString; using ::rtl::OUString;
using ::sfx2::sidebar::SidebarToolBox; using ::sfx2::sidebar::SidebarToolBox;
namespace svx { namespace sidebar { namespace svx { namespace sidebar {
InsertPropertyPanel::InsertPropertyPanel ( InsertPropertyPanel::InsertPropertyPanel (
Window* pParent, Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame) const cssu::Reference<css::frame::XFrame>& rxFrame)
: Control(pParent, SVX_RES(RID_SIDEBAR_INSERT_PANEL)), : PanelLayout(pParent, "InsertPropertyPanel", "svx/ui/sidebarinsert.ui", rxFrame),
mpStandardShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
mpStandardShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
mpStandardShapesBackground.get(),
SVX_RES(TB_INSERT_STANDARD),
rxFrame)),
mpCustomShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
mpCustomShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
mpCustomShapesBackground.get(),
SVX_RES(TB_INSERT_CUSTOM),
rxFrame)),
mxFrame(rxFrame) mxFrame(rxFrame)
{ {
FreeResource(); get(mpStandardShapesToolBox, "standardshapes");
get(mpCustomShapesToolBox, "customshapes");
mpStandardShapesToolBox->Show(); mpStandardShapesToolBox->Show();
mpCustomShapesToolBox->Show(); mpCustomShapesToolBox->Show();
...@@ -84,11 +73,6 @@ InsertPropertyPanel::~InsertPropertyPanel (void) ...@@ -84,11 +73,6 @@ InsertPropertyPanel::~InsertPropertyPanel (void)
while (pTopWindow->GetParent() != NULL) while (pTopWindow->GetParent() != NULL)
pTopWindow = pTopWindow->GetParent(); pTopWindow = pTopWindow->GetParent();
pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener)); pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
mpStandardShapesToolBox.reset();
mpCustomShapesToolBox.reset();
mpStandardShapesBackground.reset();
mpCustomShapesBackground.reset();
} }
...@@ -124,13 +108,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) ...@@ -124,13 +108,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
if (nId == 0) if (nId == 0)
return 1; return 1;
SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get()); SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox);
if (pSidebarToolBox == NULL) if (pSidebarToolBox == NULL)
return 1; return 1;
sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path)); sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path));
if (nItemId == 0) if (nItemId == 0)
{ {
pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get()); pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox);
if (pSidebarToolBox == NULL) if (pSidebarToolBox == NULL)
return 1; return 1;
nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path); nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path);
...@@ -139,7 +123,7 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) ...@@ -139,7 +123,7 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
} }
Reference<frame::XSubToolbarController> xController (pSidebarToolBox->GetControllerForItemId(nItemId), UNO_QUERY); Reference<frame::XSubToolbarController> xController (pSidebarToolBox->GetControllerForItemId(nItemId), UNO_QUERY);
if ( ! xController.is()) if ( ! xController.is() )
return 1; return 1;
const OUString sCommand (pToolBox->GetItemCommand(nId)); const OUString sCommand (pToolBox->GetItemCommand(nId));
......
/*
* 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 "svx/dialogs.hrc"
#define TB_INSERT_STANDARD 1
#define TB_INSERT_CUSTOM 2
#define TBI_STANDARD_LINE 10
#define TBI_STANDARD_ARROW 11
#define TBI_STANDARD_RECTANGLE 12
#define TBI_STANDARD_ELLIPSE 13
#define TBI_STANDARD_TEXT 14
#define TBI_STANDARD_LINES 15
#define TBI_STANDARD_CONNECTORS 16
#define TBI_STANDARD_ARROWS 17
#define TBI_CUSTOM_BASICS 20
#define TBI_CUSTOM_SYMBOLS 21
#define TBI_CUSTOM_ARROWS 22
#define TBI_CUSTOM_FLOWCHARTS 23
#define TBI_CUSTOM_CALLOUTS 24
#define TBI_CUSTOM_STARS 25
...@@ -18,15 +18,13 @@ ...@@ -18,15 +18,13 @@
#ifndef SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX #ifndef SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
#define SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX #define SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
#include <boost/scoped_ptr.hpp>
#include <vcl/ctrl.hxx> #include <vcl/ctrl.hxx>
#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XToolbarController.hpp> #include <com/sun/star/frame/XToolbarController.hpp>
#include <map> #include <map>
#include <svx/sidebar/PanelLayout.hxx>
namespace css = ::com::sun::star; namespace css = ::com::sun::star;
namespace cssu = ::com::sun::star::uno; namespace cssu = ::com::sun::star::uno;
...@@ -38,7 +36,7 @@ namespace svx { namespace sidebar { ...@@ -38,7 +36,7 @@ namespace svx { namespace sidebar {
/** This panel provides buttons for inserting shapes into a document. /** This panel provides buttons for inserting shapes into a document.
*/ */
class InsertPropertyPanel class InsertPropertyPanel
: public Control : public PanelLayout
{ {
public: public:
InsertPropertyPanel ( InsertPropertyPanel (
...@@ -47,10 +45,8 @@ public: ...@@ -47,10 +45,8 @@ public:
virtual ~InsertPropertyPanel (void); virtual ~InsertPropertyPanel (void);
private: private:
::boost::scoped_ptr<Window> mpStandardShapesBackground; ToolBox* mpStandardShapesToolBox;
::boost::scoped_ptr<ToolBox> mpStandardShapesToolBox; ToolBox* mpCustomShapesToolBox;
::boost::scoped_ptr<Window> mpCustomShapesBackground;
::boost::scoped_ptr<ToolBox> mpCustomShapesToolBox;
const cssu::Reference<css::frame::XFrame> mxFrame; const cssu::Reference<css::frame::XFrame> mxFrame;
DECL_LINK(WindowEventListener, VclSimpleEvent*); DECL_LINK(WindowEventListener, VclSimpleEvent*);
......
/*
* 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 "InsertPropertyPanel.hrc"
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include "helpid.hrc"
#define FIRST_LINE_Y SECTIONPAGE_MARGIN_VERTICAL_TOP
#define SECOND_LINE_Y FIRST_LINE_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL + 1
Control RID_SIDEBAR_INSERT_PANEL
{
OutputSize = TRUE;
DialogControl = TRUE;
Border = FALSE;
Size = MAP_APPFONT(
PROPERTYPAGE_WIDTH,
SECTIONPAGE_MARGIN_VERTICAL_TOP
+ TOOLBOX_ITEM_HEIGHT * 2
+ CONTROL_SPACING_VERTICAL
+ SECTIONPAGE_MARGIN_VERTICAL_BOT);
HelpID = HID_SIDEBAR_INSERT_PANEL;
Text = "Insert";
ToolBox TB_INSERT_STANDARD
{
SVLook = TRUE ;
Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, FIRST_LINE_Y);
Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 6 + TOOLBOX_ITEM_DD_WIDTH, TOOLBOX_ITEM_HEIGHT) ;
TabStop = TRUE ;
HelpID = HID_SIDEBAR_INSERT_TOOLBOX;
Text = "Insert Shapes";
ItemList =
{
ToolBoxItem
{
Identifier = TBI_STANDARD_LINE;
Command = ".uno:Line";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_ARROW;
Command = ".uno:LineArrowEnd";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_RECTANGLE;
Command = ".uno:Rect";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_ELLIPSE;
Command = ".uno:Ellipse";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_TEXT;
Command = ".uno:Text";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_LINES;
Command = ".uno:LineToolbox";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_CONNECTORS;
Command = ".uno:ConnectorToolbox";
};
ToolBoxItem
{
Identifier = TBI_STANDARD_ARROWS;
Command = ".uno:ArrowsToolbox";
DropDown = TRUE;
};
};
};
ToolBox TB_INSERT_CUSTOM
{
SVLook = TRUE ;
Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, SECOND_LINE_Y);
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH * 6, TOOLBOX_ITEM_HEIGHT) ;
TabStop = TRUE ;
HelpID = HID_SIDEBAR_INSERT_TOOLBOX;
Text = "Insert";
ItemList =
{
ToolBoxItem
{
Identifier = TBI_CUSTOM_BASICS;
Command = ".uno:BasicShapes";
DropDown = TRUE;
};
ToolBoxItem
{
Identifier = TBI_CUSTOM_SYMBOLS;
Command = ".uno:SymbolShapes";
DropDown = TRUE;
};
ToolBoxItem
{
Identifier = TBI_CUSTOM_ARROWS;
Command = ".uno:ArrowShapes";
DropDown = TRUE;
};
ToolBoxItem
{
Identifier = TBI_CUSTOM_FLOWCHARTS;
Command = ".uno:FlowChartShapes";
DropDown = TRUE;
};
ToolBoxItem
{
Identifier = TBI_CUSTOM_CALLOUTS;
Command = ".uno:CalloutShapes";
DropDown = TRUE;
};
ToolBoxItem
{
Identifier = TBI_CUSTOM_STARS;
Command = ".uno:StarShapes";
DropDown = TRUE;
};
};
};
};
This diff is collapsed.
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