summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-12-16 14:07:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-12-17 12:35:54 +0000
commit48c15285c52f6554f1aadab6068c076c2139ef89 (patch)
tree35360eb56a9177528d0de813e20bc5bdc1454a79 /sfx2
parentf4804a6cf1fa2a1941f43829a9801638bd456e2c (diff)
implement loading docking windows from .ui format
Change-Id: I90375232aefbe40412614ca0f30ba467cf393f2e
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/dockwin.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index b5fabebb2faf..80839b3cd101 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -943,7 +943,53 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
pImp->aMoveIdle.SetIdleHdl(LINK(this,SfxDockingWindow,TimerHdl));
}
+SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
+ vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription)
+ : DockingWindow(pParent, rID, rUIXMLDescription)
+ , pBindings(pBindinx)
+ , pMgr(pCW)
+ , pImp(NULL)
+
+/* [Description]
+ Constructor for the SfxDockingWindow class. A SfxChildWindow will be
+ required because the docking is implemented in Sfx through SfxChildWindows.
+*/
+{
+ if ( !GetHelpId().isEmpty() )
+ {
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
+ }
+ else
+ {
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame();
+ SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool();
+ const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() );
+ if ( pSlot )
+ {
+ OString aCmd("SFXDOCKINGWINDOW_");
+ aCmd += pSlot->GetUnoName();
+ SetUniqueId( aCmd );
+ }
+ }
+
+ pImp = new SfxDockingWindow_Impl;
+ pImp->bConstructed = false;
+ pImp->pSplitWin = 0;
+ pImp->bEndDocked = false;
+ pImp->bDockingPrevented = false;
+
+ pImp->bSplitable = true;
+
+ // Initially set to default, the alignment is set in the subclass
+ pImp->nLine = pImp->nDockLine = 0;
+ pImp->nPos = pImp->nDockPos = 0;
+ pImp->bNewLine = false;
+ pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT);
+ pImp->aMoveIdle.SetPriority(VCL_IDLE_PRIORITY_RESIZE);
+ pImp->aMoveIdle.SetIdleHdl(LINK(this,SfxDockingWindow,TimerHdl));
+}
void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
/* [Description]
@@ -1162,6 +1208,9 @@ void SfxDockingWindow::Initialize_Impl()
// trick: use VCL method SetWindowState to adjust position and size
pFloatWin->SetWindowState( pImp->aWinState );
+ Size aSize(pFloatWin->GetSizePixel());
+ pFloatWin->set_width_request(aSize.Width());
+ pFloatWin->set_height_request(aSize.Height());
// remember floating size for calculating alignment and tracking rectangle
SetFloatingSize( pFloatWin->GetSizePixel() );