/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_VCL_SPIN_HXX #define INCLUDED_VCL_SPIN_HXX #include #include #include #include class VCL_DLLPUBLIC SpinButton : public Control { private: AutoTimer maRepeatTimer; Rectangle maUpperRect; Rectangle maLowerRect; Rectangle maFocusRect; bool mbRepeat : 1; bool mbUpperIn : 1; bool mbLowerIn : 1; bool mbInitialUp : 1; bool mbInitialDown : 1; bool mbHorz : 1; bool mbUpperIsFocused : 1; long mnMinRange; long mnMaxRange; long mnValue; long mnValueStep; SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt ); using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle ); DECL_DLLPRIVATE_LINK( ImplTimeout, Timer*, void ); public: explicit SpinButton( vcl::Window* pParent, WinBits nStyle ); void Up(); void Down(); virtual void Resize() override; virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override; virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void StateChanged( StateChangedType nStateChange ) override; virtual void GetFocus() override; virtual void LoseFocus() override; void SetRangeMin( long nNewRange ); long GetRangeMin() const { return mnMinRange; } void SetRangeMax( long nNewRange ); long GetRangeMax() const { return mnMaxRange; } void SetRange( const Range& rRange ); void SetValue( long nValue ); long GetValue() const { return mnValue; } void SetValueStep( long nNewStep ) { mnValueStep = nNewStep; } long GetValueStep() const { return mnValueStep; } virtual bool PreNotify( NotifyEvent& rNEvt ) override; private: // moves the focus to the upper or lower rect. Return sal_True if the focus rect actually changed. SAL_DLLPRIVATE bool ImplMoveFocus( bool _bUpper ); SAL_DLLPRIVATE void ImplCalcFocusRect( bool _bUpper ); SAL_DLLPRIVATE inline bool ImplIsUpperEnabled( ) const { return mnValue + mnValueStep <= mnMaxRange; } SAL_DLLPRIVATE inline bool ImplIsLowerEnabled( ) const { return mnValue >= mnMinRange + mnValueStep; } }; #endif // INCLUDED_VCL_SPIN_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ bora/cp-5.0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-12-06tdf#97228 Move include file include/vcl/BitmapProcessor.hxx to vcl/inc/abdulwd
Adapt users, all in vcl, accordingly. Change-Id: I4531840091da73fa8fc29175407fa8a737deac18 Reviewed-on: https://gerrit.libreoffice.org/32442 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit e61fe745d12055ee3915a957714772eeb46fdcd3)
2017-11-28Extend ScopedBitmapAccess and modify various classes to use itMark Page
Exception safety, ensure the Access classes are always destroyed. Change-Id: I4889358476267853ffbd7fafc24950d84b4e9331 Reviewed-on: https://gerrit.libreoffice.org/31494 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 677246466c471fbe3522c35be3639afa008a46c0)
2016-07-10making a disabled image from a 1 bit depth icon gives index assertsCaolán McNamara
cause the disabled color cannot be mapped to the 2 entries in the palette, so use 8bit dests if the src is 1bit regression from commit 507d0ded64db51a8826d07c507f612a6c02c3869 Author: Caolán McNamara <caolanm@redhat.com> Date: Tue Dec 1 12:18:57 2015 +0000 keep disable image at same depth as original seen when clicking on the image loaded from tdf#100632 Change-Id: Ic69bccfa0fc86707b4fd9e757d8374d80e4b0071
2016-05-25Convert BMP_FORMAT to scoped enumNoel Grandin
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8 Reviewed-on: https://gerrit.libreoffice.org/25189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-06vcl: bmpacc.hxx -> bitmapaccess.hxxChris Sherlock
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2015-12-02keep disable image at same depth as originalCaolán McNamara
that way the "preferred" image format for a platform for icons etc remains sticky Change-Id: Ia76af0b7c4f27650038cab214b6406b8ef1a5fc4
2015-11-23loplugin:loopvartoosmallNoel Grandin
Change-Id: I2aca12b994c2fd260803a8897b968ddac848f235
2015-11-23vcl: add colorizeImage to BitmapProcessorTomaž Vajngerl
Change-Id: Ic90368e83d7f9a187eb8404d8aaec4380ff5bcb1
2015-11-23vcl: Bitmap processor to create a disabled imageTomaž Vajngerl
Change-Id: Iba5d86988736fa28329e1ba2783dfb15e37815a8
2015-10-12loplugin:loopvartoosmallStephan Bergmann
Change-Id: Ic3667c0daeeeb5b09eeaae66899affda65e2e9a5
2015-10-12vcl: recolor images (icons) to be more visible in a dark themeTomaž Vajngerl
This adds recoloring of images/icons (suited for breeze and sifr) so they are more visible when a dark theme is used (for example gtk3 can switch to a dark theme). LO must be started with environment variable VCL_ICONS_FOR_DARK_THEME set to 1. open issues - currently all images/icons are recolored but not all images should get recolored. Change-Id: Ibc42e30af79bb4c4f04c67b760019311b97b2cc6