Kaydet (Commit) ecca9307 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert impress table design panel to .ui

Change-Id: I4ed28ad5ba94c055fbab51148d9258624dcfdb14
üst e34263af
......@@ -281,6 +281,9 @@
<glade-widget-class title="ValueSet" name="swuilo-ColumnValueSet"
generic-name="Set of Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="TableValueSet" name="sdlo-TableValueSet"
generic-name="Set of Table Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="CsvTableBox" name="sclo-ScCsvTableBox"
generic-name="CSV Table Box" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......
......@@ -338,6 +338,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/sidebar/RecentlyUsedMasterPages \
sd/source/ui/sidebar/RecentMasterPagesSelector \
sd/source/ui/sidebar/SlideTransitionPanel \
sd/source/ui/sidebar/TableDesignPanel \
sd/source/ui/slideshow/PaneHider \
sd/source/ui/slideshow/SlideShowRestarter \
sd/source/ui/slideshow/showwin \
......
......@@ -91,6 +91,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/prntopts \
sd/uiconfig/simpress/ui/sdviewpage \
sd/uiconfig/simpress/ui/slidetransitionspanel \
sd/uiconfig/simpress/ui/tabledesignpanel \
sd/uiconfig/simpress/ui/templatedialog \
))
......
......@@ -26,8 +26,9 @@
#include "RecentMasterPagesSelector.hxx"
#include "AllMasterPagesSelector.hxx"
#include "CustomAnimationPanel.hxx"
#include "SlideTransitionPanel.hxx"
#include "NavigatorWrapper.hxx"
#include "SlideTransitionPanel.hxx"
#include "TableDesignPanel.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
......@@ -40,10 +41,6 @@ using namespace cssu;
using namespace ::sd::framework;
using ::rtl::OUString;
namespace sd {
extern ::Window * createTableDesignPanel (::Window* pParent, ViewShellBase& rBase);
}
namespace sd { namespace sidebar {
namespace {
......@@ -181,7 +178,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
pControl = new SlideTransitionPanel(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
pControl = createTableDesignPanel(pParentWindow, *pBase);
pControl = new TableDesignPanel(pParentWindow, *pBase);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator))
pControl = new NavigatorWrapper(pParentWindow, *pBase, pBindings);
#undef EndsWith
......
......@@ -16,7 +16,6 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "precompiled_sd.hxx"
#include "TableDesignPanel.hxx"
......@@ -61,10 +60,11 @@ TableDesignPanel::~TableDesignPanel (void)
css::ui::LayoutSize TableDesignPanel::GetHeightForWidth (const sal_Int32 nWidth)
css::ui::LayoutSize TableDesignPanel::GetHeightForWidth (const sal_Int32 /*nWidth*/)
{
//TODO: make the sizes depend on the font size.
return css::ui::LayoutSize(350,-1, 400);
Window *pControl = mpWrappedControl.get();
sal_Int32 nMinimumHeight = pControl ? pControl->get_preferred_size().Height() : 0;
return css::ui::LayoutSize(nMinimumHeight,-1, nMinimumHeight);
}
} } // end of namespace sd::sidebar
......
......@@ -26,15 +26,14 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <svtools/valueset.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <boost/scoped_ptr.hpp>
#include "TableDesignPane.hrc"
namespace sd
{
......@@ -46,7 +45,26 @@ class ViewShellBase;
// --------------------------------------------------------------------
class TableDesignPane : public Control, public sfx2::sidebar::ILayoutableWindow
#define CB_HEADER_ROW 0
#define CB_TOTAL_ROW 1
#define CB_BANDED_ROWS 2
#define CB_FIRST_COLUMN 3
#define CB_LAST_COLUMN 4
#define CB_BANDED_COLUMNS 5
#define CB_COUNT CB_BANDED_COLUMNS-CB_HEADER_ROW+1
class TableValueSet : public ValueSet
{
private:
bool m_bModal;
public:
TableValueSet(Window *pParent, WinBits nStyle);
virtual void Resize();
void updateSettings();
void setModal(bool bModal) { m_bModal = bModal; }
};
class TableDesignPane : public PanelLayout
{
public:
TableDesignPane( ::Window* pParent, ViewShellBase& rBase, bool bModal );
......@@ -55,12 +73,6 @@ public:
// callbacks
void onSelectionChanged();
// Control
virtual void Resize();
// ILayoutableWindow
virtual ::com::sun::star::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth);
virtual void DataChanged( const DataChangedEvent& rDCEvt );
void ApplyOptions();
......@@ -72,7 +84,6 @@ public:
private:
void addListener();
void removeListener();
void updateLayout();
void updateControls();
void FillDesignPreviewControl();
......@@ -85,8 +96,8 @@ private:
ViewShellBase& mrBase;
const OUString msTableTemplate;
boost::scoped_ptr< Control > mxControls[DESIGNPANE_CONTROL_COUNT];
int mnOrgOffsetY[DESIGNPANE_CONTROL_COUNT];
TableValueSet* m_pValueSet;
CheckBox* m_aCheckBoxes[CB_COUNT];
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="TableDesignPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkGrid" id="grid1">
<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="GtkCheckButton" id="UseFirstRowStyle">
<property name="label" translatable="yes">_Header Row</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="UseLastRowStyle">
<property name="label" translatable="yes">Tot_al Row</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="UseBandingRowStyle">
<property name="label" translatable="yes">_Banded Rows</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="UseFirstColumnStyle">
<property name="label" translatable="yes">Fi_rst Column</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="UseLastColumnStyle">
<property name="label" translatable="yes">_Last Column</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="UseBandingColumnStyle">
<property name="label" translatable="yes">Ba_nded Columns</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="sdlo-TableValueSet" id="previews:border">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</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>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</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