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