diff options
author | Prashant Pandey <prashant3.yishu@gmail.com> | 2013-07-12 23:22:45 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-07-17 13:27:45 +0200 |
commit | 3183f794bf6d9d3da214b25a67240f67cfbee16d (patch) | |
tree | 2116ca52ef5be207583d4d56a96f7aa63f7f8bbc /svx | |
parent | 5c97e88cfaff99dc9a1e250883febde11cbcaa94 (diff) |
sidebar: InsertPropertyPanel conversion to .ui
Change-Id: I51df7ade7b5f83124a2a103db3028fbb0b5ea8cc
Diffstat (limited to 'svx')
-rw-r--r-- | svx/AllLangResTarget_svx.mk | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/sidebar/insert/InsertPropertyPanel.cxx | 28 | ||||
-rw-r--r-- | svx/source/sidebar/insert/InsertPropertyPanel.hrc | 38 | ||||
-rw-r--r-- | svx/source/sidebar/insert/InsertPropertyPanel.hxx | 12 | ||||
-rw-r--r-- | svx/source/sidebar/insert/InsertPropertyPanel.src | 142 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebarinsert.ui | 256 |
7 files changed, 267 insertions, 211 deletions
diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 4bd851f25023..2adb6dcc8bca 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -74,7 +74,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\ svx/source/sidebar/line/LinePropertyPanel.src \ svx/source/sidebar/text/TextPropertyPanel.src \ svx/source/sidebar/paragraph/ParaPropertyPanel.src \ - svx/source/sidebar/insert/InsertPropertyPanel.src \ svx/source/stbctrls/stbctrls.src \ svx/source/svdraw/svdstr.src \ svx/source/table/table.src \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index a041697bc28b..99feed868322 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/redlinefilterpage \ svx/uiconfig/ui/redlineviewpage \ svx/uiconfig/ui/sidebararea \ + svx/uiconfig/ui/sidebarinsert \ svx/uiconfig/ui/sidebarline \ svx/uiconfig/ui/sidebarparagraph \ svx/uiconfig/ui/sidebarpossize \ diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx index cbaca0266bec..0d4860f3814e 100644 --- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx +++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx @@ -16,7 +16,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include "InsertPropertyPanel.hxx" -#include "InsertPropertyPanel.hrc" #include "sfx2/sidebar/CommandInfoProvider.hxx" #include <sfx2/sidebar/Theme.hxx> @@ -42,27 +41,17 @@ using namespace cssu; using ::rtl::OUString; using ::sfx2::sidebar::SidebarToolBox; - namespace svx { namespace sidebar { InsertPropertyPanel::InsertPropertyPanel ( Window* pParent, const cssu::Reference<css::frame::XFrame>& rxFrame) - : Control(pParent, SVX_RES(RID_SIDEBAR_INSERT_PANEL)), - 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)), + : PanelLayout(pParent, "InsertPropertyPanel", "svx/ui/sidebarinsert.ui", rxFrame), mxFrame(rxFrame) { - FreeResource(); + get(mpStandardShapesToolBox, "standardshapes"); + get(mpCustomShapesToolBox, "customshapes"); mpStandardShapesToolBox->Show(); mpCustomShapesToolBox->Show(); @@ -84,11 +73,6 @@ InsertPropertyPanel::~InsertPropertyPanel (void) while (pTopWindow->GetParent() != NULL) pTopWindow = pTopWindow->GetParent(); pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener)); - - mpStandardShapesToolBox.reset(); - mpCustomShapesToolBox.reset(); - mpStandardShapesBackground.reset(); - mpCustomShapesBackground.reset(); } @@ -124,13 +108,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) if (nId == 0) return 1; - SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get()); + SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox); if (pSidebarToolBox == NULL) return 1; sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path)); if (nItemId == 0) { - pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get()); + pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox); if (pSidebarToolBox == NULL) return 1; nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path); @@ -139,7 +123,7 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) } Reference<frame::XSubToolbarController> xController (pSidebarToolBox->GetControllerForItemId(nItemId), UNO_QUERY); - if ( ! xController.is()) + if ( ! xController.is() ) return 1; const OUString sCommand (pToolBox->GetItemCommand(nId)); diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hrc b/svx/source/sidebar/insert/InsertPropertyPanel.hrc deleted file mode 100644 index 55425e2537a6..000000000000 --- a/svx/source/sidebar/insert/InsertPropertyPanel.hrc +++ /dev/null @@ -1,38 +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 "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 diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hxx b/svx/source/sidebar/insert/InsertPropertyPanel.hxx index bd58a3a0f256..f5b971afe2ad 100644 --- a/svx/source/sidebar/insert/InsertPropertyPanel.hxx +++ b/svx/source/sidebar/insert/InsertPropertyPanel.hxx @@ -18,15 +18,13 @@ #ifndef SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX #define SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX -#include <boost/scoped_ptr.hpp> - #include <vcl/ctrl.hxx> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XToolbarController.hpp> #include <map> - +#include <svx/sidebar/PanelLayout.hxx> namespace css = ::com::sun::star; namespace cssu = ::com::sun::star::uno; @@ -38,7 +36,7 @@ namespace svx { namespace sidebar { /** This panel provides buttons for inserting shapes into a document. */ class InsertPropertyPanel - : public Control + : public PanelLayout { public: InsertPropertyPanel ( @@ -47,10 +45,8 @@ public: virtual ~InsertPropertyPanel (void); private: - ::boost::scoped_ptr<Window> mpStandardShapesBackground; - ::boost::scoped_ptr<ToolBox> mpStandardShapesToolBox; - ::boost::scoped_ptr<Window> mpCustomShapesBackground; - ::boost::scoped_ptr<ToolBox> mpCustomShapesToolBox; + ToolBox* mpStandardShapesToolBox; + ToolBox* mpCustomShapesToolBox; const cssu::Reference<css::frame::XFrame> mxFrame; DECL_LINK(WindowEventListener, VclSimpleEvent*); diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.src b/svx/source/sidebar/insert/InsertPropertyPanel.src deleted file mode 100644 index 5219eeded69e..000000000000 --- a/svx/source/sidebar/insert/InsertPropertyPanel.src +++ /dev/null @@ -1,142 +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 "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; - }; - }; - }; -}; diff --git a/svx/uiconfig/ui/sidebarinsert.ui b/svx/uiconfig/ui/sidebarinsert.ui new file mode 100644 index 000000000000..c58bb5990d6b --- /dev/null +++ b/svx/uiconfig/ui/sidebarinsert.ui @@ -0,0 +1,256 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkGrid" id="InsertPropertyPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_homogeneous">True</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkToolbar" id="standardshapes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkToolButton" id="line"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Line</property> + <property name="tooltip_text" translatable="yes">Line</property> + <property name="action_name">.uno:Line</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="arrow"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Line ends with Arrow</property> + <property name="tooltip_text" translatable="yes">Line ends with Arrow</property> + <property name="action_name">.uno:LineArrowEnd</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="rectangle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Rectangle</property> + <property name="tooltip_text" translatable="yes">Rectangle</property> + <property name="action_name">.uno:Rect</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="ellipse"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Ellipse</property> + <property name="tooltip_text" translatable="yes">Ellipse</property> + <property name="action_name">.uno:Ellipse</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="text"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Text (F2)</property> + <property name="tooltip_text" translatable="yes">Text (F2)</property> + <property name="action_name">.uno:Text</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="curve"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Curve</property> + <property name="tooltip_text" translatable="yes">Curve</property> + <property name="action_name">.uno:LineToolbox</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="connector"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Connector</property> + <property name="tooltip_text" translatable="yes">Connector</property> + <property name="action_name">.uno:ConnectorToolbox</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="linearrow"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Lines and Arrows</property> + <property name="tooltip_text" translatable="yes">Lines and Arrows</property> + <property name="action_name">.uno:ArrowsToolbox</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="customshapes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">6</property> + <child> + <object class="GtkMenuToolButton" id="basicshapes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Basic Shapes</property> + <property name="tooltip_text" translatable="yes">Basic Shapes</property> + <property name="action_name">.uno:BasicShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="symbolshapes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Symbol Shapes</property> + <property name="tooltip_text" translatable="yes">Symbol Shapes</property> + <property name="action_name">.uno:SymbolShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="blockarrows"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Block Arrows</property> + <property name="tooltip_text" translatable="yes">Block Arrows</property> + <property name="action_name">.uno:ArrowShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="flowcharts"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Flowcharts</property> + <property name="tooltip_text" translatable="yes">Flowcharts</property> + <property name="action_name">.uno:FlowChartShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="callouts"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Callouts</property> + <property name="tooltip_text" translatable="yes">Callouts</property> + <property name="action_name">.uno:CalloutShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="stars"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Stars</property> + <property name="tooltip_text" translatable="yes">Stars</property> + <property name="action_name">.uno:StarShapes</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> +</interface> |