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

weld DbRegistrationOptionsPage

Change-Id: I88c1129f50d9f9cbef9970f1a9453641fc87e8fd
Reviewed-on: https://gerrit.libreoffice.org/69135
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 87432474
......@@ -263,9 +263,6 @@
#define RID_SVXSTR_ERROR_TYPE_LABEL NC_("RID_SVXSTR_ERROR_TYPE_LABEL", "Type:")
#define RID_SVXSTR_ERROR_MESSAGE_LABEL NC_("RID_SVXSTR_ERROR_MESSAGE_LABEL", "Message:")
#define RID_SVXSTR_TYPE NC_("RID_SVXSTR_TYPE", "Registered name")
#define RID_SVXSTR_PATH NC_("RID_SVXSTR_PATH", "Database file")
//abbreviation for "[Load]"
#define RID_SVXSTR_HEADER1 NC_("RID_SVXSTR_HEADER1", "[L]")
//abbreviation for "[Save]"
......
......@@ -38,27 +38,24 @@ namespace svx
class DbRegistrationOptionsPage : public SfxTabPage
{
private:
VclPtr<SvSimpleTableContainer> m_pPathCtrl;
VclPtr<PushButton> m_pNew;
VclPtr<PushButton> m_pEdit;
VclPtr<PushButton> m_pDelete;
VclPtr<svx::OptHeaderTabListBox> m_pPathBox;
SvTreeListEntry* m_pCurEntry;
sal_uLong m_nOldCount;
bool m_bModified;
DECL_LINK( NewHdl, Button*, void );
DECL_LINK( EditHdl, Button*, void );
DECL_LINK( DeleteHdl, Button*, void );
DECL_LINK( PathBoxDoubleClickHdl, SvTreeListBox*, bool);
std::unique_ptr<weld::Button> m_xNew;
std::unique_ptr<weld::Button> m_xEdit;
std::unique_ptr<weld::Button> m_xDelete;
std::unique_ptr<weld::TreeView> m_xPathBox;
std::unique_ptr<weld::TreeIter> m_xIter;
DECL_LINK( PathSelect_Impl, SvTreeListBox*, void);
DECL_LINK( NewHdl, weld::Button&, void );
DECL_LINK( EditHdl, weld::Button&, void );
DECL_LINK( DeleteHdl, weld::Button&, void );
DECL_LINK( PathBoxDoubleClickHdl, weld::TreeView&, void);
DECL_LINK( HeaderSelect_Impl, HeaderBar *, void );
DECL_LINK( HeaderEndDrag_Impl, HeaderBar *, void );
DECL_LINK( NameValidator, const OUString&, bool);
DECL_LINK( PathSelect_Impl, weld::TreeView&, void);
DECL_LINK( HeaderSelect_Impl, int, void );
DECL_LINK( NameValidator, const OUString&, bool);
/** inserts a new entry in the tablistbox
@param _sName
......@@ -69,17 +66,17 @@ namespace svx
void insertNewEntry( const OUString& _sName,const OUString& _sLocation, const bool bReadOnly );
/** opens the LinkDialog to create a register pair
@param _sOldName
@param sOldName
The old name of the entry may be empty.
@param _sOldLocation
@param sOldLocation
The old location of the entry may be empty.
@param _pEntry
@param nEntry
The entry to remove if the entry will be changed
*/
void openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry const * _pEntry = nullptr);
void openLinkDialog(const OUString& sOldName, const OUString& sOldLocation, int nEntry = -1);
public:
DbRegistrationOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
DbRegistrationOptionsPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~DbRegistrationOptionsPage() override;
virtual void dispose() override;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkTreeStore" id="liststore3">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name text2 -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkGrid" id="DbRegisterPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -36,13 +45,56 @@
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="svtlo-SvSimpleTableContainer" id="pathctrl">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Simple Table Container-selection1"/>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="pathctrl">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore3</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection2"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="resizable">True</property>
<property name="spacing">6</property>
<property name="title" translatable="yes" context="dbregisterpage|type">Registered name</property>
<property name="clickable">True</property>
<property name="reorderable">True</property>
<property name="sort_indicator">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
<property name="resizable">True</property>
<property name="spacing">6</property>
<property name="title" translatable="yes" context="dbregisterpage|path">Database file</property>
<property name="clickable">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer2"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
......@@ -56,6 +108,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="spacing">3</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="new">
......@@ -124,8 +177,6 @@
<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>
......
......@@ -2266,6 +2266,9 @@ public:
virtual int get_column_width(int nColumn) const override
{
LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
return pHeaderBar->GetItemSize(pHeaderBar->GetItemId(nColumn));
// GetTab(0) gives the position of the bitmap which is automatically inserted by the TabListBox.
// So the first text column's width is Tab(2)-Tab(1).
auto nWidthPixel = m_xTreeView->GetLogicTab(nColumn + 2) - m_xTreeView->GetLogicTab(nColumn + 1);
......
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