summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/AllLangResTarget_sc.mk1
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx28
-rw-r--r--sc/source/ui/formdlg/dwfunctr.hrc25
-rw-r--r--sc/source/ui/formdlg/dwfunctr.src92
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx9
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/functionpanel.ui127
8 files changed, 147 insertions, 138 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index 9708c7babd92..6674502e39cb 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/miscdlgs/retypepassdlg.src \
sc/source/ui/miscdlgs/conflictsdlg.src \
sc/source/ui/miscdlgs/acredlin.src \
- sc/source/ui/formdlg/dwfunctr.src \
sc/source/ui/sidebar/CellAppearancePropertyPanel.src \
sc/source/ui/StatisticsDialogs/StatisticsDialogs.src \
sc/source/core/src/compiler.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 5008729fb3d0..d50164b6073f 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -127,6 +127,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/formulacalculationoptions \
sc/uiconfig/scalc/ui/floatingborderstyle \
sc/uiconfig/scalc/ui/floatinglinestyle \
+ sc/uiconfig/scalc/ui/functionpanel \
sc/uiconfig/scalc/ui/goalseekdlg \
sc/uiconfig/scalc/ui/groupdialog \
sc/uiconfig/scalc/ui/groupbydate \
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 772267c0d64e..a853c986d65e 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -36,7 +36,6 @@
#include "appoptio.hxx"
#include "compiler.hxx"
-#include "dwfunctr.hrc"
#include "dwfunctr.hxx"
/*************************************************************************
@@ -53,17 +52,16 @@
#*
#************************************************************************/
-ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const ResId& rResId) :
- vcl::Window(pParent, rResId),
- aCatBox ( VclPtr<ListBox>::Create( this, ResId( CB_CAT, *rResId.GetResMgr() ) ) ),
- aFuncList ( VclPtr<ListBox>::Create( this, ResId( LB_FUNC, *rResId.GetResMgr() ) ) ),
- aInsertButton ( VclPtr<ImageButton>::Create( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ) ),
- aFiFuncDesc ( VclPtr<FixedText>::Create( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ) ),
- pFuncDesc (nullptr)
+ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame)
+ : PanelLayout(pParent, "FunctionPanel", "modules/scalc/ui/functionpanel.ui", rFrame)
+ , pFuncDesc(nullptr)
{
- FreeResource();
+ get(aCatBox, "category");
+ get(aFuncList, "funclist");
+ get(aInsertButton, "insert");
+ get(aFiFuncDesc, "funcdesc");
+
InitLRUList();
- SetStyle(GetStyle()|WB_CLIPCHILDREN);
aFiFuncDesc->SetUpdateMode(true);
nArgs=0;
@@ -106,11 +104,11 @@ ScFunctionWin::~ScFunctionWin()
void ScFunctionWin::dispose()
{
- aCatBox.disposeAndClear();
- aFuncList.disposeAndClear();
- aInsertButton.disposeAndClear();
- aFiFuncDesc.disposeAndClear();
- vcl::Window::dispose();
+ aCatBox.clear();
+ aFuncList.clear();
+ aInsertButton.clear();
+ aFiFuncDesc.clear();
+ PanelLayout::dispose();
}
/*************************************************************************
diff --git a/sc/source/ui/formdlg/dwfunctr.hrc b/sc/source/ui/formdlg/dwfunctr.hrc
deleted file mode 100644
index b025f13b2a4e..000000000000
--- a/sc/source/ui/formdlg/dwfunctr.hrc
+++ /dev/null
@@ -1,25 +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 CB_CAT 1
-#define LB_FUNC 2
-#define IMB_INSERT 1
-#define FI_FUNCDESC 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/dwfunctr.src b/sc/source/ui/formdlg/dwfunctr.src
deleted file mode 100644
index 8c539e4be85f..000000000000
--- a/sc/source/ui/formdlg/dwfunctr.src
+++ /dev/null
@@ -1,92 +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 "sc.hrc"
-#include "dwfunctr.hrc"
-
-Window FID_FUNCTION_BOX
-{
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 130 , 160 ) ;
- HelpId = HID_FUNCTION_BOX ;
- ListBox CB_CAT
- {
- HelpID = "sc:ListBox:FID_FUNCTION_BOX:CB_CAT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 20 , 4 ) ;
- Size = MAP_APPFONT ( 56 , 80 ) ;
- DropDown = TRUE ;
- AutoSize = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- StringList [ en-US ] =
- {
- < "Last Used" ; Default ; > ;
- < "All" ; Default ; > ;
- < "Database" ; Default ; > ;
- < "Date&Time" ; Default ; > ;
- < "Financial" ; Default ; > ;
- < "Information" ; Default ; > ;
- < "Logical" ; Default ; > ;
- < "Mathematical" ; Default ; > ;
- < "Array" ; Default ; > ;
- < "Statistical" ; Default ; > ;
- < "Spreadsheet" ; Default ; > ;
- < "Text" ; Default ; > ;
- < "Add-in" ; Default ; > ;
- };
- };
- ListBox LB_FUNC
- {
- HelpID = "sc:ListBox:FID_FUNCTION_BOX:LB_FUNC";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 3 , 19 ) ;
- Size = MAP_APPFONT ( 72 , 90 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- };
- FixedText FI_FUNCDESC
- {
- WordBreak = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 3 , 115 ) ;
- Size = MAP_APPFONT ( 72 , 40 ) ;
- };
- ImageButton IMB_INSERT
- {
- HelpID = "sc:ImageButton:FID_FUNCTION_BOX:IMB_INSERT";
- Pos = MAP_APPFONT ( 3 , 4 ) ;
- Size = MAP_APPFONT ( 13 , 13 ) ;
- TabStop = TRUE ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "fx.png";
- };
- };
- DefButton = TRUE ;
- QuickHelpText [ en-US ] = "Insert Function into calculation sheet" ;
- };
- Text [ en-US ] = "Functions" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 7352bb51e807..f9dcd86e9787 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -26,22 +26,23 @@
#include <vcl/lstbox.hxx>
#include <vcl/button.hxx>
#include <vcl/combobox.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
#include "anyrefdg.hxx"
#include "global.hxx"
#include "privsplt.hxx"
#include "funcdesc.hxx"
-class ScFunctionWin : public vcl::Window
+class ScFunctionWin : public PanelLayout
{
private:
VclPtr<ListBox> aCatBox;
VclPtr<ListBox> aFuncList;
- VclPtr<ImageButton> aInsertButton;
+ VclPtr<PushButton> aInsertButton;
VclPtr<FixedText> aFiFuncDesc;
const ScFuncDesc* pFuncDesc;
- sal_uInt16 nArgs;
+ sal_uInt16 nArgs;
::std::vector< const formula::IFunctionDescription*> aLRUList;
@@ -55,7 +56,7 @@ private:
DECL_LINK( SelHdl, ListBox&, void );
public:
- ScFunctionWin(vcl::Window* pParent, const ResId& rResId);
+ ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame);
virtual ~ScFunctionWin() override;
virtual void dispose() override;
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 02a060e68e8f..7665ebfe874e 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -98,7 +98,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/FunctionsPanel"))
{
- pPanel = VclPtr<ScFunctionWin>::Create(pParentWindow, ScResId(FID_FUNCTION_BOX));
+ pPanel = VclPtr<ScFunctionWin>::Create(pParentWindow, xFrame);
nMinimumSize = 0;
}
diff --git a/sc/uiconfig/scalc/ui/functionpanel.ui b/sc/uiconfig/scalc/ui/functionpanel.ui
new file mode 100644
index 000000000000..6a6fb565aba0
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/functionpanel.ui
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">sc/res/fx.png</property>
+ </object>
+ <object class="GtkGrid" id="FunctionPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkButton" id="insert">
+ <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="tooltip_text" translatable="yes">Insert Function into calculation sheet</property>
+ <property name="image">image1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="category">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes">Last Used</item>
+ <item translatable="yes">All</item>
+ <item translatable="yes">Database</item>
+ <item translatable="yes">Date&amp;Time</item>
+ <item translatable="yes">Financial</item>
+ <item translatable="yes">Information</item>
+ <item translatable="yes">Logical</item>
+ <item translatable="yes">Mathematical</item>
+ <item translatable="yes">Array</item>
+ <item translatable="yes">Statistical</item>
+ <item translatable="yes">Spreadsheet</item>
+ <item translatable="yes">Text</item>
+ <item translatable="yes">Add-in</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTreeView" id="funclist">
+ <property name="name">functions</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="funcdesc">
+ <property name="name">funcdesc</property>
+ <property name="width_request">0</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">label</property>
+ <property name="wrap">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>