2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
re-base on ALv2 code. Includes (at least) relevant parts of:
linecap: Reintegrating finished LineCap feature
Patch contributed by Regina Henschel
http://svn.apache.org/viewvc?view=revision&revision=1232507
Patches contributed by Sven Jacobi
impress212: #i81610# fixed animation export
http://svn.apache.org/viewvc?view=revision&revision=1167620
impress212: drawinglayer gbuild environment changes
http://svn.apache.org/viewvc?view=revision&revision=1167627
http://svn.apache.org/viewvc?view=revision&revision=1167628
impress212: DffPropSet -> minor code improvements, removing table
http://svn.apache.org/viewvc?view=revision&revision=1167634
impress212: #158494# fixed excel import (text rotation)
http://svn.apache.org/viewvc?view=revision&revision=1167638
Patches contributed by Armin Le Grand
Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement
http://svn.apache.org/viewvc?view=revision&revision=1220836
#118728# changed indentifying definitions for Svg file detection
http://svn.apache.org/viewvc?view=revision&revision=1229961
#118838# LineGeometry creation for complicated cases optimized to
create single Polygons
http://svn.apache.org/viewvc?view=revision&revision=1236232
#119176# corrected file type detection for SVG for svg files
without xml header
http://svn.apache.org/viewvc?view=revision&revision=1309445
#118728# Extended Svg file detection
http://svn.apache.org/viewvc?view=revision&revision=1230531
#118529# solve break converters and convert commands for OLEs and images
http://svn.apache.org/viewvc?view=revision&revision=1186168
svg: added WaE changes from branch svgreplacement to trunc
http://svn.apache.org/viewvc?view=revision&revision=1222974
svg: corrected missing member initialization
http://svn.apache.org/viewvc?view=revision&revision=1226134
fix for #118525#: Using primitives for chart sub-geometry visualisation
http://svn.apache.org/viewvc?view=revision&revision=1226879
#118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert
metafiles to bitmapEx ...
http://svn.apache.org/viewvc?view=revision&revision=1293316
fix for #118525#: removed no longer used variable maOriginalMapMode, one
more exception eliminated
http://svn.apache.org/viewvc?view=revision&revision=1227097
#16758# Added buffering to the VDev usages of the VclProcessor2D derivates...
http://svn.apache.org/viewvc?view=revision&revision=1229521
#116758# Secured VDev buffer device to Vcl deinit
http://svn.apache.org/viewvc?view=revision&revision=1230574
#116758# added remembering allocated VDevs for VDevBuffer to be able to also
delete these when vcl goes down; it should never happen, but You never know
http://svn.apache.org/viewvc?view=revision&revision=1230927
#118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive
representation instead of TransparencePrimitive2D
http://svn.apache.org/viewvc?view=revision&revision=1231198
#118822# secured 3D geometry creation (slices) by subdividing the 2D
source polyPolygon early
http://svn.apache.org/viewvc?view=revision&revision=1234749
#118829# enhanced Svg gradient quality, obstacles avoided
http://svn.apache.org/viewvc?view=revision&revision=1235361
#118834# Unified usage of TextBreakupHelper as single tooling class
for i18n text primitive breakup
http://svn.apache.org/viewvc?view=revision&revision=1236110
#118853# added square pixel size limit to conversion of
TransparencePrimitive2D to Metafile action
http://svn.apache.org/viewvc?view=revision&revision=1237656
#118824# coreccted mirroring and boundrect when the graphicmanager
is used for bitmap output
http://svn.apache.org/viewvc?view=revision&revision=1240097
#115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for
various optimization scenarios
http://svn.apache.org/viewvc?view=revision&revision=1241434
#118783# Corrected errors in ID strings, corrected Svg line/fill export,
corrected polygon close state
http://svn.apache.org/viewvc?view=revision&revision=1232006
#118796# corrected null-pointer usage in SVG text exporter
http://svn.apache.org/viewvc?view=revision&revision=1240262
#118729# Use GraphicStreamUrl and GraphicUrl to allow multi image
import with linked graphics, too
http://svn.apache.org/viewvc?view=revision&revision=1229962
#118898# corrected error in GDIMetaFile::GetBoundRect in handling
MetaFloatTransparentAction
http://svn.apache.org/viewvc?view=revision&revision=1293349
#118855# Corrected handling of possibly created empty clipRegions
after PolyPolygon clipping
http://svn.apache.org/viewvc?view=revision&revision=1237725
#115962# Better (but not yet optimal, see comments in task) handling
of MetaFloatTransparentAction in PDF export
http://svn.apache.org/viewvc?view=revision&revision=1241078
IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ...
http://svn.apache.org/viewvc?view=revision&revision=1200879
118779# Added svg content streaming in/out to ImpGraphic stream operators
http://svn.apache.org/viewvc?view=revision&revision=1231908
linecap: correctons for WaE and mac drawing
http://svn.apache.org/viewvc?view=revision&revision=1232793
svg: uses current system Dpi for Svg replacement image creation
http://svn.apache.org/viewvc?view=revision&revision=1233948
Patches contributed by Mathias Bauer (and others)
gnumake4 work variously
http://svn.apache.org/viewvc?view=revision&revision=1394326
http://svn.apache.org/viewvc?view=revision&revision=1396797
http://svn.apache.org/viewvc?view=revision&revision=1397315
http://svn.apache.org/viewvc?view=revision&revision=1394326
Remove duplicate header includes.
cws mba34issues01: #i117720#: convert assertion into warning
http://svn.apache.org/viewvc?view=revision&revision=1172352
118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand.
http://svn.apache.org/viewvc?view=revision&revision=1182166
cws mba34issues01: #i117714#: remove assertion
http://svn.apache.org/viewvc?view=revision&revision=1172357
Patch contributed by Jurgen Schmidt
add some additional checks to ensure proper reading operations
http://svn.apache.org/viewvc?view=revision&revision=1209022
mostly prefer our stream / bounds checking work.
Patches contributed by Herbert Duerr
#i118816# add clarifying comment regarding Font::*Color*() methods
http://svn.apache.org/viewvc?view=revision&revision=1233833
extend macro->string handling for empty strings
http://svn.apache.org/viewvc?view=revision&revision=1175801
avoid magic constants for SALCOLOR_NONE
http://svn.apache.org/viewvc?view=revision&revision=1177543
initialize slant properly in ImplFontMetricData constructor (author=iorsh)
http://svn.apache.org/viewvc?view=revision&revision=1177551
#i118675# make check for extension updates more stable
http://svn.apache.org/viewvc?view=revision&revision=1214797
#a118617# remove VBasicEventListener.dll binary
There are no known users depending on its CLSID
http://svn.apache.org/viewvc?view=revision&revision=1203697
Patches contributed by Ariel Constenla-Haile
Fix build breaker on Linux/gcc
http://svn.apache.org/viewvc?view=revision&revision=1221104
Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG
http://svn.apache.org/viewvc?view=revision&revision=1215559
Patches contributed by Oliver-Rainer Wittmann
sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider
instances of <SwFlyDrawObj>
http://svn.apache.org/viewvc?view=revision&revision=1172120
sw34bf06: #i117783# - Writer's implementation of XPagePrintable -
apply print settings to new printing routines
http://svn.apache.org/viewvc?view=revision&revision=1172115
gnumake4 work variously from Hans-Joachim Lankenau
http://svn.apache.org/viewvc?view=revision&revision=1397315
http://svn.apache.org/viewvc?view=revision&revision=1396797
http://svn.apache.org/viewvc?view=revision&revision=1396782
http://svn.apache.org/viewvc?view=revision&revision=1394707
plus some amount of re-splitting of legacy headers.
Patch contributed by Pavel Janik
WaE: Remove unused variables.
http://svn.apache.org/viewvc?view=revision&revision=1230697
Patches contributed by Takashi Ono
mingwport35: i#117795: MinGW port fix for vcl2gnumake
http://svn.apache.org/viewvc?view=revision&revision=1172091
mingwport35: i#117795: MinGW port fix for vcl2gnumake
http://svn.apache.org/viewvc?view=revision&revision=1172091
Patch contributed by Christian Lippka
impress212: #i98044# re enable Text menu for outline and title shapes
http://svn.apache.org/viewvc?view=revision&revision=1167639
Patch contributed by Andre Fischer
118674: Made category B code optional and disabled by default.
http://svn.apache.org/viewvc?view=revision&revision=1215131
118881: Ignore empty paragraphs after bullets.
http://svn.apache.org/viewvc?view=revision&revision=1296205
Patches contributed by Philipp Lohmann
ooo340fixes: #i117780# use rtl allocator
http://svn.apache.org/viewvc?view=revision&revision=1172087
ooo34gsl02: #i117807# fix an off by one error (index actually
inside the pfb section header)
http://svn.apache.org/viewvc?view=revision&revision=1167576
various cleanups, related compilation fixes, warning cleanups, re-working
of obsolete stl template pieces to use boost instead, changed string
classes, re-adapt KDE about data, about dialog, fixing warnings,
and other fixes & improvements.
Disable svg import / render for about/ branding code-paths for now.
Restore full icon theme set.
Remove OS/2 conditionals and sources.
Remove conflicting gtk/full-screen monitors support.
Retain existing svg rasterizer files - temporarily disabled.
Standardize stringificaiton and fixup dllpostfix issues.
Rename SvgGradientHelper::== to equalTo to avoid overloading issues.
Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2013-10-23 19:10:20 +02:00
|
|
|
#ifndef INCLUDED_VCL_BUTTON_HXX
|
|
|
|
#define INCLUDED_VCL_BUTTON_HXX
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2012-06-10 19:26:30 +03:00
|
|
|
#include <tools/solar.h>
|
2007-04-11 16:48:55 +00:00
|
|
|
#include <vcl/dllapi.h>
|
|
|
|
#include <vcl/image.hxx>
|
|
|
|
#include <vcl/ctrl.hxx>
|
|
|
|
#include <vcl/bitmap.hxx>
|
|
|
|
#include <vcl/salnativewidgets.hxx>
|
2017-06-11 20:56:30 +01:00
|
|
|
#include <vcl/vclenum.hxx>
|
2015-01-06 10:29:11 +02:00
|
|
|
#include <vcl/vclptr.hxx>
|
2017-04-14 08:42:15 +10:00
|
|
|
#include <memory>
|
2008-01-28 13:15:55 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2015-11-11 12:16:30 +01:00
|
|
|
#include <com/sun/star/frame/FeatureStateEvent.hpp>
|
|
|
|
|
2017-10-07 22:01:45 +11:00
|
|
|
class Color;
|
2007-04-11 16:48:55 +00:00
|
|
|
class UserDrawEvent;
|
|
|
|
class ImplCommonButtonData;
|
2015-05-11 12:33:22 +02:00
|
|
|
enum class DrawButtonFlags;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
class VCL_DLLPUBLIC Button : public Control
|
|
|
|
{
|
|
|
|
private:
|
2015-04-10 15:25:33 +02:00
|
|
|
std::unique_ptr<ImplCommonButtonData> mpButtonData;
|
2015-08-19 09:11:34 +02:00
|
|
|
Link<Button*,void> maClickHdl;
|
2014-09-24 09:06:18 +02:00
|
|
|
|
|
|
|
/// Command URL (like .uno:Save) in case the button should handle it.
|
|
|
|
OUString maCommand;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
Button (const Button &) = delete;
|
|
|
|
Button & operator= (const Button &) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
public:
|
2015-05-11 12:33:22 +02:00
|
|
|
SAL_DLLPRIVATE DrawButtonFlags ImplGetButtonState() const;
|
|
|
|
SAL_DLLPRIVATE DrawButtonFlags& ImplGetButtonState();
|
2015-05-27 09:37:41 +02:00
|
|
|
SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle( OUString& rText, WinBits nWinStyle, DrawFlags nDrawFlags );
|
2015-05-05 16:20:53 +09:00
|
|
|
SAL_DLLPRIVATE void ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize,
|
2016-04-01 13:31:59 +02:00
|
|
|
sal_uLong nImageSep, DrawFlags nDrawFlags,
|
2017-03-30 20:27:55 +02:00
|
|
|
DrawTextFlags nTextStyle, tools::Rectangle *pSymbolRect=nullptr, bool bAddImageSep = false );
|
|
|
|
SAL_DLLPRIVATE void ImplSetFocusRect( const tools::Rectangle &rFocusRect );
|
|
|
|
SAL_DLLPRIVATE const tools::Rectangle& ImplGetFocusRect() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
|
2012-07-25 22:28:48 +04:00
|
|
|
/// The x-coordinate of the vertical separator line, use in MenuButton subclass only.
|
|
|
|
SAL_DLLPRIVATE long ImplGetSeparatorX() const;
|
|
|
|
SAL_DLLPRIVATE void ImplSetSeparatorX( long nX );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
protected:
|
2013-01-14 14:08:03 +00:00
|
|
|
explicit Button( WindowType nType );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~Button() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
virtual void Click();
|
|
|
|
|
2015-08-19 09:11:34 +02:00
|
|
|
void SetClickHdl( const Link<Button*,void>& rLink ) { maClickHdl = rLink; }
|
|
|
|
const Link<Button*,void>& GetClickHdl() const { return maClickHdl; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-09-24 09:06:18 +02:00
|
|
|
/// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button.
|
2017-04-07 14:11:16 +02:00
|
|
|
void SetCommandHandler(const OUString& aCommand);
|
2017-12-23 09:17:30 +02:00
|
|
|
OUString const & GetCommand() const { return maCommand; }
|
2014-09-24 09:06:18 +02:00
|
|
|
|
2013-01-24 17:21:10 +00:00
|
|
|
static OUString GetStandardText( StandardButtonType eButton );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-06 14:34:03 +02:00
|
|
|
bool SetModeImage( const Image& rImage );
|
2017-12-23 18:35:30 +02:00
|
|
|
Image const & GetModeImage( ) const;
|
2015-05-06 14:34:03 +02:00
|
|
|
bool HasImage() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
void SetImageAlign( ImageAlign eAlign );
|
|
|
|
ImageAlign GetImageAlign() const;
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void EnableImageDisplay( bool bEnable );
|
|
|
|
void EnableTextDisplay( bool bEnable );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
void SetFocusRect( const tools::Rectangle& rFocusRect );
|
2013-08-01 12:08:22 +02:00
|
|
|
bool IsSmallSymbol() const;
|
2016-02-26 10:36:34 +02:00
|
|
|
void SetSmallSymbol();
|
2017-04-28 15:21:11 +01:00
|
|
|
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
|
2014-09-24 09:06:18 +02:00
|
|
|
|
2015-11-11 12:16:30 +01:00
|
|
|
/// Sets the button state according to the FeatureStateEvent emitted by an Uno state change.
|
2015-12-08 09:19:35 +01:00
|
|
|
virtual void statusChanged(const css::frame::FeatureStateEvent& rEvent);
|
2015-11-11 12:16:30 +01:00
|
|
|
|
2016-05-19 02:20:31 +02:00
|
|
|
virtual FactoryFunction GetUITestFactory() const override;
|
2016-03-30 05:14:50 +02:00
|
|
|
|
2014-09-24 09:06:18 +02:00
|
|
|
protected:
|
|
|
|
|
|
|
|
/// Handler for click, in case we want the button to handle uno commands (.uno:Something).
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_STATIC_LINK(Button, dispatchCommandHandler, Button*, void);
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
2015-05-06 14:34:03 +02:00
|
|
|
enum class PushButtonDropdownStyle
|
|
|
|
{
|
|
|
|
NONE = 0x0000,
|
|
|
|
Toolbox = 0x0001,
|
2016-10-28 12:37:05 +01:00
|
|
|
MenuButton = 0x0002, //visual down arrow
|
2017-03-02 12:25:27 +01:00
|
|
|
SplitMenuButton = 0x0003, //visual down arrow and separator line
|
2015-05-06 14:34:03 +02:00
|
|
|
};
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
class VCL_DLLPUBLIC PushButton : public Button
|
|
|
|
{
|
|
|
|
public:
|
2014-02-21 12:53:51 +01:00
|
|
|
SAL_DLLPRIVATE void ImplSetDefButton( bool bSet );
|
2017-03-30 20:27:55 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, tools::Rectangle& rRect, DrawButtonFlags nStyle);
|
2017-07-18 09:02:03 +02:00
|
|
|
SAL_DLLPRIVATE static bool ImplHitTestPushButton(vcl::Window const * pDev, const Point& rPos);
|
2014-02-21 12:53:51 +01:00
|
|
|
SAL_DLLPRIVATE bool ImplIsDefButton() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit PushButton( vcl::Window* pParent, WinBits nStyle = 0 );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Tracking( const TrackingEvent& rTEvt ) override;
|
|
|
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
|
|
|
virtual void KeyUp( const KeyEvent& rKEvt ) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override;
|
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
|
|
|
virtual void StateChanged( StateChangedType nType ) override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-01-21 12:15:26 +02:00
|
|
|
void Toggle();
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void SetSymbol( SymbolType eSymbol );
|
|
|
|
SymbolType GetSymbol() const { return meSymbol; }
|
|
|
|
void SetSymbolAlign( SymbolAlign eAlign );
|
|
|
|
|
2015-05-06 14:34:03 +02:00
|
|
|
void SetDropDown( PushButtonDropdownStyle nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void SetState( TriState eState );
|
|
|
|
TriState GetState() const { return meState; }
|
2015-12-08 09:19:35 +01:00
|
|
|
virtual void statusChanged(const css::frame::FeatureStateEvent& rEvent) override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void Check( bool bCheck = true );
|
|
|
|
bool IsChecked() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void SetPressed( bool bPressed );
|
|
|
|
bool IsPressed() const { return mbPressed; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void EndSelection();
|
|
|
|
|
2016-02-26 10:36:34 +02:00
|
|
|
Size CalcMinimumSize() const;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual Size GetOptimalSize() const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2017-04-28 15:21:11 +01:00
|
|
|
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void ShowFocus(const tools::Rectangle& rRect) override;
|
2016-11-22 10:36:24 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
PushButtonDropdownStyle mnDDStyle;
|
|
|
|
bool mbIsActive;
|
|
|
|
|
|
|
|
SAL_DLLPRIVATE void ImplInitPushButtonData();
|
|
|
|
SAL_DLLPRIVATE static WinBits ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
|
2017-04-24 12:54:28 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInitSettings( bool bBackground );
|
2016-11-22 10:36:24 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFlags,
|
2017-03-30 20:27:55 +02:00
|
|
|
const tools::Rectangle& rRect, bool bMenuBtnSep);
|
2016-11-22 10:36:24 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDrawPushButton(vcl::RenderContext& rRenderContext);
|
|
|
|
using Button::ImplGetTextStyle;
|
|
|
|
SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle( DrawFlags nDrawFlags ) const;
|
|
|
|
SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
|
|
|
|
|
|
|
|
PushButton( const PushButton & ) = delete;
|
|
|
|
PushButton& operator=( const PushButton & )
|
|
|
|
= delete;
|
|
|
|
|
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
|
|
|
|
|
|
|
using Control::ImplInitSettings;
|
|
|
|
using Window::ImplInit;
|
|
|
|
|
|
|
|
explicit PushButton( WindowType nType );
|
|
|
|
|
|
|
|
virtual void FillLayoutData() const override;
|
|
|
|
virtual const vcl::Font&
|
|
|
|
GetCanonicalFont( const StyleSettings& _rStyle ) const override;
|
|
|
|
virtual const Color&
|
|
|
|
GetCanonicalTextColor( const StyleSettings& _rStyle ) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SymbolType meSymbol;
|
|
|
|
TriState meState;
|
|
|
|
bool mbPressed;
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
inline void PushButton::Check( bool bCheck )
|
2007-04-11 16:48:55 +00:00
|
|
|
{
|
2017-11-22 14:12:34 +01:00
|
|
|
SetState( bCheck ? TRISTATE_TRUE : TRISTATE_FALSE );
|
2007-04-11 16:48:55 +00:00
|
|
|
}
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
inline bool PushButton::IsChecked() const
|
2007-04-11 16:48:55 +00:00
|
|
|
{
|
2014-02-24 12:25:02 +01:00
|
|
|
return (GetState() == TRISTATE_TRUE);
|
2007-04-11 16:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC OKButton : public PushButton
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
using PushButton::ImplInit;
|
|
|
|
private:
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
OKButton (const OKButton &) = delete;
|
|
|
|
OKButton & operator= (const OKButton &) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit OKButton( vcl::Window* pParent, WinBits nStyle = WB_DEFBUTTON );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Click() override;
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC CancelButton : public PushButton
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
using PushButton::ImplInit;
|
|
|
|
private:
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
CancelButton (const CancelButton &) = delete;
|
|
|
|
CancelButton & operator= (const CancelButton &) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit CancelButton( vcl::Window* pParent, WinBits nStyle = 0 );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Click() override;
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
2013-01-07 21:19:04 +00:00
|
|
|
class VCL_DLLPUBLIC CloseButton : public CancelButton
|
|
|
|
{
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit CloseButton(vcl::Window* pParent, WinBits nStyle = 0);
|
2013-01-07 21:19:04 +00:00
|
|
|
};
|
|
|
|
|
2007-04-11 16:48:55 +00:00
|
|
|
class VCL_DLLPUBLIC HelpButton : public PushButton
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
using PushButton::ImplInit;
|
|
|
|
private:
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
HelpButton( const HelpButton & ) = delete;
|
|
|
|
HelpButton & operator= ( const HelpButton & ) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit HelpButton( vcl::Window* pParent, WinBits nStyle = 0 );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Click() override;
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC RadioButton : public Button
|
|
|
|
{
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
std::shared_ptr< std::vector< VclPtr< RadioButton > > > m_xGroup;
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle maStateRect;
|
|
|
|
tools::Rectangle maMouseRect;
|
2007-04-11 16:48:55 +00:00
|
|
|
Image maImage;
|
2015-05-06 14:34:03 +02:00
|
|
|
bool mbChecked;
|
|
|
|
bool mbSaveValue;
|
|
|
|
bool mbRadioCheck;
|
|
|
|
bool mbStateChanged;
|
2015-09-09 11:41:20 +02:00
|
|
|
Link<RadioButton&,void> maToggleHdl;
|
2007-04-11 16:48:55 +00:00
|
|
|
SAL_DLLPRIVATE void ImplInitRadioButtonData();
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE WinBits ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
|
2017-04-24 12:54:28 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInitSettings( bool bBackground );
|
2015-05-05 16:20:53 +09:00
|
|
|
SAL_DLLPRIVATE void ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext);
|
2015-05-27 09:37:41 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
|
2007-04-11 16:48:55 +00:00
|
|
|
const Point& rPos, const Size& rSize,
|
2017-03-30 20:27:55 +02:00
|
|
|
const Size& rImageSize, tools::Rectangle& rStateRect,
|
|
|
|
tools::Rectangle& rMouseRect );
|
2016-02-26 10:36:34 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDrawRadioButton(vcl::RenderContext& rRenderContext );
|
2007-04-11 16:48:55 +00:00
|
|
|
SAL_DLLPRIVATE void ImplUncheckAllOther();
|
|
|
|
SAL_DLLPRIVATE Size ImplGetRadioImageSize() const;
|
2009-09-25 12:26:30 +00:00
|
|
|
SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
RadioButton(const RadioButton &) = delete;
|
|
|
|
RadioButton& operator= (const RadioButton &) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
protected:
|
2009-10-13 09:49:33 +00:00
|
|
|
using Control::ImplInitSettings;
|
2007-04-11 16:48:55 +00:00
|
|
|
using Window::ImplInit;
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2015-05-27 13:47:57 +02:00
|
|
|
SAL_DLLPRIVATE void ImplCallClick( bool bGrabFocus = false, GetFocusFlags nFocusFlags = GetFocusFlags::NONE );
|
2008-04-04 10:00:09 +00:00
|
|
|
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void FillLayoutData() const override;
|
2014-09-16 10:09:58 +02:00
|
|
|
virtual const vcl::Font&
|
2015-10-12 16:04:04 +02:00
|
|
|
GetCanonicalFont( const StyleSettings& _rStyle ) const override;
|
2009-09-14 12:09:22 +00:00
|
|
|
virtual const Color&
|
2015-10-12 16:04:04 +02:00
|
|
|
GetCanonicalTextColor( const StyleSettings& _rStyle ) const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
void SetMouseRect( const tools::Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; }
|
|
|
|
void SetStateRect( const tools::Rectangle& _rStateRect ) { maStateRect = _rStateRect; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-04-10 19:59:38 +03:00
|
|
|
// draws the radio button (the knob image), in its current state (pressed/checked)
|
2007-04-11 16:48:55 +00:00
|
|
|
// at the usual location, which can be overridden with SetStateRect
|
2015-05-05 16:20:53 +09:00
|
|
|
void DrawRadioButtonState(vcl::RenderContext& rRenderContext);
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit RadioButton( vcl::Window* pParent, WinBits nWinStyle = 0 );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~RadioButton() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
|
|
|
|
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Tracking( const TrackingEvent& rTEvt ) override;
|
|
|
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
|
|
|
virtual void KeyUp( const KeyEvent& rKEvt ) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override;
|
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
|
|
|
virtual void StateChanged( StateChangedType nType ) override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-06 14:34:03 +02:00
|
|
|
void Toggle();
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
bool IsStateChanged() const { return mbStateChanged; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2016-08-30 15:34:35 +02:00
|
|
|
void EnableRadioCheck( bool bRadioCheck ) { mbRadioCheck = bRadioCheck; }
|
2014-02-21 12:53:51 +01:00
|
|
|
bool IsRadioCheckEnabled() const { return mbRadioCheck; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-05-05 08:00:36 +02:00
|
|
|
bool SetModeRadioImage( const Image& rImage );
|
2014-06-12 14:06:28 +02:00
|
|
|
const Image& GetModeRadioImage( ) const { return maImage;}
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void SetState( bool bCheck );
|
|
|
|
void Check( bool bCheck = true );
|
|
|
|
bool IsChecked() const { return mbChecked; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void SaveValue() { mbSaveValue = IsChecked(); }
|
2014-02-21 12:53:51 +01:00
|
|
|
bool GetSavedValue() const { return mbSaveValue; }
|
2014-05-05 08:00:36 +02:00
|
|
|
bool IsValueChangedFromSaved() const { return mbSaveValue != IsChecked(); }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-11 12:33:22 +02:00
|
|
|
static Image GetRadioImage( const AllSettings& rSettings, DrawButtonFlags nFlags );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2016-02-26 10:36:34 +02:00
|
|
|
Size CalcMinimumSize() const;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual Size GetOptimalSize() const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-09-09 11:41:20 +02:00
|
|
|
void SetToggleHdl( const Link<RadioButton&,void>& rLink ) { maToggleHdl = rLink; }
|
2008-01-28 13:15:55 +00:00
|
|
|
|
|
|
|
/** GetRadioButtonGroup returns a list of pointers to <code>RadioButton</code>s in the same group.
|
|
|
|
|
|
|
|
The pointers in the returned list are valid at the time call returns. However rescheduling
|
|
|
|
or giving up the SolarMutex may mean events get executed that lead to the pointers getting
|
|
|
|
invalid.
|
|
|
|
|
|
|
|
@param bIncludeThis
|
|
|
|
defines whether <code>this</code> is contained in the returned list
|
2012-04-30 10:25:34 +01:00
|
|
|
|
|
|
|
@return
|
|
|
|
on return contains the <code>RadioButton</code>s
|
|
|
|
in the same group as this <code>RadioButton</code>.
|
2008-01-28 13:15:55 +00:00
|
|
|
*/
|
2015-03-09 14:29:30 +02:00
|
|
|
std::vector<VclPtr<RadioButton> > GetRadioButtonGroup(bool bIncludeThis = true) const;
|
2012-04-25 11:35:17 +01:00
|
|
|
|
2017-04-28 15:21:11 +01:00
|
|
|
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
|
2012-05-22 12:33:28 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Group this RadioButton with another
|
|
|
|
*/
|
2012-04-30 10:19:19 +01:00
|
|
|
void group(RadioButton &rOther);
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void ShowFocus(const tools::Rectangle& rRect) override;
|
2016-05-19 03:36:18 +02:00
|
|
|
|
|
|
|
virtual FactoryFunction GetUITestFactory() const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC CheckBox : public Button
|
|
|
|
{
|
2012-07-31 20:41:51 +01:00
|
|
|
private:
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle maStateRect;
|
|
|
|
tools::Rectangle maMouseRect;
|
2007-04-11 16:48:55 +00:00
|
|
|
TriState meState;
|
|
|
|
TriState meSaveValue;
|
2014-02-21 12:53:51 +01:00
|
|
|
bool mbTriState;
|
2015-09-11 13:27:40 +02:00
|
|
|
Link<CheckBox&,void> maToggleHdl;
|
2012-08-01 17:01:44 +01:00
|
|
|
// when mbLegacyNoTextAlign is set then the old behaviour where
|
|
|
|
// the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
|
|
|
|
// occurs, otherwise the image ( checkbox box ) is placed
|
|
|
|
// to the left or right ( depending on RTL or LTR settings )
|
|
|
|
bool mbLegacyNoTextAlign;
|
2007-04-11 16:48:55 +00:00
|
|
|
SAL_DLLPRIVATE void ImplInitCheckBoxData();
|
2016-10-07 11:57:50 +02:00
|
|
|
SAL_DLLPRIVATE static WinBits ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
|
2017-04-24 12:54:28 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInitSettings( bool bBackground );
|
2015-05-27 09:37:41 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
|
2007-04-11 16:48:55 +00:00
|
|
|
const Point& rPos, const Size& rSize,
|
2017-03-30 20:27:55 +02:00
|
|
|
const Size& rImageSize, tools::Rectangle& rStateRect,
|
|
|
|
tools::Rectangle& rMouseRect );
|
2016-02-26 10:36:34 +02:00
|
|
|
SAL_DLLPRIVATE void ImplDrawCheckBox(vcl::RenderContext& rRenderContext );
|
2009-09-25 12:26:30 +00:00
|
|
|
SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
SAL_DLLPRIVATE Size ImplGetCheckImageSize() const;
|
2012-07-31 20:41:51 +01:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
CheckBox(const CheckBox &) = delete;
|
|
|
|
CheckBox& operator= (const CheckBox &) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
protected:
|
2009-10-13 09:49:33 +00:00
|
|
|
using Control::ImplInitSettings;
|
2007-04-11 16:48:55 +00:00
|
|
|
using Window::ImplInit;
|
2014-09-23 11:20:40 +02:00
|
|
|
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void FillLayoutData() const override;
|
|
|
|
virtual const vcl::Font& GetCanonicalFont( const StyleSettings& _rStyle ) const override;
|
|
|
|
virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-05 16:20:53 +09:00
|
|
|
virtual void ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext);
|
2017-03-30 20:27:55 +02:00
|
|
|
SAL_DLLPRIVATE const tools::Rectangle& GetStateRect() const { return maStateRect; }
|
|
|
|
SAL_DLLPRIVATE const tools::Rectangle& GetMouseRect() const { return maMouseRect; }
|
2012-05-22 22:26:27 +01:00
|
|
|
|
2007-04-11 16:48:55 +00:00
|
|
|
public:
|
|
|
|
SAL_DLLPRIVATE void ImplCheck();
|
2008-04-04 10:00:09 +00:00
|
|
|
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
|
2007-04-11 16:48:55 +00:00
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
explicit CheckBox( vcl::Window* pParent, WinBits nStyle = 0 );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Tracking( const TrackingEvent& rTEvt ) override;
|
|
|
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
|
|
|
virtual void KeyUp( const KeyEvent& rKEvt ) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override;
|
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
|
|
|
virtual void StateChanged( StateChangedType nType ) override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-06 14:34:03 +02:00
|
|
|
void Toggle();
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void SetState( TriState eState );
|
|
|
|
TriState GetState() const { return meState; }
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void Check( bool bCheck = true );
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsChecked() const;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void EnableTriState( bool bTriState = true );
|
|
|
|
bool IsTriStateEnabled() const { return mbTriState; }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
void SaveValue() { meSaveValue = GetState(); }
|
|
|
|
TriState GetSavedValue() const { return meSaveValue; }
|
2014-05-05 08:00:36 +02:00
|
|
|
bool IsValueChangedFromSaved() const { return meSaveValue != GetState(); }
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-05-11 12:33:22 +02:00
|
|
|
static Image GetCheckImage( const AllSettings& rSettings, DrawButtonFlags nFlags );
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual Size GetOptimalSize() const override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2015-09-11 13:27:40 +02:00
|
|
|
void SetToggleHdl( const Link<CheckBox&,void>& rLink ) { maToggleHdl = rLink; }
|
2012-08-01 17:01:44 +01:00
|
|
|
void SetLegacyNoTextAlign( bool bVal ) { mbLegacyNoTextAlign = bVal; }
|
2012-04-25 11:35:17 +01:00
|
|
|
|
2017-04-28 15:21:11 +01:00
|
|
|
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void ShowFocus(const tools::Rectangle& rRect) override;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
2016-03-30 05:14:50 +02:00
|
|
|
virtual FactoryFunction GetUITestFactory() const override;
|
|
|
|
};
|
2016-02-09 09:21:53 +11:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
inline void CheckBox::Check( bool bCheck )
|
2007-04-11 16:48:55 +00:00
|
|
|
{
|
2017-11-22 14:12:34 +01:00
|
|
|
SetState( bCheck ? TRISTATE_TRUE : TRISTATE_FALSE );
|
2007-04-11 16:48:55 +00:00
|
|
|
}
|
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
inline bool CheckBox::IsChecked() const
|
2007-04-11 16:48:55 +00:00
|
|
|
{
|
2014-02-24 12:25:02 +01:00
|
|
|
return (GetState() == TRISTATE_TRUE);
|
2007-04-11 16:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC ImageButton : public PushButton
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
using PushButton::ImplInitStyle;
|
2016-02-09 09:21:53 +11:00
|
|
|
|
2007-04-11 16:48:55 +00:00
|
|
|
private:
|
|
|
|
SAL_DLLPRIVATE void ImplInitStyle();
|
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
ImageButton( const ImageButton & ) = delete;
|
|
|
|
ImageButton & operator= ( const ImageButton & ) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2015-01-09 13:38:59 +00:00
|
|
|
ImageButton( vcl::Window* pParent, WinBits nStyle = 0 );
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
|
|
|
|
{
|
2015-10-12 15:25:41 +02:00
|
|
|
ImageRadioButton( const ImageRadioButton & ) = delete;
|
|
|
|
ImageRadioButton & operator= ( const ImageRadioButton & ) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2016-04-01 13:31:59 +02:00
|
|
|
explicit ImageRadioButton( vcl::Window* pParent );
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC TriStateBox : public CheckBox
|
|
|
|
{
|
2015-10-12 15:25:41 +02:00
|
|
|
TriStateBox( const TriStateBox & ) = delete;
|
|
|
|
TriStateBox & operator= ( const TriStateBox & ) = delete;
|
2007-04-11 16:48:55 +00:00
|
|
|
|
|
|
|
public:
|
2016-09-14 12:26:36 +02:00
|
|
|
explicit TriStateBox( vcl::Window* pParent, WinBits nStyle );
|
2007-04-11 16:48:55 +00:00
|
|
|
};
|
|
|
|
|
2009-09-08 19:48:08 +00:00
|
|
|
class VCL_DLLPUBLIC DisclosureButton : public CheckBox
|
|
|
|
{
|
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) override;
|
2016-02-09 09:21:53 +11:00
|
|
|
|
2009-09-08 19:48:08 +00:00
|
|
|
public:
|
2016-04-01 13:31:59 +02:00
|
|
|
explicit DisclosureButton( vcl::Window* pParent );
|
2009-10-29 14:22:34 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
2009-09-08 19:48:08 +00:00
|
|
|
};
|
|
|
|
|
2013-10-23 19:10:20 +02:00
|
|
|
#endif // INCLUDED_VCL_BUTTON_HXX
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|