LibreOffice Module vcl (master) 1
brdwin.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <strings.hrc>
21#include <svdata.hxx>
22#include <brdwin.hxx>
23#include <window.h>
24
25#include <vcl/textrectinfo.hxx>
26#include <vcl/event.hxx>
27#include <vcl/decoview.hxx>
28#include <vcl/syswin.hxx>
29#include <vcl/dockwin.hxx>
31#include <vcl/help.hxx>
32#include <vcl/toolkit/edit.hxx>
33#include <vcl/settings.hxx>
34#include <vcl/toolbox.hxx>
35#include <vcl/ptrstyle.hxx>
36
37using namespace ::com::sun::star::uno;
38
39// useful caption height for title bar buttons
40#define MIN_CAPTION_HEIGHT 18
41
42namespace vcl {
43
45{
46 // Add border, not shown in the non-default representation,
47 // as we want to use it for small buttons
48 rRect.AdjustLeft( -1 );
49 rRect.AdjustTop( -1 );
50 rRect.AdjustRight( 1 );
51 rRect.AdjustBottom( 1 );
52
53 // we leave 5% room between the symbol and the button border
54 tools::Long nExtraWidth = ((rRect.GetWidth()*50)+500)/1000;
55 tools::Long nExtraHeight = ((rRect.GetHeight()*50)+500)/1000;
56 rRect.AdjustLeft(nExtraWidth );
57 rRect.AdjustRight( -nExtraWidth );
58 rRect.AdjustTop(nExtraHeight );
59 rRect.AdjustBottom( -nExtraHeight );
60}
61
62} /* namespace vcl */
63
65 const tools::Rectangle& rRect, SymbolType eSymbol )
66{
67 // we leave 5% room between the symbol and the button border
68 DecorationView aDecoView( pDev );
69 tools::Rectangle aTempRect = rRect;
71 aDecoView.DrawSymbol( aTempRect, eSymbol,
73}
74
76 const tools::Rectangle& rRect,
78{
79 bool bMouseOver(nState & DrawButtonFlags::Highlight);
80 nState &= ~DrawButtonFlags::Highlight;
81
82 tools::Rectangle aTempRect;
83 vcl::Window *pWin = pDev->GetOwnerWindow();
84 if( pWin )
85 {
86 if( bMouseOver )
87 {
88 // provide a bright background for selection effect
90 pDev->SetLineColor();
91 pDev->DrawRect( rRect );
93 true );
94 }
95 aTempRect = rRect;
96 aTempRect.AdjustLeft(3 );
97 aTempRect.AdjustRight( -4 );
98 aTempRect.AdjustTop(3 );
99 aTempRect.AdjustBottom( -4 );
100 }
101 else
102 {
103 DecorationView aDecoView( pDev );
104 aTempRect = aDecoView.DrawButton( rRect, nState|DrawButtonFlags::Flat );
105 }
106 ImplDrawBrdWinSymbol( pDev, aTempRect, eSymbol );
107}
108
109
111{
112}
113
115{
116 return false;
117}
118
120{
121 return false;
122}
123
125{
126 return false;
127}
128
130{
131 return OUString();
132}
133
135{
136 return tools::Rectangle();
137}
138
140{
141 ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
142
143 if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) ||
144 (pData->mnTitleType == BorderWindowTitleType::NONE) )
145 {
146 pData->mnTitleType = BorderWindowTitleType::NONE;
147 pData->mnTitleHeight = 0;
148 }
149 else
150 {
151 const StyleSettings& rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings();
152 if (pData->mnTitleType == BorderWindowTitleType::Tearoff)
153 pData->mnTitleHeight = ToolBox::ImplGetDragWidth(*pData->mpBorderWindow, false) + 2;
154 else
155 {
156 if (pData->mnTitleType == BorderWindowTitleType::Small)
157 {
158 pBorderWindow->SetPointFont(*pBorderWindow->GetOutDev(), rStyleSettings.GetFloatTitleFont() );
159 pData->mnTitleHeight = rStyleSettings.GetFloatTitleHeight();
160 }
161 else // pData->mnTitleType == BorderWindowTitleType::Normal
162 {
163 // FIXME RenderContext
164 pBorderWindow->SetPointFont(*pBorderWindow->GetOutDev(), rStyleSettings.GetTitleFont());
165 pData->mnTitleHeight = rStyleSettings.GetTitleHeight();
166 }
167 tools::Long nTextHeight = pBorderWindow->GetTextHeight();
168 if (nTextHeight > pData->mnTitleHeight)
169 pData->mnTitleHeight = nTextHeight;
170 }
171 }
172}
173
175{
176 ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
177
178 if ( pData->maTitleRect.Contains( rPos ) )
179 {
180 if ( pData->maCloseRect.Contains( rPos ) )
182 else if ( pData->maMenuRect.Contains( rPos ) )
184 else if ( pData->maDockRect.Contains( rPos ) )
186 else if ( pData->maHideRect.Contains( rPos ) )
188 else if ( pData->maHelpRect.Contains( rPos ) )
190 else
192 }
193
194 if (pBorderWindow->GetStyle() & WB_SIZEABLE)
195 {
196 tools::Long nSizeWidth = pData->mnNoTitleTop+pData->mnTitleHeight;
197 if ( nSizeWidth < 16 )
198 nSizeWidth = 16;
199
200 // no corner resize for floating toolbars, which would lead to jumps while formatting
201 // setting nSizeWidth = 0 will only return pure left,top,right,bottom
202 if( pBorderWindow->GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP) )
203 nSizeWidth = 0;
204
205 if ( rPos.X() < pData->mnLeftBorder )
206 {
207 if ( rPos.Y() < nSizeWidth )
209 else if ( rPos.Y() >= pData->mnHeight-nSizeWidth )
211 else
213 }
214 else if ( rPos.X() >= pData->mnWidth-pData->mnRightBorder )
215 {
216 if ( rPos.Y() < nSizeWidth )
218 else if ( rPos.Y() >= pData->mnHeight-nSizeWidth )
220 else
222 }
223 else if ( rPos.Y() < pData->mnNoTitleTop )
224 {
225 if ( rPos.X() < nSizeWidth )
227 else if ( rPos.X() >= pData->mnWidth-nSizeWidth )
229 else
231 }
232 else if ( rPos.Y() >= pData->mnHeight-pData->mnBottomBorder )
233 {
234 if ( rPos.X() < nSizeWidth )
236 else if ( rPos.X() >= pData->mnWidth-nSizeWidth )
238 else
240 }
241 }
242
244}
245
247{
248 DrawButtonFlags oldCloseState = pData->mnCloseState;
249 DrawButtonFlags oldMenuState = pData->mnMenuState;
250 pData->mnCloseState &= ~DrawButtonFlags::Highlight;
251 pData->mnMenuState &= ~DrawButtonFlags::Highlight;
252
253 Point aMousePos = rMEvt.GetPosPixel();
254 BorderWindowHitTest nHitTest = ImplHitTest( pData, aMousePos );
256 if ( nHitTest & BorderWindowHitTest::Left )
257 ePtrStyle = PointerStyle::WindowWSize;
258 else if ( nHitTest & BorderWindowHitTest::Right )
259 ePtrStyle = PointerStyle::WindowESize;
260 else if ( nHitTest & BorderWindowHitTest::Top )
261 ePtrStyle = PointerStyle::WindowNSize;
262 else if ( nHitTest & BorderWindowHitTest::Bottom )
263 ePtrStyle = PointerStyle::WindowSSize;
264 else if ( nHitTest & BorderWindowHitTest::TopLeft )
265 ePtrStyle = PointerStyle::WindowNWSize;
266 else if ( nHitTest & BorderWindowHitTest::BottomRight )
267 ePtrStyle = PointerStyle::WindowSESize;
268 else if ( nHitTest & BorderWindowHitTest::TopRight )
269 ePtrStyle = PointerStyle::WindowNESize;
270 else if ( nHitTest & BorderWindowHitTest::BottomLeft )
271 ePtrStyle = PointerStyle::WindowSWSize;
272 else if ( nHitTest & BorderWindowHitTest::Close )
273 pData->mnCloseState |= DrawButtonFlags::Highlight;
274 else if ( nHitTest & BorderWindowHitTest::Menu )
275 pData->mnMenuState |= DrawButtonFlags::Highlight;
276 else if ( nHitTest & BorderWindowHitTest::Title &&
277 pData->mnTitleType == BorderWindowTitleType::Tearoff && !rMEvt.IsLeaveWindow() )
278 ePtrStyle = PointerStyle::Move;
279 pData->mpBorderWindow->SetPointer( ePtrStyle );
280
281 if( pData->mnCloseState != oldCloseState )
282 pData->mpBorderWindow->Invalidate( pData->maCloseRect );
283 if( pData->mnMenuState != oldMenuState )
284 pData->mpBorderWindow->Invalidate( pData->maMenuRect );
285}
286
288 const Point& rPos,
289 tools::Rectangle& rHelpRect )
290{
291 TranslateId pHelpId;
292 OUString aHelpStr;
293 BorderWindowHitTest nHitTest = ImplHitTest( pData, rPos );
294 if ( nHitTest != BorderWindowHitTest::NONE )
295 {
296 if ( nHitTest & BorderWindowHitTest::Close )
297 {
298 pHelpId = SV_HELPTEXT_CLOSE;
299 rHelpRect = pData->maCloseRect;
300 }
301 else if ( nHitTest & BorderWindowHitTest::Dock )
302 {
303 pHelpId = SV_HELPTEXT_MAXIMIZE;
304 rHelpRect = pData->maDockRect;
305 }
306 else if ( nHitTest & BorderWindowHitTest::Hide )
307 {
308 pHelpId = SV_HELPTEXT_MINIMIZE;
309 rHelpRect = pData->maHideRect;
310 }
311 else if ( nHitTest & BorderWindowHitTest::Help )
312 {
313 pHelpId = SV_HELPTEXT_HELP;
314 rHelpRect = pData->maHelpRect;
315 }
316 else if ( nHitTest & BorderWindowHitTest::Title )
317 {
318 if( !pData->maTitleRect.IsEmpty() )
319 {
320 // tooltip only if title truncated
321 if( pData->mbTitleClipped )
322 {
323 rHelpRect = pData->maTitleRect;
324 // no help id, use window title as help string
325 aHelpStr = pData->mpBorderWindow->GetText();
326 }
327 }
328 }
329 }
330
331 if (pHelpId)
332 aHelpStr = VclResId(pHelpId);
333
334 return aHelpStr;
335}
336
338{
339 // title is not visible therefore no width
340 if ( !pData->mnTitleHeight )
341 return 0;
342
343 ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
344 tools::Long nTitleWidth = pBorderWindow->GetTextWidth( pBorderWindow->GetText() )+6;
345 nTitleWidth += pData->maCloseRect.GetWidth();
346 nTitleWidth += pData->maDockRect.GetWidth();
347 nTitleWidth += pData->maMenuRect.GetWidth();
348 nTitleWidth += pData->maHideRect.GetWidth();
349 nTitleWidth += pData->maHelpRect.GetWidth();
350 nTitleWidth += pData->mnLeftBorder+pData->mnRightBorder;
351 return nTitleWidth;
352}
353
354
356{
357}
358
360{
361}
362
363void ImplNoBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
364 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
365{
366 rLeftBorder = 0;
367 rTopBorder = 0;
368 rRightBorder = 0;
369 rBottomBorder = 0;
370}
371
373{
374 return 0;
375}
376
378{
379}
380
382 : mpBorderWindow(pBorderWindow)
383 , mpOutDev(nullptr)
384 , mnWidth(0)
385 , mnHeight(0)
386 , mnLeftBorder(0)
387 , mnTopBorder(0)
388 , mnRightBorder(0)
389 , mnBottomBorder(0)
390 , mbNWFBorder(false)
391{
392}
393
395{
396 mpOutDev = pDev;
397 mnWidth = nWidth;
398 mnHeight = nHeight;
399 mbNWFBorder = false;
400
402 vcl::Window *pCtrl = nullptr;
403 vcl::Window *pSubEdit = nullptr;
404 if (pWin)
406
407 tools::Long nOrigLeftBorder = mnLeftBorder;
408 tools::Long nOrigTopBorder = mnTopBorder;
409 tools::Long nOrigRightBorder = mnRightBorder;
410 tools::Long nOrigBottomBorder = mnBottomBorder;
411
413 if ( nBorderStyle & WindowBorderStyle::NOBORDER )
414 {
415 mnLeftBorder = 0;
416 mnTopBorder = 0;
417 mnRightBorder = 0;
418 mnBottomBorder = 0;
419 }
420 else
421 {
422 // FIXME: this is currently only on macOS, check with other
423 // platforms
424 if( ImplGetSVData()->maNWFData.mbNoFocusRects && !( nBorderStyle & WindowBorderStyle::NWF ) )
425 {
426 // for native widget drawing we must find out what
427 // control this border belongs to
430 if (pCtrl)
431 {
432 switch( pCtrl->GetType() )
433 {
435 if( pCtrl->GetStyle() & WB_DROPDOWN )
436 {
437 aCtrlType = ControlType::Listbox;
438 mbNWFBorder = true;
439 pSubEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
440 }
441 break;
443 aCtrlType = ControlType::Listbox;
444 aCtrlPart = ControlPart::ListboxWindow;
445 mbNWFBorder = true;
446 break;
448 if( pCtrl->GetStyle() & WB_DROPDOWN )
449 {
450 aCtrlType = ControlType::Combobox;
451 mbNWFBorder = true;
452 pSubEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
453 }
454 break;
457 mbNWFBorder = true;
458 break;
459 case WindowType::EDIT:
467 mbNWFBorder = true;
468 if (pCtrl->GetStyle() & WB_SPIN)
469 aCtrlType = ControlType::Spinbox;
470 else
471 aCtrlType = ControlType::Editbox;
472 pSubEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
473 break;
474 default:
475 break;
476 }
477 }
478 if( mbNWFBorder )
479 {
480 ImplControlValue aControlValue;
481 Size aMinSize( mnWidth, mnHeight );
482 if( aMinSize.Width() < 10 ) aMinSize.setWidth( 10 );
483 if( aMinSize.Height() < 10 ) aMinSize.setHeight( 10 );
484 tools::Rectangle aCtrlRegion( Point(), aMinSize );
485 tools::Rectangle aBounds, aContent;
486 if( pWin->GetNativeControlRegion( aCtrlType, aCtrlPart, aCtrlRegion,
487 ControlState::ENABLED, aControlValue,
488 aBounds, aContent ) )
489 {
490 aBounds.AdjustLeft(mnLeftBorder);
491 aBounds.AdjustRight(-mnRightBorder);
492 aBounds.AdjustTop(mnTopBorder);
494 aContent.AdjustLeft(mnLeftBorder);
495 aContent.AdjustRight(-mnRightBorder);
496 aContent.AdjustTop(mnTopBorder);
497 aContent.AdjustBottom(-mnBottomBorder);
498 mnLeftBorder = aContent.Left() - aBounds.Left();
499 mnRightBorder = aBounds.Right() - aContent.Right();
500 mnTopBorder = aContent.Top() - aBounds.Top();
501 mnBottomBorder = aBounds.Bottom() - aContent.Bottom();
502 if( mnWidth && mnHeight )
503 {
504
507 if (!pCtrl->IsControlBackground())
508 {
509 pCtrl->SetPaintTransparent(true);
510 if (pSubEdit)
511 pSubEdit->SetPaintTransparent(true);
512 }
513
514 vcl::Window* pCompoundParent = nullptr;
515 if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() )
516 pCompoundParent = pWin->GetParent();
517
518 if( pCompoundParent )
519 pCompoundParent->SetPaintTransparent( true );
520
521 if( mnWidth < aBounds.GetWidth() || mnHeight < aBounds.GetHeight() )
522 {
523 if( ! pCompoundParent ) // compound controls have to fix themselves
524 {
526 if( mnWidth < aBounds.GetWidth() )
527 aPos.AdjustX( -((aBounds.GetWidth() - mnWidth) / 2) );
528 if( mnHeight < aBounds.GetHeight() )
529 aPos.AdjustY( -((aBounds.GetHeight() - mnHeight) / 2) );
530 mpBorderWindow->SetPosSizePixel( aPos, aBounds.GetSize() );
531 }
532 }
533 }
534 }
535 else
536 mbNWFBorder = false;
537 }
538 }
539
540 if( ! mbNWFBorder )
541 {
544 // move border outside if border was converted or if the BorderWindow is a frame window,
547 else if ( nBorderStyle & WindowBorderStyle::NWF )
548 nStyle = DrawFrameStyle::NWF;
549 else
551 if ( nBorderStyle & WindowBorderStyle::MONO )
552 nFlags |= DrawFrameFlags::Mono;
553
554 DecorationView aDecoView( mpOutDev );
555 tools::Rectangle aRect( 0, 0, 10, 10 );
556 tools::Rectangle aCalcRect = aDecoView.DrawFrame( aRect, nStyle, nFlags );
557 mnLeftBorder = aCalcRect.Left();
558 mnTopBorder = aCalcRect.Top();
559 mnRightBorder = aRect.Right()-aCalcRect.Right();
560 mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
561 }
562 }
563
564 if (pCtrl)
565 {
566 //fdo#57090 If the borders have changed, then trigger a queue_resize on
567 //the bordered window, which will resync its borders at that point
568 if (nOrigLeftBorder != mnLeftBorder ||
569 nOrigTopBorder != mnTopBorder ||
570 nOrigRightBorder != mnRightBorder ||
571 nOrigBottomBorder != mnBottomBorder)
572 {
573 pCtrl->queue_resize();
574 }
575 }
576}
577
578void ImplSmallBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
579 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
580{
581 rLeftBorder = mnLeftBorder;
582 rTopBorder = mnTopBorder;
583 rRightBorder = mnRightBorder;
584 rBottomBorder = mnBottomBorder;
585}
586
588{
589 return 0;
590}
591
593{
595 if (nBorderStyle & WindowBorderStyle::NOBORDER)
596 return;
597
598 bool bNativeOK = false;
599 // for native widget drawing we must find out what
600 // control this border belongs to
602
605 if (pCtrl)
606 {
607 switch (pCtrl->GetType())
608 {
611 break;
612 case WindowType::EDIT:
620 if (pCtrl->GetStyle() & WB_SPIN)
621 aCtrlType = ControlType::Spinbox;
622 else
623 aCtrlType = ControlType::Editbox;
624 break;
625
629 aCtrlType = ControlType::Listbox;
630 if (pCtrl->GetStyle() & WB_DROPDOWN)
631 aCtrlPart = ControlPart::Entire;
632 else
633 aCtrlPart = ControlPart::ListboxWindow;
634 break;
635
637 aCtrlType = ControlType::Listbox;
638 aCtrlPart = ControlPart::ListboxWindow;
639 break;
640
649 if (pCtrl->GetStyle() & WB_DROPDOWN)
650 {
651 aCtrlType = ControlType::Combobox;
652 aCtrlPart = ControlPart::Entire;
653 }
654 else
655 {
656 aCtrlType = ControlType::Listbox;
657 aCtrlPart = ControlPart::ListboxWindow;
658 }
659 break;
660
661 default:
662 break;
663 }
664 }
665
666 if (aCtrlType != ControlType::Generic && pCtrl->IsNativeControlSupported(aCtrlType, aCtrlPart))
667 {
668 ImplControlValue aControlValue;
670
672 nState &= ~ControlState::ENABLED;
673 if (mpBorderWindow->HasFocus() || pCtrl->HasFocus() || pCtrl->HasChildPathFocus())
675
676 bool bMouseOver = pCtrl->IsMouseOver();
677 if (!bMouseOver)
678 {
679 vcl::Window *pCtrlChild = pCtrl->GetWindow(GetWindowType::FirstChild);
680 while(pCtrlChild)
681 {
682 bMouseOver = pCtrlChild->IsMouseOver();
683 if (bMouseOver)
684 break;
685 pCtrlChild = pCtrlChild->GetWindow(GetWindowType::Next);
686 }
687 }
688
689 if (bMouseOver)
691
692 Point aPoint;
693 tools::Rectangle aCtrlRegion(aPoint, Size(mnWidth, mnHeight));
694
695 tools::Rectangle aBoundingRgn(aPoint, Size(mnWidth, mnHeight));
696 tools::Rectangle aContentRgn(aCtrlRegion);
697 if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize &&
698 rRenderContext.GetNativeControlRegion(aCtrlType, aCtrlPart, aCtrlRegion,
699 nState, aControlValue,
700 aBoundingRgn, aContentRgn))
701 {
702 aCtrlRegion=aContentRgn;
703 }
704
705 Color aBackgroundColor = COL_AUTO;
706 if (pCtrl->IsControlBackground())
707 aBackgroundColor = pCtrl->GetBackgroundColor();
708 bNativeOK = rRenderContext.DrawNativeControl(aCtrlType, aCtrlPart, aCtrlRegion, nState, aControlValue, OUString(), aBackgroundColor);
709
710 // if the native theme draws the spinbuttons in one call, make sure the proper settings
711 // are passed, this might force a redraw though... (TODO: improve)
713 {
714 Edit* pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
715 if (pEdit && !pEdit->SupportsDoubleBuffering())
716 pCtrl->Paint(*pCtrl->GetOutDev(), tools::Rectangle()); // make sure the buttons are also drawn as they might overwrite the border
717 }
718 }
719
720 if (bNativeOK)
721 return;
722
725 // move border outside if border was converted or if the border window is a frame window,
728 else if (nBorderStyle & WindowBorderStyle::NWF)
729 nStyle = DrawFrameStyle::NWF;
730 else
732 if (nBorderStyle & WindowBorderStyle::MONO)
733 nFlags |= DrawFrameFlags::Mono;
734 if (nBorderStyle & WindowBorderStyle::MENU)
735 nFlags |= DrawFrameFlags::Menu;
736 // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
739
740 DecorationView aDecoView(&rRenderContext);
742 aDecoView.DrawFrame(aInRect, nStyle, nFlags);
743}
744
745
747{
748 maFrameData.mpBorderWindow = pBorderWindow;
749 maFrameData.mbDragFull = false;
757}
758
760{
761}
762
764{
765 ImplMouseMove( &maFrameData, rMEvt );
766 return true;
767}
768
770{
772
773 if ( rMEvt.IsLeft() || rMEvt.IsRight() )
774 {
778 {
780 bool bTracking = true;
781 bool bHitTest = true;
782
784 {
786 pBorderWindow->InvalidateBorder();
787 }
789 {
791 pBorderWindow->InvalidateBorder();
792 }
794 {
796 pBorderWindow->InvalidateBorder();
797
798 // call handler already on mouse down
799 if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
800 {
801 SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
802 pClientWindow->TitleButtonClick( TitleButton::Menu );
803 }
804
806 pBorderWindow->InvalidateBorder();
807
808 bTracking = false;
809 }
811 {
813 pBorderWindow->InvalidateBorder();
814 }
816 {
818 pBorderWindow->InvalidateBorder();
819 }
820 else
821 {
822 if ( rMEvt.GetClicks() == 1 )
823 {
824 Point aPos = pBorderWindow->GetPosPixel();
825 Size aSize = pBorderWindow->GetOutputSizePixel();
826 maFrameData.mnTrackX = aPos.X();
827 maFrameData.mnTrackY = aPos.Y();
830
832 nDragFullTest = DragFullOptions::WindowMove;
833 else
834 nDragFullTest = DragFullOptions::WindowSize;
835 }
836 else
837 {
838 bTracking = false;
839
841 ((rMEvt.GetClicks() % 2) == 0) )
842 {
844 bHitTest = false;
845
846 if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
847 {
848 SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
849 // always perform docking on double click, no button required
850 pClientWindow->TitleButtonClick( TitleButton::Docking );
851 }
852 }
853 }
854 }
855
856 if ( bTracking )
857 {
858 maFrameData.mbDragFull = false;
859 if ( nDragFullTest != DragFullOptions::NONE )
860 maFrameData.mbDragFull = true; // always fulldrag for proper docking, ignore system settings
861 pBorderWindow->StartTracking();
862 }
863 else if ( bHitTest )
865 }
866 }
867
868 return true;
869}
870
872{
874
875 if ( rTEvt.IsTrackingEnded() )
876 {
879
880 if ( nHitTest & BorderWindowHitTest::Close )
881 {
883 {
885 pBorderWindow->InvalidateBorder();
886
887 // do not call a Click-Handler when aborting
888 if ( !rTEvt.IsTrackingCanceled() )
889 {
890 // dispatch to correct window type (why is Close() not virtual ??? )
891 // TODO: make Close() virtual
892 VclPtr<vcl::Window> pWin = pBorderWindow->ImplGetClientWindow()->ImplGetWindow();
893 SystemWindow *pSysWin = dynamic_cast<SystemWindow* >(pWin.get());
894 DockingWindow *pDockWin = dynamic_cast<DockingWindow*>(pWin.get());
895 if ( pSysWin )
896 pSysWin->Close();
897 else if ( pDockWin )
898 pDockWin->Close();
899 }
900 }
901 }
902 else if ( nHitTest & BorderWindowHitTest::Dock )
903 {
905 {
907 pBorderWindow->InvalidateBorder();
908
909 // do not call a Click-Handler when aborting
910 if ( !rTEvt.IsTrackingCanceled() )
911 {
912 if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
913 {
914 SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
915 pClientWindow->TitleButtonClick( TitleButton::Docking );
916 }
917 }
918 }
919 }
920 else if ( nHitTest & BorderWindowHitTest::Menu )
921 {
923 {
925 pBorderWindow->InvalidateBorder();
926
927 // handler already called on mouse down
928 }
929 }
930 else if ( nHitTest & BorderWindowHitTest::Hide )
931 {
933 {
935 pBorderWindow->InvalidateBorder();
936
937 // do not call a Click-Handler when aborting
938 if ( !rTEvt.IsTrackingCanceled() )
939 {
940 if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
941 {
942 SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow());
943 pClientWindow->TitleButtonClick( TitleButton::Hide );
944 }
945 }
946 }
947 }
948 else if ( nHitTest & BorderWindowHitTest::Help )
949 {
951 {
953 pBorderWindow->InvalidateBorder();
954 }
955 }
956 else
957 {
959 {
960 // restore old state when aborting
961 if ( rTEvt.IsTrackingCanceled() )
963 }
964 else
965 {
966 pBorderWindow->HideTracking();
967 if ( !rTEvt.IsTrackingCanceled() )
969 }
970
971 if ( !rTEvt.IsTrackingCanceled() )
972 {
973 if ( pBorderWindow->ImplGetClientWindow()->ImplIsFloatingWindow() )
974 {
975 if ( static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->IsInPopupMode() )
976 static_cast<FloatingWindow*>(pBorderWindow->ImplGetClientWindow())->EndPopupMode( FloatWinPopupEndFlags::TearOff );
977 }
978 }
979 }
980 }
981 else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
982 {
983 Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
984
986 {
987 if ( maFrameData.maCloseRect.Contains( aMousePos ) )
988 {
990 {
992 pBorderWindow->InvalidateBorder();
993 }
994 }
995 else
996 {
998 {
1000 pBorderWindow->InvalidateBorder();
1001 }
1002 }
1003 }
1005 {
1006 if ( maFrameData.maDockRect.Contains( aMousePos ) )
1007 {
1009 {
1011 pBorderWindow->InvalidateBorder();
1012 }
1013 }
1014 else
1015 {
1017 {
1019 pBorderWindow->InvalidateBorder();
1020 }
1021 }
1022 }
1024 {
1025 if ( maFrameData.maMenuRect.Contains( aMousePos ) )
1026 {
1028 {
1030 pBorderWindow->InvalidateBorder();
1031 }
1032 }
1033 else
1034 {
1036 {
1038 pBorderWindow->InvalidateBorder();
1039 }
1040 }
1041 }
1043 {
1044 if ( maFrameData.maHideRect.Contains( aMousePos ) )
1045 {
1047 {
1049 pBorderWindow->InvalidateBorder();
1050 }
1051 }
1052 else
1053 {
1055 {
1057 pBorderWindow->InvalidateBorder();
1058 }
1059 }
1060 }
1062 {
1063 if ( maFrameData.maHelpRect.Contains( aMousePos ) )
1064 {
1066 {
1068 pBorderWindow->InvalidateBorder();
1069 }
1070 }
1071 else
1072 {
1074 {
1076 pBorderWindow->InvalidateBorder();
1077 }
1078 }
1079 }
1080 else
1081 {
1082 aMousePos.AdjustX( -(maFrameData.maMouseOff.X()) );
1083 aMousePos.AdjustY( -(maFrameData.maMouseOff.Y()) );
1084
1086 {
1088
1089 Point aPos = pBorderWindow->GetPosPixel();
1090 aPos.AdjustX(aMousePos.X() );
1091 aPos.AdjustY(aMousePos.Y() );
1092 if ( maFrameData.mbDragFull )
1093 {
1094 pBorderWindow->SetPosPixel( aPos );
1095 pBorderWindow->ImplUpdateAll();
1096 pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
1097 }
1098 else
1099 {
1100 maFrameData.mnTrackX = aPos.X();
1101 maFrameData.mnTrackY = aPos.Y();
1102 pBorderWindow->ShowTracking( tools::Rectangle( pBorderWindow->ScreenToOutputPixel( aPos ), pBorderWindow->GetOutputSizePixel() ), ShowTrackFlags::Big );
1103 }
1104 }
1105 else
1106 {
1107 Point aOldPos = pBorderWindow->GetPosPixel();
1108 Size aSize = pBorderWindow->GetSizePixel();
1109 tools::Rectangle aNewRect( aOldPos, aSize );
1110 tools::Long nOldWidth = aSize.Width();
1111 tools::Long nOldHeight = aSize.Height();
1114 tools::Long nMinWidth = pBorderWindow->mnMinWidth+nBorderWidth;
1115 tools::Long nMinHeight = pBorderWindow->mnMinHeight+nBorderHeight;
1116 tools::Long nMinWidth2 = nBorderWidth;
1117 tools::Long nMaxWidth = pBorderWindow->mnMaxWidth+nBorderWidth;
1118 tools::Long nMaxHeight = pBorderWindow->mnMaxHeight+nBorderHeight;
1119
1121 {
1122 nMinWidth2 += 4;
1123
1124 if ( pBorderWindow->GetStyle() & WB_CLOSEABLE )
1125 nMinWidth2 += maFrameData.maCloseRect.GetWidth();
1126 }
1127 if ( nMinWidth2 > nMinWidth )
1128 nMinWidth = nMinWidth2;
1130 {
1131 aNewRect.AdjustLeft(aMousePos.X() );
1132 if ( aNewRect.GetWidth() < nMinWidth )
1133 aNewRect.SetLeft( aNewRect.Right()-nMinWidth+1 );
1134 else if ( aNewRect.GetWidth() > nMaxWidth )
1135 aNewRect.SetLeft( aNewRect.Right()-nMaxWidth+1 );
1136 }
1138 {
1139 aNewRect.AdjustRight(aMousePos.X() );
1140 if ( aNewRect.GetWidth() < nMinWidth )
1141 aNewRect.SetRight( aNewRect.Left()+nMinWidth+1 );
1142 else if ( aNewRect.GetWidth() > nMaxWidth )
1143 aNewRect.SetRight( aNewRect.Left()+nMaxWidth+1 );
1144 }
1146 {
1147 aNewRect.AdjustTop(aMousePos.Y() );
1148 if ( aNewRect.GetHeight() < nMinHeight )
1149 aNewRect.SetTop( aNewRect.Bottom()-nMinHeight+1 );
1150 else if ( aNewRect.GetHeight() > nMaxHeight )
1151 aNewRect.SetTop( aNewRect.Bottom()-nMaxHeight+1 );
1152 }
1154 {
1155 aNewRect.AdjustBottom(aMousePos.Y() );
1156 if ( aNewRect.GetHeight() < nMinHeight )
1157 aNewRect.SetBottom( aNewRect.Top()+nMinHeight+1 );
1158 else if ( aNewRect.GetHeight() > nMaxHeight )
1159 aNewRect.SetBottom( aNewRect.Top()+nMaxHeight+1 );
1160 }
1161
1162 // call Resizing-Handler for SystemWindows
1163 if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
1164 {
1165 // adjust size for Resizing-call
1166 aSize = aNewRect.GetSize();
1167 aSize.AdjustWidth( -nBorderWidth );
1168 aSize.AdjustHeight( -nBorderHeight );
1169 static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow())->Resizing( aSize );
1170 aSize.AdjustWidth(nBorderWidth );
1171 aSize.AdjustHeight(nBorderHeight );
1172 if ( aSize.Width() < nMinWidth )
1173 aSize.setWidth( nMinWidth );
1174 if ( aSize.Height() < nMinHeight )
1175 aSize.setHeight( nMinHeight );
1176 if ( aSize.Width() > nMaxWidth )
1177 aSize.setWidth( nMaxWidth );
1178 if ( aSize.Height() > nMaxHeight )
1179 aSize.setHeight( nMaxHeight );
1181 aNewRect.SetLeft( aNewRect.Right()-aSize.Width()+1 );
1182 else
1183 aNewRect.SetRight( aNewRect.Left()+aSize.Width()-1 );
1185 aNewRect.SetTop( aNewRect.Bottom()-aSize.Height()+1 );
1186 else
1187 aNewRect.SetBottom( aNewRect.Top()+aSize.Height()-1 );
1188 }
1189
1190 if ( maFrameData.mbDragFull )
1191 {
1192 // no move (only resize) if position did not change
1193 if( aOldPos != aNewRect.TopLeft() )
1194 pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
1195 aNewRect.GetWidth(), aNewRect.GetHeight() );
1196 else
1197 pBorderWindow->setPosSizePixel( aNewRect.Left(), aNewRect.Top(),
1198 aNewRect.GetWidth(), aNewRect.GetHeight(), PosSizeFlags::Size );
1199
1200 pBorderWindow->ImplUpdateAll();
1201 pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll();
1203 maFrameData.maMouseOff.AdjustX(aNewRect.GetWidth()-nOldWidth );
1205 maFrameData.maMouseOff.AdjustY(aNewRect.GetHeight()-nOldHeight );
1206 }
1207 else
1208 {
1209 maFrameData.mnTrackX = aNewRect.Left();
1210 maFrameData.mnTrackY = aNewRect.Top();
1211 maFrameData.mnTrackWidth = aNewRect.GetWidth();
1212 maFrameData.mnTrackHeight = aNewRect.GetHeight();
1213 pBorderWindow->ShowTracking( tools::Rectangle( pBorderWindow->ScreenToOutputPixel( aNewRect.TopLeft() ), aNewRect.GetSize() ), ShowTrackFlags::Big );
1214 }
1215 }
1216 }
1217 }
1218
1219 return true;
1220}
1221
1223{
1224 return ImplRequestHelp( &maFrameData, rPos, rHelpRect );
1225}
1226
1228{
1229 return maFrameData.maMenuRect;
1230}
1231
1233{
1236 const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
1237 DecorationView aDecoView( pDev );
1238 tools::Rectangle aRect( 0, 0, 10, 10 );
1240
1241 pData->mpOutDev = pDev;
1242 pData->mnWidth = nWidth;
1243 pData->mnHeight = nHeight;
1244
1245 pData->mnTitleType = pBorderWindow->mnTitleType;
1246
1247 if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BorderWindowTitleType::NONE) )
1248 pData->mnBorderSize = 0;
1249 else if ( pData->mnTitleType == BorderWindowTitleType::Tearoff )
1250 pData->mnBorderSize = 0;
1251 else
1252 pData->mnBorderSize = StyleSettings::GetBorderSize();
1253 pData->mnLeftBorder = aCalcRect.Left();
1254 pData->mnTopBorder = aCalcRect.Top();
1255 pData->mnRightBorder = aRect.Right()-aCalcRect.Right();
1256 pData->mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
1257 pData->mnLeftBorder += pData->mnBorderSize;
1258 pData->mnTopBorder += pData->mnBorderSize;
1259 pData->mnRightBorder += pData->mnBorderSize;
1260 pData->mnBottomBorder += pData->mnBorderSize;
1261 pData->mnNoTitleTop = pData->mnTopBorder;
1262
1264 if (pData->mnTitleHeight)
1265 {
1266 // to improve symbol display force a minimum title height
1267 if (pData->mnTitleType != BorderWindowTitleType::Tearoff &&
1268 pData->mnTitleHeight < MIN_CAPTION_HEIGHT)
1269 pData->mnTitleHeight = MIN_CAPTION_HEIGHT;
1270
1271 // set a proper background for drawing
1272 // highlighted buttons in the title
1273 pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() );
1274
1275 pData->maTitleRect.SetLeft( pData->mnLeftBorder );
1276 pData->maTitleRect.SetRight( nWidth-pData->mnRightBorder-1 );
1277 pData->maTitleRect.SetTop( pData->mnTopBorder );
1278 pData->maTitleRect.SetBottom( pData->maTitleRect.Top()+pData->mnTitleHeight-1 );
1279
1281 {
1282 tools::Long nRight = pData->maTitleRect.Right() - 3;
1283 tools::Long const nItemTop = pData->maTitleRect.Top() + 2;
1284 tools::Long const nItemBottom = pData->maTitleRect.Bottom() - 2;
1285
1286 auto addSquareOnRight = [&nRight, nItemTop, nItemBottom](
1287 tools::Rectangle & rect, tools::Long gap)
1288 {
1289 rect.SetTop( nItemTop );
1290 rect.SetBottom( nItemBottom );
1291 rect.SetRight( nRight );
1292 rect.SetLeft( rect.Right() - rect.GetHeight() + 1 );
1293 nRight -= rect.GetWidth() + gap;
1294 };
1295
1296 if ( pBorderWindow->GetStyle() & WB_CLOSEABLE )
1297 {
1298 addSquareOnRight(pData->maCloseRect, 3);
1299 }
1300
1301 if ( pBorderWindow->mbMenuBtn )
1302 {
1303 addSquareOnRight(pData->maMenuRect, 0);
1304 }
1305
1306 if ( pBorderWindow->mbDockBtn )
1307 {
1308 addSquareOnRight(pData->maDockRect, 0);
1309 }
1310
1311 if ( pBorderWindow->mbHideBtn )
1312 {
1313 addSquareOnRight(pData->maHideRect, 0);
1314 }
1315 }
1316 else
1317 {
1318 pData->maCloseRect.SetEmpty();
1319 pData->maDockRect.SetEmpty();
1320 pData->maMenuRect.SetEmpty();
1321 pData->maHideRect.SetEmpty();
1322 pData->maHelpRect.SetEmpty();
1323 }
1324
1325 pData->mnTopBorder += pData->mnTitleHeight;
1326 }
1327 else
1328 {
1329 pData->maTitleRect.SetEmpty();
1330 pData->maCloseRect.SetEmpty();
1331 pData->maDockRect.SetEmpty();
1332 pData->maMenuRect.SetEmpty();
1333 pData->maHideRect.SetEmpty();
1334 pData->maHelpRect.SetEmpty();
1335 }
1336}
1337
1338void ImplStdBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
1339 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
1340{
1341 rLeftBorder = maFrameData.mnLeftBorder;
1342 rTopBorder = maFrameData.mnTopBorder;
1343 rRightBorder = maFrameData.mnRightBorder;
1344 rBottomBorder = maFrameData.mnBottomBorder;
1345}
1346
1348{
1350}
1351
1353{
1355 ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
1356 Point aTmpPoint = pOffset ? *pOffset : Point();
1357 tools::Rectangle aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) );
1358 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
1359 Color aFaceColor(rStyleSettings.GetFaceColor());
1360 Color aFrameColor(aFaceColor);
1361
1362 aFrameColor.DecreaseContrast(sal_uInt8(0.5 * 255));
1363
1364 // Draw Frame
1365 vcl::Region oldClipRgn(rRenderContext.GetClipRegion());
1366
1367 // for popups, don't draw part of the frame
1368 const bool bShowJunctionToLauncher = !(pData->mnTitleType & (BorderWindowTitleType::Normal | BorderWindowTitleType::Small));
1369 if (bShowJunctionToLauncher && !ImplGetSVData()->maNWFData.mbNoFrameJunctionForPopups)
1370 {
1371 FloatingWindow* pWin = dynamic_cast<FloatingWindow*>(pData->mpBorderWindow->GetWindow(GetWindowType::Client));
1372 if (pWin)
1373 {
1374 vcl::Region aClipRgn(aInRect);
1375 tools::Rectangle aItemClipRect(pWin->ImplGetItemEdgeClipRect());
1376 if (!aItemClipRect.IsEmpty())
1377 {
1378 aItemClipRect.SetPos(pData->mpBorderWindow->AbsoluteScreenToOutputPixel(aItemClipRect.TopLeft()));
1379 aClipRgn.Exclude(aItemClipRect);
1380 rRenderContext.SetClipRegion(aClipRgn);
1381 }
1382 }
1383 }
1384
1385 // single line frame
1386 rRenderContext.SetLineColor(aFrameColor);
1387 rRenderContext.SetFillColor();
1388 rRenderContext.DrawRect(aInRect);
1389 aInRect.AdjustLeft( 1 );
1390 aInRect.AdjustRight( -1 );
1391 aInRect.AdjustTop( 1 );
1392 aInRect.AdjustBottom( -1 );
1393
1394 // restore
1396 rRenderContext.SetClipRegion(oldClipRgn);
1397
1398 // Draw Border
1399 rRenderContext.SetLineColor();
1400 tools::Long nBorderSize = pData->mnBorderSize;
1401 if (nBorderSize)
1402 {
1403 rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
1404 rRenderContext.DrawRect(tools::Rectangle(Point(aInRect.Left(), aInRect.Top()),
1405 Size(aInRect.GetWidth(), nBorderSize)));
1406 rRenderContext.DrawRect(tools::Rectangle(Point(aInRect.Left(), aInRect.Top() + nBorderSize),
1407 Size(nBorderSize, aInRect.GetHeight() - nBorderSize)));
1408 rRenderContext.DrawRect(tools::Rectangle(Point(aInRect.Left(), aInRect.Bottom() - nBorderSize + 1),
1409 Size(aInRect.GetWidth(), nBorderSize)));
1410 rRenderContext.DrawRect(tools::Rectangle(Point(aInRect.Right()-nBorderSize + 1, aInRect.Top() + nBorderSize),
1411 Size(nBorderSize, aInRect.GetHeight() - nBorderSize)));
1412 }
1413
1414 // Draw Title
1415 if (!pData->maTitleRect.IsEmpty())
1416 {
1417 aInRect = pData->maTitleRect;
1418
1419 // use no gradient anymore, just a static titlecolor
1420 if (pData->mnTitleType == BorderWindowTitleType::Tearoff)
1421 rRenderContext.SetFillColor(rStyleSettings.GetFaceGradientColor());
1422 else if (pData->mnTitleType == BorderWindowTitleType::Popup)
1423 rRenderContext.SetFillColor(aFaceColor);
1424 else
1425 rRenderContext.SetFillColor(aFrameColor);
1426
1427 rRenderContext.SetTextColor(rStyleSettings.GetButtonTextColor());
1428 tools::Rectangle aTitleRect(pData->maTitleRect);
1429 if(pOffset)
1430 aTitleRect.Move(pOffset->X(), pOffset->Y());
1431 rRenderContext.DrawRect(aTitleRect);
1432
1433 if (pData->mnTitleType != BorderWindowTitleType::Tearoff)
1434 {
1435 aInRect.AdjustLeft(2 );
1436 aInRect.AdjustRight( -2 );
1437
1438 if (!pData->maHelpRect.IsEmpty())
1439 aInRect.SetRight( pData->maHelpRect.Left() - 2 );
1440 else if (!pData->maHideRect.IsEmpty())
1441 aInRect.SetRight( pData->maHideRect.Left() - 2 );
1442 else if (!pData->maDockRect.IsEmpty())
1443 aInRect.SetRight( pData->maDockRect.Left() - 2 );
1444 else if (!pData->maMenuRect.IsEmpty())
1445 aInRect.SetRight( pData->maMenuRect.Left() - 2 );
1446 else if (!pData->maCloseRect.IsEmpty())
1447 aInRect.SetRight( pData->maCloseRect.Left() - 2 );
1448
1449 if (pOffset)
1450 aInRect.Move(pOffset->X(), pOffset->Y());
1451
1453
1454 // must show tooltip ?
1455 TextRectInfo aInfo;
1456 rRenderContext.GetTextRect(aInRect, pBorderWindow->GetText(), nTextStyle, &aInfo);
1457 pData->mbTitleClipped = aInfo.IsEllipses();
1458
1459 rRenderContext.DrawText(aInRect, pBorderWindow->GetText(), nTextStyle);
1460 }
1461 else
1462 {
1463 ToolBox::ImplDrawGrip(rRenderContext, aTitleRect, ToolBox::ImplGetDragWidth(rRenderContext, false),
1464 WindowAlign::Left, false);
1465 }
1466 }
1467
1468 if (!pData->maCloseRect.IsEmpty())
1469 {
1470 tools::Rectangle aSymbolRect(pData->maCloseRect);
1471 if (pOffset)
1472 aSymbolRect.Move(pOffset->X(), pOffset->Y());
1473 ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::CLOSE, pData->mnCloseState);
1474 }
1475 if (!pData->maDockRect.IsEmpty())
1476 {
1477 tools::Rectangle aSymbolRect(pData->maDockRect);
1478 if (pOffset)
1479 aSymbolRect.Move(pOffset->X(), pOffset->Y());
1480 ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::DOCK, pData->mnDockState);
1481 }
1482 if (!pData->maMenuRect.IsEmpty())
1483 {
1484 tools::Rectangle aSymbolRect(pData->maMenuRect);
1485 if (pOffset)
1486 aSymbolRect.Move(pOffset->X(), pOffset->Y());
1487 ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::MENU, pData->mnMenuState);
1488 }
1489 if (!pData->maHideRect.IsEmpty())
1490 {
1491 tools::Rectangle aSymbolRect(pData->maHideRect);
1492 if (pOffset)
1493 aSymbolRect.Move(pOffset->X(), pOffset->Y());
1494 ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::HIDE, pData->mnHideState);
1495 }
1496
1497 if (!pData->maHelpRect.IsEmpty())
1498 {
1499 tools::Rectangle aSymbolRect(pData->maHelpRect);
1500 if (pOffset)
1501 aSymbolRect.Move(pOffset->X(), pOffset->Y());
1502 ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::HELP, pData->mnHelpState);
1503 }
1504}
1505
1507 WinBits nStyle, BorderWindowStyle nTypeStyle,
1508 SystemParentData* pSystemParentData
1509 )
1510{
1511 // remove all unwanted WindowBits
1512 WinBits nOrgStyle = nStyle;
1514 if ( nTypeStyle & BorderWindowStyle::App )
1515 nTestStyle |= WB_APP;
1516 nStyle &= nTestStyle;
1517
1518 mpWindowImpl->mbBorderWin = true;
1519 mbSmallOutBorder = false;
1520 if ( nTypeStyle & BorderWindowStyle::Frame )
1521 {
1522 if( nStyle & WB_SYSTEMCHILDWINDOW )
1523 {
1524 mpWindowImpl->mbOverlapWin = true;
1525 mpWindowImpl->mbFrame = true;
1526 mbFrameBorder = false;
1527 }
1528 else if( nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP) )
1529 {
1530 mpWindowImpl->mbOverlapWin = true;
1531 mpWindowImpl->mbFrame = true;
1532 mbFrameBorder = (nOrgStyle & WB_NOBORDER) == 0;
1533 }
1534 else
1535 {
1536 mpWindowImpl->mbOverlapWin = true;
1537 mpWindowImpl->mbFrame = true;
1538 mbFrameBorder = false;
1539 // closeable windows may have a border as well, eg. system floating windows without caption
1540 if ( (nOrgStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE/* | WB_CLOSEABLE*/)) == WB_BORDER )
1541 mbSmallOutBorder = true;
1542 }
1543 }
1544 else if ( nTypeStyle & BorderWindowStyle::Overlap )
1545 {
1546 mpWindowImpl->mbOverlapWin = true;
1547 mbFrameBorder = true;
1548 }
1549 else
1550 mbFrameBorder = false;
1551
1552 if ( nTypeStyle & BorderWindowStyle::Float )
1553 mbFloatWindow = true;
1554 else
1555 mbFloatWindow = false;
1556
1557 Window::ImplInit( pParent, nStyle, pSystemParentData );
1558 SetBackground();
1560
1561 mpMenuBarWindow = nullptr;
1562 mnMinWidth = 0;
1563 mnMinHeight = 0;
1564 mnMaxWidth = SHRT_MAX;
1565 mnMaxHeight = SHRT_MAX;
1566 mnOrgMenuHeight = 0;
1567 mbMenuHide = false;
1568 mbDockBtn = false;
1569 mbMenuBtn = false;
1570 mbHideBtn = false;
1572
1573 if ( nTypeStyle & BorderWindowStyle::Float )
1575 else
1578 InitView();
1579}
1580
1582 SystemParentData* pSystemParentData,
1583 WinBits nStyle, BorderWindowStyle nTypeStyle
1585{
1586 ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
1587}
1588
1590 BorderWindowStyle nTypeStyle ) :
1592{
1593 ImplInit( pParent, nStyle, nTypeStyle, nullptr );
1594}
1595
1597{
1598 disposeOnce();
1599}
1600
1602{
1603 mpBorderView.reset();
1607}
1608
1610{
1611 if (mpBorderView)
1612 mpBorderView->MouseMove( rMEvt );
1613}
1614
1616{
1617 if (mpBorderView)
1618 mpBorderView->MouseButtonDown( rMEvt );
1619}
1620
1622{
1623 if (mpBorderView)
1624 mpBorderView->Tracking( rTEvt );
1625}
1626
1628{
1629 if (mpBorderView)
1630 mpBorderView->DrawWindow(rRenderContext);
1631}
1632
1633void ImplBorderWindow::Draw( OutputDevice* pOutDev, const Point& rPos )
1634{
1635 if (mpBorderView)
1636 mpBorderView->DrawWindow(*pOutDev, &rPos);
1637}
1638
1640{
1641 SetDisplayActive( true );
1642 Window::Activate();
1643}
1644
1646{
1647 // remove active windows from the ruler, also ignore the Deactivate
1648 // if a menu becomes active
1649 if (GetActivateMode() != ActivateModeFlags::NONE && !ImplGetSVData()->mpWinData->mbNoDeactivate)
1650 SetDisplayActive( false );
1651 Window::Deactivate();
1652}
1653
1655{
1656 // no keyboard help for border window
1658 {
1659 Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
1660 tools::Rectangle aHelpRect;
1661 OUString aHelpStr( mpBorderView->RequestHelp( aMousePosPixel, aHelpRect ) );
1662
1663 // retrieve rectangle
1664 if ( !aHelpStr.isEmpty() )
1665 {
1666 aHelpRect.SetPos( OutputToScreenPixel( aHelpRect.TopLeft() ) );
1667 if ( rHEvt.GetMode() & HelpEventMode::BALLOON )
1668 Help::ShowBalloon( this, aHelpRect.Center(), aHelpRect, aHelpStr );
1669 else
1670 Help::ShowQuickHelp( this, aHelpRect, aHelpStr );
1671 return;
1672 }
1673 }
1674
1675 Window::RequestHelp( rHEvt );
1676}
1677
1679{
1680 Size aSize = GetOutputSizePixel();
1681
1682 vcl::Window* pClientWindow = ImplGetClientWindow();
1683
1684 sal_Int32 nLeftBorder;
1685 sal_Int32 nTopBorder;
1686 sal_Int32 nRightBorder;
1687 sal_Int32 nBottomBorder;
1688 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1689
1690 if (mpMenuBarWindow)
1691 {
1693 if ( mbMenuHide )
1694 {
1695 if ( nMenuHeight )
1696 mnOrgMenuHeight = nMenuHeight;
1697 nMenuHeight = 0;
1698 }
1699 else
1700 {
1701 if ( !nMenuHeight )
1702 nMenuHeight = mnOrgMenuHeight;
1703 }
1705 nLeftBorder, nTopBorder,
1706 aSize.Width()-nLeftBorder-nRightBorder,
1707 nMenuHeight);
1708
1709 // shift the notebookbar down accordingly
1710 nTopBorder += nMenuHeight;
1711 }
1712
1713 if (mpNotebookBar)
1714 {
1715 tools::Long nNotebookBarHeight = mpNotebookBar->GetSizePixel().Height();
1716
1717 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1718 const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader();
1719 // since size of notebookbar changes, to make common persona for menubar
1720 // and notebookbar persona should be set again with changed coordinates
1721 if (!aPersona.IsEmpty())
1722 {
1723 Wallpaper aWallpaper(aPersona);
1725 aWallpaper.SetRect(tools::Rectangle(Point(0, -nTopBorder),
1726 Size(aSize.Width() - nLeftBorder - nRightBorder,
1727 nNotebookBarHeight + nTopBorder)));
1728 mpNotebookBar->SetBackground(aWallpaper);
1729 }
1730
1732 nLeftBorder, nTopBorder,
1733 aSize.Width() - nLeftBorder - nRightBorder,
1734 nNotebookBarHeight);
1735 }
1736
1737 GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder,
1738 pClientWindow->mpWindowImpl->mnRightBorder, pClientWindow->mpWindowImpl->mnBottomBorder );
1739 pClientWindow->ImplPosSizeWindow( pClientWindow->mpWindowImpl->mnLeftBorder,
1740 pClientWindow->mpWindowImpl->mnTopBorder,
1741 aSize.Width()-pClientWindow->mpWindowImpl->mnLeftBorder-pClientWindow->mpWindowImpl->mnRightBorder,
1742 aSize.Height()-pClientWindow->mpWindowImpl->mnTopBorder-pClientWindow->mpWindowImpl->mnBottomBorder,
1745
1746 // UpdateView
1747 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1749
1750 Window::Resize();
1751}
1752
1754{
1755 if ( (nType == StateChangedType::Text) ||
1757 {
1760 }
1761
1762 Window::StateChanged( nType );
1763}
1764
1766{
1767 if ( (rDCEvt.GetType() == DataChangedEventType::FONTS) ||
1769 ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
1770 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
1771 {
1772 if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
1774 }
1775
1776 Window::DataChanged( rDCEvt );
1777}
1778
1780{
1781 if ( mbSmallOutBorder )
1782 mpBorderView.reset(new ImplSmallBorderWindowView( this ));
1783 else if ( mpWindowImpl->mbFrame )
1784 {
1785 if( mbFrameBorder )
1786 mpBorderView.reset(new ImplStdBorderWindowView( this ));
1787 else
1789 }
1790 else if ( !mbFrameBorder )
1791 mpBorderView.reset(new ImplSmallBorderWindowView( this ));
1792 else
1793 mpBorderView.reset(new ImplStdBorderWindowView( this ));
1794 Size aSize = GetOutputSizePixel();
1795 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1796}
1797
1798void ImplBorderWindow::UpdateView( bool bNewView, const Size& rNewOutSize )
1799{
1800 sal_Int32 nLeftBorder;
1801 sal_Int32 nTopBorder;
1802 sal_Int32 nRightBorder;
1803 sal_Int32 nBottomBorder;
1804 Size aOldSize = GetSizePixel();
1805 Size aOutputSize = rNewOutSize;
1806
1807 if ( bNewView )
1808 {
1809 mpBorderView.reset();
1810 InitView();
1811 }
1812 else
1813 {
1814 Size aSize = aOutputSize;
1815 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1816 aSize.AdjustWidth(nLeftBorder+nRightBorder );
1817 aSize.AdjustHeight(nTopBorder+nBottomBorder );
1818 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1819 }
1820
1821 vcl::Window* pClientWindow = ImplGetClientWindow();
1822 if ( pClientWindow )
1823 {
1824 GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder,
1825 pClientWindow->mpWindowImpl->mnRightBorder, pClientWindow->mpWindowImpl->mnBottomBorder );
1826 }
1827 GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1828 if ( aOldSize.Width() || aOldSize.Height() )
1829 {
1830 aOutputSize.AdjustWidth(nLeftBorder+nRightBorder );
1831 aOutputSize.AdjustHeight(nTopBorder+nBottomBorder );
1832 if ( aOutputSize == GetSizePixel() )
1834 else
1835 SetSizePixel( aOutputSize );
1836 }
1837}
1838
1840{
1841 if ( !IsReallyVisible() )
1842 return;
1843
1844 // invalidate only if we have a border
1845 sal_Int32 nLeftBorder;
1846 sal_Int32 nTopBorder;
1847 sal_Int32 nRightBorder;
1848 sal_Int32 nBottomBorder;
1849 mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
1850 if ( !(nLeftBorder || nTopBorder || nRightBorder || nBottomBorder) )
1851 return;
1852
1853 tools::Rectangle aWinRect( Point( 0, 0 ), GetOutputSizePixel() );
1854 vcl::Region aRegion( aWinRect );
1855 aWinRect.AdjustLeft(nLeftBorder );
1856 aWinRect.AdjustTop(nTopBorder );
1857 aWinRect.AdjustRight( -nRightBorder );
1858 aWinRect.AdjustBottom( -nBottomBorder );
1859 // no output area anymore, now invalidate all
1860 if ( (aWinRect.Right() < aWinRect.Left()) ||
1861 (aWinRect.Bottom() < aWinRect.Top()) )
1863 else
1864 {
1865 aRegion.Exclude( aWinRect );
1867 }
1868}
1869
1871{
1872 if ( mbDisplayActive != bActive )
1873 {
1874 mbDisplayActive = bActive;
1875 if ( mbFrameBorder )
1877 }
1878}
1879
1881{
1882 mnTitleType = nTitleType;
1883 UpdateView( false, rSize );
1884}
1885
1887{
1888 if ( !mbFrameBorder && (mnBorderStyle != nStyle) )
1889 {
1890 mnBorderStyle = nStyle;
1892 }
1893}
1894
1896{
1898 Size aSize = GetOutputSizePixel();
1899 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1901}
1902
1903void ImplBorderWindow::SetDockButton( bool bDockButton )
1904{
1905 mbDockBtn = bDockButton;
1906 Size aSize = GetOutputSizePixel();
1907 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1909}
1910
1911void ImplBorderWindow::SetHideButton( bool bHideButton )
1912{
1913 mbHideBtn = bHideButton;
1914 Size aSize = GetOutputSizePixel();
1915 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1917}
1918
1919void ImplBorderWindow::SetMenuButton( bool bMenuButton )
1920{
1921 mbMenuBtn = bMenuButton;
1922 Size aSize = GetOutputSizePixel();
1923 mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
1925}
1926
1928{
1929 Resize();
1930}
1931
1933{
1934 mpMenuBarWindow = pWindow;
1936 if ( pWindow )
1937 pWindow->Show();
1938}
1939
1941{
1942 mbMenuHide = bHide;
1944}
1945
1946void ImplBorderWindow::SetNotebookBar(const OUString& rUIXMLDescription,
1947 const css::uno::Reference<css::frame::XFrame>& rFrame,
1948 const NotebookBarAddonsItem& aNotebookBarAddonsItem)
1949{
1950 if (mpNotebookBar)
1952 mpNotebookBar = VclPtr<NotebookBar>::Create(this, "NotebookBar", rUIXMLDescription, rFrame,
1953 aNotebookBarAddonsItem);
1954 Resize();
1955}
1956
1958{
1959 if (mpNotebookBar)
1961 mpNotebookBar = nullptr;
1962 Resize();
1963}
1964
1965void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
1966 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
1967{
1968 mpBorderView->GetBorder(rLeftBorder, rTopBorder, rRightBorder, rBottomBorder);
1969
1971 rTopBorder += mpMenuBarWindow->GetSizePixel().Height();
1972
1974 rTopBorder += mpNotebookBar->GetSizePixel().Height();
1975}
1976
1978{
1979 return mpBorderView->CalcTitleWidth();
1980}
1981
1983{
1984 return mpBorderView->GetMenuRect();
1985}
1986
1988{
1989 const vcl::Window* pClientWindow = ImplGetClientWindow();
1990 if (pClientWindow)
1991 return pClientWindow->GetOptimalSize();
1992 return Size(mnMinWidth, mnMinHeight);
1993}
1994
1996{
1997 //if we are floating, then we don't want to inform our parent that it needs
1998 //to calculate a new layout allocation. Because while we are a child
1999 //of our parent we are not embedded into the parent so it doesn't care
2000 //about us.
2001 if (mbFloatWindow)
2002 return;
2004}
2005
2006/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawTextFlags
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
static void ImplDrawBrdWinSymbolButton(vcl::RenderContext *pDev, const tools::Rectangle &rRect, SymbolType eSymbol, DrawButtonFlags nState)
Definition: brdwin.cxx:75
static void ImplDrawBrdWinSymbol(vcl::RenderContext *pDev, const tools::Rectangle &rRect, SymbolType eSymbol)
Definition: brdwin.cxx:64
#define MIN_CAPTION_HEIGHT
Definition: brdwin.cxx:40
BorderWindowHitTest
Definition: brdwin.hxx:44
BorderWindowTitleType
Definition: brdwin.hxx:65
BorderWindowStyle
Definition: brdwin.hxx:33
constexpr int nBorderWidth
const StyleSettings & GetStyleSettings() const
bool IsEmpty() const
Definition: BitmapEx.cxx:186
void DecreaseContrast(sal_uInt8 cContDec)
DataChangedEventType GetType() const
Definition: event.hxx:362
AllSettingsFlags GetFlags() const
Definition: event.hxx:363
tools::Rectangle DrawButton(const tools::Rectangle &rRect, DrawButtonFlags nStyle)
Definition: decoview.cxx:894
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
Definition: decoview.cxx:768
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:811
virtual bool Close()
Definition: dockwin.cxx:625
Definition: edit.hxx:56
SAL_DLLPRIVATE tools::Rectangle ImplGetItemEdgeClipRect() const
Definition: floatwin.cxx:53
bool IsInPopupMode() const
Definition: floatwin.hxx:130
HelpEventMode GetMode() const
Definition: event.hxx:208
bool KeyboardActivated() const
Definition: event.hxx:209
const Point & GetMousePosPixel() const
Definition: event.hxx:207
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:180
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
Definition: help.cxx:157
static void ImplInitTitle(ImplBorderFrameData *pData)
Definition: brdwin.cxx:139
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
Definition: brdwin.cxx:119
static tools::Long ImplCalcTitleWidth(const ImplBorderFrameData *pData)
Definition: brdwin.cxx:337
static void ImplMouseMove(ImplBorderFrameData *pData, const MouseEvent &rMEvt)
Definition: brdwin.cxx:246
virtual bool MouseMove(const MouseEvent &rMEvt)
Definition: brdwin.cxx:114
virtual tools::Rectangle GetMenuRect() const
Definition: brdwin.cxx:134
virtual bool Tracking(const TrackingEvent &rTEvt)
Definition: brdwin.cxx:124
static OUString ImplRequestHelp(ImplBorderFrameData const *pData, const Point &rPos, tools::Rectangle &rHelpRect)
Definition: brdwin.cxx:287
virtual ~ImplBorderWindowView()
Definition: brdwin.cxx:110
static BorderWindowHitTest ImplHitTest(ImplBorderFrameData const *pData, const Point &rPos)
Definition: brdwin.cxx:174
virtual OUString RequestHelp(const Point &rPos, tools::Rectangle &rHelpRect)
Definition: brdwin.cxx:129
BorderWindowTitleType mnTitleType
Definition: brdwin.hxx:93
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem)
Definition: brdwin.cxx:1946
bool mbFrameBorder
Definition: brdwin.hxx:97
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: brdwin.cxx:1615
void ImplInit(vcl::Window *pParent, WinBits nStyle, BorderWindowStyle nTypeStyle, SystemParentData *pParentData)
Definition: brdwin.cxx:1506
tools::Long CalcTitleWidth() const
Definition: brdwin.cxx:1977
void SetDockButton(bool bDockButton)
Definition: brdwin.cxx:1903
virtual ~ImplBorderWindow() override
Definition: brdwin.cxx:1596
std::unique_ptr< ImplBorderWindowView > mpBorderView
Definition: brdwin.hxx:85
void UpdateView(bool bNewView, const Size &rNewOutSize)
Definition: brdwin.cxx:1798
void SetMenuBarWindow(vcl::Window *pWindow)
Definition: brdwin.cxx:1932
void SetHideButton(bool bHideButton)
Definition: brdwin.cxx:1911
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: brdwin.cxx:1609
void InvalidateBorder()
Definition: brdwin.cxx:1839
ImplBorderWindow(const ImplBorderWindow &)=delete
virtual void Activate() override
Definition: brdwin.cxx:1639
VclPtr< NotebookBar > mpNotebookBar
Definition: brdwin.hxx:87
void SetCloseButton()
Definition: brdwin.cxx:1895
bool mbSmallOutBorder
Definition: brdwin.hxx:96
void SetDisplayActive(bool bActive)
Definition: brdwin.cxx:1870
tools::Long mnMaxHeight
Definition: brdwin.hxx:91
VclPtr< vcl::Window > mpMenuBarWindow
Definition: brdwin.hxx:86
tools::Rectangle GetMenuRect() const
Definition: brdwin.cxx:1982
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: brdwin.cxx:1995
void Draw(OutputDevice *pDev, const Point &rPos)
Definition: brdwin.cxx:1633
tools::Long mnMinWidth
Definition: brdwin.hxx:88
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: brdwin.cxx:1765
void SetMenuButton(bool bMenuButton)
Definition: brdwin.cxx:1919
bool mbDisplayActive
Definition: brdwin.hxx:102
virtual void Resize() override
Definition: brdwin.cxx:1678
friend class ImplSmallBorderWindowView
Definition: brdwin.hxx:81
WindowBorderStyle mnBorderStyle
Definition: brdwin.hxx:94
tools::Long mnMaxWidth
Definition: brdwin.hxx:90
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: brdwin.cxx:1654
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: brdwin.cxx:1627
void UpdateMenuHeight()
Definition: brdwin.cxx:1927
bool mbFloatWindow
Definition: brdwin.hxx:95
tools::Long mnMinHeight
Definition: brdwin.hxx:89
void SetMenuBarMode(bool bHide)
Definition: brdwin.cxx:1940
void SetBorderStyle(WindowBorderStyle nStyle)
Definition: brdwin.cxx:1886
virtual void StateChanged(StateChangedType nType) override
Definition: brdwin.cxx:1753
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: brdwin.cxx:1965
WindowBorderStyle GetBorderStyle() const
Definition: brdwin.hxx:144
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: brdwin.cxx:1601
friend class ImplStdBorderWindowView
Definition: brdwin.hxx:82
void SetTitleType(BorderWindowTitleType nTitleType, const Size &rSize)
Definition: brdwin.cxx:1880
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition: brdwin.cxx:1621
void CloseNotebookBar()
Definition: brdwin.cxx:1957
virtual void Deactivate() override
Definition: brdwin.cxx:1645
tools::Long mnOrgMenuHeight
Definition: brdwin.hxx:92
virtual Size GetOptimalSize() const override
Definition: brdwin.cxx:1987
virtual void Init(OutputDevice *pDev, tools::Long nWidth, tools::Long nHeight) override
Definition: brdwin.cxx:359
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
Definition: brdwin.cxx:363
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
Definition: brdwin.cxx:377
virtual tools::Long CalcTitleWidth() const override
Definition: brdwin.cxx:372
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
Definition: brdwin.cxx:578
VclPtr< ImplBorderWindow > mpBorderWindow
Definition: brdwin.hxx:247
virtual void Init(OutputDevice *pOutDev, tools::Long nWidth, tools::Long nHeight) override
Definition: brdwin.cxx:394
ImplSmallBorderWindowView(ImplBorderWindow *pBorderWindow)
Definition: brdwin.cxx:381
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
Definition: brdwin.cxx:592
VclPtr< OutputDevice > mpOutDev
Definition: brdwin.hxx:248
virtual tools::Long CalcTitleWidth() const override
Definition: brdwin.cxx:587
virtual tools::Rectangle GetMenuRect() const override
Definition: brdwin.cxx:1227
virtual ~ImplStdBorderWindowView() override
Definition: brdwin.cxx:759
virtual void Init(OutputDevice *pDev, tools::Long nWidth, tools::Long nHeight) override
Definition: brdwin.cxx:1232
virtual tools::Long CalcTitleWidth() const override
Definition: brdwin.cxx:1347
virtual void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const override
Definition: brdwin.cxx:1338
virtual OUString RequestHelp(const Point &rPos, tools::Rectangle &rHelpRect) override
Definition: brdwin.cxx:1222
ImplStdBorderWindowView(ImplBorderWindow *pBorderWindow)
Definition: brdwin.cxx:746
virtual bool Tracking(const TrackingEvent &rTEvt) override
Definition: brdwin.cxx:871
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: brdwin.cxx:763
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: brdwin.cxx:769
virtual void DrawWindow(vcl::RenderContext &rRenderContext, const Point *pOffset=nullptr) override
Definition: brdwin.cxx:1352
ImplBorderFrameData maFrameData
Definition: brdwin.hxx:269
bool IsSynthetic() const
Definition: event.hxx:142
bool IsLeaveWindow() const
Definition: event.hxx:140
sal_uInt16 GetClicks() const
Definition: event.hxx:126
bool IsRight() const
Definition: event.hxx:153
const Point & GetPosPixel() const
Definition: event.hxx:123
bool IsLeft() const
Definition: event.hxx:149
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
vcl::Region GetClipRegion() const
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
void SetLineColor()
Definition: line.cxx:37
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
void SetFillColor()
Definition: fill.cxx:29
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: text.cxx:1881
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:797
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
virtual vcl::Window * GetOwnerWindow() const
Get the vcl::Window that this OutputDevice belongs to, if any.
Definition: outdev.hxx:1897
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
BitmapEx const & GetPersonaHeader() const
sal_Int32 GetTitleHeight() const
const Color & GetWindowColor() const
const vcl::Font & GetFloatTitleFont() const
static sal_Int32 GetBorderSize()
Color GetFaceGradientColor() const
sal_Int32 GetFloatTitleHeight() const
const Color & GetFaceColor() const
const vcl::Font & GetTitleFont() const
const Color & GetButtonTextColor() const
virtual void TitleButtonClick(TitleButton nButton)
Definition: syswin.cxx:287
virtual bool Close()
Definition: syswin.cxx:262
bool IsEllipses() const
SAL_DLLPRIVATE int ImplGetDragWidth() const
Definition: toolbox.cxx:149
static SAL_DLLPRIVATE void ImplDrawGrip(vcl::RenderContext &rRenderContext, const tools::Rectangle &aDragArea, int nDragWidth, WindowAlign eAlign, bool bHorz)
Definition: toolbox.cxx:246
bool IsTrackingEnded() const
Definition: event.hxx:261
bool IsTrackingCanceled() const
Definition: event.hxx:263
const MouseEvent & GetMouseEvent() const
Definition: event.hxx:257
void disposeAndClear()
Definition: vclptr.hxx:200
void clear()
Definition: vclptr.hxx:190
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
void SetRect(const tools::Rectangle &rRect)
Definition: wall.hxx:84
void SetStyle(WallpaperStyle eStyle)
Definition: wall.cxx:165
constexpr Point Center() const
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
void SetPos(const Point &rPoint)
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
void Exclude(const tools::Rectangle &rRegion)
Definition: region.cxx:680
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2806
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: window.cxx:140
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
void SetStyle(WinBits nStyle)
Definition: window.cxx:1962
SAL_DLLPRIVATE void ImplPosSizeWindow(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
Definition: window.cxx:1458
SAL_DLLPRIVATE void ImplUpdateAll()
Definition: paint.cxx:988
bool IsReallyVisible() const
Definition: window2.cxx:1133
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
vcl::Window * GetParent() const
Definition: window2.cxx:1123
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1163
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3004
bool IsMouseOver() const
Definition: mouse.cxx:596
void HideTracking()
Definition: window2.cxx:151
WindowType GetType() const
Definition: window2.cxx:1000
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
Definition: window.cxx:3860
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1288
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1036
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1353
bool IsCompoundControl() const
Definition: window2.cxx:1219
bool HasFocus() const
Definition: window.cxx:2981
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
Definition: window3.cxx:79
virtual Point GetPosPixel() const
Definition: window.cxx:2794
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
WinBits GetStyle() const
Definition: window2.cxx:979
const AllSettings & GetSettings() const
Definition: window3.cxx:129
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: paint.cxx:1020
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
Definition: window2.cxx:128
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
Definition: window3.cxx:74
void SetTextFillColor()
Definition: window3.cxx:97
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2666
Color GetBackgroundColor() const
Definition: window3.cxx:214
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:484
bool IsSystemWindow() const
Definition: window2.cxx:1023
virtual Size GetSizePixel() const
Definition: window.cxx:2402
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1113
void DrawSelectionBackground(const tools::Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder)
Definition: window.cxx:3465
virtual void SetPointer(PointerStyle)
Definition: mouse.cxx:486
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2173
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
Definition: window2.cxx:947
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
bool IsVisible() const
Definition: window2.cxx:1128
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1283
virtual OUString GetText() const
Definition: window.cxx:3055
static SAL_DLLPRIVATE void ImplCalcSymbolRect(tools::Rectangle &rRect)
Definition: brdwin.cxx:44
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:866
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2812
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1294
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
Definition: window2.cxx:901
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:937
bool IsActive() const
Definition: window2.cxx:1209
bool IsEnabled() const
Definition: window2.cxx:1148
void SetBackground()
Definition: window3.cxx:100
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
DrawButtonFlags
Definition: decoview.hxx:54
sal_Int32 nState
std::unique_ptr< sal_Int32[]> pData
@ eSymbol
Definition: ppdparser.hxx:44
long Long
PointerStyle
Definition: ptrstyle.hxx:26
QPRO_FUNC_TYPE nType
DragFullOptions
Definition: settings.hxx:164
double mnWidth
double mnHeight
sal_Int32 mnRightBorder
Definition: brdwin.hxx:193
DrawButtonFlags mnMenuState
Definition: brdwin.hxx:201
tools::Long mnTrackY
Definition: brdwin.hxx:188
tools::Rectangle maHelpRect
Definition: brdwin.hxx:183
BorderWindowHitTest mnHitTest
Definition: brdwin.hxx:198
DrawButtonFlags mnCloseState
Definition: brdwin.hxx:199
tools::Long mnTrackHeight
Definition: brdwin.hxx:190
DrawButtonFlags mnHideState
Definition: brdwin.hxx:202
sal_Int32 mnTopBorder
Definition: brdwin.hxx:192
sal_Int32 mnBottomBorder
Definition: brdwin.hxx:194
tools::Long mnTitleHeight
Definition: brdwin.hxx:197
DrawButtonFlags mnDockState
Definition: brdwin.hxx:200
tools::Long mnTrackWidth
Definition: brdwin.hxx:189
tools::Long mnTrackX
Definition: brdwin.hxx:187
sal_Int32 mnLeftBorder
Definition: brdwin.hxx:191
VclPtr< ImplBorderWindow > mpBorderWindow
Definition: brdwin.hxx:176
tools::Rectangle maHideRect
Definition: brdwin.hxx:182
tools::Rectangle maCloseRect
Definition: brdwin.hxx:179
tools::Rectangle maDockRect
Definition: brdwin.hxx:180
DrawButtonFlags mnHelpState
Definition: brdwin.hxx:203
tools::Rectangle maMenuRect
Definition: brdwin.hxx:181
ImplSVNWFData maNWFData
Definition: svdata.hxx:403
bool mbNoFrameJunctionForPopups
Definition: svdata.hxx:327
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:261
unsigned char sal_uInt8
SymbolType
Definition: vclenum.hxx:74
DrawFrameStyle
Definition: vclenum.hxx:290
DrawFrameFlags
Definition: vclenum.hxx:302
WindowBorderStyle
Definition: vclenum.hxx:107
StateChangedType
Definition: window.hxx:291
@ NoChildren
The child windows are not invalidated.
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_CLOSEABLE
Definition: wintypes.hxx:123
WinBits const WB_MOVEABLE
Definition: wintypes.hxx:122
WinBits const WB_DIALOGCONTROL
Definition: wintypes.hxx:113
WinBits const WB_OWNERDRAWDECORATION
Definition: wintypes.hxx:173
WinBits const WB_DROPDOWN
Definition: wintypes.hxx:159
WindowType
Definition: wintypes.hxx:27
WinBits const WB_SYSTEMCHILDWINDOW
Definition: wintypes.hxx:136
WinBits const WB_POPUP
Definition: wintypes.hxx:175
WinBits const WB_SIZEABLE
Definition: wintypes.hxx:117
WinBits const WB_APP
Definition: wintypes.hxx:125
WinBits const WB_DEFAULTWIN
Definition: wintypes.hxx:174
WinBits const WB_BORDER
Definition: wintypes.hxx:115
WinBits const WB_SPIN
Definition: wintypes.hxx:153
WinBits const WB_SYSTEMFLOATWIN
Definition: wintypes.hxx:169
WinBits const WB_INTROWIN
Definition: wintypes.hxx:170
WinBits const WB_NODIALOGCONTROL
Definition: wintypes.hxx:114
WinBits const WB_STANDALONE
Definition: wintypes.hxx:124
WinBits const WB_TOOLTIPWIN
Definition: wintypes.hxx:172
WinBits const WB_NOBORDER
Definition: wintypes.hxx:116
WinBits const WB_NOSHADOW
Definition: wintypes.hxx:171