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-07-24 09:00:00 +00:00
|
|
|
|
2016-01-25 20:38:10 +11:00
|
|
|
#ifndef INCLUDED_VCL_INC_LISTBOX_HXX
|
|
|
|
#define INCLUDED_VCL_INC_LISTBOX_HXX
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/floatwin.hxx>
|
2016-01-25 20:38:10 +11:00
|
|
|
#include <vcl/quickselectionengine.hxx>
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2016-01-27 22:13:01 +11:00
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
|
|
|
|
2007-07-24 09:00:00 +00:00
|
|
|
class ScrollBar;
|
|
|
|
class ScrollBarBox;
|
|
|
|
|
|
|
|
#define HORZ_SCROLL 4
|
|
|
|
#define IMG_TXT_DISTANCE 6
|
|
|
|
|
|
|
|
enum LB_EVENT_TYPE
|
|
|
|
{
|
|
|
|
LET_MBDOWN,
|
|
|
|
LET_TRACKING,
|
|
|
|
LET_TRACKING_END,
|
|
|
|
LET_KEYMOVE,
|
|
|
|
LET_KEYSPACE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ImplEntryType
|
|
|
|
{
|
2013-03-12 22:02:14 +01:00
|
|
|
OUString maStr;
|
2007-07-24 09:00:00 +00:00
|
|
|
Image maImage;
|
|
|
|
void* mpUserData;
|
2015-11-11 14:13:43 +02:00
|
|
|
bool mbIsSelected;
|
2015-05-14 13:24:56 +02:00
|
|
|
ListBoxEntryFlags mnFlags;
|
2008-12-15 12:14:02 +00:00
|
|
|
long mnHeight;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
ImplEntryType( const OUString& rStr, const Image& rImage ) :
|
|
|
|
maStr( rStr ),
|
|
|
|
maImage( rImage ),
|
2015-05-14 13:24:56 +02:00
|
|
|
mnFlags( ListBoxEntryFlags::NONE ),
|
2013-04-22 15:38:05 +00:00
|
|
|
mnHeight( 0 )
|
|
|
|
{
|
2014-02-21 12:53:51 +01:00
|
|
|
mbIsSelected = false;
|
2015-11-10 10:28:29 +01:00
|
|
|
mpUserData = nullptr;
|
2013-04-22 15:38:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ImplEntryType( const OUString& rStr ) :
|
|
|
|
maStr( rStr ),
|
2015-05-14 13:24:56 +02:00
|
|
|
mnFlags( ListBoxEntryFlags::NONE ),
|
2013-04-22 15:38:05 +00:00
|
|
|
mnHeight( 0 )
|
|
|
|
{
|
2014-02-21 12:53:51 +01:00
|
|
|
mbIsSelected = false;
|
2015-11-10 10:28:29 +01:00
|
|
|
mpUserData = nullptr;
|
2013-04-22 15:38:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ImplEntryType( const Image& rImage ) :
|
|
|
|
maImage( rImage ),
|
2015-05-14 13:24:56 +02:00
|
|
|
mnFlags( ListBoxEntryFlags::NONE ),
|
2013-04-22 15:38:05 +00:00
|
|
|
mnHeight( 0 )
|
|
|
|
{
|
2014-02-21 12:53:51 +01:00
|
|
|
mbIsSelected = false;
|
2015-11-10 10:28:29 +01:00
|
|
|
mpUserData = nullptr;
|
2013-04-22 15:38:05 +00:00
|
|
|
}
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
2011-05-02 13:42:19 -04:30
|
|
|
class ImplEntryList
|
2007-07-24 09:00:00 +00:00
|
|
|
{
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<vcl::Window> mpWindow; ///< For getting the current locale when matching strings
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnLastSelected;
|
|
|
|
sal_Int32 mnSelectionAnchor;
|
|
|
|
sal_Int32 mnImages;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnMRUCount;
|
|
|
|
sal_Int32 mnMaxMRUCount;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-09-09 15:09:26 +02:00
|
|
|
Link<sal_Int32,void> maSelectionChangedHdl;
|
2014-02-21 12:53:51 +01:00
|
|
|
bool mbCallSelectionChangedHdl;
|
2015-11-11 14:13:43 +02:00
|
|
|
std::vector<std::unique_ptr<ImplEntryType> > maEntries;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
ImplEntryType* GetEntry( sal_Int32 nPos ) const
|
2011-05-02 13:42:19 -04:30
|
|
|
{
|
2014-03-01 03:13:28 +01:00
|
|
|
if (nPos < 0 || static_cast<size_t>(nPos) >= maEntries.size())
|
2015-11-10 10:28:29 +01:00
|
|
|
return nullptr;
|
2015-11-12 08:51:10 +02:00
|
|
|
return maEntries[nPos].get();
|
2011-05-02 13:42:19 -04:30
|
|
|
}
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplEntryList( vcl::Window* pWindow );
|
2007-07-24 09:00:00 +00:00
|
|
|
~ImplEntryList();
|
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry, bool bSort );
|
|
|
|
void RemoveEntry( sal_Int32 nPos );
|
2015-06-02 11:28:51 +02:00
|
|
|
const ImplEntryType* GetEntryPtr( sal_Int32 nPos ) const { return GetEntry( nPos ); }
|
2014-03-01 03:13:28 +01:00
|
|
|
ImplEntryType* GetMutableEntryPtr( sal_Int32 nPos ) const { return GetEntry( nPos ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
void Clear();
|
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 FindMatchingEntry( const OUString& rStr, sal_Int32 nStart = 0, bool bForward = true, bool bLazy = true ) const;
|
|
|
|
sal_Int32 FindEntry( const OUString& rStr, bool bSearchMRUArea = false ) const;
|
|
|
|
sal_Int32 FindEntry( const void* pData ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-07-11 12:03:19 +03:00
|
|
|
/// helper: add up heights up to index nEndIndex.
|
|
|
|
/// GetAddedHeight( 0 ) @return 0
|
|
|
|
/// GetAddedHeight( LISTBOX_ENTRY_NOTFOUND ) @return 0
|
|
|
|
/// GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i )
|
2016-03-16 08:49:35 +02:00
|
|
|
long GetAddedHeight( sal_Int32 nEndIndex, sal_Int32 nBeginIndex = 0 ) const;
|
2014-03-01 03:13:28 +01:00
|
|
|
long GetEntryHeight( sal_Int32 nPos ) const;
|
2008-12-15 12:14:02 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetEntryCount() const { return (sal_Int32 )maEntries.size(); }
|
2015-04-24 12:34:53 +02:00
|
|
|
bool HasImages() const { return mnImages != 0; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
OUString GetEntryText( sal_Int32 nPos ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
bool HasEntryImage( sal_Int32 nPos ) const;
|
|
|
|
Image GetEntryImage( sal_Int32 nPos ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetEntryData( sal_Int32 nPos, void* pNewData );
|
|
|
|
void* GetEntryData( sal_Int32 nPos ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-05-14 13:24:56 +02:00
|
|
|
void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags );
|
|
|
|
ListBoxEntryFlags GetEntryFlags( sal_Int32 nPos ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SelectEntry( sal_Int32 nPos, bool bSelect );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetSelectEntryCount() const;
|
|
|
|
OUString GetSelectEntry( sal_Int32 nIndex ) const;
|
|
|
|
sal_Int32 GetSelectEntryPos( sal_Int32 nIndex ) const;
|
|
|
|
bool IsEntryPosSelected( sal_Int32 nIndex ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetLastSelected( sal_Int32 nPos ) { mnLastSelected = nPos; }
|
|
|
|
sal_Int32 GetLastSelected() const { return mnLastSelected; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetSelectionAnchor( sal_Int32 nPos ) { mnSelectionAnchor = nPos; }
|
|
|
|
sal_Int32 GetSelectionAnchor() const { return mnSelectionAnchor; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-09-09 15:09:26 +02:00
|
|
|
void SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maSelectionChangedHdl = rLnk; }
|
2014-02-21 12:53:51 +01:00
|
|
|
void SetCallSelectionChangedHdl( bool bCall ) { mbCallSelectionChangedHdl = bCall; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetMRUCount( sal_Int32 n ) { mnMRUCount = n; }
|
|
|
|
sal_Int32 GetMRUCount() const { return mnMRUCount; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetMaxMRUCount( sal_Int32 n ) { mnMaxMRUCount = n; }
|
|
|
|
sal_Int32 GetMaxMRUCount() const { return mnMaxMRUCount; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
/** An Entry is selectable if its mnFlags does not have the
|
2015-05-14 13:24:56 +02:00
|
|
|
ListBoxEntryFlags::DisableSelection flag set. */
|
2014-03-01 03:13:28 +01:00
|
|
|
bool IsEntrySelectable( sal_Int32 nPos ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-07-11 12:03:19 +03:00
|
|
|
/** @return the first entry found from the given position nPos that is selectable
|
2007-07-24 09:00:00 +00:00
|
|
|
or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable,
|
|
|
|
it returns the first selectable entry after nPos if bForward is true and the
|
|
|
|
first selectable entry after nPos is bForward is false.
|
|
|
|
*/
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 FindFirstSelectable( sal_Int32 nPos, bool bForward = true );
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
2015-04-28 23:09:13 +03:00
|
|
|
class ImplListBoxWindow : public Control, public vcl::ISearchableStringList
|
2007-07-24 09:00:00 +00:00
|
|
|
{
|
|
|
|
private:
|
2013-07-11 12:03:19 +03:00
|
|
|
ImplEntryList* mpEntryList; ///< EntryList
|
2007-07-24 09:00:00 +00:00
|
|
|
Rectangle maFocusRect;
|
|
|
|
|
|
|
|
Size maUserItemSize;
|
|
|
|
|
2013-07-11 12:03:19 +03:00
|
|
|
long mnMaxTxtHeight; ///< Maximum height of a text item
|
|
|
|
long mnMaxTxtWidth; ///< Maximum width of a text item
|
|
|
|
///< Entry without Image
|
|
|
|
long mnMaxImgTxtWidth;///< Maximum width of a text item
|
|
|
|
///< Entry AND Image
|
|
|
|
long mnMaxImgWidth; ///< Maximum width of an image item
|
|
|
|
long mnMaxImgHeight; ///< Maximum height of an image item
|
|
|
|
long mnMaxWidth; ///< Maximum width of an entry
|
|
|
|
long mnMaxHeight; ///< Maximum height of an entry
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnCurrentPos; ///< Position (Focus)
|
|
|
|
sal_Int32 mnTrackingSaveSelection; ///< Selection before Tracking();
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnSeparatorPos; ///< Separator
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnUserDrawEntry;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnTop; ///< output from line on
|
2013-07-11 12:03:19 +03:00
|
|
|
long mnLeft; ///< output from column on
|
|
|
|
long mnBorder; ///< distance border - text
|
|
|
|
long mnTextHeight; ///< text height
|
|
|
|
ProminentEntry meProminentType; ///< where is the "prominent" entry
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_uInt16 mnSelectModifier; ///< Modifiers
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
/// bitfield
|
|
|
|
bool mbHasFocusRect : 1;
|
2013-07-11 12:03:19 +03:00
|
|
|
bool mbSort : 1; ///< ListBox sorted
|
|
|
|
bool mbTrack : 1; ///< Tracking
|
|
|
|
bool mbMulti : 1; ///< MultiListBox
|
|
|
|
bool mbStackMode : 1; ///< StackSelection
|
|
|
|
bool mbSimpleMode : 1; ///< SimpleMode for MultiListBox
|
|
|
|
bool mbImgsDiffSz : 1; ///< Images have different sizes
|
|
|
|
bool mbTravelSelect : 1; ///< TravelSelect
|
|
|
|
bool mbTrackingSelect : 1; ///< Selected at a MouseMove
|
|
|
|
bool mbSelectionChanged : 1; ///< Do not call Select() too often ...
|
|
|
|
bool mbMouseMoveSelect : 1; ///< Select at MouseMove
|
|
|
|
bool mbGrabFocus : 1; ///< Grab focus at MBDown
|
|
|
|
bool mbUserDrawEnabled : 1; ///< UserDraw possible
|
|
|
|
bool mbInUserDraw : 1; ///< In UserDraw
|
|
|
|
bool mbReadOnly : 1; ///< ReadOnly
|
|
|
|
bool mbMirroring : 1; ///< pb: #106948# explicit mirroring for calc
|
|
|
|
bool mbRight : 1; ///< right align Text output
|
|
|
|
bool mbCenter : 1; ///< center Text output
|
2013-04-22 15:38:05 +00:00
|
|
|
bool mbEdgeBlending : 1;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-09-09 15:40:00 +02:00
|
|
|
Link<ImplListBoxWindow*,void> maScrollHdl;
|
|
|
|
Link<LinkParamNone*,void> maSelectHdl;
|
|
|
|
Link<LinkParamNone*,void> maCancelHdl;
|
|
|
|
Link<ImplListBoxWindow*,void> maDoubleClickHdl;
|
2016-02-18 13:38:12 +00:00
|
|
|
Link<UserDrawEvent*, void> maUserDrawHdl;
|
2015-09-09 15:40:00 +02:00
|
|
|
Link<LinkParamNone*,void> maMRUChangedHdl;
|
|
|
|
Link<sal_Int32,void> maFocusHdl;
|
|
|
|
Link<LinkParamNone*,void> maListItemSelectHdl;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-04-28 23:09:13 +03:00
|
|
|
vcl::QuickSelectionEngine maQuickSelectionEngine;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2010-09-27 23:21:07 +02:00
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void MouseMove( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Tracking( const TrackingEvent& rTEvt ) override;
|
|
|
|
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override;
|
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
bool SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bool bShift = false, bool bCtrl = false, bool bSelectPosChange = false );
|
2016-03-07 08:09:35 +02:00
|
|
|
void ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nPos);
|
2016-02-25 15:00:10 +02:00
|
|
|
void ImplDoPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
|
2007-07-24 09:00:00 +00:00
|
|
|
void ImplCalcMetrics();
|
2008-12-15 12:14:02 +00:00
|
|
|
void ImplUpdateEntryMetrics( ImplEntryType& rEntry );
|
2007-07-24 09:00:00 +00:00
|
|
|
void ImplCallSelect();
|
|
|
|
|
|
|
|
void ImplShowFocusRect();
|
|
|
|
void ImplHideFocusRect();
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void StateChanged( StateChangedType nType ) override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void FillLayoutData() const override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplListBoxWindow( vcl::Window* pParent, WinBits nWinStyle );
|
2015-01-12 11:38:12 +02:00
|
|
|
virtual ~ImplListBoxWindow();
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
ImplEntryList* GetEntryList() const { return mpEntryList; }
|
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry );
|
|
|
|
void RemoveEntry( sal_Int32 nPos );
|
2007-07-24 09:00:00 +00:00
|
|
|
void Clear();
|
|
|
|
void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetCurrentPos() const { return mnCurrentPos; }
|
|
|
|
sal_uInt16 GetDisplayLineCount() const;
|
2015-05-14 13:24:56 +02:00
|
|
|
void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2016-03-16 08:49:35 +02:00
|
|
|
void DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos = false);
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SelectEntry( sal_Int32 nPos, bool bSelect );
|
2007-07-24 09:00:00 +00:00
|
|
|
void DeselectAll();
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetEntryPosForPoint( const Point& rPoint ) const;
|
|
|
|
sal_Int32 GetLastVisibleEntry() const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
bool ProcessKeyInput( const KeyEvent& rKEvt );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetTopEntry( sal_Int32 nTop );
|
|
|
|
sal_Int32 GetTopEntry() const { return mnTop; }
|
2013-07-11 12:03:19 +03:00
|
|
|
/** ShowProminentEntry will set the entry correspoding to nEntryPos
|
|
|
|
either at top or in the middle depending on the chosen style*/
|
2014-03-01 03:13:28 +01:00
|
|
|
void ShowProminentEntry( sal_Int32 nEntryPos );
|
2009-12-18 15:29:59 +01:00
|
|
|
void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
|
2007-07-24 09:00:00 +00:00
|
|
|
using Window::IsVisible;
|
2014-03-01 03:13:28 +01:00
|
|
|
bool IsVisible( sal_Int32 nEntry ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2008-12-15 12:14:02 +00:00
|
|
|
long GetLeftIndent() const { return mnLeft; }
|
|
|
|
void SetLeftIndent( long n );
|
|
|
|
void ScrollHorz( long nDiff );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void AllowGrabFocus( bool b ) { mbGrabFocus = b; }
|
|
|
|
bool IsGrabFocusAllowed() const { return mbGrabFocus; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SetSeparatorPos( sal_Int32 n ) { mnSeparatorPos = n; }
|
|
|
|
sal_Int32 GetSeparatorPos() const { return mnSeparatorPos; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void SetTravelSelect( bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
|
|
|
|
bool IsTravelSelect() const { return mbTravelSelect; }
|
|
|
|
bool IsTrackingSelect() const { return mbTrackingSelect; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
void SetUserItemSize( const Size& rSz );
|
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
|
|
|
|
bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void EnableMultiSelection( bool bMulti, bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
|
|
|
|
bool IsMultiSelectionEnabled() const { return mbMulti; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void SetMultiSelectionSimpleMode( bool bSimple ) { mbSimpleMode = bSimple; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void EnableMouseMoveSelect( bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
|
|
|
|
bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-01-13 01:10:27 +00:00
|
|
|
Size CalcSize(sal_Int32 nMaxLines) const;
|
2014-03-01 03:13:28 +01:00
|
|
|
Rectangle GetBoundingRectangle( sal_Int32 nItem ) const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
long GetEntryHeight() const { return mnMaxHeight; }
|
|
|
|
long GetMaxEntryWidth() const { return mnMaxWidth; }
|
|
|
|
|
2015-09-09 15:40:00 +02:00
|
|
|
void SetScrollHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maScrollHdl = rLink; }
|
|
|
|
void SetSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maSelectHdl = rLink; }
|
|
|
|
void SetCancelHdl( const Link<LinkParamNone*,void>& rLink ) { maCancelHdl = rLink; }
|
|
|
|
void SetDoubleClickHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maDoubleClickHdl = rLink; }
|
2016-02-18 13:38:12 +00:00
|
|
|
void SetUserDrawHdl( const Link<UserDrawEvent*, void>& rLink ) { maUserDrawHdl = rLink; }
|
2015-09-09 15:40:00 +02:00
|
|
|
void SetMRUChangedHdl( const Link<LinkParamNone*,void>& rLink ) { maMRUChangedHdl = rLink; }
|
|
|
|
void SetFocusHdl( const Link<sal_Int32,void>& rLink ) { maFocusHdl = rLink ; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-09-09 15:40:00 +02:00
|
|
|
void SetListItemSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maListItemSelectHdl = rLink ; }
|
2013-04-22 15:38:05 +00:00
|
|
|
bool IsSelectionChanged() const { return mbSelectionChanged; }
|
2013-11-25 13:15:27 +00:00
|
|
|
sal_uInt16 GetSelectModifier() const { return mnSelectModifier; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void EnableSort( bool b ) { mbSort = b; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void SetReadOnly( bool bReadOnly ) { mbReadOnly = bReadOnly; }
|
|
|
|
bool IsReadOnly() const { return mbReadOnly; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-05-18 13:36:39 +02:00
|
|
|
DrawTextFlags ImplGetTextStyle() const;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-07-11 12:03:19 +03:00
|
|
|
/// pb: #106948# explicit mirroring for calc
|
2013-04-22 15:38:05 +00:00
|
|
|
inline void EnableMirroring() { mbMirroring = true; }
|
|
|
|
inline bool IsMirroring() const { return mbMirroring; }
|
|
|
|
|
|
|
|
bool GetEdgeBlending() const { return mbEdgeBlending; }
|
|
|
|
void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; }
|
2013-07-25 16:15:27 +02:00
|
|
|
void EnableQuickSelection( const bool& b );
|
2010-09-27 23:21:07 +02:00
|
|
|
|
2015-05-17 22:56:46 +09:00
|
|
|
using Control::ImplInitSettings;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
|
2015-05-17 22:56:46 +09:00
|
|
|
|
2010-09-27 23:21:07 +02:00
|
|
|
protected:
|
|
|
|
// ISearchableStringList
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual vcl::StringEntryIdentifier CurrentEntry( OUString& _out_entryText ) const override;
|
|
|
|
virtual vcl::StringEntryIdentifier NextEntry( vcl::StringEntryIdentifier _currentEntry, OUString& _out_entryText ) const override;
|
|
|
|
virtual void SelectEntry( vcl::StringEntryIdentifier _entry ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ImplListBox : public Control
|
|
|
|
{
|
|
|
|
private:
|
2015-03-13 16:26:50 +02:00
|
|
|
VclPtr<ImplListBoxWindow> maLBWindow;
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<ScrollBar> mpHScrollBar;
|
|
|
|
VclPtr<ScrollBar> mpVScrollBar;
|
|
|
|
VclPtr<ScrollBarBox> mpScrollBarBox;
|
2013-04-22 15:38:05 +00:00
|
|
|
|
|
|
|
/// bitfield
|
|
|
|
bool mbVScroll : 1; // VScroll an oder aus
|
|
|
|
bool mbHScroll : 1; // HScroll an oder aus
|
|
|
|
bool mbAutoHScroll : 1; // AutoHScroll an oder aus
|
|
|
|
bool mbEdgeBlending : 1;
|
|
|
|
|
2015-09-09 15:40:00 +02:00
|
|
|
Link<ImplListBox*,void> maScrollHdl; // because it is needed by ImplListBoxWindow itself
|
2015-11-18 10:11:06 +02:00
|
|
|
css::uno::Reference< css::uno::XInterface > mxDNDListenerContainer;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void StateChanged( StateChangedType nType ) override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool Notify( NotifyEvent& rNEvt ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
void ImplResizeControls();
|
|
|
|
void ImplCheckScrollBars();
|
|
|
|
void ImplInitScrollBars();
|
|
|
|
|
2015-09-03 11:10:57 +02:00
|
|
|
DECL_LINK_TYPED( ScrollBarHdl, ScrollBar*, void );
|
2015-09-09 15:40:00 +02:00
|
|
|
DECL_LINK_TYPED( LBWindowScrolled, ImplListBoxWindow*, void );
|
|
|
|
DECL_LINK_TYPED( MRUChanged, LinkParamNone*, void );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplListBox( vcl::Window* pParent, WinBits nWinStyle );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~ImplListBox();
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
const ImplEntryList* GetEntryList() const { return maLBWindow->GetEntryList(); }
|
2015-03-13 16:26:50 +02:00
|
|
|
ImplListBoxWindow* GetMainWindow() { return maLBWindow.get(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Resize() override;
|
|
|
|
virtual const Wallpaper& GetDisplayBackground() const override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 InsertEntry( sal_Int32 nPos, const OUString& rStr );
|
|
|
|
sal_Int32 InsertEntry( sal_Int32 nPos, const OUString& rStr, const Image& rImage );
|
|
|
|
void RemoveEntry( sal_Int32 nPos );
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetEntryData( sal_Int32 nPos, void* pNewData ) { maLBWindow->GetEntryList()->SetEntryData( nPos, pNewData ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
void Clear();
|
|
|
|
|
2015-05-14 13:24:56 +02:00
|
|
|
void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
void SelectEntry( sal_Int32 nPos, bool bSelect );
|
2007-07-24 09:00:00 +00:00
|
|
|
void SetNoSelection();
|
2014-12-04 13:50:21 +02:00
|
|
|
void ResetCurrentPos() { maLBWindow->ResetCurrentPos(); }
|
|
|
|
sal_Int32 GetCurrentPos() const { return maLBWindow->GetCurrentPos(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
bool ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow->ProcessKeyInput( rKEvt ); }
|
2014-02-21 12:53:51 +01:00
|
|
|
bool HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetSeparatorPos( sal_Int32 n ) { maLBWindow->SetSeparatorPos( n ); }
|
|
|
|
sal_Int32 GetSeparatorPos() const { return maLBWindow->GetSeparatorPos(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetTopEntry( sal_Int32 nTop ) { maLBWindow->SetTopEntry( nTop ); }
|
|
|
|
sal_Int32 GetTopEntry() const { return maLBWindow->GetTopEntry(); }
|
|
|
|
void ShowProminentEntry( sal_Int32 nPos ) { maLBWindow->ShowProminentEntry( nPos ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
using Window::IsVisible;
|
2014-12-04 13:50:21 +02:00
|
|
|
bool IsVisible( sal_Int32 nEntry ) const { return maLBWindow->IsVisible( nEntry ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetProminentEntryType( ProminentEntry eType ) { maLBWindow->SetProminentEntryType( eType ); }
|
2009-12-18 15:29:59 +01:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
long GetLeftIndent() const { return maLBWindow->GetLeftIndent(); }
|
|
|
|
void SetLeftIndent( sal_uInt16 n ) { maLBWindow->SetLeftIndent( n ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetTravelSelect( bool bTravelSelect ) { maLBWindow->SetTravelSelect( bTravelSelect ); }
|
|
|
|
bool IsTravelSelect() const { return maLBWindow->IsTravelSelect(); }
|
|
|
|
bool IsTrackingSelect() const { return maLBWindow->IsTrackingSelect(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void EnableMultiSelection( bool bMulti, bool bStackMode ) { maLBWindow->EnableMultiSelection( bMulti, bStackMode ); }
|
|
|
|
bool IsMultiSelectionEnabled() const { return maLBWindow->IsMultiSelectionEnabled(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetMultiSelectionSimpleMode( bool bSimple ) { maLBWindow->SetMultiSelectionSimpleMode( bSimple ); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetReadOnly( bool b ) { maLBWindow->SetReadOnly( b ); }
|
|
|
|
bool IsReadOnly() const { return maLBWindow->IsReadOnly(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-12-04 13:50:21 +02:00
|
|
|
Size CalcSize( sal_Int32 nMaxLines ) const { return maLBWindow->CalcSize( nMaxLines ); }
|
|
|
|
long GetEntryHeight() const { return maLBWindow->GetEntryHeight(); }
|
|
|
|
long GetMaxEntryWidth() const { return maLBWindow->GetMaxEntryWidth(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-09-09 15:40:00 +02:00
|
|
|
void SetScrollHdl( const Link<ImplListBox*,void>& rLink ) { maScrollHdl = rLink; }
|
|
|
|
void SetSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetSelectHdl( rLink ); }
|
|
|
|
void SetCancelHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetCancelHdl( rLink ); }
|
|
|
|
void SetDoubleClickHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maLBWindow->SetDoubleClickHdl( rLink ); }
|
2016-02-18 13:38:12 +00:00
|
|
|
void SetUserDrawHdl( const Link<UserDrawEvent*, void>& rLink ) { maLBWindow->SetUserDrawHdl( rLink ); }
|
2015-09-09 15:40:00 +02:00
|
|
|
void SetFocusHdl( const Link<sal_Int32,void>& rLink ) { maLBWindow->SetFocusHdl( rLink ); }
|
|
|
|
void SetListItemSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetListItemSelectHdl( rLink ); }
|
2015-09-09 15:09:26 +02:00
|
|
|
void SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); }
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetCallSelectionChangedHdl( bool bCall ) { maLBWindow->GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
|
|
|
|
bool IsSelectionChanged() const { return maLBWindow->IsSelectionChanged(); }
|
|
|
|
sal_uInt16 GetSelectModifier() const { return maLBWindow->GetSelectModifier(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SetMRUEntries( const OUString& rEntries, sal_Unicode cSep );
|
2015-09-09 15:09:26 +02:00
|
|
|
OUString GetMRUEntries( sal_Unicode cSep ) const;
|
2014-12-04 13:50:21 +02:00
|
|
|
void SetMaxMRUCount( sal_Int32 n ) { maLBWindow->GetEntryList()->SetMaxMRUCount( n ); }
|
|
|
|
sal_Int32 GetMaxMRUCount() const { return maLBWindow->GetEntryList()->GetMaxMRUCount(); }
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_uInt16 GetDisplayLineCount() const
|
2014-12-04 13:50:21 +02:00
|
|
|
{ return maLBWindow->GetDisplayLineCount(); }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
bool GetEdgeBlending() const { return mbEdgeBlending; }
|
|
|
|
void SetEdgeBlending(bool bNew);
|
|
|
|
|
2013-07-11 12:03:19 +03:00
|
|
|
/// pb: #106948# explicit mirroring for calc
|
2014-12-04 13:50:21 +02:00
|
|
|
inline void EnableMirroring() { maLBWindow->EnableMirroring(); }
|
2015-11-18 10:11:06 +02:00
|
|
|
inline void SetDropTraget(const css::uno::Reference< css::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; }
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ImplListBoxFloatingWindow : public FloatingWindow
|
|
|
|
{
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<ImplListBox> mpImplLB;
|
2007-07-24 09:00:00 +00:00
|
|
|
Size maPrefSz;
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_uInt16 mnDDLineCount;
|
|
|
|
sal_Int32 mnPopupModeStartSaveSelection;
|
2014-02-21 12:53:51 +01:00
|
|
|
bool mbAutoWidth;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplListBoxFloatingWindow( vcl::Window* pParent );
|
2015-03-09 14:29:30 +02:00
|
|
|
virtual ~ImplListBoxFloatingWindow();
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2007-07-24 09:00:00 +00:00
|
|
|
void SetImplListBox( ImplListBox* pLB ) { mpImplLB = pLB; }
|
|
|
|
|
|
|
|
void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; }
|
|
|
|
const Size& GetPrefSize() const { return maPrefSz; }
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
void SetAutoWidth( bool b ) { mbAutoWidth = b; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
Size CalcFloatSize();
|
2014-02-21 12:53:51 +01:00
|
|
|
void StartFloat( bool bStartTracking );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2012-08-24 12:34:22 +01:00
|
|
|
virtual void setPosSizePixel( long nX, long nY,
|
2015-10-12 16:04:04 +02:00
|
|
|
long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All ) override;
|
|
|
|
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) override
|
2007-07-24 09:00:00 +00:00
|
|
|
{ FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
|
|
|
|
|
2010-09-29 15:46:40 +08:00
|
|
|
void SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; }
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_uInt16 GetDropDownLineCount() const { return mnDDLineCount; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Resize() override;
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ImplWin : public Control
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 mnItemPos; ///< because of UserDraw I have to know which item I draw
|
2013-03-12 22:02:14 +01:00
|
|
|
OUString maString;
|
2007-07-24 09:00:00 +00:00
|
|
|
Image maImage;
|
|
|
|
|
|
|
|
Rectangle maFocusRect;
|
|
|
|
Size maUserItemSize;
|
|
|
|
|
2016-02-18 13:38:12 +00:00
|
|
|
Link<void*,void> maMBDownHdl;
|
|
|
|
Link<UserDrawEvent*, void> maUserDrawHdl;
|
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
/// bitfield
|
|
|
|
bool mbUserDrawEnabled : 1;
|
|
|
|
bool mbInUserDraw : 1;
|
|
|
|
bool mbEdgeBlending : 1;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-05-25 16:18:23 +09:00
|
|
|
void ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout = false);
|
2007-07-24 09:00:00 +00:00
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void FillLayoutData() const override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-05-25 16:18:23 +09:00
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplWin( vcl::Window* pParent, WinBits nWinStyle = 0 );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override;
|
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void GetFocus() override;
|
|
|
|
virtual void LoseFocus() override;
|
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2014-03-01 03:13:28 +01:00
|
|
|
sal_Int32 GetItemPos() const { return mnItemPos; }
|
|
|
|
void SetItemPos( sal_Int32 n ) { mnItemPos = n; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2013-03-12 22:02:14 +01:00
|
|
|
void SetString( const OUString& rStr ) { maString = rStr; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
void SetImage( const Image& rImg ) { maImage = rImg; }
|
|
|
|
|
2015-01-21 12:15:26 +02:00
|
|
|
void MBDown();
|
2014-09-14 13:07:31 +02:00
|
|
|
|
2016-02-18 13:38:12 +00:00
|
|
|
void SetMBDownHdl( const Link<void*,void>& rLink ) { maMBDownHdl = rLink; }
|
|
|
|
void SetUserDrawHdl( const Link<UserDrawEvent*, void>& rLink ) { maUserDrawHdl = rLink; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
|
|
|
|
|
2013-04-22 15:38:05 +00:00
|
|
|
void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
|
|
|
|
bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2016-04-01 13:31:59 +02:00
|
|
|
void DrawEntry(vcl::RenderContext& rRenderContext, bool bDrawImage,
|
2015-05-25 16:18:23 +09:00
|
|
|
bool bDrawTextAtImagePos = false, bool bLayout = false);
|
2013-04-22 15:38:05 +00:00
|
|
|
|
|
|
|
bool GetEdgeBlending() const { return mbEdgeBlending; }
|
|
|
|
void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; }
|
2015-05-14 16:44:10 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ShowFocus(const Rectangle& rRect) override;
|
2015-05-17 22:56:46 +09:00
|
|
|
|
|
|
|
using Control::ImplInitSettings;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
|
2015-05-17 22:56:46 +09:00
|
|
|
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ImplBtn : public PushButton
|
|
|
|
{
|
|
|
|
private:
|
2014-02-21 12:53:51 +01:00
|
|
|
bool mbDown;
|
2016-02-18 13:38:12 +00:00
|
|
|
Link<void*,void> maMBDownHdl;
|
2007-07-24 09:00:00 +00:00
|
|
|
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
ImplBtn( vcl::Window* pParent, WinBits nWinStyle = 0 );
|
2007-07-24 09:00:00 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
2015-01-20 12:38:10 +02:00
|
|
|
void MBDown();
|
2016-02-18 13:38:12 +00:00
|
|
|
void SetMBDownHdl( const Link<void*,void>& rLink ) { maMBDownHdl = rLink; }
|
2007-07-24 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void ImplInitDropDownButton( PushButton* pButton );
|
|
|
|
|
2016-01-25 20:38:10 +11:00
|
|
|
#endif // INCLUDED_VCL_INC_LISTBOX_HXX
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|