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 Color aColor( rStyleSettings.GetAccentColor() );
365// merging the highlightcolor (which is used if accent does not exist) with the background
366// fails in many cases such as Breeze Dark (highlight is too close to background) and
367// Breeze Light (font color is white and not readable anymore)
368#ifdef MACOSX
369 aColor.Merge( rStyleSettings.GetFaceColor(), 80 );
370#endif
371 GetOutDev()->SetFillColor( aColor );
372 GetOutDev()->DrawRect( aFillRect );
373 }
374 }
375
376 GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
377 if (bVertical)
378 {
379 tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
380 GetOutDev()->DrawLine( Point( nDarkPos, nPStart ), Point( nDarkPos, nLineEnd ) );
381 }
382 else
383 GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) );
384
385 // line in different color for selection
386 if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && !bHighContrast )
387 {
388 GetOutDev()->SetLineColor( aSelLineColor );
389 if (bVertical)
390 {
391 tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
392 GetOutDev()->DrawLine( Point( nDarkPos, nTransStart ), Point( nDarkPos, nTransEnd ) );
393 }
394 else
395 GetOutDev()->DrawLine( Point( nTransStart, nBarSize-1 ), Point( nTransEnd, nBarSize-1 ) );
396 }
397 }
398
399 // tdf#89841 Use blue row numbers when Autofilter selected
400 std::vector<sc::ColRowSpan> aSpans;
401 if (bVertical && pTabView)
402 {
405
406 ScDBData* pDBData = rDoc.GetAnonymousDBData(nTab);
407 if (pDBData && pDBData->HasAutoFilter())
408 {
409 SCSIZE nSelected = 0;
410 SCSIZE nTotal = 0;
411 pDBData->GetFilterSelCount(nSelected, nTotal);
412 if (nTotal > nSelected)
413 {
414 ScRange aRange;
415 pDBData->GetArea(aRange);
416 SCCOLROW nStartRow = static_cast<SCCOLROW>(aRange.aStart.Row());
417 SCCOLROW nEndRow = static_cast<SCCOLROW>(aRange.aEnd.Row());
418 if (pDBData->HasHeader())
419 nStartRow++;
420 aSpans.push_back(sc::ColRowSpan(nStartRow, nEndRow));
421 }
422 }
423
424 ScDBCollection* pDocColl = rDoc.GetDBCollection();
425 if (!pDocColl->empty())
426 {
427 ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs();
428 for (const auto& rxDB : rDBs)
429 {
430 if (rxDB->GetTab() == nTab && rxDB->HasAutoFilter())
431 {
432 SCSIZE nSelected = 0;
433 SCSIZE nTotal = 0;
434 rxDB->GetFilterSelCount(nSelected, nTotal);
435 if (nTotal > nSelected)
436 {
437 ScRange aRange;
438 rxDB->GetArea(aRange);
439 SCCOLROW nStartRow = static_cast<SCCOLROW>(aRange.aStart.Row());
440 SCCOLROW nEndRow = static_cast<SCCOLROW>(aRange.aEnd.Row());
441 if (rxDB->HasHeader())
442 nStartRow++;
443 aSpans.push_back(sc::ColRowSpan(nStartRow, nEndRow));
444 }
445 }
446 }
447 }
448 }
449
450 // loop through entries several times to avoid changing the line color too often
451 // and to allow merging of lines
452
453 ScGridMerger aGrid( GetOutDev(), 1, 1 );
454
455 // start at SC_HDRPAINT_BOTTOM instead of 0 - selection doesn't get different
456 // borders, light border at top isn't used anymore
457 // use SC_HDRPAINT_SEL_BOTTOM for different color
458
459 for (sal_uInt16 nPass = SC_HDRPAINT_SEL_BOTTOM; nPass < SC_HDRPAINT_COUNT; nPass++)
460 {
461 // set line color etc. before entry loop
462 switch ( nPass )
463 {
465 // same as non-selected for high contrast
466 GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetDarkShadowColor() : aSelLineColor );
467 break;
469 GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
470 break;
471 case SC_HDRPAINT_TEXT:
472 // DrawSelectionBackground is used only for high contrast on light background
473 if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && bHighContrast && !bDark )
474 {
475 // Transparent selection background is drawn after lines, before text.
476 // Use DrawSelectionBackground to make sure there is a visible
477 // difference. The case of a dark face color, where DrawSelectionBackground
478 // would just paint over the lines, is handled separately (bDark).
479 // Otherwise, GetHighlightColor is used with 80% transparency.
480 // The window's background color (SetBackground) has to be the background
481 // of the cell area, for the contrast comparison in DrawSelectionBackground.
482
483 tools::Rectangle aTransRect;
484 if (bVertical)
485 aTransRect = tools::Rectangle( 0, nTransStart, nBarSize-1, nTransEnd );
486 else
487 aTransRect = tools::Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
488 SetBackground( rStyleSettings.GetFaceColor() );
489 DrawSelectionBackground( aTransRect, 0, true, false );
491 }
492 break;
493 }
494
496 tools::Long nScrPos=nInitScrPos;
497 do
498 {
499 if (bVertical)
500 aScrPos = Point( 0, nScrPos );
501 else
502 aScrPos = Point( nScrPos, 0 );
503
504 SCCOLROW nEntryNo = nCount + nPos;
505 if ( nEntryNo >= nSize ) // rDoc.MaxCol()/rDoc.MaxRow()
506 nScrPos = nPEnd + nLayoutSign; // beyond nPEnd -> stop
507 else
508 {
509 sal_uInt16 nSizePix = GetEntrySize( nEntryNo );
510
511 if (nSizePix == 0)
512 {
513 SCCOLROW nHidden = GetHiddenCount(nEntryNo);
514 if (nHidden > 0)
515 nCount += nHidden - 1;
516 }
517 else if ((nScrPos+nSizePix*nLayoutSign)*nLayoutSign >= nPStart*nLayoutSign)
518 {
519 Point aEndPos(aScrPos);
520 if (bVertical)
521 aEndPos = Point( aScrPos.X()+nBarSize-1, aScrPos.Y()+(nSizePix-1)*nLayoutSign );
522 else
523 aEndPos = Point( aScrPos.X()+(nSizePix-1)*nLayoutSign, aScrPos.Y()+nBarSize-1 );
524
525 bool bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
526 bool bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
527
528 switch ( nPass )
529 {
532 if ( nPass == ( bNextToMark ? SC_HDRPAINT_SEL_BOTTOM : SC_HDRPAINT_BOTTOM ) )
533 {
534 if (bVertical)
535 aGrid.AddHorLine(/* here we work in pixels */ true, aScrPos.X(), aEndPos.X(), aEndPos.Y());
536 else
537 aGrid.AddVerLine(/* here we work in pixels */ true, aEndPos.X(), aScrPos.Y(), aEndPos.Y());
538
539 // thick bottom for hidden rows
540 // (drawn directly, without aGrid)
541 if ( nEntryNo+1 < nSize )
542 if ( GetEntrySize(nEntryNo+1)==0 )
543 {
544 if (bVertical)
545 GetOutDev()->DrawLine( Point(aScrPos.X(),aEndPos.Y()-nLayoutSign),
546 Point(aEndPos.X(),aEndPos.Y()-nLayoutSign) );
547 else
548 GetOutDev()->DrawLine( Point(aEndPos.X()-nLayoutSign,aScrPos.Y()),
549 Point(aEndPos.X()-nLayoutSign,aEndPos.Y()) );
550 }
551 }
552 break;
553
554 case SC_HDRPAINT_TEXT:
555 if ( nSizePix > 1 ) // minimal check for small columns/rows
556 {
557 if (bVertical)
558 {
559 bool bAutoFilterPos = false;
560 for (const auto& rSpan : aSpans)
561 {
562 if (nEntryNo >= rSpan.mnStart && nEntryNo <= rSpan.mnEnd)
563 {
564 bAutoFilterPos = true;
565 break;
566 }
567 }
568
569 if (bMark != bBoldSet || bAutoFilterPos != bAutoFilterSet)
570 {
571 if (bMark)
573 else if (bAutoFilterPos)
575 else
577 bBoldSet = bMark;
578 bAutoFilterSet = bAutoFilterPos && !bMark;
579 }
580 }
581 else
582 {
583 if (bMark != bBoldSet)
584 {
585 if (bMark)
587 else
589 bBoldSet = bMark;
590 }
591 }
592
593 aString = GetEntryText( nEntryNo );
594 aTextSize.setWidth( GetTextWidth( aString ) );
595 aTextSize.setHeight( GetTextHeight() );
596
597 Point aTxtPos(aScrPos);
598 if (bVertical)
599 {
600 aTxtPos.AdjustX((nBarSize-aTextSize.Width())/2 );
601 aTxtPos.AdjustY((nSizePix*nLayoutSign-aTextSize.Height())/2 );
602 if ( bMirrored )
603 aTxtPos.AdjustX(1 ); // dark border is left instead of right
604 }
605 else
606 {
607 aTxtPos.AdjustX((nSizePix*nLayoutSign-aTextSize.Width()+1)/2 );
608 aTxtPos.AdjustY((nBarSize-aTextSize.Height())/2 );
609 }
610 GetOutDev()->DrawText( aTxtPos, aString );
611 }
612 break;
613 }
614
615 // when selecting the complete row/column:
616 // InvertRect( Rectangle( aScrPos, aEndPos ) );
617 }
618 nScrPos += nSizePix * nLayoutSign; // also if before the visible area
619 }
620 ++nCount;
621 }
622 while ( nScrPos * nLayoutSign <= nPEnd * nLayoutSign );
623
624 aGrid.Flush();
625 }
626}
627
628SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const
629{
630 bool bFound = false;
631 SCCOLROW nPos = GetPos();
632 SCCOLROW nHitNo = nPos;
633 SCCOLROW nEntryNo = 1 + nPos;
634 tools::Long nScrPos;
635 tools::Long nMousePos = bVertical ? rPos.Y() : rPos.X();
636 tools::Long nDif;
637 Size aSize = GetOutputSizePixel();
638 tools::Long nWinSize = bVertical ? aSize.Height() : aSize.Width();
639
640 bool bLayoutRTL = IsLayoutRTL();
641 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
642 tools::Long nEndPos = bLayoutRTL ? -1 : nWinSize;
643
644 nScrPos = GetScrPos( nPos ) - nLayoutSign;
645 do
646 {
647 if (nEntryNo > nSize)
648 nScrPos = nEndPos + nLayoutSign;
649 else
650 nScrPos += GetEntrySize( nEntryNo - 1 ) * nLayoutSign;
651
652 nDif = nMousePos - nScrPos;
653 if (nDif >= -2 && nDif <= 2)
654 {
655 bFound = true;
656 nHitNo=nEntryNo-1;
657 }
658 else if (nDif * nLayoutSign >= 0 && nEntryNo < nSize)
659 nHitNo = nEntryNo;
660 ++nEntryNo;
661 }
662 while ( nScrPos * nLayoutSign < nEndPos * nLayoutSign && nDif * nLayoutSign > 0 );
663
664 rBorder = bFound;
665 return nHitNo;
666}
667
669{
670 ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
671 if (!pViewSh)
672 return false;
673
674 ScViewData& rViewData = pViewSh->GetViewData();
675 sal_uInt16 nTab = rViewData.GetTabNo();
676 ScDocument& rDoc = rViewData.GetDocument();
677 const ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
678 bool bSelectAllowed = true;
679 if ( pProtect && pProtect->isProtected() )
680 {
681 // This sheet is protected. Check if a context menu is allowed on this cell.
682 bool bCellsProtected = false;
683 if (bVertical)
684 {
685 // row header
686 SCROW nRPos = static_cast<SCROW>(nPos);
687 bCellsProtected = rDoc.HasAttrib(0, nRPos, nTab, rDoc.MaxCol(), nRPos, nTab, HasAttrFlags::Protected);
688 }
689 else
690 {
691 // column header
692 SCCOL nCPos = static_cast<SCCOL>(nPos);
693 bCellsProtected = rDoc.HasAttrib(nCPos, 0, nTab, nCPos, rDoc.MaxRow(), nTab, HasAttrFlags::Protected);
694 }
695
696 bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
697 bool bSelUnprotected = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
698
699 if (bCellsProtected)
700 bSelectAllowed = bSelProtected;
701 else
702 bSelectAllowed = bSelUnprotected;
703 }
704 return bSelectAllowed;
705}
706
708{
709 if (IsDisabled())
710 return;
711
712 bIgnoreMove = false;
713 SelectWindow();
714
715 bool bIsBorder;
716 SCCOLROW nHitNo = GetMousePos(rMEvt.GetPosPixel(), bIsBorder);
717 if (!IsSelectionAllowed(nHitNo))
718 return;
719 if ( ! rMEvt.IsLeft() )
720 return;
721 if ( SC_MOD()->IsFormulaMode() )
722 {
723 if( !pTabView )
724 return;
726 if( !rMEvt.IsShift() )
727 pTabView->DoneRefMode( rMEvt.IsMod1() );
729 if( !bVertical )
730 {
731 pTabView->InitRefMode( nHitNo, 0, nTab, SC_REFTYPE_REF );
732 pTabView->UpdateRef( nHitNo, rDoc.MaxRow(), nTab );
733 }
734 else
735 {
736 pTabView->InitRefMode( 0, nHitNo, nTab, SC_REFTYPE_REF );
737 pTabView->UpdateRef( rDoc.MaxCol(), nHitNo, nTab );
738 }
739 bInRefMode = true;
740 return;
741 }
742 if ( bIsBorder && ResizeAllowed() )
743 {
744 nDragNo = nHitNo;
745 sal_uInt16 nClicks = rMEvt.GetClicks();
746 if ( nClicks && nClicks%2==0 )
747 {
749 SetPointer( PointerStyle::Arrow );
750 }
751 else
752 {
753 if (bVertical)
754 nDragStart = rMEvt.GetPosPixel().Y();
755 else
756 nDragStart = rMEvt.GetPosPixel().X();
758 // tdf#140833 launch help tip to show after the double click time has expired
759 // so under gtk the popover isn't active when the double click is processed
760 // by gtk because under load on wayland the double click is getting handled
761 // by something else and getting sent to the window underneath our window
764
766 bDragging = true;
767 bDragMoved = false;
768 }
769 }
770 else
771 {
772 pSelEngine->SetWindow( this );
774 if (bVertical)
775 {
776 aVis.SetLeft( LONG_MIN );
777 aVis.SetRight( LONG_MAX );
778 }
779 else
780 {
781 aVis.SetTop( LONG_MIN );
782 aVis.SetBottom( LONG_MAX );
783 }
784 pSelEngine->SetVisibleArea( aVis );
785
786 SetMarking( true ); // must precede SelMouseButtonDown
788
789 // In column/row headers a simple click already is a selection.
790 // -> Call SelMouseMove to ensure CreateAnchor is called (and DestroyAnchor
791 // if the next click is somewhere else with Control key).
792 pSelEngine->SelMouseMove( rMEvt );
793
794 if (IsMouseCaptured())
795 {
796 // tracking instead of CaptureMouse, so it can be cancelled cleanly
798 ReleaseMouse();
800 }
801 }
802}
803
805{
806 if ( IsDisabled() )
807 return;
808
809 if ( SC_MOD()->IsFormulaMode() )
810 {
811 SC_MOD()->EndReference();
812 bInRefMode = false;
813 return;
814 }
815
816 SetMarking( false );
817 bIgnoreMove = false;
818
819 if ( bDragging )
820 {
822 ReleaseMouse();
823 HideDragHelp();
824 bDragging = false;
825
826 tools::Long nScrPos = GetScrPos( nDragNo );
827 tools::Long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
828 bool bLayoutRTL = IsLayoutRTL();
829 tools::Long nNewWidth = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
830 : ( nMousePos + 2 - nScrPos );
831
832 if ( nNewWidth < 0 /* && !IsSelected(nDragNo) */ )
833 {
834 SCCOLROW nStart = 0;
835 SCCOLROW nEnd = nDragNo;
836 while (nNewWidth < 0)
837 {
838 nStart = nDragNo;
839 if (nDragNo>0)
840 {
841 --nDragNo;
842 nNewWidth += GetEntrySize( nDragNo );
843 }
844 else
845 nNewWidth = 0;
846 }
847 HideEntries( nStart, nEnd );
848 }
849 else
850 {
851 if (bDragMoved)
852 SetEntrySize( nDragNo, static_cast<sal_uInt16>(nNewWidth) );
853 }
854 }
855 else
856 {
858 ReleaseMouse();
859 }
860}
861
863{
864 if ( IsDisabled() )
865 {
866 SetPointer( PointerStyle::Arrow );
867 return;
868 }
869
870 if ( bInRefMode && rMEvt.IsLeft() && SC_MOD()->IsFormulaMode() )
871 {
872 if( !pTabView )
873 return;
874 bool bTmp;
875 SCCOLROW nHitNo = GetMousePos(rMEvt.GetPosPixel(), bTmp);
878 if( !bVertical )
879 pTabView->UpdateRef( nHitNo, rDoc.MaxRow(), nTab );
880 else
881 pTabView->UpdateRef( rDoc.MaxCol(), nHitNo, nTab );
882
883 return;
884 }
885
886 if ( bDragging )
887 {
888 tools::Long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
889 if ( nNewPos != nDragPos )
890 {
892 nDragPos = nNewPos;
893 ShowDragHelp();
895
896 if (nDragPos <= nDragStart-SC_DRAG_MIN || nDragPos >= nDragStart+SC_DRAG_MIN)
897 bDragMoved = true;
898 }
899 }
900 else
901 {
902 bool bIsBorder;
903 (void)GetMousePos(rMEvt.GetPosPixel(), bIsBorder);
904
905 if ( bIsBorder && rMEvt.GetButtons()==0 && ResizeAllowed() )
906 SetPointer( bVertical ? PointerStyle::VSizeBar : PointerStyle::HSizeBar );
907 else
908 SetPointer( PointerStyle::Arrow );
909
910 if (!bIgnoreMove)
911 pSelEngine->SelMouseMove( rMEvt );
912 }
913}
914
916{
917 // Distribute the tracking events to the various MouseEvents, because
918 // SelectionEngine does not know anything about Tracking
919
920 if ( rTEvt.IsTrackingCanceled() )
921 StopMarking();
922 else if ( rTEvt.IsTrackingEnded() )
923 MouseButtonUp( rTEvt.GetMouseEvent() );
924 else
925 MouseMove( rTEvt.GetMouseEvent() );
926}
927
929{
930 CommandEventId nCmd = rCEvt.GetCommand();
931 if ( nCmd == CommandEventId::ContextMenu )
932 {
933 StopMarking(); // finish selection / dragging
934
935 // execute popup menu
936
937 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() );
938 if ( pViewSh )
939 {
940 if ( rCEvt.IsMouseEvent() )
941 {
942 // #i18735# select the column/row under the mouse pointer
943 ScViewData& rViewData = pViewSh->GetViewData();
944
945 SelectWindow(); // also deselects drawing objects, stops draw text edit
946 if ( rViewData.HasEditView( rViewData.GetActivePart() ) )
947 SC_MOD()->InputEnterHandler(); // always end edit mode
948
949 bool bBorder;
950 SCCOLROW nPos = GetMousePos(rCEvt.GetMousePosPixel(), bBorder );
952 // Selecting this cell is not allowed, neither is context menu.
953 return;
954
955 SCTAB nTab = rViewData.GetTabNo();
956 ScDocument& rDoc = pViewSh->GetViewData().GetDocument();
957 ScRange aNewRange;
958 if ( bVertical )
959 aNewRange = ScRange( 0, sal::static_int_cast<SCROW>(nPos), nTab,
960 rDoc.MaxCol(), sal::static_int_cast<SCROW>(nPos), nTab );
961 else
962 aNewRange = ScRange( sal::static_int_cast<SCCOL>(nPos), 0, nTab,
963 sal::static_int_cast<SCCOL>(nPos), rDoc.MaxRow(), nTab );
964
965 // see if any part of the range is already selected
966 ScRangeList aRanges;
967 rViewData.GetMarkData().FillRangeListWithMarks( &aRanges, false );
968 bool bSelected = aRanges.Intersects(aNewRange);
969
970 // select the range if no part of it was selected
971 if ( !bSelected )
972 pViewSh->MarkRange( aNewRange );
973 }
974
975 pViewSh->GetDispatcher()->ExecutePopup( bVertical ? OUString( "rowheader" ) : OUString( "colheader" ) );
976 }
977 }
978 else if ( nCmd == CommandEventId::StartDrag )
979 {
980 pSelEngine->Command( rCEvt );
981 }
982}
983
985{
986 if ( bDragging )
987 {
989 HideDragHelp();
990 bDragging = false;
991 }
992
993 SetMarking( false );
994 bIgnoreMove = true;
995
996 // don't call pSelEngine->Reset, so selection across the parts of
997 // a split/frozen view is possible
998 if (IsMouseCaptured())
999 ReleaseMouse();
1000}
1001
1002IMPL_LINK_NOARG(ScHeaderControl, ShowDragHelpHdl, Timer*, void)
1003{
1004 ShowDragHelp();
1005}
1006
1008{
1011 return;
1012
1013 tools::Long nScrPos = GetScrPos( nDragNo );
1014 bool bLayoutRTL = IsLayoutRTL();
1015 tools::Long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
1016 : ( nDragPos + 2 - nScrPos );
1017
1018 OUString aHelpStr = GetDragHelp( nVal );
1019 Point aPos = OutputToScreenPixel( Point(0,0) );
1020 Size aSize = GetSizePixel();
1021
1023
1024 tools::Rectangle aRect;
1025 QuickHelpFlags nAlign;
1026 if (!bVertical)
1027 {
1028 // above
1029 aRect.SetLeft( aMousePos.X() );
1030 aRect.SetTop( aPos.Y() - 4 );
1031 nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center;
1032 }
1033 else
1034 {
1035 // top right
1036 aRect.SetLeft( aPos.X() + aSize.Width() + 8 );
1037 aRect.SetTop( aMousePos.Y() - 2 );
1038 nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
1039 }
1040
1041 aRect.SetRight( aRect.Left() );
1042 aRect.SetBottom( aRect.Top() );
1043
1044 if (nTipVisible)
1046 nTipVisible = Help::ShowPopover(this, aRect, aHelpStr, nAlign);
1047}
1048
1050{
1052 if (nTipVisible)
1053 {
1055 nTipVisible = nullptr;
1056 }
1057}
1058
1060{
1061 // If the own QuickHelp is displayed, don't let RequestHelp remove it
1062
1063 bool bOwn = bDragging && Help::IsQuickHelpEnabled();
1064 if (!bOwn)
1065 Window::RequestHelp(rHEvt);
1066}
1067
1068// dummies for virtual methods
1069
1071{
1072 SCCOLROW nHidden = 0;
1073 while ( nEntryNo < nSize && GetEntrySize( nEntryNo ) == 0 )
1074 {
1075 ++nEntryNo;
1076 ++nHidden;
1077 }
1078 return nHidden;
1079}
1080
1082{
1083 return false;
1084}
1085
1087{
1088 return false;
1089}
1090
1092{
1093 return false;
1094}
1095
1097{
1098 return true;
1099}
1100
1102{
1103}
1104
1106{
1107}
1108
1110{
1111 return OUString();
1112}
1113
1114void ScHeaderControl::SetMarking( bool /* bSet */ )
1115{
1116}
1117
1119{
1120 rStart = nMarkStart;
1121 rEnd = nMarkEnd;
1122}
1123
1124/* 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)
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
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:1634
bool HasAutoFilter() const
Definition: dbdata.hxx:212
bool HasHeader() const
Definition: dbdata.hxx:136
void GetFilterSelCount(SCSIZE &nSelected, SCSIZE &nTotal)
Definition: dbdata.cxx:981
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:298
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1914
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:5161
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:827
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
Definition: document.cxx:290
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:1070
virtual bool IsLayoutRTL() const
Definition: hdrcont.cxx:1081
void GetMarkRange(SCCOLROW &rStart, SCCOLROW &rEnd) const
Definition: hdrcont.cxx:1118
bool bIgnoreMove
Definition: hdrcont.hxx:64
vcl::Font aAutoFilterFont
Definition: hdrcont.hxx:41
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: hdrcont.cxx:1059
virtual bool IsDisabled() const
Definition: hdrcont.cxx:1091
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:1007
SelectionEngine * pSelEngine
Definition: hdrcont.hxx:37
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:707
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition: hdrcont.cxx:915
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:1105
virtual void SelectWindow()
Definition: hdrcont.cxx:1101
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:668
SCCOLROW nMarkStart
Definition: hdrcont.hxx:53
void HideDragHelp()
Definition: hdrcont.cxx:1049
void SetWidth(tools::Long nNew)
Definition: hdrcont.cxx:109
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:862
virtual void HideEntries(SCCOLROW nStart, SCCOLROW nEnd)=0
virtual OUString GetDragHelp(tools::Long nVal)
Definition: hdrcont.cxx:1109
virtual void Command(const CommandEvent &rCEvt) override
Definition: hdrcont.cxx:928
bool bAutoFilterSet
Definition: hdrcont.hxx:43
virtual void dispose() override
Definition: hdrcont.cxx:103
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: hdrcont.cxx:804
tools::Long nWidth
Definition: hdrcont.hxx:47
virtual bool IsMirrored() const
Definition: hdrcont.cxx:1086
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:1096
virtual OUString GetEntryText(SCCOLROW nEntryNo) const =0
vcl::Font aNormFont
Definition: hdrcont.hxx:39
void StopMarking()
Definition: hdrcont.cxx:984
tools::Long GetScrPos(SCCOLROW nEntryNo) const
Definition: hdrcont.cxx:189
SCCOLROW GetMousePos(const Point &rPos, bool &rBorder) const
Definition: hdrcont.cxx:628
virtual void SetMarking(bool bSet)
Definition: hdrcont.cxx:1114
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:344
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:3146
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 & GetAccentColor() 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)
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:1002
#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:247
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