Lines 73-83
Link Here
|
73 |
|
73 |
|
74 |
class SfxModelessDialog_Impl : public SfxListener |
74 |
class SfxModelessDialog_Impl : public SfxListener |
75 |
{ |
75 |
{ |
|
|
76 |
|
76 |
public: |
77 |
public: |
77 |
ByteString aWinState; |
78 |
ByteString aWinState; |
78 |
SfxChildWindow* pMgr; |
79 |
SfxChildWindow* pMgr; |
79 |
BOOL bConstructed; |
80 |
BOOL bConstructed; |
80 |
void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); |
81 |
void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); |
|
|
82 |
|
83 |
Timer aMoveTimer; |
84 |
|
81 |
}; |
85 |
}; |
82 |
|
86 |
|
83 |
void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) |
87 |
void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) |
Lines 100-105
Link Here
|
100 |
SfxChildWindow* pMgr; |
104 |
SfxChildWindow* pMgr; |
101 |
BOOL bConstructed; |
105 |
BOOL bConstructed; |
102 |
void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); |
106 |
void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); |
|
|
107 |
|
108 |
Timer aMoveTimer; |
109 |
|
103 |
}; |
110 |
}; |
104 |
|
111 |
|
105 |
void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) |
112 |
void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) |
Lines 315-327
Link Here
|
315 |
ModelessDialog::Resize(); |
322 |
ModelessDialog::Resize(); |
316 |
if ( pImp->bConstructed && pImp->pMgr ) |
323 |
if ( pImp->bConstructed && pImp->pMgr ) |
317 |
{ |
324 |
{ |
318 |
if ( !IsRollUp() ) |
325 |
// start timer for saving window status information |
319 |
aSize = GetSizePixel(); |
326 |
pImp->aMoveTimer.Start(); |
320 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
|
|
321 |
if ( GetStyle() & WB_SIZEABLE ) |
322 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
323 |
pImp->aWinState = GetWindowState( nMask ); |
324 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
325 |
} |
327 |
} |
326 |
} |
328 |
} |
327 |
|
329 |
|
Lines 330-343
Link Here
|
330 |
ModelessDialog::Move(); |
332 |
ModelessDialog::Move(); |
331 |
if ( pImp->bConstructed && pImp->pMgr && IsReallyVisible() ) |
333 |
if ( pImp->bConstructed && pImp->pMgr && IsReallyVisible() ) |
332 |
{ |
334 |
{ |
|
|
335 |
// start timer for saving window status information |
336 |
pImp->aMoveTimer.Start(); |
337 |
} |
338 |
} |
339 |
|
340 |
IMPL_LINK( SfxModelessDialog, TimerHdl, Timer*, EMPTYARG) |
341 |
/* |
342 |
Implements a timer event that is triggered by a move or resize of the window |
343 |
This will save config information to Views.xcu with a small delay |
344 |
*/ |
345 |
{ |
346 |
pImp->aMoveTimer.Stop(); |
347 |
if ( pImp->bConstructed && pImp->pMgr ) |
348 |
{ |
349 |
if ( !IsRollUp() ) |
350 |
aSize = GetSizePixel(); |
333 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
351 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
334 |
if ( GetStyle() & WB_SIZEABLE ) |
352 |
if ( GetStyle() & WB_SIZEABLE ) |
335 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
353 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
336 |
pImp->aWinState = GetWindowState( nMask ); |
354 |
pImp->aWinState = GetWindowState( nMask ); |
337 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
355 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
338 |
} |
356 |
} |
|
|
357 |
return 0; |
339 |
} |
358 |
} |
340 |
|
359 |
|
|
|
360 |
|
341 |
// ----------------------------------------------------------------------- |
361 |
// ----------------------------------------------------------------------- |
342 |
|
362 |
|
343 |
SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, |
363 |
SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, |
Lines 354-359
Link Here
|
354 |
SetUniqueId( nId ); |
374 |
SetUniqueId( nId ); |
355 |
if ( pBindinx ) |
375 |
if ( pBindinx ) |
356 |
pImp->StartListening( *pBindinx ); |
376 |
pImp->StartListening( *pBindinx ); |
|
|
377 |
pImp->aMoveTimer.SetTimeout(50); |
378 |
pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxModelessDialog,TimerHdl)); |
357 |
} |
379 |
} |
358 |
|
380 |
|
359 |
// ----------------------------------------------------------------------- |
381 |
// ----------------------------------------------------------------------- |
Lines 372-377
Link Here
|
372 |
SetUniqueId( nId ); |
394 |
SetUniqueId( nId ); |
373 |
if ( pBindinx ) |
395 |
if ( pBindinx ) |
374 |
pImp->StartListening( *pBindinx ); |
396 |
pImp->StartListening( *pBindinx ); |
|
|
397 |
pImp->aMoveTimer.SetTimeout(50); |
398 |
pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxModelessDialog,TimerHdl)); |
375 |
} |
399 |
} |
376 |
|
400 |
|
377 |
// ----------------------------------------------------------------------- |
401 |
// ----------------------------------------------------------------------- |
Lines 538-543
Link Here
|
538 |
SetUniqueId( nId ); |
562 |
SetUniqueId( nId ); |
539 |
if ( pBindinx ) |
563 |
if ( pBindinx ) |
540 |
pImp->StartListening( *pBindinx ); |
564 |
pImp->StartListening( *pBindinx ); |
|
|
565 |
pImp->aMoveTimer.SetTimeout(50); |
566 |
pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxFloatingWindow,TimerHdl)); |
567 |
|
541 |
} |
568 |
} |
542 |
|
569 |
|
543 |
// ----------------------------------------------------------------------- |
570 |
// ----------------------------------------------------------------------- |
Lines 557-562
Link Here
|
557 |
SetUniqueId( nId ); |
584 |
SetUniqueId( nId ); |
558 |
if ( pBindinx ) |
585 |
if ( pBindinx ) |
559 |
pImp->StartListening( *pBindinx ); |
586 |
pImp->StartListening( *pBindinx ); |
|
|
587 |
pImp->aMoveTimer.SetTimeout(50); |
588 |
pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxFloatingWindow,TimerHdl)); |
589 |
|
560 |
} |
590 |
} |
561 |
|
591 |
|
562 |
//------------------------------------------------------------------------- |
592 |
//------------------------------------------------------------------------- |
Lines 614-626
Link Here
|
614 |
FloatingWindow::Resize(); |
644 |
FloatingWindow::Resize(); |
615 |
if ( pImp->bConstructed && pImp->pMgr ) |
645 |
if ( pImp->bConstructed && pImp->pMgr ) |
616 |
{ |
646 |
{ |
617 |
if ( !IsRollUp() ) |
647 |
// start timer for saving window status information |
618 |
aSize = GetSizePixel(); |
648 |
pImp->aMoveTimer.Start(); |
619 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
|
|
620 |
if ( GetStyle() & WB_SIZEABLE ) |
621 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
622 |
pImp->aWinState = GetWindowState( nMask ); |
623 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
624 |
} |
649 |
} |
625 |
} |
650 |
} |
626 |
|
651 |
|
Lines 629-642
Link Here
|
629 |
FloatingWindow::Move(); |
654 |
FloatingWindow::Move(); |
630 |
if ( pImp->bConstructed && pImp->pMgr ) |
655 |
if ( pImp->bConstructed && pImp->pMgr ) |
631 |
{ |
656 |
{ |
|
|
657 |
// start timer for saving window status information |
658 |
pImp->aMoveTimer.Start(); |
659 |
} |
660 |
} |
661 |
|
662 |
IMPL_LINK( SfxFloatingWindow, TimerHdl, Timer*, EMPTYARG) |
663 |
/* |
664 |
Implements a timer event that is triggered by a move or resize of the window |
665 |
This will save config information to Views.xcu with a small delay |
666 |
*/ |
667 |
{ |
668 |
pImp->aMoveTimer.Stop(); |
669 |
if ( pImp->bConstructed && pImp->pMgr ) |
670 |
{ |
671 |
if ( !IsRollUp() ) |
672 |
aSize = GetSizePixel(); |
632 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
673 |
ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; |
633 |
if ( GetStyle() & WB_SIZEABLE ) |
674 |
if ( GetStyle() & WB_SIZEABLE ) |
634 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
675 |
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); |
635 |
pImp->aWinState = GetWindowState( nMask ); |
676 |
pImp->aWinState = GetWindowState( nMask ); |
636 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
677 |
GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); |
637 |
} |
678 |
} |
|
|
679 |
return 0; |
638 |
} |
680 |
} |
639 |
|
681 |
|
|
|
682 |
|
640 |
//------------------------------------------------------------------------- |
683 |
//------------------------------------------------------------------------- |
641 |
void SfxFloatingWindow::StateChanged( StateChangedType nStateChange ) |
684 |
void SfxFloatingWindow::StateChanged( StateChangedType nStateChange ) |
642 |
{ |
685 |
{ |