diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-18 13:00:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-20 13:52:34 +0200 |
commit | 8947c9b1d8cd407131fdfb6fc3c77c8532e9d2a0 (patch) | |
tree | f47becc099d139ae601fc41d9e8f49f24672f0e0 /vcl | |
parent | b361413eef7e46f340d921708faca9986c63c9f8 (diff) |
weld SchAttribTabDlg
Change-Id: Ia53547b7b42a3ff8848085ab8f8d214259d5cc7b
Reviewed-on: https://gerrit.libreoffice.org/61959
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 23 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 16 |
2 files changed, 39 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index c0967e15f66a..00f31f36f702 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1025,6 +1025,8 @@ class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::No private: VclPtr<TabControl> m_xNotebook; mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages; + std::vector<VclPtr<TabPage>> m_aAddedPages; + std::vector<VclPtr<VclGrid>> m_aAddedGrids; DECL_LINK(DeactivatePageHdl, TabControl*, bool); DECL_LINK(ActivatePageHdl, TabControl*, void); @@ -1078,6 +1080,23 @@ public: m_xNotebook->RemovePage(m_xNotebook->GetPageId(rIdent)); } + virtual void append_page(const OString& rIdent, const OUString& rLabel) override + { + sal_uInt16 nNewPageCount = m_xNotebook->GetPageCount() + 1; + sal_uInt16 nNewPageId = nNewPageCount; + m_xNotebook->InsertPage(nNewPageId, rLabel); + VclPtrInstance<TabPage> xPage(m_xNotebook); + VclPtrInstance<VclGrid> xGrid(xPage); + xPage->Show(); + xGrid->set_hexpand(true); + xGrid->set_vexpand(true); + xGrid->Show(); + m_xNotebook->SetTabPage(nNewPageId, xPage); + m_xNotebook->SetPageName(nNewPageId, rIdent); + m_aAddedPages.push_back(xPage); + m_aAddedGrids.push_back(xGrid); + } + virtual int get_n_pages() const override { return m_xNotebook->GetPageCount(); @@ -1090,6 +1109,10 @@ public: virtual ~SalInstanceNotebook() override { + for (auto &rGrid : m_aAddedGrids) + rGrid.disposeAndClear(); + for (auto &rPage : m_aAddedPages) + rPage.disposeAndClear(); m_xNotebook->SetActivatePageHdl(Link<TabControl*,void>()); m_xNotebook->SetDeactivatePageHdl(Link<TabControl*,bool>()); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index f43d6dc46da4..13c1f3b49c96 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2937,6 +2937,22 @@ public: enable_notify_events(); } + virtual void append_page(const OString& rIdent, const OUString& rLabel) override + { + disable_notify_events(); + + GtkWidget *pTabWidget = gtk_label_new(MapToGtkAccelerator(rLabel).getStr()); + gtk_buildable_set_name(GTK_BUILDABLE(pTabWidget), rIdent.getStr()); + + GtkWidget *pChild = gtk_grid_new(); + gtk_notebook_append_page(m_pNotebook, pChild, pTabWidget); + gtk_widget_show_all(pChild); + gtk_widget_show_all(pTabWidget); + + update_tab_pos(); + enable_notify_events(); + } + virtual ~GtkInstanceNotebook() override { g_signal_handler_disconnect(m_pNotebook, m_nSwitchPageSignalId); |