convert function panel to .ui format

Change-Id: I79e069aa9bd15642d969d5829a5ad2fa2d264d6c
This commit is contained in:
Caolán McNamara 2016-10-23 20:55:26 +01:00
parent d02e96e0f2
commit a2ba500c70
8 changed files with 147 additions and 138 deletions

View File

@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/miscdlgs/retypepassdlg.src \ sc/source/ui/miscdlgs/retypepassdlg.src \
sc/source/ui/miscdlgs/conflictsdlg.src \ sc/source/ui/miscdlgs/conflictsdlg.src \
sc/source/ui/miscdlgs/acredlin.src \ sc/source/ui/miscdlgs/acredlin.src \
sc/source/ui/formdlg/dwfunctr.src \
sc/source/ui/sidebar/CellAppearancePropertyPanel.src \ sc/source/ui/sidebar/CellAppearancePropertyPanel.src \
sc/source/ui/StatisticsDialogs/StatisticsDialogs.src \ sc/source/ui/StatisticsDialogs/StatisticsDialogs.src \
sc/source/core/src/compiler.src \ sc/source/core/src/compiler.src \

View File

@ -127,6 +127,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/formulacalculationoptions \ sc/uiconfig/scalc/ui/formulacalculationoptions \
sc/uiconfig/scalc/ui/floatingborderstyle \ sc/uiconfig/scalc/ui/floatingborderstyle \
sc/uiconfig/scalc/ui/floatinglinestyle \ sc/uiconfig/scalc/ui/floatinglinestyle \
sc/uiconfig/scalc/ui/functionpanel \
sc/uiconfig/scalc/ui/goalseekdlg \ sc/uiconfig/scalc/ui/goalseekdlg \
sc/uiconfig/scalc/ui/groupdialog \ sc/uiconfig/scalc/ui/groupdialog \
sc/uiconfig/scalc/ui/groupbydate \ sc/uiconfig/scalc/ui/groupbydate \

View File

@ -36,7 +36,6 @@
#include "appoptio.hxx" #include "appoptio.hxx"
#include "compiler.hxx" #include "compiler.hxx"
#include "dwfunctr.hrc"
#include "dwfunctr.hxx" #include "dwfunctr.hxx"
/************************************************************************* /*************************************************************************
@ -53,17 +52,16 @@
#* #*
#************************************************************************/ #************************************************************************/
ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const ResId& rResId) : ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame)
vcl::Window(pParent, rResId), : PanelLayout(pParent, "FunctionPanel", "modules/scalc/ui/functionpanel.ui", rFrame)
aCatBox ( VclPtr<ListBox>::Create( this, ResId( CB_CAT, *rResId.GetResMgr() ) ) ), , pFuncDesc(nullptr)
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)
{ {
FreeResource(); get(aCatBox, "category");
get(aFuncList, "funclist");
get(aInsertButton, "insert");
get(aFiFuncDesc, "funcdesc");
InitLRUList(); InitLRUList();
SetStyle(GetStyle()|WB_CLIPCHILDREN);
aFiFuncDesc->SetUpdateMode(true); aFiFuncDesc->SetUpdateMode(true);
nArgs=0; nArgs=0;
@ -106,11 +104,11 @@ ScFunctionWin::~ScFunctionWin()
void ScFunctionWin::dispose() void ScFunctionWin::dispose()
{ {
aCatBox.disposeAndClear(); aCatBox.clear();
aFuncList.disposeAndClear(); aFuncList.clear();
aInsertButton.disposeAndClear(); aInsertButton.clear();
aFiFuncDesc.disposeAndClear(); aFiFuncDesc.clear();
vcl::Window::dispose(); PanelLayout::dispose();
} }
/************************************************************************* /*************************************************************************

View File

@ -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: */

View File

@ -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: */

View File

@ -26,19 +26,20 @@
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/combobox.hxx> #include <vcl/combobox.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include "anyrefdg.hxx" #include "anyrefdg.hxx"
#include "global.hxx" #include "global.hxx"
#include "privsplt.hxx" #include "privsplt.hxx"
#include "funcdesc.hxx" #include "funcdesc.hxx"
class ScFunctionWin : public vcl::Window class ScFunctionWin : public PanelLayout
{ {
private: private:
VclPtr<ListBox> aCatBox; VclPtr<ListBox> aCatBox;
VclPtr<ListBox> aFuncList; VclPtr<ListBox> aFuncList;
VclPtr<ImageButton> aInsertButton; VclPtr<PushButton> aInsertButton;
VclPtr<FixedText> aFiFuncDesc; VclPtr<FixedText> aFiFuncDesc;
const ScFuncDesc* pFuncDesc; const ScFuncDesc* pFuncDesc;
sal_uInt16 nArgs; sal_uInt16 nArgs;
@ -55,7 +56,7 @@ private:
DECL_LINK( SelHdl, ListBox&, void ); DECL_LINK( SelHdl, ListBox&, void );
public: public:
ScFunctionWin(vcl::Window* pParent, const ResId& rResId); ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame);
virtual ~ScFunctionWin() override; virtual ~ScFunctionWin() override;
virtual void dispose() override; virtual void dispose() override;

View File

@ -98,7 +98,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
} }
else if (rsResourceURL.endsWith("/FunctionsPanel")) else if (rsResourceURL.endsWith("/FunctionsPanel"))
{ {
pPanel = VclPtr<ScFunctionWin>::Create(pParentWindow, ScResId(FID_FUNCTION_BOX)); pPanel = VclPtr<ScFunctionWin>::Create(pParentWindow, xFrame);
nMinimumSize = 0; nMinimumSize = 0;
} }

View File

@ -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>