LibreOffice Module vcl (master) 1
slider.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 <vcl/event.hxx>
21#include <vcl/decoview.hxx>
22#include <slider.hxx>
23#include <vcl/settings.hxx>
24
25#include "thumbpos.hxx"
26
27#define SLIDER_STATE_CHANNEL1_DOWN (sal_uInt16(0x0001))
28#define SLIDER_STATE_CHANNEL2_DOWN (sal_uInt16(0x0002))
29#define SLIDER_STATE_THUMB_DOWN (sal_uInt16(0x0004))
30
31#define SLIDER_THUMB_SIZE 9
32#define SLIDER_CHANNEL_SIZE 4
33#define SLIDER_CHANNEL_HALFSIZE 2
34
35#define SLIDER_HEIGHT 16
36
37#define SLIDER_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
38
39void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle )
40{
43 mnThumbPixPos = 0; // between mnThumbPixOffset and mnThumbPixOffset+mnThumbPixRange
48
49 mnMinRange = 0;
50 mnMaxRange = 100;
51 mnThumbPos = 0;
52 mnLineSize = 1;
53 mnPageSize = 1;
54 mnStateFlags = 0;
56 mbCalcSize = true;
57
58 Control::ImplInit( pParent, nStyle, nullptr );
59
62}
63
64Slider::Slider( vcl::Window* pParent, WinBits nStyle ) :
66{
67 ImplInit( pParent, nStyle );
68}
69
71{
73}
74
76{
77 vcl::Window* pParent = GetParent();
79 {
82 SetPaintTransparent( true );
84 }
85 else
86 {
89 SetPaintTransparent( false );
90
91 if ( IsControlBackground() )
93 else
94 SetBackground( pParent->GetBackground() );
95 }
96}
97
98void Slider::ImplUpdateRects( bool bUpdate )
99{
100 tools::Rectangle aOldThumbRect = maThumbRect;
101 bool bInvalidateAll = false;
102
103 if ( mnThumbPixRange )
104 {
105 if ( GetStyle() & WB_HORZ )
106 {
109 if ( 0 < maThumbRect.Left() )
110 {
115 }
116 else
119 {
124 }
125 else
127
128 const tools::Rectangle aControlRegion(tools::Rectangle(Point(), Size(mnThumbSize, 10)));
129 tools::Rectangle aThumbBounds, aThumbContent;
131 aControlRegion, ControlState::NONE, ImplControlValue(),
132 aThumbBounds, aThumbContent ) )
133 {
134 maThumbRect.SetLeft( mnThumbPixPos - aThumbBounds.GetWidth()/2 );
135 maThumbRect.SetRight( maThumbRect.Left() + aThumbBounds.GetWidth() - 1 );
136 bInvalidateAll = true;
137 }
138 }
139 else
140 {
143 if ( 0 < maThumbRect.Top() )
144 {
149 }
150 else
153 {
158 }
159 else
161
162 const tools::Rectangle aControlRegion(tools::Rectangle(Point(), Size(10, mnThumbSize)));
163 tools::Rectangle aThumbBounds, aThumbContent;
165 aControlRegion, ControlState::NONE, ImplControlValue(),
166 aThumbBounds, aThumbContent ) )
167 {
168 maThumbRect.SetTop( mnThumbPixPos - aThumbBounds.GetHeight()/2 );
169 maThumbRect.SetBottom( maThumbRect.Top() + aThumbBounds.GetHeight() - 1 );
170 bInvalidateAll = true;
171 }
172 }
173 }
174 else
175 {
179 }
180
181 if ( !bUpdate )
182 return;
183
184 if ( aOldThumbRect == maThumbRect )
185 return;
186
187 if( bInvalidateAll )
189 else
190 {
191 vcl::Region aInvalidRegion( aOldThumbRect );
192 aInvalidRegion.Union( maThumbRect );
193
194 if( !IsBackground() && GetParent() )
195 {
196 const Point aPos( GetPosPixel() );
197 aInvalidRegion.Move( aPos.X(), aPos.Y() );
199 }
200 else
201 Invalidate( aInvalidRegion );
202 }
203}
204
206{
207 // calculate position
208 tools::Long nCalcThumbPos;
209 nCalcThumbPos = ImplMulDiv( nPixPos-mnThumbPixOffset, mnMaxRange-mnMinRange, mnThumbPixRange-1 );
210 nCalcThumbPos += mnMinRange;
211 return nCalcThumbPos;
212}
213
215{
216 // calculate position
217 tools::Long nCalcThumbPos;
219 // at the beginning and end we try to display Slider correctly
220 if ( !nCalcThumbPos && (mnThumbPos > mnMinRange) )
221 nCalcThumbPos = 1;
222 if ( nCalcThumbPos &&
223 (nCalcThumbPos == mnThumbPixRange-1) &&
225 nCalcThumbPos--;
226 return nCalcThumbPos+mnThumbPixOffset;
227}
228
229void Slider::ImplCalc( bool bUpdate )
230{
231 bool bInvalidateAll = false;
232
233 if (mbCalcSize)
234 {
235 if (GetStyle() & WB_HORZ)
236 {
237 const tools::Rectangle aControlRegion(tools::Rectangle(Point(), Size(SLIDER_THUMB_SIZE, 10)));
238 tools::Rectangle aThumbBounds, aThumbContent;
240 aControlRegion, ControlState::NONE, ImplControlValue(),
241 aThumbBounds, aThumbContent))
242 {
243 mnThumbSize = aThumbBounds.GetWidth();
244 }
245 else
246 {
248 }
249 }
250 else
251 {
252 const tools::Rectangle aControlRegion(tools::Rectangle(Point(), Size(10, SLIDER_THUMB_SIZE)));
253 tools::Rectangle aThumbBounds, aThumbContent;
255 aControlRegion, ControlState::NONE, ImplControlValue(),
256 aThumbBounds, aThumbContent))
257 {
258 mnThumbSize = aThumbBounds.GetHeight();
259 }
260 else
261 {
263 }
264 }
265
266 tools::Long nOldChannelPixRange = mnChannelPixRange;
267 tools::Long nOldChannelPixTop = mnChannelPixTop;
268 tools::Long nOldChannelPixBottom = mnChannelPixBottom;
269 tools::Long nCalcWidth;
270 tools::Long nCalcHeight;
271
275
276 Size aSize = GetOutputSizePixel();
277 if ( GetStyle() & WB_HORZ )
278 {
279 nCalcWidth = aSize.Width();
280 nCalcHeight = aSize.Height();
281 maThumbRect.SetTop( 0 );
282 maThumbRect.SetBottom( aSize.Height()-1 );
283 }
284 else
285 {
286 nCalcWidth = aSize.Height();
287 nCalcHeight = aSize.Width();
288 maThumbRect.SetLeft( 0 );
289 maThumbRect.SetRight( aSize.Width()-1 );
290 }
291
292 if (nCalcWidth >= mnThumbSize)
293 {
295 mnThumbPixRange = nCalcWidth - mnThumbSize;
296 mnThumbPixPos = 0;
297 mnChannelPixRange = nCalcWidth;
300 }
301 else
302 {
303 mnThumbPixRange = 0;
305 }
306
307 if ( (nOldChannelPixRange != mnChannelPixRange) ||
308 (nOldChannelPixTop != mnChannelPixTop) ||
309 (nOldChannelPixBottom != mnChannelPixBottom) )
310 bInvalidateAll = true;
311
312 mbCalcSize = false;
313 }
314
315 if ( mnThumbPixRange )
317
318 if ( bUpdate && bInvalidateAll )
319 {
320 Invalidate();
321 bUpdate = false;
322 }
323 ImplUpdateRects( bUpdate );
324}
325
327{
328 // do missing calculations
329 if (mbCalcSize)
330 ImplCalc(false);
331
333
334 if (rRenderContext.IsNativeControlSupported(ControlType::Slider, nPart))
335 {
338
339 SliderValue aSliderValue;
340 aSliderValue.mnMin = mnMinRange;
341 aSliderValue.mnMax = mnMaxRange;
342 aSliderValue.mnCur = mnThumbPos;
343 aSliderValue.maThumbRect = maThumbRect;
344
345 if (IsMouseOver())
346 {
348 aSliderValue.mnThumbState |= ControlState::ROLLOVER;
349 }
350
351 const tools::Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel());
352
353 if (rRenderContext.DrawNativeControl(ControlType::Slider, nPart, aCtrlRegion, nState, aSliderValue, OUString()))
354 return;
355 }
356
357 DecorationView aDecoView(&rRenderContext);
358 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
359 bool bEnabled = IsEnabled();
360
361 if (!maChannel1Rect.IsEmpty())
362 {
363 tools::Long nRectSize;
365 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
366 if (GetStyle() & WB_HORZ)
367 {
368 rRenderContext.DrawLine(aRect.TopLeft(), Point(aRect.Left(), aRect.Bottom() - 1));
369 rRenderContext.DrawLine(aRect.TopLeft(), aRect.TopRight());
370 }
371 else
372 {
373 rRenderContext.DrawLine(aRect.TopLeft(), Point(aRect.Right() - 1, aRect.Top()));
374 rRenderContext.DrawLine(aRect.TopLeft(), aRect.BottomLeft());
375 }
376 rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
377 if (GetStyle() & WB_HORZ)
378 {
379 rRenderContext.DrawLine(aRect.BottomLeft(), aRect.BottomRight());
380 nRectSize = aRect.GetWidth();
381 }
382 else
383 {
384 rRenderContext.DrawLine(aRect.TopRight(), aRect.BottomRight());
385 nRectSize = aRect.GetHeight();
386 }
387
388 if (nRectSize > 1)
389 {
390 aRect.AdjustLeft( 1 );
391 aRect.AdjustTop( 1 );
392 if (GetStyle() & WB_HORZ)
393 aRect.AdjustBottom( -1 );
394 else
395 aRect.AdjustRight( -1 );
396 rRenderContext.SetLineColor();
398 rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
399 else
400 rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
401 rRenderContext.DrawRect(aRect);
402 }
403 }
404
405 if (!maChannel2Rect.IsEmpty())
406 {
407 tools::Long nRectSize;
409 rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
410 if (GetStyle() & WB_HORZ)
411 {
412 rRenderContext.DrawLine(aRect.TopRight(), aRect.BottomRight());
413 rRenderContext.DrawLine(aRect.BottomLeft(), aRect.BottomRight());
414 nRectSize = aRect.GetWidth();
415 }
416 else
417 {
418 rRenderContext.DrawLine(aRect.BottomLeft(), aRect.BottomRight());
419 rRenderContext.DrawLine(aRect.TopRight(), aRect.BottomRight());
420 nRectSize = aRect.GetHeight();
421 }
422
423 if (nRectSize > 1)
424 {
425 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
426 if (GetStyle() & WB_HORZ)
427 rRenderContext.DrawLine(aRect.TopLeft(), Point(aRect.Right() - 1, aRect.Top()));
428 else
429 rRenderContext.DrawLine(aRect.TopLeft(), Point(aRect.Left(), aRect.Bottom() - 1));
430
431 aRect.AdjustRight( -1 );
432 aRect.AdjustBottom( -1 );
433 if (GetStyle() & WB_HORZ)
434 aRect.AdjustTop( 1 );
435 else
436 aRect.AdjustLeft( 1 );
437 rRenderContext.SetLineColor();
439 rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
440 else
441 rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
442 rRenderContext.DrawRect(aRect);
443 }
444 }
445
446 if (maThumbRect.IsEmpty())
447 return;
448
449 if (bEnabled)
450 {
453 nStyle |= DrawButtonFlags::Pressed;
454 aDecoView.DrawButton(maThumbRect, nStyle);
455 }
456 else
457 {
458 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
459 rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
460 rRenderContext.DrawRect(maThumbRect);
461 }
462}
463
464bool Slider::ImplIsPageUp( const Point& rPos ) const
465{
466 Size aSize = GetOutputSizePixel();
468 if ( GetStyle() & WB_HORZ )
469 {
470 aRect.SetTop( 0 );
471 aRect.SetBottom( aSize.Height()-1 );
472 }
473 else
474 {
475 aRect.SetLeft( 0 );
476 aRect.SetRight( aSize.Width()-1 );
477 }
478 return aRect.Contains( rPos );
479}
480
481bool Slider::ImplIsPageDown( const Point& rPos ) const
482{
483 Size aSize = GetOutputSizePixel();
485 if ( GetStyle() & WB_HORZ )
486 {
487 aRect.SetTop( 0 );
488 aRect.SetBottom( aSize.Height()-1 );
489 }
490 else
491 {
492 aRect.SetLeft( 0 );
493 aRect.SetRight( aSize.Width()-1 );
494 }
495 return aRect.Contains( rPos );
496}
497
499{
500 tools::Long nOldPos = mnThumbPos;
501 SetThumbPos( nNewPos );
502 tools::Long nDelta = mnThumbPos-nOldPos;
503 if ( nDelta )
504 {
505 Slide();
506 }
507 return nDelta;
508}
509
511{
512 tools::Long nDelta = 0;
513
514 switch ( meScrollType )
515 {
517 nDelta = ImplSlide( mnThumbPos-mnLineSize );
518 break;
519
521 nDelta = ImplSlide( mnThumbPos+mnLineSize );
522 break;
523
525 nDelta = ImplSlide( mnThumbPos-mnPageSize );
526 break;
527
529 nDelta = ImplSlide( mnThumbPos+mnPageSize );
530 break;
531
532 default:
533 break;
534 }
535
536 return nDelta;
537}
538
539void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
540{
541 sal_uInt16 nOldStateFlags = mnStateFlags;
542 bool bAction = false;
543
544 switch ( meScrollType )
545 {
547 if ( ImplIsPageUp( rMousePos ) )
548 {
549 bAction = bCallAction;
551 }
552 else
553 mnStateFlags &= ~SLIDER_STATE_CHANNEL1_DOWN;
554 break;
555
557 if ( ImplIsPageDown( rMousePos ) )
558 {
559 bAction = bCallAction;
561 }
562 else
563 mnStateFlags &= ~SLIDER_STATE_CHANNEL2_DOWN;
564 break;
565 default:
566 break;
567 }
568
569 if ( bAction )
570 {
571 if ( ImplDoAction() )
572 {
573 Invalidate();
574 }
575 }
576 else if ( nOldStateFlags != mnStateFlags )
577 {
578 Invalidate();
579 }
580}
581
583{
585 return;
586
588 ImplSlide( nNewPos );
590}
591
593{
595 (eScrollType == ScrollType::DontKnow) ||
596 (eScrollType == ScrollType::Drag) )
597 return;
598
599 meScrollType = eScrollType;
600 ImplDoAction();
602}
603
605{
606 if ( !rMEvt.IsLeft() )
607 return;
608
609 const Point& rMousePos = rMEvt.GetPosPixel();
611
612 if ( maThumbRect.Contains( rMousePos ) )
613 {
615
616 // calculate additional values
617 Point aCenterPos = maThumbRect.Center();
618 if ( GetStyle() & WB_HORZ )
619 mnMouseOff = rMousePos.X()-aCenterPos.X();
620 else
621 mnMouseOff = rMousePos.Y()-aCenterPos.Y();
622 }
623 else if ( ImplIsPageUp( rMousePos ) )
624 {
627 }
628 else if ( ImplIsPageDown( rMousePos ) )
629 {
632 }
633
634 // Shall we start Tracking?
636 {
637 // store Start position for cancel and EndScroll delta
639 ImplDoMouseAction( rMousePos, /*bCallAction*/true );
641
642 StartTracking( nTrackFlags );
643 }
644}
645
647{
648}
649
650void Slider::Tracking( const TrackingEvent& rTEvt )
651{
652 if ( rTEvt.IsTrackingEnded() )
653 {
654 // reset Button and PageRect state
655 sal_uInt16 nOldStateFlags = mnStateFlags;
658 if ( nOldStateFlags != mnStateFlags )
659 {
661 }
662
663 // on cancel, reset the previous Thumb position
664 if ( rTEvt.IsTrackingCanceled() )
665 {
667 Slide();
668 }
669
671 {
672 // after dragging, recalculate to a rounded Thumb position
673 ImplCalc();
675 }
676
678 }
679 else
680 {
681 const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel();
682
683 // special handling for dragging
685 {
686 tools::Long nMovePix;
687 Point aCenterPos = maThumbRect.Center();
688 if ( GetStyle() & WB_HORZ )
689 nMovePix = rMousePos.X()-(aCenterPos.X()+mnMouseOff);
690 else
691 nMovePix = rMousePos.Y()-(aCenterPos.Y()+mnMouseOff);
692 // only if the mouse moves in Scroll direction we have to act
693 if ( nMovePix )
694 {
695 mnThumbPixPos += nMovePix;
700 tools::Long nOldPos = mnThumbPos;
702 if ( nOldPos != mnThumbPos )
703 {
706 if ( nOldPos != mnThumbPos )
707 {
708 Slide();
709 }
710 }
711 }
712 }
713 else
714 ImplDoMouseAction( rMousePos, rTEvt.IsTrackingRepeat() );
715
716 // end tracking if ScrollBar values indicate we are done
717 if ( !IsVisible() )
718 EndTracking();
719 }
720}
721
722void Slider::KeyInput( const KeyEvent& rKEvt )
723{
724 if ( !rKEvt.GetKeyCode().GetModifier() )
725 {
726 switch ( rKEvt.GetKeyCode().GetCode() )
727 {
728 case KEY_HOME:
730 break;
731 case KEY_END:
733 break;
734
735 case KEY_LEFT:
736 case KEY_UP:
738 break;
739
740 case KEY_RIGHT:
741 case KEY_DOWN:
743 break;
744
745 case KEY_PAGEUP:
747 break;
748
749 case KEY_PAGEDOWN:
751 break;
752
753 default:
754 Control::KeyInput( rKEvt );
755 break;
756 }
757 }
758 else
759 Control::KeyInput( rKEvt );
760}
761
762void Slider::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
763{
764 ImplDraw(rRenderContext);
765}
766
768{
770 mbCalcSize = true;
771 if ( IsReallyVisible() )
772 ImplCalc( false );
774}
775
777{
779
781 ImplCalc( false );
782 else if ( nType == StateChangedType::Data )
783 {
784 if ( IsReallyVisible() && IsUpdateMode() )
785 ImplCalc();
786 }
788 {
789 if ( IsReallyVisible() && IsUpdateMode() )
790 {
791 ImplCalc( false );
792 Invalidate();
793 }
794 }
795 else if ( nType == StateChangedType::Enable ||
797 {
798 if ( IsReallyVisible() && IsUpdateMode() )
799 {
800 Invalidate();
801 }
802 }
803 else if ( nType == StateChangedType::Style )
804 {
805 if ( IsReallyVisible() && IsUpdateMode() )
806 {
807 if ( (GetPrevStyle() & SLIDER_VIEW_STYLE) !=
809 {
810 mbCalcSize = true;
811 ImplCalc( false );
812 Invalidate();
813 }
814 }
815 }
817 {
819 Invalidate();
820 }
821}
822
824{
825 Control::DataChanged( rDCEvt );
826
827 if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
828 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
829 {
831 Invalidate();
832 }
833}
834
836{
837 maSlideHdl.Call( this );
838}
839
841{
842 SetRange(Range(nNewRange, GetRangeMax()));
843}
844
846{
847 SetRange(Range(GetRangeMin(), nNewRange));
848}
849
850void Slider::SetRange( const Range& rRange )
851{
852 // adjust Range
853 Range aRange = rRange;
854 aRange.Normalize();
855 tools::Long nNewMinRange = aRange.Min();
856 tools::Long nNewMaxRange = aRange.Max();
857
858 // reset Range if different
859 if ( (mnMinRange != nNewMinRange) ||
860 (mnMaxRange != nNewMaxRange) )
861 {
862 mnMinRange = nNewMinRange;
863 mnMaxRange = nNewMaxRange;
864
865 // adjust Thumb
866 if ( mnThumbPos > mnMaxRange )
868 if ( mnThumbPos < mnMinRange )
871 }
872}
873
875{
876 if ( nNewThumbPos < mnMinRange )
877 nNewThumbPos = mnMinRange;
878 if ( nNewThumbPos > mnMaxRange )
879 nNewThumbPos = mnMaxRange;
880
881 if ( mnThumbPos != nNewThumbPos )
882 {
883 mnThumbPos = nNewThumbPos;
885 }
886}
887
889{
891 tools::Long nHeight = SLIDER_HEIGHT;
892 Size aSize;
893 if ( GetStyle() & WB_HORZ )
894 {
895 aSize.setWidth( nWidth );
896 aSize.setHeight( nHeight );
897 }
898 else
899 {
900 aSize.setHeight( nWidth );
901 aSize.setWidth( nHeight );
902 }
903 return aSize;
904}
905
906/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
Definition: ctrl.hxx:80
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:256
virtual void Resize() override
Definition: ctrl.cxx:77
DataChangedEventType GetType() const
Definition: event.hxx:362
AllSettingsFlags GetFlags() const
Definition: event.hxx:363
tools::Rectangle DrawButton(const tools::Rectangle &rRect, DrawButtonFlags nStyle)
Definition: decoview.cxx:894
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
const Point & GetPosPixel() const
Definition: event.hxx:123
bool IsLeft() const
Definition: event.hxx:149
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:161
void SetLineColor()
Definition: line.cxx:37
void SetFillColor()
Definition: fill.cxx:29
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
constexpr tools::Long Y() const
constexpr tools::Long X() const
tools::Long Max() const
void Normalize()
tools::Long Min() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
tools::Long mnCur
tools::Rectangle maThumbRect
tools::Long mnMax
ControlState mnThumbState
tools::Long mnMin
void SetRange(const Range &rRange)
Definition: slider.cxx:850
tools::Long mnMinRange
Definition: slider.hxx:42
tools::Long ImplCalcThumbPosPix(tools::Long nPos) const
Definition: slider.cxx:214
tools::Long mnLineSize
Definition: slider.hxx:45
tools::Long ImplDoAction()
Definition: slider.cxx:510
void ImplInitSettings()
Definition: slider.cxx:75
tools::Rectangle maChannel2Rect
Definition: slider.hxx:31
void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: slider.cxx:39
tools::Long GetRangeMin() const
Definition: slider.hxx:85
tools::Long mnThumbPixRange
Definition: slider.hxx:36
void ImplDoMouseAction(const Point &rPos, bool bCallAction)
Definition: slider.cxx:539
Size CalcWindowSizePixel() const
Definition: slider.cxx:888
tools::Long mnChannelPixBottom
Definition: slider.hxx:41
ScrollType meScrollType
Definition: slider.hxx:48
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: slider.cxx:646
tools::Long mnMaxRange
Definition: slider.hxx:43
virtual ~Slider() override
Definition: slider.cxx:70
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: slider.cxx:604
sal_uInt16 mnStateFlags
Definition: slider.hxx:47
tools::Long mnMouseOff
Definition: slider.hxx:34
Link< Slider *, void > maSlideHdl
Definition: slider.hxx:51
void SetThumbPos(tools::Long nThumbPos)
Definition: slider.cxx:874
tools::Long mnChannelPixRange
Definition: slider.hxx:39
bool ImplIsPageUp(const Point &rPos) const
Definition: slider.cxx:464
tools::Long ImplCalcThumbPos(tools::Long nPixPos) const
Definition: slider.cxx:205
virtual void StateChanged(StateChangedType nType) override
Definition: slider.cxx:776
tools::Long mnChannelPixTop
Definition: slider.hxx:40
void ImplCalc(bool bUpdate=true)
Definition: slider.cxx:229
void ImplDraw(vcl::RenderContext &rRenderContext)
Definition: slider.cxx:326
void SetRangeMin(tools::Long nNewRange)
Definition: slider.cxx:840
void Slide()
Definition: slider.cxx:835
void ImplUpdateRects(bool bUpdate=true)
Definition: slider.cxx:98
tools::Rectangle maThumbRect
Definition: slider.hxx:32
tools::Long GetRangeMax() const
Definition: slider.hxx:87
bool mbCalcSize
Definition: slider.hxx:49
tools::Long mnStartPos
Definition: slider.hxx:33
tools::Long mnThumbPixOffset
Definition: slider.hxx:35
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: slider.cxx:823
tools::Long mnThumbSize
Definition: slider.hxx:38
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition: slider.cxx:650
virtual void Resize() override
Definition: slider.cxx:767
tools::Rectangle maChannel1Rect
Definition: slider.hxx:30
void ImplDoSlideAction(ScrollType eScrollType)
Definition: slider.cxx:592
void SetRangeMax(tools::Long nNewRange)
Definition: slider.cxx:845
tools::Long ImplSlide(tools::Long nNewPos)
Definition: slider.cxx:498
Slider(vcl::Window *pParent, WinBits nStyle)
Definition: slider.cxx:64
bool ImplIsPageDown(const Point &rPos) const
Definition: slider.cxx:481
tools::Long mnPageSize
Definition: slider.hxx:46
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: slider.cxx:762
void ImplDoSlide(tools::Long nNewPos)
Definition: slider.cxx:582
tools::Long mnThumbPos
Definition: slider.hxx:44
tools::Long mnThumbPixPos
Definition: slider.hxx:37
virtual void KeyInput(const KeyEvent &rKEvt) override
Definition: slider.cxx:722
const Color & GetShadowColor() const
const Color & GetCheckedColor() const
const Color & GetLightColor() const
bool IsTrackingEnded() const
Definition: event.hxx:261
bool IsTrackingRepeat() const
Definition: event.hxx:259
bool IsTrackingCanceled() const
Definition: event.hxx:263
const MouseEvent & GetMouseEvent() const
Definition: event.hxx:257
constexpr Point Center() const
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr Point TopRight() const
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
constexpr Point BottomLeft() const
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
sal_uInt16 GetModifier() const
Definition: keycod.hxx:52
void Move(tools::Long nHorzMove, tools::Long nVertMove)
Definition: region.cxx:401
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:507
const Wallpaper & GetBackground() const
Definition: window3.cxx:63
bool IsReallyVisible() const
Definition: window2.cxx:1133
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
Definition: window2.cxx:252
vcl::Window * GetParent() const
Definition: window2.cxx:1123
void PaintImmediately()
Definition: paint.cxx:1268
WinBits GetPrevStyle() const
Definition: window2.cxx:984
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
Definition: window2.cxx:293
bool IsMouseOver() const
Definition: mouse.cxx:596
bool IsBackground() const
Definition: window3.cxx:64
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1288
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
bool IsUpdateMode() const
Definition: window2.cxx:1199
bool IsChildTransparentModeEnabled() const
Definition: window2.cxx:1053
bool HasFocus() const
Definition: window.cxx:2981
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
Definition: window3.cxx:79
virtual Point GetPosPixel() const
Definition: window.cxx:2794
WinBits GetStyle() const
Definition: window2.cxx:979
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1805
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1113
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
Point GetPointerPosPixel()
Definition: mouse.cxx:540
const Color & GetControlBackground() const
Definition: window2.cxx:1108
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
bool IsVisible() const
Definition: window2.cxx:1128
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
bool IsEnabled() const
Definition: window2.cxx:1148
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:941
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1048
void SetBackground()
Definition: window3.cxx:100
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3898
DrawButtonFlags
Definition: decoview.hxx:54
sal_Int32 nState
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
sal_uInt16 nPos
long Long
QPRO_FUNC_TYPE nType
#define SLIDER_CHANNEL_SIZE
Definition: slider.cxx:32
#define SLIDER_THUMB_SIZE
Definition: slider.cxx:31
#define SLIDER_CHANNEL_HALFSIZE
Definition: slider.cxx:33
#define SLIDER_STATE_THUMB_DOWN
Definition: slider.cxx:29
#define SLIDER_VIEW_STYLE
Definition: slider.cxx:37
#define SLIDER_STATE_CHANNEL2_DOWN
Definition: slider.cxx:28
#define SLIDER_STATE_CHANNEL1_DOWN
Definition: slider.cxx:27
#define SLIDER_HEIGHT
Definition: slider.cxx:35
tools::Long ImplMulDiv(tools::Long nNumber, tools::Long nNumerator, tools::Long nDenominator)
Definition: thumbpos.hxx:12
ScrollType
Definition: vclenum.hxx:372
StartTrackingFlags
Definition: window.hxx:265
StateChangedType
Definition: window.hxx:291
@ NoErase
The invalidated area is painted with the background color/pattern.
@ Update
The invalidated area is updated immediately.
@ Transparent
The parent window is invalidated, too.
@ NoChildren
The child windows are not invalidated.
sal_Int64 WinBits
Definition: wintypes.hxx:109
WindowType
Definition: wintypes.hxx:27
WinBits const WB_HORZ
Definition: wintypes.hxx:144