LibreOffice Module svtools (master) 1
datwin.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 "datwin.hxx"
21#include <o3tl/numeric.hxx>
22#include <svtools/brwhead.hxx>
24#include <utility>
25#include <vcl/commandevent.hxx>
26#include <vcl/help.hxx>
27#include <vcl/settings.hxx>
28#include <vcl/ptrstyle.hxx>
29#include <tools/debug.hxx>
30#include <tools/fract.hxx>
31
33{
34 Color aOldFillColor = rDev.GetFillColor();
35 Color aOldLineColor = rDev.GetLineColor();
36
37 const StyleSettings &rSettings = rDev.GetSettings().GetStyleSettings();
38 Color aColLight( rSettings.GetLightColor() );
39 Color aColShadow( rSettings.GetShadowColor() );
40 Color aColFace( rSettings.GetFaceColor() );
41
42 rDev.SetLineColor( aColFace );
43 rDev.SetFillColor( aColFace );
44 rDev.DrawRect( aRect );
45
46 if( rDev.GetOutDevType() != OUTDEV_WINDOW )
47 {
48 rDev.SetLineColor( aColLight );
49 rDev.DrawLine( aRect.TopLeft(), Point( aRect.Right(), aRect.Top() ) );
50 rDev.DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom() - 1 ) );
51 rDev.SetLineColor( aColShadow );
54 }
55
56 if ( !aText.isEmpty() )
57 {
58 OUString aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH);
59
60 vcl::Font aFont( rDev.GetFont() );
61 bool bOldTransp = aFont.IsTransparent();
62 if ( !bOldTransp )
63 {
64 aFont.SetTransparent( true );
65 rDev.SetFont( aFont );
66 }
67
68 Color aOldColor = rDev.GetTextColor();
70 rDev.SetTextColor(rSettings.GetDisableColor());
71
72 rDev.DrawText( Point(
73 ( aInnerRect.Left() + aInnerRect.Right() ) / 2 - ( rDev.GetTextWidth(aVal) / 2 ),
74 aInnerRect.Top() ), aVal );
75
76 // restore settings
77 if ( !bOldTransp )
78 {
79 aFont.SetTransparent(false);
80 rDev.SetFont( aFont );
81 }
83 rDev.SetTextColor(aOldColor);
84 }
85
86 rDev.SetLineColor( aOldLineColor );
87 rDev.SetFillColor( aOldFillColor );
88}
89
90BrowserColumn::BrowserColumn( sal_uInt16 nItemId,
91 OUString aTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom )
92: _nId( nItemId ),
93 _nWidth( nWidthPixel ),
94 _aTitle(std::move( aTitle )),
95 _bFrozen( false )
96{
97 double n = static_cast<double>(_nWidth);
98 n *= static_cast<double>(rCurrentZoom.GetDenominator());
99 if (!rCurrentZoom.GetNumerator())
100 throw o3tl::divide_by_zero();
101 n /= static_cast<double>(rCurrentZoom.GetNumerator());
102 _nOriginalWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
103}
104
106{
107}
108
109void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom)
110{
111 _nWidth = nNewWidthPixel;
112 // Avoid overflow when called with LONG_MAX from
113 // BrowseBox::AutoSizeLastColumn:
114 if (_nWidth == LONG_MAX)
115 {
117 }
118 else
119 {
120 double n = static_cast<double>(_nWidth);
121 n *= static_cast<double>(rCurrentZoom.GetDenominator());
122 if (!rCurrentZoom.GetNumerator())
123 throw o3tl::divide_by_zero();
124 n /= static_cast<double>(rCurrentZoom.GetNumerator());
125 _nOriginalWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
126 }
127}
128
129void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Point& rPos )
130{
131 if ( _nId == 0 )
132 {
133 // paint handle column
134 ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ),
135 "", false ).Draw( rDev );
136 Color aOldLineColor = rDev.GetLineColor();
137 rDev.SetLineColor( COL_BLACK );
138 rDev.DrawLine(
139 Point( rPos.X(), rPos.Y()+rBox.GetDataRowHeight()-1 ),
140 Point( rPos.X() + Width() - 1, rPos.Y()+rBox.GetDataRowHeight()-1 ) );
141 rDev.DrawLine(
142 Point( rPos.X() + Width() - 1, rPos.Y() ),
143 Point( rPos.X() + Width() - 1, rPos.Y()+rBox.GetDataRowHeight()-1 ) );
144 rDev.SetLineColor( aOldLineColor );
145
146 rBox.DoPaintField( rDev,
148 Point( rPos.X() + 2, rPos.Y() + 2 ),
149 Size( Width()-1, rBox.GetDataRowHeight()-1 ) ),
150 GetId(),
152 }
153 else
154 {
155 // paint data column
156 tools::Long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
157
158 rBox.DoPaintField( rDev,
160 Point( rPos.X() + MIN_COLUMNWIDTH, rPos.Y() ),
161 Size( nWidth-2*MIN_COLUMNWIDTH, rBox.GetDataRowHeight()-1 ) ),
162 GetId(),
164 }
165}
166
167
169{
170 double n(_nOriginalWidth * rNewZoom);
171 _nWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
172}
173
174
176 :Control( pParent, WB_CLIPCHILDREN )
177 ,DragSourceHelper( this )
178 ,DropTargetHelper( this )
179 ,pHeaderBar( nullptr )
180 ,bInDtor( false )
181 ,aMouseTimer("BrowserDataWin aMouseTimer")
182 ,bInPaint( false )
183 ,bInCommand( false )
184 ,bNoHScroll( false )
185 ,bNoVScroll( false )
186 ,bAutoHScroll(false)
187 ,bAutoVScroll(false)
188 ,bUpdateMode( true )
189 ,bAutoSizeLastCol(false)
190 ,bResizeOnPaint( false )
191 ,bUpdateOnUnlock( false )
192 ,bInUpdateScrollbars( false )
193 ,bHadRecursion( false )
194 ,bCallingDropCallback( false )
195 ,nUpdateLock( 0 )
196 ,nCursorHidden( 0 )
197 ,m_nDragRowDividerLimit( 0 )
198 ,m_nDragRowDividerOffset( 0 )
199{
200 aMouseTimer.SetInvokeHandler( LINK( this, BrowserDataWin, RepeatedMouseMove ) );
201 aMouseTimer.SetTimeout( 100 );
202}
203
205{
206 disposeOnce();
207}
208
210{
211 bInDtor = true;
212
213 aInvalidRegion.clear();
215 DragSourceHelper::dispose();
216 DropTargetHelper::dispose();
218}
219
221{
222 if ( !--nUpdateLock )
223 {
225 if (bUpdateOnUnlock )
226 {
228 bUpdateOnUnlock = false;
229 }
230 }
231}
232
234{
235 const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
236
237 pWin->ApplyControlFont(*pWin->GetOutDev(), rStyleSettings.GetFieldFont());
238 pWin->ApplyControlForeground(*pWin->GetOutDev(), rStyleSettings.GetWindowTextColor());
239 pWin->ApplyControlBackground(*pWin->GetOutDev(), rStyleSettings.GetWindowColor());
240}
241
242
244{
245 if ( !nUpdateLock )
247 else
248 bUpdateOnUnlock = true;
249}
250
251
253{
254 if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
255 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
256 {
257 InitSettings_Impl(this);
258 Invalidate();
261 GetParent()->Resize();
262 }
263 else
264 Control::DataChanged( rDCEvt );
265}
266
267
269{
270 if (!nUpdateLock && GetUpdateMode())
271 {
272 if (bInPaint)
273 {
274 aInvalidRegion.emplace_back(rRect);
275 return;
276 }
277 bInPaint = true;
278 GetParent()->PaintData(*this, rRenderContext, rRect);
279 bInPaint = false;
281 }
282 else
283 {
284 aInvalidRegion.emplace_back(rRect);
285 }
286}
287
289{
290 return static_cast<BrowseBox*>(Window::GetParent());
291}
292
294{
295 BrowseBox *pBox = GetParent();
296
297 // seek to row under mouse
298 sal_Int32 nRelRow = rPosPixel.Y() < 0
299 ? -1
300 : rPosPixel.Y() / pBox->GetDataRowHeight();
301 sal_Int32 nRow = nRelRow < 0 ? -1 : nRelRow + pBox->nTopRow;
302
303 // find column under mouse
304 tools::Long nMouseX = rPosPixel.X();
305 tools::Long nColX = 0;
306 size_t nCol;
307 for ( nCol = 0;
308 nCol < pBox->mvCols.size() && nColX < GetSizePixel().Width();
309 ++nCol )
310 if ( pBox->mvCols[ nCol ]->IsFrozen() || nCol >= pBox->nFirstCol )
311 {
312 nColX += pBox->mvCols[ nCol ]->Width();
313 if ( nMouseX < nColX )
314 break;
315 }
316 sal_uInt16 nColId = BROWSER_INVALIDID;
317 if ( nCol < pBox->mvCols.size() )
318 nColId = pBox->mvCols[ nCol ]->GetId();
319
320 // compute the field rectangle and field relative MouseEvent
321 tools::Rectangle aFieldRect;
322 if ( nCol < pBox->mvCols.size() )
323 {
324 nColX -= pBox->mvCols[ nCol ]->Width();
325 aFieldRect = tools::Rectangle(
326 Point( nColX, nRelRow * pBox->GetDataRowHeight() ),
327 Size( pBox->mvCols[ nCol ]->Width(),
328 pBox->GetDataRowHeight() ) );
329 }
330
331 // assemble and return the BrowseEvent
332 return BrowseEvent( this, nRow, nCol, nColId, aFieldRect );
333}
334
335
337{
339 sal_Int8 nReturn = GetParent()->AcceptDrop( BrowserAcceptDropEvent( this, _rEvt ) );
340 bCallingDropCallback = false;
341 return nReturn;
342}
343
344
346{
348 sal_Int8 nReturn = GetParent()->ExecuteDrop( BrowserExecuteDropEvent( this, _rEvt ) );
349 bCallingDropCallback = false;
350 return nReturn;
351}
352
353
354void BrowserDataWin::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
355{
356 if ( !GetParent()->bRowDividerDrag )
357 {
358 Point aEventPos( _rPosPixel );
359 aEventPos.AdjustY(GetParent()->GetTitleHeight() );
360 GetParent()->StartDrag( _nAction, aEventPos );
361 }
362}
363
364
366{
367 // scroll mouse event?
368 BrowseBox *pBox = GetParent();
369 if ( ( (rEvt.GetCommand() == CommandEventId::Wheel) ||
370 (rEvt.GetCommand() == CommandEventId::StartAutoScroll) ||
371 (rEvt.GetCommand() == CommandEventId::AutoScroll) ) &&
372 ( HandleScrollCommand( rEvt, pBox->aHScroll.get(), pBox->pVScroll ) ) )
373 return;
374
375 Point aEventPos( rEvt.GetMousePosPixel() );
376 sal_Int32 nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false);
377 MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT );
378 if ( CommandEventId::ContextMenu == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
379 nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
380 {
381 bInCommand = true;
382 MouseButtonDown( aMouseEvt );
383 if( bInDtor )
384 return;
385 MouseButtonUp( aMouseEvt );
386 if( bInDtor )
387 return;
388 bInCommand = false;
389 }
390
391 aEventPos.AdjustY(GetParent()->GetTitleHeight() );
392 CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
393 rEvt.IsMouseEvent(), rEvt.GetEventData() );
394 bInCommand = true;
395 GetParent()->Command( aEvt );
396 if( bInDtor )
397 return;
398 bInCommand = false;
399
400 if ( CommandEventId::StartDrag == rEvt.GetCommand() )
401 MouseButtonUp( aMouseEvt );
402
403 Control::Command( rEvt );
404}
405
406
408{
409 if ( ! ( GetParent()->IsInteractiveRowHeightEnabled()
410 && ( _rEvent.GetRow() >= 0 )
411 && ( _rEvent.GetRow() < GetParent()->GetRowCount() )
412 && ( _rEvent.GetColumnId() == BrowseBox::HandleColumnId )
413 )
414 )
415 return false;
416
417 tools::Long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
418 return ( nDividerDistance <= 4 );
419}
420
421
423{
425
426 BrowserMouseEvent aBrowserEvent( this, rEvt );
427 if ( ( aBrowserEvent.GetClicks() == 1 ) && ImplRowDividerHitTest( aBrowserEvent ) )
428 {
429 StartRowDividerDrag( aBrowserEvent.GetPosPixel() );
430 return;
431 }
432
433 GetParent()->MouseButtonDown( BrowserMouseEvent( this, rEvt ) );
434}
435
436
438{
439 // avoid pseudo MouseMoves
440 Point aNewPos = OutputToScreenPixel( rEvt.GetPosPixel() );
441 if ( aNewPos == aLastMousePos )
442 return;
443 aLastMousePos = aNewPos;
444
445 // transform to a BrowseEvent
446 BrowserMouseEvent aBrowserEvent( this, rEvt );
447 GetParent()->MouseMove( aBrowserEvent );
448
449 // pointer shape
450 PointerStyle ePointerStyle = PointerStyle::Arrow;
451 if ( ImplRowDividerHitTest( aBrowserEvent ) )
452 ePointerStyle = PointerStyle::VSizeBar;
453 SetPointer( ePointerStyle );
454
455 // dragging out of the visible area?
456 if ( rEvt.IsLeft() &&
457 ( rEvt.GetPosPixel().Y() > GetSizePixel().Height() ||
458 rEvt.GetPosPixel().Y() < 0 ) )
459 {
460 // repeat the event
461 aRepeatEvt = rEvt;
463 }
464 else
465 // killing old repeat-event
466 if ( aMouseTimer.IsActive() )
468}
469
470
471IMPL_LINK_NOARG(BrowserDataWin, RepeatedMouseMove, Timer *, void)
472{
473 GetParent()->MouseMove( BrowserMouseEvent( this, aRepeatEvt ) );
474}
475
477{
478 // avoid pseudo MouseMoves
479 Point aNewPos = OutputToScreenPixel( rEvt.GetPosPixel() );
480 aLastMousePos = aNewPos;
481
482 // simulate a move to the current position
483 MouseMove( rEvt );
484
485 // actual button up handling
486 ReleaseMouse();
487 if ( aMouseTimer.IsActive() )
489 GetParent()->MouseButtonUp( BrowserMouseEvent( this, rEvt ) );
490}
491
492
494{
495 tools::Long nDataRowHeight = GetParent()->GetDataRowHeight();
496 // the exact separation pos of the two rows
497 tools::Long nDragRowDividerCurrentPos = _rStartPos.Y();
498 if ( ( nDragRowDividerCurrentPos % nDataRowHeight ) > nDataRowHeight / 2 )
499 nDragRowDividerCurrentPos += nDataRowHeight;
500 nDragRowDividerCurrentPos /= nDataRowHeight;
501 nDragRowDividerCurrentPos *= nDataRowHeight;
502
503 m_nDragRowDividerOffset = nDragRowDividerCurrentPos - _rStartPos.Y();
504
505 m_nDragRowDividerLimit = nDragRowDividerCurrentPos - nDataRowHeight;
506
507 GetParent()->bRowDividerDrag = true;
509
510 tools::Rectangle aDragSplitRect( 0, m_nDragRowDividerLimit, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos );
511 ShowTracking( aDragSplitRect );
512
514}
515
516
518{
519 if ( !GetParent()->bRowDividerDrag )
520 return;
521
522 Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
523 // stop resizing at our bottom line
524 if ( aMousePos.Y() > GetOutputSizePixel().Height() )
525 aMousePos.setY( GetOutputSizePixel().Height() );
526
527 if ( rTEvt.IsTrackingEnded() )
528 {
529 HideTracking();
530 GetParent()->bRowDividerDrag = false;
532
533 if ( !rTEvt.IsTrackingCanceled() )
534 {
535 tools::Long nNewRowHeight = aMousePos.Y() + m_nDragRowDividerOffset - m_nDragRowDividerLimit;
536
537 // care for minimum row height
538 if ( nNewRowHeight < GetParent()->QueryMinimumRowHeight() )
539 nNewRowHeight = GetParent()->QueryMinimumRowHeight();
540
541 GetParent()->SetDataRowHeight( nNewRowHeight );
543 }
544 }
545 else
546 {
547 tools::Long nDragRowDividerCurrentPos = aMousePos.Y() + m_nDragRowDividerOffset;
548
549 // care for minimum row height
550 if ( nDragRowDividerCurrentPos < m_nDragRowDividerLimit + GetParent()->QueryMinimumRowHeight() )
551 nDragRowDividerCurrentPos = m_nDragRowDividerLimit + GetParent()->QueryMinimumRowHeight();
552
553 tools::Rectangle aDragSplitRect( 0, m_nDragRowDividerLimit, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos );
554 ShowTracking( aDragSplitRect );
555 }
556}
557
558
560{
561 // pass to parent window
562 if ( !GetParent()->ProcessKey( rEvt ) )
563 Control::KeyInput( rEvt );
564}
565
566
568{
569 GetParent()->RequestHelp( rHEvt );
570}
571
572
574 sal_Int32 nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
575 const tools::Rectangle& rRect ):
576 pWin(pWindow),
577 aRect(rRect),
578 nRow(nAbsRow),
579 nCol(nColumn),
580 nColId(nColumnId)
581{
582}
583
584
586 const MouseEvent& rEvt ):
587 MouseEvent(rEvt),
588 BrowseEvent( pWindow->CreateBrowseEvent( rEvt.GetPosPixel() ) )
589{
590}
591
592
594 sal_Int32 nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
595 const tools::Rectangle& rRect ):
596 MouseEvent(rEvt),
597 BrowseEvent( pWindow, nAbsRow, nColumn, nColumnId, rRect )
598{
599}
600
601
603 :AcceptDropEvent(rEvt)
604 ,BrowseEvent( pWindow->CreateBrowseEvent( rEvt.maPosPixel ) )
605{
606}
607
608
610 :ExecuteDropEvent(rEvt)
611 ,BrowseEvent( pWindow->CreateBrowseEvent( rEvt.maPosPixel ) )
612{
613}
614
615
617{
618 DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" );
619 if ( bMode == bUpdateMode )
620 return;
621
622 bUpdateMode = bMode;
623 if ( bMode )
625}
626
627
629{
630 for (const auto& rRect : aInvalidRegion)
631 {
632 vcl::Region aRegion(rRect);
633 Control::ImplInvalidate( &aRegion, InvalidateFlags::NONE );
634 }
635 aInvalidRegion.clear();
636}
637
639{
640 if ( !GetUpdateMode() )
641 {
642 aInvalidRegion.clear();
643 if (!pRegion)
644 aInvalidRegion.emplace_back( Point( 0, 0 ), GetOutputSizePixel() );
645 else
646 aInvalidRegion.emplace_back( pRegion->GetBoundRect() );
647 }
648 else
649 Window::ImplInvalidate( pRegion, nFlags );
650}
651
652/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BROWSER_INVALIDID
Definition: brwbox.hxx:55
const StyleSettings & GetStyleSettings() const
tools::Long GetDataRowHeight() const
Definition: brwbox1.cxx:2287
virtual void Command(const CommandEvent &rEvt) override
Definition: brwbox2.cxx:95
virtual void MouseButtonDown(const MouseEvent &rEvt) override
Definition: brwbox2.cxx:1322
BrowserDataWin & GetDataWindow() const
Definition: brwbox1.cxx:2395
virtual tools::Long QueryMinimumRowHeight()
Definition: brwbox2.cxx:187
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: brwbox2.cxx:56
VclPtr< ScrollAdaptor > pVScroll
Definition: brwbox.hxx:271
virtual void ImplStartTracking()
Definition: brwbox2.cxx:193
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: brwbox2.cxx:48
sal_Int32 GetRowAtYPosPixel(tools::Long nY, bool bRelToBrowser=true) const
Definition: brwbox1.cxx:2079
virtual void MouseButtonUp(const MouseEvent &rEvt) override
Definition: brwbox2.cxx:1426
void DoPaintField(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColumnId, BrowserColumnAccess) const
public version of PaintField, with selected access rights for the BrowserColumn
Definition: brwbox.hxx:615
virtual void StartDrag(sal_Int8 _nAction, const Point &_rPosPixel) override
Definition: brwbox2.cxx:42
static const sal_uInt16 HandleColumnId
Definition: brwbox.hxx:267
sal_Int32 nTopRow
Definition: brwbox.hxx:288
virtual void Resize() override
Definition: brwbox2.cxx:469
void SetDataRowHeight(tools::Long nPixel)
Definition: brwbox1.cxx:863
virtual void MouseMove(const MouseEvent &rEvt) override
Definition: brwbox2.cxx:1376
bool bRowDividerDrag
Definition: brwbox.hxx:295
sal_uInt16 nFirstCol
Definition: brwbox.hxx:291
void PaintData(vcl::Window const &rWin, vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: brwbox2.cxx:1036
::std::vector< std::unique_ptr< BrowserColumn > > mvCols
Definition: brwbox.hxx:314
virtual void ImplEndTracking()
Definition: brwbox2.cxx:198
virtual void RowHeightChanged()
called when the row height has been changed interactively
Definition: brwbox2.cxx:203
VclPtr< ScrollAdaptor > aHScroll
Definition: brwbox.hxx:272
virtual bool IsRowSelected(sal_Int32 nRow) const override
Definition: brwbox1.cxx:1898
sal_Int32 GetRow() const
Definition: brwbox.hxx:133
BrowseEvent(vcl::Window *pWindow, sal_Int32 nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, const tools::Rectangle &rRect)
Definition: datwin.cxx:573
sal_uInt16 GetColumnId() const
Definition: brwbox.hxx:135
BrowserAcceptDropEvent(BrowserDataWin *pWin, const AcceptDropEvent &rEvt)
Definition: datwin.cxx:602
sal_uInt16 _nId
Definition: datwin.hxx:55
void SetWidth(sal_uLong nNewWidthPixel, const Fraction &rCurrentZoom)
Definition: datwin.cxx:109
sal_uLong _nWidth
Definition: datwin.hxx:57
BrowserColumn(sal_uInt16 nItemId, OUString aTitle, sal_uLong nWidthPixel, const Fraction &rCurrentZoom)
Definition: datwin.cxx:90
sal_uInt16 GetId() const
Definition: datwin.hxx:66
sal_uLong Width() const
Definition: datwin.hxx:68
sal_uLong _nOriginalWidth
Definition: datwin.hxx:56
void ZoomChanged(const Fraction &rNewZoom)
Definition: datwin.cxx:168
void Draw(BrowseBox const &rBox, OutputDevice &rDev, const Point &rPos)
Definition: datwin.cxx:129
virtual void KeyInput(const KeyEvent &rEvt) override
Definition: datwin.cxx:559
void DoOutstandingInvalidations()
Definition: datwin.cxx:628
virtual ~BrowserDataWin() override
Definition: datwin.cxx:204
bool bCallingDropCallback
Definition: brwbox.hxx:169
bool bUpdateMode
Definition: brwbox.hxx:163
tools::Long m_nDragRowDividerLimit
Definition: brwbox.hxx:173
bool bUpdateOnUnlock
Definition: brwbox.hxx:166
BrowserDataWin(BrowseBox *pParent)
Definition: datwin.cxx:175
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: datwin.cxx:336
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition: datwin.cxx:517
BrowseBox * GetParent() const
Definition: datwin.cxx:288
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: datwin.cxx:268
MouseEvent aRepeatEvt
Definition: brwbox.hxx:151
AutoTimer aMouseTimer
Definition: brwbox.hxx:150
bool GetUpdateMode() const
Definition: brwbox.hxx:206
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: datwin.cxx:567
virtual void dispose() override
Definition: datwin.cxx:209
void Update()
Definition: datwin.cxx:243
std::vector< tools::Rectangle > aInvalidRegion
Definition: brwbox.hxx:156
virtual void MouseMove(const MouseEvent &rEvt) override
Definition: datwin.cxx:437
virtual void Command(const CommandEvent &rEvt) override
Definition: datwin.cxx:365
VclPtr< BrowserHeader > pHeaderBar
Definition: brwbox.hxx:148
bool ImplRowDividerHitTest(const BrowserMouseEvent &_rEvent) const
Definition: datwin.cxx:407
virtual void StartDrag(sal_Int8 _nAction, const Point &_rPosPixel) override
Definition: datwin.cxx:354
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: datwin.cxx:345
virtual void MouseButtonDown(const MouseEvent &rEvt) override
Definition: datwin.cxx:422
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: datwin.cxx:252
void StartRowDividerDrag(const Point &_rStartPos)
Definition: datwin.cxx:493
BrowseEvent CreateBrowseEvent(const Point &rPosPixel)
Definition: datwin.cxx:293
Point aLastMousePos
Definition: brwbox.hxx:152
bool bInCommand
Definition: brwbox.hxx:158
virtual void MouseButtonUp(const MouseEvent &rEvt) override
Definition: datwin.cxx:476
void SetUpdateMode(bool bMode)
Definition: datwin.cxx:616
void LeaveUpdateLock()
Definition: datwin.cxx:220
sal_uInt16 nUpdateLock
Definition: brwbox.hxx:170
tools::Long m_nDragRowDividerOffset
Definition: brwbox.hxx:174
virtual void ImplInvalidate(const vcl::Region *pRegion, InvalidateFlags nFlags) override
Definition: datwin.cxx:638
BrowserExecuteDropEvent(BrowserDataWin *pWin, const ExecuteDropEvent &rEvt)
Definition: datwin.cxx:609
BrowserMouseEvent(BrowserDataWin *pWin, const MouseEvent &rEvt)
Definition: datwin.cxx:585
tools::Rectangle aInnerRect
Definition: datwin.hxx:33
OUString aText
Definition: datwin.hxx:34
void Draw(OutputDevice &rDev)
Definition: datwin.cxx:32
tools::Rectangle aRect
Definition: datwin.hxx:32
bool m_bDrawDisabled
Definition: datwin.hxx:35
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
void * GetEventData() const
bool IsMouseEvent() const
virtual void dispose() override
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
bool IsLeft() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetLineColor()
OUString GetEllipsisString(const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) const
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
void SetTextColor(const Color &rColor)
void SetFillColor()
const Color & GetLineColor() const
const Color & GetTextColor() const
OutDevType GetOutDevType() const
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)
const AllSettings & GetSettings() const
const Color & GetFillColor() const
constexpr tools::Long Y() const
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long X() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetShadowColor() const
const vcl::Font & GetFieldFont() const
const Color & GetWindowTextColor() const
const Color & GetLightColor() const
const Color & GetFaceColor() const
const Color & GetDisableColor() const
bool IsActive() const
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
bool IsTrackingEnded() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
void clear()
reference_type * get() const
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long Right() const
constexpr Point BottomRight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
void SetTransparent(bool bTransparent)
bool IsTransparent() const
tools::Rectangle GetBoundRect() const
Point OutputToScreenPixel(const Point &rPos) const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
virtual void RequestHelp(const HelpEvent &rHEvt)
void PaintImmediately()
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
void HideTracking()
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
virtual void Command(const CommandEvent &rCEvt)
const AllSettings & GetSettings() const
virtual void KeyInput(const KeyEvent &rKEvt)
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
::OutputDevice const * GetOutDev() const
void ReleaseMouse()
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
virtual void ImplInvalidate(const vcl::Region *pRegion, InvalidateFlags nFlags)
virtual void SetPointer(PointerStyle)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
void InitSettings_Impl(vcl::Window *pWin)
Definition: datwin.cxx:233
IMPL_LINK_NOARG(BrowserDataWin, RepeatedMouseMove, Timer *, void)
Definition: datwin.cxx:471
#define MIN_COLUMNWIDTH
Definition: datwin.hxx:28
#define DBG_ASSERT(sCon, aError)
#define MOUSE_LEFT
sal_Int64 n
const long LONG_MAX
long Long
OUTDEV_WINDOW
PointerStyle
sal_uIntPtr sal_uLong
access to selected methods, to be granted to the BrowserColumn
Definition: brwbox.hxx:612
signed char sal_Int8
InvalidateFlags
WinBits const WB_CLIPCHILDREN