LibreOffice Module sc (master) 1
hdrcont.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 <sfx2/dispatch.hxx>
21#include <vcl/commandevent.hxx>
22#include <vcl/help.hxx>
23#include <vcl/settings.hxx>
24#include <svtools/colorcfg.hxx>
25#include <osl/diagnose.h>
26
27#include <tabvwsh.hxx>
28#include <hdrcont.hxx>
29#include <dbdata.hxx>
30#include <scmod.hxx>
31#include <inputopt.hxx>
32#include <gridmerg.hxx>
33#include <document.hxx>
34#include <markdata.hxx>
35#include <tabview.hxx>
36#include <viewdata.hxx>
37#include <columnspanset.hxx>
38
39#define SC_DRAG_MIN 2
40
41// passes in paint
42// (selection left/right must be first because the continuous lines
43// are partly overwritten later)
44
45#define SC_HDRPAINT_SEL_BOTTOM 4
46#define SC_HDRPAINT_BOTTOM 5
47#define SC_HDRPAINT_TEXT 6
48#define SC_HDRPAINT_COUNT 7
49
51 SCCOLROW nNewSize, bool bNewVertical, ScTabView* pTab ) :
52 Window ( pParent ),
53 pSelEngine ( pSelectionEngine ),
54 aShowHelpTimer("sc HeaderControl Popover Timer"),
55 bVertical ( bNewVertical ),
56 nSize ( nNewSize ),
57 nMarkStart ( 0 ),
58 nMarkEnd ( 0 ),
59 bMarkRange ( false ),
60 bDragging ( false ),
61 nDragNo ( 0 ),
62 nDragStart ( 0 ),
63 nDragPos ( 0 ),
64 nTipVisible ( nullptr ),
65 bDragMoved ( false ),
66 bIgnoreMove ( false ),
67 bInRefMode ( false ),
68 pTabView ( pTab )
69{
70 // RTL: no default mirroring for this window, the spreadsheet itself
71 // is also not mirrored
72 // mirror the vertical window for correct border drawing
73 // table layout depends on sheet format, not UI setting, so the
74 // borders of the vertical window have to be handled manually, too.
75 EnableRTL( false );
76
82
84 bBoldSet = true;
85 bAutoFilterSet = false;
86
87 Size aSize = LogicToPixel( Size(
88 GetTextWidth("8888"),
89 GetTextHeight() ) );
90 aSize.AdjustWidth(4 ); // place for highlight border
91 aSize.AdjustHeight(3 );
92 SetSizePixel( aSize );
93
94 nWidth = nSmallWidth = aSize.Width();
95 nBigWidth = LogicToPixel( Size( GetTextWidth("8888888"), 0 ) ).Width() + 5;
96
97 aShowHelpTimer.SetInvokeHandler(LINK(this, ScHeaderControl, ShowDragHelpHdl));
98 aShowHelpTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
99
101}
102
104{
107}
108
110{
111 OSL_ENSURE( bVertical, "SetWidth works only on row headers" );
112 if ( nNew != nWidth )
113 {
114 Size aSize( nNew, GetSizePixel().Height() );
115 SetSizePixel( aSize );
116
117 nWidth = nNew;
118
119 Invalidate();
120 }
121}
122
124{
125}
126
128{
129 bool bLayoutRTL = IsLayoutRTL();
130 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
131
133 if ( bVertical )
134 {
135 aRect.SetTop( GetScrPos( nStart )-nLayoutSign ); // extra pixel for line at top of selection
136 aRect.SetBottom( GetScrPos( nEnd+1 )-nLayoutSign );
137 }
138 else
139 {
140 aRect.SetLeft( GetScrPos( nStart )-nLayoutSign ); // extra pixel for line left of selection
141 aRect.SetRight( GetScrPos( nEnd+1 )-nLayoutSign );
142 }
143 Invalidate(aRect);
144}
145
146void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd )
147{
148 bool bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader();
149 if (!bEnabled)
150 bNewSet = false;
151
152 bool bOldSet = bMarkRange;
153 SCCOLROW nOldStart = nMarkStart;
154 SCCOLROW nOldEnd = nMarkEnd;
155 PutInOrder( nNewStart, nNewEnd );
156 bMarkRange = bNewSet;
157 nMarkStart = nNewStart;
158 nMarkEnd = nNewEnd;
159
160 // Paint
161
162 if ( bNewSet )
163 {
164 if ( bOldSet )
165 {
166 if ( nNewStart == nOldStart )
167 {
168 if ( nNewEnd != nOldEnd )
169 DoPaint( std::min( nNewEnd, nOldEnd ) + 1, std::max( nNewEnd, nOldEnd ) );
170 }
171 else if ( nNewEnd == nOldEnd )
172 DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewStart, nOldStart ) - 1 );
173 else if ( nNewStart > nOldEnd || nNewEnd < nOldStart )
174 {
175 // two areas
176 DoPaint( nOldStart, nOldEnd );
177 DoPaint( nNewStart, nNewEnd );
178 }
179 else // somehow overlapping... (it is not often)
180 DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewEnd, nOldEnd ) );
181 }
182 else
183 DoPaint( nNewStart, nNewEnd ); // completely new selection
184 }
185 else if ( bOldSet )
186 DoPaint( nOldStart, nOldEnd ); // cancel selection
187}
188
190{
191 tools::Long nScrPos;
192
194 if (nEntryNo >= nSize)
195 nScrPos = nMax;
196 else
197 {
198 nScrPos = 0;
199 for (SCCOLROW i=GetPos(); i<nEntryNo && nScrPos<nMax; i++)
200 {
201 sal_uInt16 nAdd = GetEntrySize(i);
202 if (nAdd)
203 nScrPos += nAdd;
204 else
205 {
206 SCCOLROW nHidden = GetHiddenCount(i);
207 if (nHidden > 0)
208 i += nHidden - 1;
209 }
210 }
211 }
212
213 if ( IsLayoutRTL() )
214 nScrPos = nMax - nScrPos - 2;
215
216 return nScrPos;
217}
218
219void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& rRect )
220{
221 // It is important for VCL to have few calls, that is why the outer lines are
222 // grouped together
223
224 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
225 bool bHighContrast = rStyleSettings.GetHighContrastMode();
226 bool bDark = rStyleSettings.GetFaceColor().IsDark();
227 // Use the same distinction for bDark as in Window::DrawSelectionBackground
228
229 Color aTextColor = rStyleSettings.GetButtonTextColor();
230 Color aSelTextColor = rStyleSettings.GetHighlightTextColor();
231 Color aAFilterTextColor = rStyleSettings.GetButtonTextColor();
232 aAFilterTextColor.Merge(COL_LIGHTBLUE, bDark ? 150 : 10); // color of filtered row numbers
233 aNormFont.SetColor( aTextColor );
234 aAutoFilterFont.SetColor(aAFilterTextColor);
235 if ( bHighContrast )
236 aBoldFont.SetColor( aTextColor );
237 else
238 aBoldFont.SetColor( aSelTextColor );
239
240 if (bAutoFilterSet)
241 SetTextColor(aAFilterTextColor);
242 else
243 SetTextColor((bBoldSet && !bHighContrast) ? aSelTextColor : aTextColor);
244
245 Color aSelLineColor = rStyleSettings.GetHighlightColor();
246 aSelLineColor.Merge( COL_BLACK, 0xe0 ); // darken just a little bit
247
248 bool bLayoutRTL = IsLayoutRTL();
249 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
250 bool bMirrored = IsMirrored();
251
252 OUString aString;
253 sal_uInt16 nBarSize;
254 Point aScrPos;
255 Size aTextSize;
256
257 if (bVertical)
258 nBarSize = static_cast<sal_uInt16>(GetSizePixel().Width());
259 else
260 nBarSize = static_cast<sal_uInt16>(GetSizePixel().Height());
261
262 SCCOLROW nPos = GetPos();
263
264 tools::Long nPStart = bVertical ? rRect.Top() : rRect.Left();
265 tools::Long nPEnd = bVertical ? rRect.Bottom() : rRect.Right();
266
267 tools::Long nTransStart = nPEnd + 1;
268 tools::Long nTransEnd = 0;
269
270 tools::Long nInitScrPos = 0;
271 if ( bLayoutRTL )
272 {
273 std::swap(nPStart, nPEnd);
274 std::swap(nTransStart, nTransEnd);
275 if ( bVertical ) // start loops from the end
276 nInitScrPos = GetSizePixel().Height() - 1;
277 else
278 nInitScrPos = GetSizePixel().Width() - 1;
279 }
280
281 // complete the painting of the outer lines
282 // first find the end of the last cell
283
284 tools::Long nLineEnd = nInitScrPos - nLayoutSign;
285
286 for (SCCOLROW i=nPos; i<nSize; i++)
287 {
288 sal_uInt16 nSizePix = GetEntrySize( i );
289 if (nSizePix)
290 {
291 nLineEnd += nSizePix * nLayoutSign;
292
293 if ( bMarkRange && i >= nMarkStart && i <= nMarkEnd )
294 {
295 tools::Long nLineStart = nLineEnd - ( nSizePix - 1 ) * nLayoutSign;
296 if ( nLineStart * nLayoutSign < nTransStart * nLayoutSign )
297 nTransStart = nLineStart;
298 if ( nLineEnd * nLayoutSign > nTransEnd * nLayoutSign )
299 nTransEnd = nLineEnd;
300 }
301
302 if ( nLineEnd * nLayoutSign > nPEnd * nLayoutSign )
303 {
304 nLineEnd = nPEnd;
305 break;
306 }
307 }
308 else
309 {
310 SCCOLROW nHidden = GetHiddenCount(i);
311 if (nHidden > 0)
312 i += nHidden - 1;
313 }
314 }
315
316 // background is different for entry area and behind the entries
317
318 tools::Rectangle aFillRect;
320
321 if ( nLineEnd * nLayoutSign >= nInitScrPos * nLayoutSign )
322 {
323 GetOutDev()->SetFillColor( rStyleSettings.GetFaceColor() );
324 if ( bVertical )
325 aFillRect = tools::Rectangle( 0, nInitScrPos, nBarSize-1, nLineEnd );
326 else
327 aFillRect = tools::Rectangle( nInitScrPos, 0, nLineEnd, nBarSize-1 );
328 GetOutDev()->DrawRect( aFillRect );
329 }
330
331 if ( nLineEnd * nLayoutSign < nPEnd * nLayoutSign )
332 {
333 GetOutDev()->SetFillColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::APPBACKGROUND).nColor );
334 if ( bVertical )
335 aFillRect = tools::Rectangle( 0, nLineEnd+nLayoutSign, nBarSize-1, nPEnd );
336 else
337 aFillRect = tools::Rectangle( nLineEnd+nLayoutSign, 0, nPEnd, nBarSize-1 );
338 GetOutDev()->DrawRect( aFillRect );
339 }
340
341 if ( nLineEnd * nLayoutSign >= nPStart * nLayoutSign )
342 {
343 if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign )
344 {
345 if (bVertical)
346 aFillRect = tools::Rectangle( 0, nTransStart, nBarSize-1, nTransEnd );
347 else
348 aFillRect = tools::Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
349
350 if ( bHighContrast )
351 {
352 if ( bDark )
353 {
354 // solid grey background for dark face color is drawn before lines
357 GetOutDev()->DrawRect( aFillRect );
358 }
359 }
360 else
361 {
362 // background for selection
364 GetOutDev()->SetFillColor( rStyleSettings.GetHighlightColor() );
365 GetOutDev()->DrawRect( aFillRect );
366 }
367 }
368
369 GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
370 if (bVertical)
371 {
372 tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
373 GetOutDev()->DrawLine( Point( nDarkPos, nPStart ), Point( nDarkPos, nLineEnd ) );
374 }
375 else
376 GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) );
377
378 // line in different color for selection
379 if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && !bHighContrast )
380 {
381 GetOutDev()->SetLineColor( aSelLineColor );
382 if (bVertical)
383 {
384 tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
385 GetOutDev()->DrawLine( Point( nDarkPos, nTransStart ), Point( nDarkPos, nTransEnd ) );
386 }
387 else
388 GetOutDev()->DrawLine( Point( nTransStart, nBarSize-1 ), Point( nTransEnd, nBarSize-1 ) );
389 }
390 }
391
392 // tdf#89841 Use blue row numbers when Autofilter selected
393 std::vector<sc::ColRowSpan> aSpans;
394 if (bVertical && pTabView)
395 {
398
399 ScDBData* pDBData = rDoc.GetAnonymousDBData(nTab);
400 if (pDBData && pDBData->HasAutoFilter())
401 {
402 SCSIZE nSelected = 0;
403 SCSIZE nTotal = 0;
404 pDBData->GetFilterSelCount(nSelected, nTotal);
405 if (nTotal > nSelected)
406 {
407 ScRange aRange;
408 pDBData->GetArea(aRange);
409 SCCOLROW nStartRow = static_cast<SCCOLROW>(aRange.aStart.Row());
410 SCCOLROW nEndRow = static_cast<SCCOLROW>(aRange.aEnd.Row());
411 if (pDBData->HasHeader())
412 nStartRow++;
413 aSpans.push_back(sc::ColRowSpan(nStartRow, nEndRow));
414 }
415 }
416
417 ScDBCollection* pDocColl = rDoc.GetDBCollection();
418 if (!pDocColl->empty())
419 {
420 ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs();
421 for (const auto& rxDB : rDBs)
422 {
423 if (rxDB->GetTab() == nTab && rxDB->HasAutoFilter())
424 {
425 SCSIZE nSelected = 0;
426 SCSIZE nTotal = 0;
427 rxDB->GetFilterSelCount(nSelected, nTotal);
428 if (nTotal > nSelected)
429 {
430 ScRange aRange;
431 rxDB->GetArea(aRange);
432 SCCOLROW nStartRow = static_cast<SCCOLROW>(aRange.aStart.Row());
433 SCCOLROW nEndRow = static_cast<SCCOLROW>(aRange.aEnd.Row());
434 if (rxDB->HasHeader())
435 nStartRow++;
436 aSpans.push_back(sc::ColRowSpan(nStartRow, nEndRow));
437 }
438 }
439 }
440 }
441 }
442
443 // loop through entries several times to avoid changing the line color too often
444 // and to allow merging of lines
445
446 ScGridMerger aGrid( GetOutDev(), 1, 1 );
447
448 // start at SC_HDRPAINT_BOTTOM instead of 0 - selection doesn't get different
449 // borders, light border at top isn't used anymore
450 // use SC_HDRPAINT_SEL_BOTTOM for different color
451
452 for (sal_uInt16 nPass = SC_HDRPAINT_SEL_BOTTOM; nPass < SC_HDRPAINT_COUNT; nPass++)
453 {
454 // set line color etc. before entry loop
455 switch ( nPass )
456 {
458 // same as non-selected for high contrast
459 GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetDarkShadowColor() : aSelLineColor );
460 break;
462 GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
463 break;
464 case SC_HDRPAINT_TEXT:
465 // DrawSelectionBackground is used only for high contrast on light background
466 if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && bHighContrast && !bDark )
467 {
468 // Transparent selection background is drawn after lines, before text.
469 // Use DrawSelectionBackground to make sure there is a visible
470 // difference. The case of a dark face color, where DrawSelectionBackground
471 // would just paint over the lines, is handled separately (bDark).
472 // Otherwise, GetHighlightColor is used with 80% transparency.
473 // The window's background color (SetBackground) has to be the background
474 // of the cell area, for the contrast comparison in DrawSelectionBackground.
475
476 tools::Rectangle aTransRect;
477 if (bVertical)
478 aTransRect = tools::Rectangle( 0, nTransStart, nBarSize-1, nTransEnd );
479 else
480 aTransRect = tools::Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
481 SetBackground( rStyleSettings.GetFaceColor() );
482 DrawSelectionBackground( aTransRect, 0, true, false );
484 }
485 break;
486 }
487
489 tools::Long nScrPos=nInitScrPos;
490 do
491 {
492 if (bVertical)
493 aScrPos = Point( 0, nScrPos );
494 else
495 aScrPos = Point( nScrPos, 0 );
496
497 SCCOLROW nEntryNo = nCount + nPos;
498 if ( nEntryNo >= nSize ) // rDoc.MaxCol()/rDoc.MaxRow()
499 nScrPos = nPEnd + nLayoutSign; // beyond nPEnd -> stop
500 else
501 {
502 sal_uInt16 nSizePix = GetEntrySize( nEntryNo );
503
504 if (nSizePix == 0)
505 {
506 SCCOLROW nHidden = GetHiddenCount(nEntryNo);
507 if (nHidden > 0)
508 nCount += nHidden - 1;
509 }
510 else if ((nScrPos+nSizePix*nLayoutSign)*nLayoutSign >= nPStart*nLayoutSign)
511 {
512 Point aEndPos(aScrPos);
513 if (bVertical)
514 aEndPos = Point( aScrPos.X()+nBarSize-1, aScrPos.Y()+(nSizePix-1)*nLayoutSign );
515 else
516 aEndPos = Point( aScrPos.X()+(nSizePix-1)*nLayoutSign, aScrPos.Y()+nBarSize-1 );
517
518 bool bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
519 bool bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
520
521 switch ( nPass )
522 {
525 if ( nPass == ( bNextToMark ? SC_HDRPAINT_SEL_BOTTOM : SC_HDRPAINT_BOTTOM ) )
526 {
527 if (bVertical)
528 aGrid.AddHorLine(/* here we work in pixels */ true, aScrPos.X(), aEndPos.X(), aEndPos.Y());
529 else
530 aGrid.AddVerLine(/* here we work in pixels */ true, aEndPos.X(), aScrPos.Y(), aEndPos.Y());
531
532 // thick bottom for hidden rows
533 // (drawn directly, without aGrid)
534 if ( nEntryNo+1 < nSize )
535 if ( GetEntrySize(nEntryNo+1)==0 )
536 {
537 if (bVertical)
538 GetOutDev()->DrawLine( Point(aScrPos.X(),aEndPos.Y()-nLayoutSign),
539 Point(aEndPos.X(),aEndPos.Y()-nLayoutSign) );
540 else
541 GetOutDev()->DrawLine( Point(aEndPos.X()-nLayoutSign,aScrPos.Y()),
542 Point(aEndPos.X()-nLayoutSign,aEndPos.Y()) );
543 }
544 }
545 break;
546
547 case SC_HDRPAINT_TEXT:
548 if ( nSizePix > 1 ) // minimal check for small columns/rows
549 {
550 if (bVertical)
551 {
552 bool bAutoFilterPos = false;
553 for (const auto& rSpan : aSpans)
554 {
555 if (nEntryNo >= rSpan.mnStart && nEntryNo <= rSpan.mnEnd)
556 {
557 bAutoFilterPos = true;
558 break;
559 }
560 }
561
562 if (bMark != bBoldSet || bAutoFilterPos != bAutoFilterSet)
563 {
564 if (bMark)
566 else if (bAutoFilterPos)
568 else
570 bBoldSet = bMark;
571 bAutoFilterSet = bAutoFilterPos && !bMark;
572 }
573 }
574 else
575 {
576 if (bMark != bBoldSet)
577 {
578 if (bMark)
580 else
582 bBoldSet = bMark;
583 }
584 }
585
586 aString = GetEntryText( nEntryNo );
587 aTextSize.setWidth( GetTextWidth( aString ) );
588 aTextSize.setHeight( GetTextHeight() );
589
590 Point aTxtPos(aScrPos);
591 if (bVertical)
592 {
593 aTxtPos.AdjustX((nBarSize-aTextSize.Width())/2 );
594 aTxtPos.AdjustY((nSizePix*nLayoutSign-aTextSize.Height())/2 );
595 if ( bMirrored )
596 aTxtPos.AdjustX(1 ); // dark border is left instead of right
597 }
598 else
599 {
600 aTxtPos.AdjustX((nSizePix*nLayoutSign-aTextSize.Width()+1)/2 );
601 aTxtPos.AdjustY((nBarSize-aTextSize.Height())/2 );
602 }
603 GetOutDev()->DrawText( aTxtPos, aString );
604 }
605 break;
606 }
607
608 // when selecting the complete row/column:
609 // InvertRect( Rectangle( aScrPos, aEndPos ) );
610 }
611 nScrPos += nSizePix * nLayoutSign; // also if before the visible area
612 }
613 ++nCount;
614 }
615 while ( nScrPos * nLayoutSign <= nPEnd * nLayoutSign );
616
617 aGrid.Flush();
618 }
619}
620
621SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const
622{
623 bool bFound = false;
624 SCCOLROW nPos = GetPos();
625 SCCOLROW nHitNo = nPos;
626 SCCOLROW nEntryNo = 1 + nPos;
627 tools::Long nScrPos;
628 tools::Long nMousePos = bVertical ? rPos.Y() : rPos.X();
629 tools::Long nDif;
630 Size aSize = GetOutputSizePixel();
631 tools::Long nWinSize = bVertical ? aSize.Height() : aSize.Width();
632
633 bool bLayoutRTL = IsLayoutRTL();
634 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
635 tools::Long nEndPos = bLayoutRTL ? -1 : nWinSize;
636
637 nScrPos = GetScrPos( nPos ) - nLayoutSign;
638 do
639 {
640 if (nEntryNo > nSize)
641 nScrPos = nEndPos + nLayoutSign;
642 else
643 nScrPos += GetEntrySize( nEntryNo - 1 ) * nLayoutSign;
644
645 nDif = nMousePos - nScrPos;
646 if (nDif >= -2 && nDif <= 2)
647 {
648 bFound = true;
649 nHitNo=nEntryNo-1;
650 }
651 else if (nDif * nLayoutSign >= 0 && nEntryNo < nSize)
652 nHitNo = nEntryNo;
653 ++nEntryNo;
654 }
655 while ( nScrPos * nLayoutSign < nEndPos * nLayoutSign && nDif * nLayoutSign > 0 );
656
657 rBorder = bFound;
658 return nHitNo;
659}
660
662{
663 ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
664 if (!pViewSh)
665 return false;
666
667 ScViewData& rViewData = pViewSh->GetViewData();
668 sal_uInt16 nTab = rViewData.GetTabNo();
669 ScDocument& rDoc = rViewData.GetDocument();
670 const ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
671 bool bSelectAllowed = true;
672 if ( pProtect && pProtect->isProtected() )
673 {
674 // This sheet is protected. Check if a context menu is allowed on this cell.
675 bool bCellsProtected = false;
676 if (bVertical)
677 {
678 // row header
679 SCROW nRPos = static_cast<SCROW>(nPos);
680 bCellsProtected = rDoc.HasAttrib(0, nRPos, nTab, rDoc.MaxCol(), nRPos, nTab, HasAttrFlags::Protected);
681 }
682 else
683 {
684 // column header
685 SCCOL nCPos = static_cast<SCCOL>(nPos);
686 bCellsProtected = rDoc.HasAttrib(nCPos, 0, nTab, nCPos, rDoc.MaxRow(), nTab, HasAttrFlags::Protected);
687 }
688
689 bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
690 bool bSelUnprotected = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
691
692 if (bCellsProtected)
693 bSelectAllowed = bSelProtected;
694 else
695 bSelectAllowed = bSelUnprotected;
696 }
697 return bSelectAllowed;
698}
699
701{
702 if (IsDisabled())
703 return;
704
705 bIgnoreMove = false;
706 SelectWindow();
707
708 bool bIsBorder;
709 SCCOLROW nHitNo = GetMousePos(rMEvt.GetPosPixel(), bIsBorder);
710 if (!IsSelectionAllowed(nHitNo))
711 return;
712 if ( ! rMEvt.IsLeft() )
713 return;
714 if ( SC_MOD()->IsFormulaMode() )
715 {
716 if( !pTabView )
717 return;
719 if( !rMEvt.IsShift() )
720 pTabView->DoneRefMode( rMEvt.IsMod1() );
722 if( !bVertical )
723 {
724 pTabView->InitRefMode( nHitNo, 0, nTab, SC_REFTYPE_REF );
725 pTabView->UpdateRef( nHitNo, rDoc.MaxRow(), nTab );
726 }
727 else
728 {
729 pTabView->InitRefMode( 0, nHitNo, nTab, SC_REFTYPE_REF );
730 pTabView->UpdateRef( rDoc.MaxCol(), nHitNo, nTab );
731 }
732 bInRefMode = true;
733 return;
734 }
735 if ( bIsBorder && ResizeAllowed() )
736 {
737 nDragNo = nHitNo;
738 sal_uInt16 nClicks = rMEvt.GetClicks();
739 if ( nClicks && nClicks%2==0 )
740 {
742 SetPointer( PointerStyle::Arrow );
743 }
744 else
745 {
746 if (bVertical)
747 nDragStart = rMEvt.GetPosPixel().Y();
748 else
749 nDragStart = rMEvt.GetPosPixel().X();
751 // tdf#140833 launch help tip to show after the double click time has expired
752 // so under gtk the popover isn't active when the double click is processed
753 // by gtk because under load on wayland the double click is getting handled
754 // by something else and getting sent to the window underneath our window
757
759 bDragging = true;
760 bDragMoved = false;
761 }
762 }
763 else
764 {
765 pSelEngine->SetWindow( this );
767 if (bVertical)
768 {
769 aVis.SetLeft( LONG_MIN );
770 aVis.SetRight( LONG_MAX );
771 }
772 else
773 {
774 aVis.SetTop( LONG_MIN );
775 aVis.SetBottom( LONG_MAX );
776 }
777 pSelEngine->SetVisibleArea( aVis );
778
779 SetMarking( true ); // must precede SelMouseButtonDown
781
782 // In column/row headers a simple click already is a selection.
783 // -> Call SelMouseMove to ensure CreateAnchor is called (and DestroyAnchor
784 // if the next click is somewhere else with Control key).
785 pSelEngine->SelMouseMove( rMEvt );
786
787 if (IsMouseCaptured())
788 {
789 // tracking instead of CaptureMouse, so it can be cancelled cleanly
791 ReleaseMouse();
793 }
794 }
795}
796
798{
799 if ( IsDisabled() )
800 return;
801
802 if ( SC_MOD()->IsFormulaMode() )
803 {
804 SC_MOD()->EndReference();
805 bInRefMode = false;
806 return;
807 }
808
809 SetMarking( false );
810 bIgnoreMove = false;
811
812 if ( bDragging )
813 {
815 ReleaseMouse();
816 HideDragHelp();
817 bDragging = false;
818
819 tools::Long nScrPos = GetScrPos( nDragNo );
820 tools::Long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
821 bool bLayoutRTL = IsLayoutRTL();
822 tools::Long nNewWidth = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
823 : ( nMousePos + 2 - nScrPos );
824
825 if ( nNewWidth < 0 /* && !IsSelected(nDragNo) */ )
826 {
827 SCCOLROW nStart = 0;
828 SCCOLROW nEnd = nDragNo;
829 while (nNewWidth < 0)
830 {
831 nStart = nDragNo;
832 if (nDragNo>0)
833 {
834 --nDragNo;
835 nNewWidth += GetEntrySize( nDragNo );
836 }
837 else
838 nNewWidth = 0;
839 }
840 HideEntries( nStart, nEnd );
841 }
842 else
843 {
844 if (bDragMoved)
845 SetEntrySize( nDragNo, static_cast<sal_uInt16>(nNewWidth) );
846 }
847 }
848 else
849 {
851 ReleaseMouse();
852 }
853}
854
856{
857 if ( IsDisabled() )
858 {
859 SetPointer( PointerStyle::Arrow );
860 return;
861 }
862
863 if ( bInRefMode && rMEvt.IsLeft() && SC_MOD()->IsFormulaMode() )
864 {
865 if( !pTabView )
866 return;
867 bool bTmp;
868 SCCOLROW nHitNo = GetMousePos(rMEvt.GetPosPixel(), bTmp);
871 if( !bVertical )
872 pTabView->UpdateRef( nHitNo, rDoc.MaxRow(), nTab );
873 else
874 pTabView->UpdateRef( rDoc.MaxCol(), nHitNo, nTab );
875
876 return;
877 }
878
879 if ( bDragging )
880 {
881 tools::Long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
882 if ( nNewPos != nDragPos )
883 {
885 nDragPos = nNewPos;
886 ShowDragHelp();
888
889 if (nDragPos <= nDragStart-SC_DRAG_MIN || nDragPos >= nDragStart+SC_DRAG_MIN)
890 bDragMoved = true;
891 }
892 }
893 else
894 {
895 bool bIsBorder;
896 (void)GetMousePos(rMEvt.GetPosPixel(), bIsBorder);
897
898 if ( bIsBorder && rMEvt.GetButtons()==0 && ResizeAllowed() )
899 SetPointer( bVertical ? PointerStyle::VSizeBar : PointerStyle::HSizeBar );
900 else
901 SetPointer( PointerStyle::Arrow );
902
903 if (!bIgnoreMove)
904 pSelEngine->SelMouseMove( rMEvt );
905 }
906}
907
909{
910 // Distribute the tracking events to the various MouseEvents, because
911 // SelectionEngine does not know anything about Tracking
912
913 if ( rTEvt.IsTrackingCanceled() )
914 StopMarking();
915 else if ( rTEvt.IsTrackingEnded() )
916 MouseButtonUp( rTEvt.GetMouseEvent() );
917 else
918 MouseMove( rTEvt.GetMouseEvent() );
919}
920
922{
923 CommandEventId nCmd = rCEvt.GetCommand();
924 if ( nCmd == CommandEventId::ContextMenu )
925 {
926 StopMarking(); // finish selection / dragging
927
928 // execute popup menu
929
930 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() );
931 if ( pViewSh )
932 {
933 if ( rCEvt.IsMouseEvent() )
934 {
935 // #i18735# select the column/row under the mouse pointer
936 ScViewData& rViewData = pViewSh->GetViewData();
937
938 SelectWindow(); // also deselects drawing objects, stops draw text edit
939 if ( rViewData.HasEditView( rViewData.GetActivePart() ) )
940 SC_MOD()->InputEnterHandler(); // always end edit mode
941
942 bool bBorder;
943 SCCOLROW nPos = GetMousePos(rCEvt.GetMousePosPixel(), bBorder );
945 // Selecting this cell is not allowed, neither is context menu.
946 return;
947
948 SCTAB nTab = rViewData.GetTabNo();
949 ScDocument& rDoc = pViewSh->GetViewData().GetDocument();
950 ScRange aNewRange;
951 if ( bVertical )
952 aNewRange = ScRange( 0, sal::static_int_cast<SCROW>(nPos), nTab,
953 rDoc.MaxCol(), sal::static_int_cast<SCROW>(nPos), nTab );
954 else
955 aNewRange = ScRange( sal::static_int_cast<SCCOL>(nPos), 0, nTab,
956 sal::static_int_cast<SCCOL>(nPos), rDoc.MaxRow(), nTab );
957
958 // see if any part of the range is already selected
959 ScRangeList aRanges;
960 rViewData.GetMarkData().FillRangeListWithMarks( &aRanges, false );
961 bool bSelected = aRanges.Intersects(aNewRange);
962
963 // select the range if no part of it was selected
964 if ( !bSelected )
965 pViewSh->MarkRange( aNewRange );
966 }
967
968 pViewSh->GetDispatcher()->ExecutePopup( bVertical ? OUString( "rowheader" ) : OUString( "colheader" ) );
969 }
970 }
971 else if ( nCmd == CommandEventId::StartDrag )
972 {
973 pSelEngine->Command( rCEvt );
974 }
975}
976
978{
979 if ( bDragging )
980 {
982 HideDragHelp();
983 bDragging = false;
984 }
985
986 SetMarking( false );
987 bIgnoreMove = true;
988
989 // don't call pSelEngine->Reset, so selection across the parts of
990 // a split/frozen view is possible
991 if (IsMouseCaptured())
992 ReleaseMouse();
993}
994
995IMPL_LINK_NOARG(ScHeaderControl, ShowDragHelpHdl, Timer*, void)
996{
997 ShowDragHelp();
998}
999
1001{
1004 return;
1005
1006 tools::Long nScrPos = GetScrPos( nDragNo );
1007 bool bLayoutRTL = IsLayoutRTL();
1008 tools::Long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
1009 : ( nDragPos + 2 - nScrPos );
1010
1011 OUString aHelpStr = GetDragHelp( nVal );
1012 Point aPos = OutputToScreenPixel( Point(0,0) );
1013 Size aSize = GetSizePixel();
1014
1016
1017 tools::Rectangle aRect;
1018 QuickHelpFlags nAlign;
1019 if (!bVertical)
1020 {
1021 // above
1022 aRect.SetLeft( aMousePos.X() );
1023 aRect.SetTop( aPos.Y() - 4 );
1024 nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center;
1025 }
1026 else
1027 {
1028 // top right
1029 aRect.SetLeft( aPos.X() + aSize.Width() + 8 );
1030 aRect.SetTop( aMousePos.Y() - 2 );
1031 nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
1032 }
1033
1034 aRect.SetRight( aRect.Left() );
1035 aRect.SetBottom( aRect.Top() );
1036
1037 if (nTipVisible)
1039 nTipVisible = Help::ShowPopover(this, aRect, aHelpStr, nAlign);
1040}
1041
1043{
1045 if (nTipVisible)
1046 {
1048 nTipVisible = nullptr;
1049 }
1050}
1051
1053{
1054 // If the own QuickHelp is displayed, don't let RequestHelp remove it
1055
1056 bool bOwn = bDragging && Help::IsQuickHelpEnabled();
1057 if (!bOwn)
1058 Window::RequestHelp(rHEvt);
1059}
1060
1061// dummies for virtual methods
1062
1064{
1065 SCCOLROW nHidden = 0;
1066 while ( nEntryNo < nSize && GetEntrySize( nEntryNo ) == 0 )
1067 {
1068 ++nEntryNo;
1069 ++nHidden;
1070 }
1071 return nHidden;
1072}
1073
1075{
1076 return false;
1077}
1078
1080{
1081 return false;
1082}
1083
1085{
1086 return false;
1087}
1088
1090{
1091 return true;
1092}
1093
1095{
1096}
1097
1099{
1100}
1101
1103{
1104 return OUString();
1105}
1106
1107void ScHeaderControl::SetMarking( bool /* bSet */ )
1108{
1109}
1110
1112{
1113 rStart = nMarkStart;
1114 rEnd = nMarkEnd;
1115}
1116
1117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
void PutInOrder(T &nStart, T &nEnd)
Definition: address.hxx:150
const StyleSettings & GetStyleSettings() const
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
bool IsDark() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
static bool IsQuickHelpEnabled()
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
static void HidePopover(vcl::Window const *pParent, void *nId)
bool IsMod1() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
bool IsLeft() const
bool IsShift() const
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetLineColor()
void SetFillColor()
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)
SCROW Row() const
Definition: address.hxx:274
Stores global named database ranges.
Definition: dbdata.hxx:243
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:324
bool empty() const
Definition: dbdata.cxx:1639
bool HasAutoFilter() const
Definition: dbdata.hxx:212
bool HasHeader() const
Definition: dbdata.hxx:136
void GetFilterSelCount(SCSIZE &nSelected, SCSIZE &nTotal)
Definition: dbdata.cxx:986
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:303
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1928
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5289
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:827
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
Definition: document.cxx:310
void AddHorLine(bool bWorksInPixels, tools::Long nX1, tools::Long nX2, tools::Long nY, bool bDashed=false)
Definition: gridmerg.cxx:96
void Flush()
Definition: gridmerg.cxx:184
void AddVerLine(bool bWorksInPixels, tools::Long nX, tools::Long nY1, tools::Long nY2, bool bDashed=false)
Definition: gridmerg.cxx:140
virtual SCCOLROW GetHiddenCount(SCCOLROW nEntryNo) const
Definition: hdrcont.cxx:1063
virtual bool IsLayoutRTL() const
Definition: hdrcont.cxx:1074
void GetMarkRange(SCCOLROW &rStart, SCCOLROW &rEnd) const
Definition: hdrcont.cxx:1111
bool bIgnoreMove
Definition: hdrcont.hxx:64
vcl::Font aAutoFilterFont
Definition: hdrcont.hxx:41
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: hdrcont.cxx:1052
virtual bool IsDisabled() const
Definition: hdrcont.cxx:1084
ScTabView * pTabView
Definition: hdrcont.hxx:79
virtual SCCOLROW GetPos() const =0
void DoPaint(SCCOLROW nStart, SCCOLROW nEnd)
Definition: hdrcont.cxx:127
SCCOLROW nMarkEnd
Definition: hdrcont.hxx:54
tools::Long nDragStart
Definition: hdrcont.hxx:59
void ShowDragHelp()
Definition: hdrcont.cxx:1000
SelectionEngine * pSelEngine
Definition: hdrcont.hxx:37
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:700
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition: hdrcont.cxx:908
void SetMark(bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd)
Definition: hdrcont.cxx:146
tools::Long nBigWidth
Definition: hdrcont.hxx:49
vcl::Font aBoldFont
Definition: hdrcont.hxx:40
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: hdrcont.cxx:219
virtual void DrawInvert(tools::Long nDragPos)
Definition: hdrcont.cxx:1098
virtual void SelectWindow()
Definition: hdrcont.cxx:1094
tools::Long nSmallWidth
Definition: hdrcont.hxx:48
tools::Long nDragPos
Definition: hdrcont.hxx:60
Timer aShowHelpTimer
Definition: hdrcont.hxx:38
ScHeaderControl(vcl::Window *pParent, SelectionEngine *pSelectionEngine, SCCOLROW nNewSize, bool bNewVertical, ScTabView *pTab)
Definition: hdrcont.cxx:50
void * nTipVisible
Definition: hdrcont.hxx:61
SCCOLROW nDragNo
Definition: hdrcont.hxx:58
bool IsSelectionAllowed(SCCOLROW nPos) const
Definition: hdrcont.cxx:661
SCCOLROW nMarkStart
Definition: hdrcont.hxx:53
void HideDragHelp()
Definition: hdrcont.cxx:1042
void SetWidth(tools::Long nNew)
Definition: hdrcont.cxx:109
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:855
virtual void HideEntries(SCCOLROW nStart, SCCOLROW nEnd)=0
virtual OUString GetDragHelp(tools::Long nVal)
Definition: hdrcont.cxx:1102
virtual void Command(const CommandEvent &rCEvt) override
Definition: hdrcont.cxx:921
bool bAutoFilterSet
Definition: hdrcont.hxx:43
virtual void dispose() override
Definition: hdrcont.cxx:103
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:797
tools::Long nWidth
Definition: hdrcont.hxx:47
virtual bool IsMirrored() const
Definition: hdrcont.cxx:1079
virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nNewWidth)=0
SCCOLROW nSize
Definition: hdrcont.hxx:51
virtual ~ScHeaderControl() override
Definition: hdrcont.cxx:123
virtual sal_uInt16 GetEntrySize(SCCOLROW nEntryNo) const =0
virtual bool ResizeAllowed() const
Definition: hdrcont.cxx:1089
virtual OUString GetEntryText(SCCOLROW nEntryNo) const =0
vcl::Font aNormFont
Definition: hdrcont.hxx:39
void StopMarking()
Definition: hdrcont.cxx:977
tools::Long GetScrPos(SCCOLROW nEntryNo) const
Definition: hdrcont.cxx:189
SCCOLROW GetMousePos(const Point &rPos, bool &rBorder) const
Definition: hdrcont.cxx:621
virtual void SetMarking(bool bSet)
Definition: hdrcont.cxx:1107
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
Definition: markdata.cxx:372
bool Intersects(const ScRange &) const
Definition: rangelst.cxx:1077
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void DoneRefMode(bool bContinue=false)
Definition: tabview4.cxx:159
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1708
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:309
ScViewData & GetViewData()
Definition: tabview.hxx:341
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
Definition: tabview4.cxx:186
sheet protection state container
bool isOptionEnabled(Option eOption) const
virtual bool isProtected() const override
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3141
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
bool HasEditView(ScSplitPos eWhich) const
Definition: viewdata.hxx:582
bool Command(const CommandEvent &rCEvt)
bool SelMouseMove(const MouseEvent &rMEvt)
bool SelMouseButtonDown(const MouseEvent &rMEvt)
void SetWindow(vcl::Window *)
void SetVisibleArea(const tools::Rectangle &rNewArea)
bool SelMouseButtonUp(const MouseEvent &rMEvt)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
SfxDispatcher * GetDispatcher() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
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
const Color & GetDarkShadowColor() const
bool GetHighContrastMode() const
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
const Color & GetHighlightTextColor() const
const Color & GetButtonTextColor() 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
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr void SetRight(tools::Long v)
constexpr tools::Long Right() const
constexpr void SetBottom(tools::Long v)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
void SetTransparent(bool bTransparent)
void SetColor(const Color &)
void SetWeight(FontWeight)
Point OutputToScreenPixel(const Point &rPos) const
virtual void dispose() override
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 SetFont(const vcl::Font &rNewFont)
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
bool IsMouseCaptured() const
Point LogicToPixel(const Point &rLogicPt) const
virtual void SetSizePixel(const Size &rNewSize)
virtual void EnableRTL(bool bEnable=true)
tools::Long GetTextHeight() const
const AllSettings & GetSettings() const
::OutputDevice const * GetOutDev() const
const vcl::Font & GetFont() const
void ReleaseMouse()
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
Point GetPointerPosPixel()
void DrawSelectionBackground(const tools::Rectangle &rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder)
virtual void SetPointer(PointerStyle)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void SetTextColor(const Color &rColor)
void SetBackground()
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
CommandEventId
int nCount
WEIGHT_BOLD
#define SC_HDRPAINT_COUNT
Definition: hdrcont.cxx:48
#define SC_DRAG_MIN
Definition: hdrcont.cxx:39
IMPL_LINK_NOARG(ScHeaderControl, ShowDragHelpHdl, Timer *, void)
Definition: hdrcont.cxx:995
#define SC_HDRPAINT_BOTTOM
Definition: hdrcont.cxx:46
#define SC_HDRPAINT_SEL_BOTTOM
Definition: hdrcont.cxx:45
#define SC_HDRPAINT_TEXT
Definition: hdrcont.cxx:47
#define HDR_SIZE_OPTIMUM
Definition: hdrcont.hxx:26
QuickHelpFlags
sal_uInt16 nPos
const long LONG_MAX
int i
long Long
#define SC_MOD()
Definition: scmod.hxx:249
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
@ SC_REFTYPE_REF
Definition: viewdata.hxx:55