summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-29 12:35:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-29 12:38:02 +0000
commit9a19ef1a041d708f64cc20364b99d929ed01c406 (patch)
tree8a9b058f320808f7a285b00c984baa41f95b98f1
parentfdbb10a0e3f1e36cc28ea5547e08e6ad4b5de526 (diff)
make the options dialog layout incrementally convertable to .ui
it will now allocate the fixed reserved size for its tab pages to layout-enabled tabpages Change-Id: I5e56a09c5febc702d194f18954fd249bcd366dd9
-rw-r--r--cui/source/inc/treeopt.hxx2
-rw-r--r--cui/source/options/treeopt.cxx20
-rw-r--r--vcl/inc/vcl/tabpage.hxx4
3 files changed, 20 insertions, 6 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 05321b2d47f9..ee6fa4069664 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -186,6 +186,8 @@ private:
VectorOfNodes LoadNodes( Module* pModule, const rtl::OUString& rExtensionId );
void InsertNodes( const VectorOfNodes& rNodeList );
+ void SetPaneSize(Window *pPane);
+
protected:
DECL_LINK(ExpandedHdl_Impl, SvTreeListBox* );
DECL_LINK(ShowPageHdl_Impl, void *);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 5227729d81bf..aafbc6838369 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -913,6 +913,18 @@ long OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
}
// --------------------------------------------------------------------
+void OfaTreeOptionsDialog::SetPaneSize(Window *pPane)
+{
+ //The OfaTreeOptionsDialog is not fully widget layout enabled
+ //yet so it's a classic fixed dimension dialog, but to make
+ //it possible to incrementally convert it over each pane
+ //can be converted to .ui layout format and the fixed area
+ //size reserved for panes is allocated to them here
+ Point aPos(aSeparatorFL.GetPosPixel().X(), aTreeLB.GetPosPixel().Y());
+ Size aSize(aSeparatorFL.GetSizePixel().Width(),
+ aSeparatorFL.GetPosPixel().Y() - aTreeLB.GetPosPixel().Y());
+ pPane->SetPosSizePixel( aPos, aSize );
+}
void OfaTreeOptionsDialog::SelectHdl_Impl()
{
@@ -1050,6 +1062,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet);
+
}
DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
@@ -1069,6 +1082,8 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
{
pPageInfo->m_pPage->Reset( *pGroupInfo->m_pInItemSet );
}
+ if (pPageInfo->m_pPage->isLayoutEnabled())
+ SetPaneSize(pPageInfo->m_pPage);
}
}
else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_pExtPage )
@@ -1085,10 +1100,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
pPageInfo->m_pExtPage = new ExtensionsTabPage(
this, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
- Point aPos(aSeparatorFL.GetPosPixel().X(), aTreeLB.GetPosPixel().Y());
- Size aSize(aSeparatorFL.GetSizePixel().Width(),
- aSeparatorFL.GetPosPixel().Y() - aTreeLB.GetPosPixel().Y());
- pPageInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
+ SetPaneSize(pPageInfo->m_pExtPage);
}
if ( pPageInfo->m_pPage )
diff --git a/vcl/inc/vcl/tabpage.hxx b/vcl/inc/vcl/tabpage.hxx
index 67a346930d9b..1aa4b91a778b 100644
--- a/vcl/inc/vcl/tabpage.hxx
+++ b/vcl/inc/vcl/tabpage.hxx
@@ -38,8 +38,6 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- bool isLayoutEnabled() const;
-
public:
TabPage( Window* pParent, WinBits nStyle = 0 );
TabPage(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription);
@@ -55,6 +53,8 @@ public:
virtual void ActivatePage();
virtual void DeactivatePage();
+ bool isLayoutEnabled() const;
+
//To-Do, consider inheriting from VclContainer
virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
virtual void SetPosPixel(const Point& rNewPos);