1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swframeexample.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
35 #include <tools/poly.hxx>
36 #include <vcl/metric.hxx>
37 #include <vcl/svapp.hxx>
38 #include <svtools/colorcfg.hxx>
39 #include <swframeexample.hxx>
40 #include <com/sun/star/text/TextContentAnchorType.hpp>
41 #include <com/sun/star/text/HoriOrientation.hpp>
42 #include <com/sun/star/text/VertOrientation.hpp>
43 #include <com/sun/star/text/RelOrientation.hpp>
44 #include <com/sun/star/text/WrapTextMode.hpp>
46 using namespace ::com::sun::star::text
;
48 #define FLYINFLY_BORDER 3
50 #define C2S(cChar) UniString::CreateFromAscii(cChar)
53 SvxSwFrameExample::SvxSwFrameExample( Window
*pParent
, const ResId
& rResID
) :
55 Window(pParent
, rResID
),
57 nHAlign (HoriOrientation::CENTER
),
58 nHRel (RelOrientation::FRAME
),
59 nVAlign (VertOrientation::TOP
),
60 nVRel (RelOrientation::PRINT_AREA
),
61 nWrap (WrapTextMode_NONE
),
62 nAnchor (TextContentAnchorType_AT_PAGE
),
67 SetMapMode(MAP_PIXEL
);
70 SvxSwFrameExample::~SvxSwFrameExample()
74 void SvxSwFrameExample::InitColors_Impl( void )
76 const StyleSettings
& rSettings
= GetSettings().GetStyleSettings();
77 m_aBgCol
= Color( rSettings
.GetWindowColor() ); // old: COL_WHITE
79 BOOL bHC
= m_aBgCol
.IsDark();
81 m_aFrameColor
= Color( COL_LIGHTGREEN
);
82 m_aAlignColor
= Color( COL_LIGHTRED
);
83 m_aTransColor
= Color( COL_TRANSPARENT
);
86 svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR
).nColor
:
87 Color( COL_GRAY
); // old: COL_GRAY
88 m_aPrintAreaCol
= bHC
? m_aTxtCol
: Color( COL_GRAY
);
89 m_aBorderCol
= m_aTxtCol
; // old: COL_BLACK;
90 m_aBlankCol
= bHC
? m_aTxtCol
: Color( COL_LIGHTGRAY
);
91 m_aBlankFrameCol
= bHC
? m_aTxtCol
: Color( COL_GRAY
);
94 void SvxSwFrameExample::DataChanged( const DataChangedEvent
& rDCEvt
)
96 Window::DataChanged( rDCEvt
);
98 if( rDCEvt
.GetType() == DATACHANGED_SETTINGS
&& ( rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
102 void SvxSwFrameExample::InitAllRects_Impl()
104 // const Size aSz(GetOutputSizePixel());
107 // aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
108 aPage
.SetSize( GetOutputSizePixel() );
110 ULONG nOutWPix
= aPage
.GetWidth();
111 ULONG nOutHPix
= aPage
.GetHeight();
124 if (nAnchor
!= TextContentAnchorType_AS_CHARACTER
)
148 aPagePrtArea
= Rectangle(Point(nLBorder
, nTBorder
), Point((nOutWPix
- 1) - nRBorder
, (nOutHPix
- 1) - nBBorder
));
150 // Beispiel-Text: Vorbereiten fuer die Textausgabe
152 aTextLine
= aPagePrtArea
;
153 aTextLine
.SetSize(Size(aTextLine
.GetWidth(), 2));
154 aTextLine
.Left() += nLTxtBorder
;
155 aTextLine
.Right() -= nRTxtBorder
;
156 aTextLine
.Move(0, nTTxtBorder
);
158 // Rechteck um Absatz incl. Raender
159 USHORT nLines
= (USHORT
)((aPagePrtArea
.GetHeight() / 2 - nTTxtBorder
- nBTxtBorder
)
160 / (aTextLine
.GetHeight() + 2));
161 aPara
= aPagePrtArea
;
162 aPara
.SetSize(Size(aPara
.GetWidth(),
163 (aTextLine
.GetHeight() + 2) * nLines
+ nTTxtBorder
+ nBTxtBorder
));
165 // Rechteck um Absatz ohne Raender
166 aParaPrtArea
= aPara
;
167 aParaPrtArea
.Left() += nLTxtBorder
;
168 aParaPrtArea
.Right() -= nRTxtBorder
;
169 aParaPrtArea
.Top() += nTTxtBorder
;
170 aParaPrtArea
.Bottom() -= nBTxtBorder
;
172 if (nAnchor
== TextContentAnchorType_AS_CHARACTER
|| nAnchor
== TextContentAnchorType_AT_CHARACTER
)
174 Font aFont
= OutputDevice::GetDefaultFont(
175 DEFAULTFONT_LATIN_TEXT
, Application::GetSettings().GetLanguage(),
176 DEFAULTFONT_FLAGS_ONLYONE
, this );
177 aFont
.SetColor( m_aTxtCol
);
178 aFont
.SetFillColor( m_aBgCol
);
179 aFont
.SetWeight(WEIGHT_NORMAL
);
181 if (nAnchor
== TextContentAnchorType_AS_CHARACTER
)
183 aFont
.SetSize(Size(0, aParaPrtArea
.GetHeight() - 2));
185 aParaPrtArea
.SetSize(Size(GetTextWidth(C2S(DEMOTEXT
)), GetTextHeight()));
189 aFont
.SetSize(Size(0, aParaPrtArea
.GetHeight() / 2));
191 aAutoCharFrame
.SetSize(Size(GetTextWidth('A'), GetTextHeight()));
192 aAutoCharFrame
.SetPos(Point(aParaPrtArea
.Left() + (aParaPrtArea
.GetWidth() - aAutoCharFrame
.GetWidth()) / 2,
193 aParaPrtArea
.Top() + (aParaPrtArea
.GetHeight() - aAutoCharFrame
.GetHeight()) / 2));
197 // Innerer Frame fuer am Frame verankerte Rahmen
198 aFrameAtFrame
= aPara
;
199 aFrameAtFrame
.Left() += 9;
200 aFrameAtFrame
.Right() -= 5;
201 aFrameAtFrame
.Bottom() += 5;
202 aFrameAtFrame
.SetPos(Point(aFrameAtFrame
.Left() + 2, (aPagePrtArea
.Bottom() - aFrameAtFrame
.GetHeight()) / 2 + 5));
204 // Groesse des zu positionierenden Rahmens
205 if (nAnchor
!= TextContentAnchorType_AS_CHARACTER
)
207 ULONG nLFBorder
= nAnchor
== TextContentAnchorType_AT_PAGE
? nLBorder
: nLTxtBorder
;
208 ULONG nRFBorder
= nAnchor
== TextContentAnchorType_AT_PAGE
? nRBorder
: nRTxtBorder
;
212 case RelOrientation::PAGE_LEFT
:
213 case RelOrientation::FRAME_LEFT
:
214 aFrmSize
= Size(nLFBorder
- 4, (aTextLine
.GetHeight() + 2) * 3);
217 case RelOrientation::PAGE_RIGHT
:
218 case RelOrientation::FRAME_RIGHT
:
219 aFrmSize
= Size(nRFBorder
- 4, (aTextLine
.GetHeight() + 2) * 3);
223 aFrmSize
= Size(nLBorder
- 3, (aTextLine
.GetHeight() + 2) * 3);
226 aFrmSize
.Width() = Max(5L, aFrmSize
.Width());
227 aFrmSize
.Height() = Max(5L, aFrmSize
.Height());
231 ULONG nFreeWidth
= aPagePrtArea
.GetWidth() - GetTextWidth(C2S(DEMOTEXT
));
233 aFrmSize
= Size(nFreeWidth
/ 2, (aTextLine
.GetHeight() + 2) * 3);
234 aDrawObj
.SetSize(Size(Max(5L, (long)nFreeWidth
/ 3L), Max(5L, aFrmSize
.Height() * 3L)));
235 aDrawObj
.SetPos(Point(aParaPrtArea
.Right() + 1, aParaPrtArea
.Bottom() / 2));
236 aParaPrtArea
.Right() = aDrawObj
.Right();
240 void SvxSwFrameExample::CalcBoundRect_Impl(Rectangle
&rRect
)
244 case TextContentAnchorType_AT_PAGE
:
248 case RelOrientation::FRAME
:
249 case RelOrientation::PAGE_FRAME
:
250 rRect
.Left() = aPage
.Left();
251 rRect
.Right() = aPage
.Right();
254 case RelOrientation::PRINT_AREA
:
255 case RelOrientation::PAGE_PRINT_AREA
:
256 rRect
.Left() = aPagePrtArea
.Left();
257 rRect
.Right() = aPagePrtArea
.Right();
260 case RelOrientation::PAGE_LEFT
:
261 rRect
.Left() = aPage
.Left();
262 rRect
.Right() = aPagePrtArea
.Left();
265 case RelOrientation::PAGE_RIGHT
:
266 rRect
.Left() = aPagePrtArea
.Right();
267 rRect
.Right() = aPage
.Right();
273 case RelOrientation::PRINT_AREA
:
274 case RelOrientation::PAGE_PRINT_AREA
:
275 rRect
.Top() = aPagePrtArea
.Top();
276 rRect
.Bottom() = aPagePrtArea
.Bottom();
279 case RelOrientation::FRAME
:
280 case RelOrientation::PAGE_FRAME
:
281 rRect
.Top() = aPage
.Top();
282 rRect
.Bottom() = aPage
.Bottom();
288 case TextContentAnchorType_AT_FRAME
:
292 case RelOrientation::FRAME
:
293 case RelOrientation::PAGE_FRAME
:
294 rRect
.Left() = aFrameAtFrame
.Left();
295 rRect
.Right() = aFrameAtFrame
.Right();
298 case RelOrientation::PRINT_AREA
:
299 case RelOrientation::PAGE_PRINT_AREA
:
300 rRect
.Left() = aFrameAtFrame
.Left() + FLYINFLY_BORDER
;
301 rRect
.Right() = aFrameAtFrame
.Right() - FLYINFLY_BORDER
;
304 case RelOrientation::PAGE_RIGHT
:
305 rRect
.Left() = aFrameAtFrame
.Left();
306 rRect
.Right() = aFrameAtFrame
.Left() + FLYINFLY_BORDER
;
309 case RelOrientation::PAGE_LEFT
:
310 rRect
.Left() = aFrameAtFrame
.Right();
311 rRect
.Right() = aFrameAtFrame
.Right() - FLYINFLY_BORDER
;
317 case RelOrientation::FRAME
:
318 case RelOrientation::PAGE_FRAME
:
319 rRect
.Top() = aFrameAtFrame
.Top();
320 rRect
.Bottom() = aFrameAtFrame
.Bottom();
323 case RelOrientation::PRINT_AREA
:
324 case RelOrientation::PAGE_PRINT_AREA
:
325 rRect
.Top() = aFrameAtFrame
.Top() + FLYINFLY_BORDER
;
326 rRect
.Bottom() = aFrameAtFrame
.Bottom() - FLYINFLY_BORDER
;
331 case TextContentAnchorType_AT_PARAGRAPH
:
332 case TextContentAnchorType_AT_CHARACTER
:
336 case RelOrientation::FRAME
:
337 rRect
.Left() = aPara
.Left();
338 rRect
.Right() = aPara
.Right();
341 case RelOrientation::PRINT_AREA
:
342 rRect
.Left() = aParaPrtArea
.Left();
343 rRect
.Right() = aParaPrtArea
.Right();
346 case RelOrientation::PAGE_LEFT
:
347 rRect
.Left() = aPage
.Left();
348 rRect
.Right() = aPagePrtArea
.Left();
351 case RelOrientation::PAGE_RIGHT
:
352 rRect
.Left() = aPagePrtArea
.Right();
353 rRect
.Right() = aPage
.Right();
356 case RelOrientation::PAGE_FRAME
:
357 rRect
.Left() = aPage
.Left();
358 rRect
.Right() = aPage
.Right();
361 case RelOrientation::PAGE_PRINT_AREA
:
362 rRect
.Left() = aPagePrtArea
.Left();
363 rRect
.Right() = aPagePrtArea
.Right();
366 case RelOrientation::FRAME_LEFT
:
367 rRect
.Left() = aPara
.Left();
368 rRect
.Right() = aParaPrtArea
.Left();
371 case RelOrientation::FRAME_RIGHT
:
372 rRect
.Left() = aParaPrtArea
.Right();
373 rRect
.Right() = aPara
.Right();
376 case RelOrientation::CHAR
:
377 rRect
.Left() = aAutoCharFrame
.Left();
378 rRect
.Right() = aAutoCharFrame
.Left();
384 case RelOrientation::FRAME
:
385 rRect
.Top() = aPara
.Top();
386 rRect
.Bottom() = aPara
.Bottom();
389 case RelOrientation::PRINT_AREA
:
390 rRect
.Top() = aParaPrtArea
.Top();
391 rRect
.Bottom() = aParaPrtArea
.Bottom();
394 case RelOrientation::CHAR
:
395 if (nVAlign
!= VertOrientation::NONE
&&
396 nVAlign
!= VertOrientation::CHAR_BOTTOM
)
397 rRect
.Top() = aAutoCharFrame
.Top();
399 rRect
.Top() = aAutoCharFrame
.Bottom();
400 rRect
.Bottom() = aAutoCharFrame
.Bottom();
402 // OD 12.11.2003 #i22341#
403 case RelOrientation::TEXT_LINE
:
404 rRect
.Top() = aAutoCharFrame
.Top();
405 rRect
.Bottom() = aAutoCharFrame
.Top();
411 case TextContentAnchorType_AS_CHARACTER
:
412 rRect
.Left() = aParaPrtArea
.Left();
413 rRect
.Right() = aParaPrtArea
.Right();
417 case VertOrientation::NONE
:
418 case VertOrientation::TOP
:
419 case VertOrientation::CENTER
:
420 case VertOrientation::BOTTOM
:
422 FontMetric
aMetric(GetFontMetric());
424 rRect
.Top() = aParaPrtArea
.Bottom() - aMetric
.GetDescent();
425 rRect
.Bottom() = rRect
.Top();
431 case VertOrientation::LINE_TOP
:
432 case VertOrientation::LINE_CENTER
:
433 case VertOrientation::LINE_BOTTOM
:
434 rRect
.Top() = aParaPrtArea
.Top();
435 rRect
.Bottom() = aDrawObj
.Bottom();
438 case VertOrientation::CHAR_TOP
:
439 case VertOrientation::CHAR_CENTER
:
440 case VertOrientation::CHAR_BOTTOM
:
441 rRect
.Top() = aParaPrtArea
.Top();
442 rRect
.Bottom() = aParaPrtArea
.Bottom();
452 Rectangle
SvxSwFrameExample::DrawInnerFrame_Impl(const Rectangle
&rRect
, const Color
&rFillColor
, const Color
&rBorderColor
)
454 DrawRect_Impl(rRect
, rFillColor
, rBorderColor
);
456 // Bereich, zu dem relativ positioniert wird, bestimmen
457 Rectangle
aRect(rRect
); // aPagePrtArea = Default
458 CalcBoundRect_Impl(aRect
);
460 if (nAnchor
== TextContentAnchorType_AT_FRAME
&& &rRect
== &aPagePrtArea
)
462 // Testabsatz zeichnen
463 Rectangle
aTxt(aTextLine
);
464 sal_Int32 nStep
= aTxt
.GetHeight() + 2;
465 USHORT nLines
= (USHORT
)(aParaPrtArea
.GetHeight() / (aTextLine
.GetHeight() + 2));
467 for (USHORT i
= 0; i
< nLines
; i
++)
470 aTxt
.SetSize(Size(aTxt
.GetWidth() / 2, aTxt
.GetHeight()));
471 DrawRect_Impl(aTxt
, m_aTxtCol
, m_aTransColor
);
479 void SvxSwFrameExample::Paint(const Rectangle
&)
484 // Rectangle aShadow(aPage);
485 // aShadow += Point(3, 3);
486 // DrawRect_Impl(aShadow, Color(COL_GRAY), aTransColor);
489 DrawRect_Impl( aPage
, m_aBgCol
, m_aBorderCol
);
491 // PrintArea zeichnen
492 Rectangle aRect
= DrawInnerFrame_Impl( aPagePrtArea
, m_aTransColor
, m_aPrintAreaCol
);
494 if (nAnchor
== TextContentAnchorType_AT_FRAME
)
495 aRect
= DrawInnerFrame_Impl( aFrameAtFrame
, m_aBgCol
, m_aBorderCol
);
500 // Horizontale Ausrichtung
502 if (nAnchor
!= TextContentAnchorType_AS_CHARACTER
)
506 case HoriOrientation::RIGHT
:
508 lXPos
= aRect
.Right() - aFrmSize
.Width() + 1;
511 case HoriOrientation::CENTER
:
513 lXPos
= aRect
.Left() + (aRect
.GetWidth() - aFrmSize
.Width()) / 2;
516 case HoriOrientation::NONE
:
518 lXPos
= aRect
.Left() + aRelPos
.X();
522 default: // HoriOrientation::LEFT
523 lXPos
= aRect
.Left();
528 lXPos
= aRect
.Right() + 2;
530 // Vertikale Ausrichtung
532 if (nAnchor
!= TextContentAnchorType_AS_CHARACTER
)
536 case VertOrientation::BOTTOM
:
537 case VertOrientation::LINE_BOTTOM
:
539 // OD 12.11.2003 #i22341#
540 if ( nVRel
!= RelOrientation::TEXT_LINE
)
542 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
550 case VertOrientation::CENTER
:
551 case VertOrientation::LINE_CENTER
:
553 lYPos
= aRect
.Top() + (aRect
.GetHeight() - aFrmSize
.Height()) / 2;
556 case VertOrientation::NONE
:
558 // OD 12.11.2003 #i22341#
559 if ( nVRel
!= RelOrientation::CHAR
&& nVRel
!= RelOrientation::TEXT_LINE
)
560 lYPos
= aRect
.Top() + aRelPos
.Y();
562 lYPos
= aRect
.Top() - aRelPos
.Y();
566 // OD 12.11.2003 #i22341#
567 if ( nVRel
!= RelOrientation::TEXT_LINE
)
573 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
582 case VertOrientation::CENTER
:
583 case VertOrientation::CHAR_CENTER
:
584 case VertOrientation::LINE_CENTER
:
585 lYPos
= aRect
.Top() + (aRect
.GetHeight() - aFrmSize
.Height()) / 2;
588 case VertOrientation::TOP
:
589 case VertOrientation::CHAR_BOTTOM
:
590 case VertOrientation::LINE_BOTTOM
:
591 lYPos
= aRect
.Bottom() - aFrmSize
.Height() + 1;
594 /* case VertOrientation::NONE:
595 case VertOrientation::BOTTOM:
596 case VertOrientation::CHAR_TOP:
597 case VertOrientation::LINE_TOP:*/
599 lYPos
= aRect
.Top() - aRelPos
.Y();
604 Rectangle
aFrmRect(Point(lXPos
, lYPos
), aFrmSize
);
606 Rectangle
*pOuterFrame
= &aPage
;
608 if (nAnchor
== TextContentAnchorType_AT_FRAME
)
609 pOuterFrame
= &aFrameAtFrame
;
611 if (aFrmRect
.Left() < pOuterFrame
->Left())
612 aFrmRect
.Move(pOuterFrame
->Left() - aFrmRect
.Left(), 0);
613 if (aFrmRect
.Right() > pOuterFrame
->Right())
614 aFrmRect
.Move(pOuterFrame
->Right() - aFrmRect
.Right(), 0);
616 if (aFrmRect
.Top() < pOuterFrame
->Top())
617 aFrmRect
.Move(0, pOuterFrame
->Top() - aFrmRect
.Top());
618 if (aFrmRect
.Bottom() > pOuterFrame
->Bottom())
619 aFrmRect
.Move(0, pOuterFrame
->Bottom() - aFrmRect
.Bottom());
621 // Testabsatz zeichnen
622 const long nTxtLineHeight
= aTextLine
.GetHeight();
623 Rectangle
aTxt(aTextLine
);
627 if (nAnchor
== TextContentAnchorType_AT_FRAME
)
629 aTxt
.Left() = aFrameAtFrame
.Left() + FLYINFLY_BORDER
;
630 aTxt
.Right() = aFrameAtFrame
.Right() - FLYINFLY_BORDER
;
631 aTxt
.Top() = aFrameAtFrame
.Top() + FLYINFLY_BORDER
;
632 aTxt
.Bottom() = aTxt
.Top() + aTextLine
.GetHeight() - 1;
634 nStep
= aTxt
.GetHeight() + 2;
635 nLines
= (USHORT
)(((aFrameAtFrame
.GetHeight() - 2 * FLYINFLY_BORDER
) * 2 / 3)
636 / (aTxt
.GetHeight() + 2));
640 nStep
= aTxt
.GetHeight() + 2;
641 nLines
= (USHORT
)(aParaPrtArea
.GetHeight() / (aTextLine
.GetHeight() + 2));
644 if (nAnchor
!= TextContentAnchorType_AS_CHARACTER
)
648 const long nOldR
= aTxt
.Right();
649 const long nOldL
= aTxt
.Left();
651 // OD 12.11.2003 #i22341#
652 const bool bIgnoreWrap
= nAnchor
== TextContentAnchorType_AT_CHARACTER
&&
653 ( nHRel
== RelOrientation::CHAR
|| nVRel
== RelOrientation::CHAR
||
654 nVRel
== RelOrientation::TEXT_LINE
);
656 for (USHORT i
= 0; i
< nLines
; ++i
)
658 if (i
== (nLines
- 1))
659 aTxt
.SetSize(Size(aTxt
.GetWidth() / 2, aTxt
.GetHeight()));
661 if (aTxt
.IsOver(aFrmRect
) && nAnchor
!= TextContentAnchorType_AS_CHARACTER
&& !bIgnoreWrap
)
665 case WrapTextMode_NONE
:
666 aTxt
.Top() = aFrmRect
.Bottom() + nTxtLineHeight
;
667 aTxt
.Bottom() = aTxt
.Top() + nTxtLineHeight
- 1;
670 case WrapTextMode_LEFT
:
671 aTxt
.Right() = aFrmRect
.Left();
674 case WrapTextMode_RIGHT
:
675 aTxt
.Left() = aFrmRect
.Right();
679 if (pOuterFrame
->IsInside(aTxt
))
680 DrawRect_Impl( aTxt
, m_aTxtCol
, m_aTransColor
);
683 aTxt
.Right() = nOldR
;
686 aTxt
.Move(0, -nStep
);
688 if (nAnchor
!= TextContentAnchorType_AT_FRAME
&& aTxt
.Bottom() > aParaPrtArea
.Bottom())
690 // Text wurde durch Rahmen verdraengt, daher Para-Hoehe anpassen
691 ULONG nDiff
= aTxt
.Bottom() - aParaPrtArea
.Bottom();
692 aParaPrtArea
.Bottom() += nDiff
;
693 aPara
.Bottom() += nDiff
;
695 CalcBoundRect_Impl(aRect
);
697 aParaPrtArea
.Bottom() -= nDiff
;
698 aPara
.Bottom() -= nDiff
;
700 if (nAnchor
== TextContentAnchorType_AT_CHARACTER
&& bIgnoreWrap
)
701 DrawText(aAutoCharFrame
, 'A');
705 DrawText(aParaPrtArea
, C2S(DEMOTEXT
));
706 DrawRect_Impl(aDrawObj
, m_aBlankCol
, m_aBlankFrameCol
);
709 // Rechteck zeichnen, zu dem der Rahmen ausgerichtet wird:
710 DrawRect_Impl(aRect
, m_aTransColor
, m_aAlignColor
);
713 BOOL bDontFill
= (nAnchor
== TextContentAnchorType_AT_CHARACTER
&& aFrmRect
.IsOver(aAutoCharFrame
)) ? TRUE
: bTrans
;
714 DrawRect_Impl( aFrmRect
, bDontFill
? m_aTransColor
: m_aBgCol
, m_aFrameColor
);
717 void SvxSwFrameExample::SetRelPos(const Point
& rP
)
732 void SvxSwFrameExample::DrawRect_Impl(const Rectangle
&rRect
, const Color
&rFillColor
, const Color
&rLineColor
)
734 SetFillColor(rFillColor
);
735 SetLineColor(rLineColor
);
736 Window::DrawRect(rRect
);