Lines 1-5
Link Here
|
1 |
/************************************************************** |
1 |
/************************************************************** |
2 |
* |
2 |
* |
3 |
* Licensed to the Apache Software Foundation (ASF) under one |
3 |
* Licensed to the Apache Software Foundation (ASF) under one |
4 |
* or more contributor license agreements. See the NOTICE file |
4 |
* or more contributor license agreements. See the NOTICE file |
5 |
* distributed with this work for additional information |
5 |
* distributed with this work for additional information |
Lines 7-22
Link Here
|
7 |
* to you under the Apache License, Version 2.0 (the |
7 |
* to you under the Apache License, Version 2.0 (the |
8 |
* "License"); you may not use this file except in compliance |
8 |
* "License"); you may not use this file except in compliance |
9 |
* with the License. You may obtain a copy of the License at |
9 |
* with the License. You may obtain a copy of the License at |
10 |
* |
10 |
* |
11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
12 |
* |
12 |
* |
13 |
* Unless required by applicable law or agreed to in writing, |
13 |
* Unless required by applicable law or agreed to in writing, |
14 |
* software distributed under the License is distributed on an |
14 |
* software distributed under the License is distributed on an |
15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
16 |
* KIND, either express or implied. See the License for the |
16 |
* KIND, either express or implied. See the License for the |
17 |
* specific language governing permissions and limitations |
17 |
* specific language governing permissions and limitations |
18 |
* under the License. |
18 |
* under the License. |
19 |
* |
19 |
* |
20 |
*************************************************************/ |
20 |
*************************************************************/ |
21 |
|
21 |
|
22 |
|
22 |
|
Lines 61-69
using namespace ::rtl;
Link Here
|
61 |
struct SfxDock_Impl |
61 |
struct SfxDock_Impl |
62 |
{ |
62 |
{ |
63 |
sal_uInt16 nType; |
63 |
sal_uInt16 nType; |
64 |
SfxDockingWindow* pWin; // This window has SplitWindow |
64 |
SfxDockingWindow* pWin; // SplitWindow hat dieses Fenster |
65 |
sal_Bool bNewLine; |
65 |
sal_Bool bNewLine; |
66 |
sal_Bool bHide; // SplitWindow had this window |
66 |
sal_Bool bHide; // SplitWindow hatte dieses Fenster |
67 |
long nSize; |
67 |
long nSize; |
68 |
}; |
68 |
}; |
69 |
|
69 |
|
Lines 75-83
class SfxEmptySplitWin_Impl : public SplitWindow
Link Here
|
75 |
{ |
75 |
{ |
76 |
/* [Beschreibung] |
76 |
/* [Beschreibung] |
77 |
|
77 |
|
78 |
SfxEmptySplitWin_Impldow is an empty split window replacing the SfxSplitWindow |
78 |
Das SfxEmptySplitWin_Impldow ist ein leeres SplitWindow, das das SfxSplitWindow |
79 |
in AutoHide mode. It works as a placeholder to receive mouse MouseMoves. |
79 |
im AutoHide-Modus ersetzt. Es dient nur als Platzhalter, um MouseMoves |
80 |
the actual light split window display |
80 |
zu empfangen und ggf. das eigentlichte SplitWindow einzublenden |
81 |
*/ |
81 |
*/ |
82 |
friend class SfxSplitWindow; |
82 |
friend class SfxSplitWindow; |
83 |
|
83 |
|
Lines 154-162
void SfxEmptySplitWin_Impl::FadeIn()
Link Here
|
154 |
pOwner->Show_Impl(); |
154 |
pOwner->Show_Impl(); |
155 |
if ( bAutoHide ) |
155 |
if ( bAutoHide ) |
156 |
{ |
156 |
{ |
157 |
// Put timer to close; the caller must make sure it is, |
157 |
// Timer zum Schlie\sen aufsetzen; der Aufrufer mu\s selbst sicherstellen, |
158 |
// that the window does not stay or leave ( z.B. by setting the |
158 |
// da\s das Window nicht gleich wieder zu geht ( z.B. durch Setzen des |
159 |
// Focus mode or modal ) |
159 |
// Focus oder einen modal mode ) |
160 |
aLastPos = GetPointerPosPixel(); |
160 |
aLastPos = GetPointerPosPixel(); |
161 |
aTimer.Start(); |
161 |
aTimer.Start(); |
162 |
} |
162 |
} |
Lines 434-446
void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
Link Here
|
434 |
|
434 |
|
435 |
/* [Beschreibung] |
435 |
/* [Beschreibung] |
436 |
|
436 |
|
437 |
To insert SfxDockingWindows with no position can also be transfered. |
437 |
Zum Einf"ugen von SfxDockingWindows kann auch keine Position "ubergeben |
438 |
The SfxSplitWindow then searches out the noted recently transfered |
438 |
werden. Das SfxSplitWindow sucht dann die zuletzt gemerkte zu dem |
439 |
to the newly SfxDockingWindow or it depends on the last. |
439 |
"ubergebenen SfxDockingWindow heraus oder h"angt es als letztes neu an. |
440 |
|
440 |
|
441 |
*/ |
441 |
*/ |
442 |
{ |
442 |
{ |
443 |
short nLine = -1; // so first window can be set to 0 nLine high |
443 |
short nLine = -1; // damit erstes Fenster nLine auf 0 hochsetzen kann |
444 |
sal_uInt16 nL; |
444 |
sal_uInt16 nL; |
445 |
sal_uInt16 nPos = 0; |
445 |
sal_uInt16 nPos = 0; |
446 |
sal_Bool bNewLine = sal_True; |
446 |
sal_Bool bNewLine = sal_True; |
Lines 452-484
void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
Link Here
|
452 |
SfxDock_Impl *pDock = (*pDockArr)[n]; |
452 |
SfxDock_Impl *pDock = (*pDockArr)[n]; |
453 |
if ( pDock->bNewLine ) |
453 |
if ( pDock->bNewLine ) |
454 |
{ |
454 |
{ |
455 |
// The window opens a new line |
455 |
// Das Fenster er"offnet eine neue Zeile |
456 |
if ( pFoundDock ) |
456 |
if ( pFoundDock ) |
457 |
// But behind the window just inserted |
457 |
// Aber hinter dem gerade eingef"ugten Fenster |
458 |
break; |
458 |
break; |
459 |
|
459 |
|
460 |
// new line |
460 |
// Neue Zeile |
461 |
nPos = 0; |
461 |
nPos = 0; |
462 |
bNewLine = sal_True; |
462 |
bNewLine = sal_True; |
463 |
} |
463 |
} |
464 |
|
464 |
|
465 |
if ( pDock->pWin ) |
465 |
if ( pDock->pWin ) |
466 |
{ |
466 |
{ |
467 |
// It is at this point just a window |
467 |
// Es gibt an dieser Stelle gerade ein Fenster |
468 |
if ( bNewLine && !pFoundDock ) |
468 |
if ( bNewLine && !pFoundDock ) |
469 |
{ |
469 |
{ |
470 |
// It is not known, in which real line is the one |
470 |
// Bisher ist nicht bekannt, in welcher realen Zeile es liegt |
471 |
GetWindowPos( pDock->pWin, nL, nPos ); |
471 |
GetWindowPos( pDock->pWin, nL, nPos ); |
472 |
nLine = (short) nL; |
472 |
nLine = (short) nL; |
473 |
} |
473 |
} |
474 |
|
474 |
|
475 |
if ( !pFoundDock ) |
475 |
if ( !pFoundDock ) |
476 |
{ |
476 |
{ |
477 |
// before the window is attached |
477 |
// Fenster liegt vor dem eingef"ugten |
478 |
nPos++; |
478 |
nPos++; |
479 |
} |
479 |
} |
480 |
|
480 |
|
481 |
// Line is now open |
481 |
// Zeile ist schon er"offnet |
482 |
bNewLine = sal_False; |
482 |
bNewLine = sal_False; |
483 |
if ( pFoundDock ) |
483 |
if ( pFoundDock ) |
484 |
break; |
484 |
break; |
Lines 486-501
void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
Link Here
|
486 |
|
486 |
|
487 |
if ( pDock->nType == pDockWin->GetType() ) |
487 |
if ( pDock->nType == pDockWin->GetType() ) |
488 |
{ |
488 |
{ |
489 |
DBG_ASSERT( !pFoundDock && !pDock->pWin, "Window is already available!"); |
489 |
DBG_ASSERT( !pFoundDock && !pDock->pWin, "Fenster ist schon vorhanden!"); |
490 |
pFoundDock = pDock; |
490 |
pFoundDock = pDock; |
491 |
if ( !bNewLine ) |
491 |
if ( !bNewLine ) |
492 |
break; |
492 |
break; |
493 |
else |
493 |
else |
494 |
{ |
494 |
{ |
495 |
// It was most recently a new series started, but not found a |
495 |
// Es wurde zuletzt eine neue Reihe gestartet, aber noch kein |
496 |
// window above it, so keep looking if nochein window follows |
496 |
// darin liegendes Fenster gefunden; daher weitersuchen, ob noch |
497 |
// this line to bNewLine to set correctly. But it must be nLine |
497 |
// ein Fenster in dieser Zeile folgt, um bNewLine korrekt zu setzen. |
498 |
// or nPos shouldn't be changed. |
498 |
// Dabei darf aber nLine oder nPos nicht mehr ver"andert werden! |
499 |
nLine++; |
499 |
nLine++; |
500 |
} |
500 |
} |
501 |
} |
501 |
} |
Lines 528-534
void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa
Link Here
|
528 |
|
528 |
|
529 |
/* [Beschreibung] |
529 |
/* [Beschreibung] |
530 |
|
530 |
|
531 |
The DockinWindow is no longer stored in the internal data. |
531 |
Das DockingWindow wird nicht mehr in den internen Daten gespeichert. |
532 |
*/ |
532 |
*/ |
533 |
|
533 |
|
534 |
{ |
534 |
{ |
Lines 607-622
void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
Link Here
|
607 |
pDock->bNewLine = bNewLine; |
607 |
pDock->bNewLine = bNewLine; |
608 |
pDock->pWin = pDockWin; |
608 |
pDock->pWin = pDockWin; |
609 |
|
609 |
|
610 |
DBG_ASSERT( nPos==0 || !bNewLine, "Wrong Parameter!"); |
610 |
DBG_ASSERT( nPos==0 || !bNewLine, "Falsche Paramenter!"); |
611 |
if ( bNewLine ) |
611 |
if ( bNewLine ) |
612 |
nPos = 0; |
612 |
nPos = 0; |
613 |
|
613 |
|
614 |
// The window introduced before the first window are suffices that the |
614 |
// Das Fenster mu\s vor dem ersten Fenster eingef"ugt werden, das die |
615 |
// body or a greater position as the pDockWin. |
615 |
// gleiche oder eine gr"o\sere Position hat als pDockWin. |
616 |
sal_uInt16 nCount = pDockArr->Count(); |
616 |
sal_uInt16 nCount = pDockArr->Count(); |
617 |
sal_uInt16 nLastWindowIdx(0); |
|
|
618 |
|
617 |
|
619 |
// If window not found, is inserted as the first |
618 |
// Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt |
620 |
sal_uInt16 nInsertPos = 0; |
619 |
sal_uInt16 nInsertPos = 0; |
621 |
for ( sal_uInt16 n=0; n<nCount; n++ ) |
620 |
for ( sal_uInt16 n=0; n<nCount; n++ ) |
622 |
{ |
621 |
{ |
Lines 628-658
void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
Link Here
|
628 |
// Wenn kein geeignetes Fenster hinter der gew"unschten Einf"ugeposition |
627 |
// Wenn kein geeignetes Fenster hinter der gew"unschten Einf"ugeposition |
629 |
// gefunden wird, wird am Ende eingef"ugt |
628 |
// gefunden wird, wird am Ende eingef"ugt |
630 |
nInsertPos = nCount; |
629 |
nInsertPos = nCount; |
631 |
nLastWindowIdx = n; |
|
|
632 |
sal_uInt16 nL=0, nP=0; |
630 |
sal_uInt16 nL=0, nP=0; |
633 |
GetWindowPos( pD->pWin, nL, nP ); |
631 |
GetWindowPos( pD->pWin, nL, nP ); |
634 |
|
632 |
|
635 |
if ( (nL == nLine && nP == nPos) || nL > nLine ) |
633 |
if ( (nL == nLine && nP == nPos) || nL > nLine ) |
636 |
{ |
634 |
{ |
637 |
DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Wrong Parameter!" ); |
635 |
DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Falsche Parameter!" ); |
638 |
if ( nL == nLine && nPos == 0 && !bNewLine ) |
636 |
if ( nL == nLine && nPos == 0 && !bNewLine ) |
639 |
{ |
637 |
{ |
640 |
DBG_ASSERT(pD->bNewLine, "No new line?"); |
638 |
DBG_ASSERT(pD->bNewLine, "Keine neue Zeile?"); |
641 |
|
639 |
|
642 |
// Das Fenster wird auf nPos==0 eingeschoben |
640 |
// Das Fenster wird auf nPos==0 eingeschoben |
643 |
pD->bNewLine = sal_False; |
641 |
pD->bNewLine = sal_False; |
644 |
pDock->bNewLine = sal_True; |
642 |
pDock->bNewLine = sal_True; |
645 |
} |
643 |
} |
646 |
|
644 |
|
647 |
nInsertPos = n != 0 ? nLastWindowIdx + 1 : 0; // ignore all non-windows after the last window |
645 |
nInsertPos = n; |
648 |
break; |
646 |
break; |
649 |
} |
647 |
} |
650 |
} |
648 |
} |
651 |
} |
649 |
} |
652 |
if (nInsertPos == nCount && nLastWindowIdx != nCount - 1) |
|
|
653 |
{ |
654 |
nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window |
655 |
} |
656 |
|
650 |
|
657 |
pDockArr->Insert(pDock, nInsertPos); |
651 |
pDockArr->Insert(pDock, nInsertPos); |
658 |
InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); |
652 |
InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); |