1161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5161f4cd1SAndrew Rist * distributed with this work for additional information 6161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10161f4cd1SAndrew Rist * 11161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12161f4cd1SAndrew Rist * 13161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17161f4cd1SAndrew Rist * specific language governing permissions and limitations 18161f4cd1SAndrew Rist * under the License. 19161f4cd1SAndrew Rist * 20161f4cd1SAndrew Rist *************************************************************/ 21161f4cd1SAndrew Rist 22161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SV_ILSTBOX_HXX 25cdf0e10cSrcweir #define _SV_ILSTBOX_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <vcl/sv.h> 28cdf0e10cSrcweir #include <vcl/image.hxx> 29cdf0e10cSrcweir #include <vcl/ctrl.hxx> 30cdf0e10cSrcweir #include <vcl/button.hxx> 31cdf0e10cSrcweir #include <vcl/floatwin.hxx> 32cdf0e10cSrcweir #include <vcl/lstbox.h> 33cdf0e10cSrcweir #include <vcl/timer.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include "vcl/quickselectionengine.hxx" 36cdf0e10cSrcweir 37cdf0e10cSrcweir class ScrollBar; 38cdf0e10cSrcweir class ScrollBarBox; 39cdf0e10cSrcweir 40cdf0e10cSrcweir // ----------------- 41cdf0e10cSrcweir // - ListBox-Types - 42cdf0e10cSrcweir // ----------------- 43cdf0e10cSrcweir 44cdf0e10cSrcweir #define HORZ_SCROLL 4 45cdf0e10cSrcweir #define IMG_TXT_DISTANCE 6 46cdf0e10cSrcweir 47cdf0e10cSrcweir enum LB_EVENT_TYPE 48cdf0e10cSrcweir { 49cdf0e10cSrcweir LET_MBDOWN, 50cdf0e10cSrcweir LET_TRACKING, 51cdf0e10cSrcweir LET_TRACKING_END, 52cdf0e10cSrcweir LET_KEYMOVE, 53cdf0e10cSrcweir LET_KEYSPACE 54cdf0e10cSrcweir }; 55cdf0e10cSrcweir 56cdf0e10cSrcweir // ----------------- 57cdf0e10cSrcweir // - ImplEntryType - 58cdf0e10cSrcweir // ----------------- 59cdf0e10cSrcweir 60cdf0e10cSrcweir struct ImplEntryType 61cdf0e10cSrcweir { 62cdf0e10cSrcweir XubString maStr; 63cdf0e10cSrcweir Image maImage; 64cdf0e10cSrcweir void* mpUserData; 65cdf0e10cSrcweir sal_Bool mbIsSelected; 66cdf0e10cSrcweir long mnFlags; 67cdf0e10cSrcweir long mnHeight; 68cdf0e10cSrcweir 69*a68b38dfSArmin Le Grand ImplEntryType( const XubString& rStr, const Image& rImage ) : 70*a68b38dfSArmin Le Grand maStr( rStr ), 71*a68b38dfSArmin Le Grand maImage( rImage ), 72*a68b38dfSArmin Le Grand mnFlags( 0 ), 73*a68b38dfSArmin Le Grand mnHeight( 0 ) 74*a68b38dfSArmin Le Grand { 75*a68b38dfSArmin Le Grand mbIsSelected = sal_False; 76*a68b38dfSArmin Le Grand mpUserData = NULL; 77*a68b38dfSArmin Le Grand } 78*a68b38dfSArmin Le Grand 79*a68b38dfSArmin Le Grand ImplEntryType( const XubString& rStr ) : 80*a68b38dfSArmin Le Grand maStr( rStr ), 81*a68b38dfSArmin Le Grand mnFlags( 0 ), 82*a68b38dfSArmin Le Grand mnHeight( 0 ) 83*a68b38dfSArmin Le Grand { 84*a68b38dfSArmin Le Grand mbIsSelected = sal_False; 85*a68b38dfSArmin Le Grand mpUserData = NULL; 86*a68b38dfSArmin Le Grand } 87*a68b38dfSArmin Le Grand 88*a68b38dfSArmin Le Grand ImplEntryType( const Image& rImage ) : 89*a68b38dfSArmin Le Grand maImage( rImage ), 90*a68b38dfSArmin Le Grand mnFlags( 0 ), 91*a68b38dfSArmin Le Grand mnHeight( 0 ) 92*a68b38dfSArmin Le Grand { 93*a68b38dfSArmin Le Grand mbIsSelected = sal_False; 94*a68b38dfSArmin Le Grand mpUserData = NULL; 95*a68b38dfSArmin Le Grand } 96cdf0e10cSrcweir }; 97cdf0e10cSrcweir 98cdf0e10cSrcweir // ----------------- 99cdf0e10cSrcweir // - ImplEntryList - 100cdf0e10cSrcweir // ----------------- 101cdf0e10cSrcweir 102cdf0e10cSrcweir class ImplEntryList : private List 103cdf0e10cSrcweir { 104cdf0e10cSrcweir private: 105cdf0e10cSrcweir Window* mpWindow; // For getting the current locale when matching strings 106cdf0e10cSrcweir sal_uInt16 mnLastSelected; 107cdf0e10cSrcweir sal_uInt16 mnSelectionAnchor; 108cdf0e10cSrcweir sal_uInt16 mnImages; 109cdf0e10cSrcweir 110cdf0e10cSrcweir sal_uInt16 mnMRUCount; 111cdf0e10cSrcweir sal_uInt16 mnMaxMRUCount; 112cdf0e10cSrcweir 113cdf0e10cSrcweir Link maSelectionChangedHdl; 114cdf0e10cSrcweir sal_Bool mbCallSelectionChangedHdl; 115cdf0e10cSrcweir 116cdf0e10cSrcweir ImplEntryType* GetEntry( sal_uInt16 nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); } 117cdf0e10cSrcweir 118cdf0e10cSrcweir public: 119cdf0e10cSrcweir ImplEntryList( Window* pWindow ); 120cdf0e10cSrcweir ~ImplEntryList(); 121cdf0e10cSrcweir 122cdf0e10cSrcweir sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort ); 123cdf0e10cSrcweir void RemoveEntry( sal_uInt16 nPos ); 124cdf0e10cSrcweir const ImplEntryType* GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetObject( nPos ); } 125cdf0e10cSrcweir ImplEntryType* GetMutableEntryPtr( sal_uInt16 nPos ) const { return (ImplEntryType*) GetObject( nPos ); } 126cdf0e10cSrcweir void Clear(); 127cdf0e10cSrcweir 128cdf0e10cSrcweir sal_uInt16 FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart = 0, sal_Bool bForward = sal_True, sal_Bool bLazy = sal_True ) const; 129cdf0e10cSrcweir sal_uInt16 FindEntry( const XubString& rStr, sal_Bool bSearchMRUArea = sal_False ) const; 130cdf0e10cSrcweir sal_uInt16 FindEntry( const void* pData ) const; 131cdf0e10cSrcweir 132cdf0e10cSrcweir // helper: add up heights up to index nEndIndex. 133cdf0e10cSrcweir // GetAddedHeight( 0 ) returns 0 134cdf0e10cSrcweir // GetAddedHeight( LISTBOX_ENTRY_NOTFOUND ) returns 0 135cdf0e10cSrcweir // GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i ) 136cdf0e10cSrcweir long GetAddedHeight( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const; 137cdf0e10cSrcweir long GetEntryHeight( sal_uInt16 nPos ) const; 138cdf0e10cSrcweir 139cdf0e10cSrcweir sal_uInt16 GetEntryCount() const { return (sal_uInt16)List::Count(); } 140cdf0e10cSrcweir sal_Bool HasImages() const { return mnImages ? sal_True : sal_False; } 141cdf0e10cSrcweir 142cdf0e10cSrcweir XubString GetEntryText( sal_uInt16 nPos ) const; 143cdf0e10cSrcweir 144cdf0e10cSrcweir sal_Bool HasEntryImage( sal_uInt16 nPos ) const; 145cdf0e10cSrcweir Image GetEntryImage( sal_uInt16 nPos ) const; 146cdf0e10cSrcweir 147cdf0e10cSrcweir void SetEntryData( sal_uInt16 nPos, void* pNewData ); 148cdf0e10cSrcweir void* GetEntryData( sal_uInt16 nPos ) const; 149cdf0e10cSrcweir 150cdf0e10cSrcweir void SetEntryFlags( sal_uInt16 nPos, long nFlags ); 151cdf0e10cSrcweir long GetEntryFlags( sal_uInt16 nPos ) const; 152cdf0e10cSrcweir 153cdf0e10cSrcweir void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect ); 154cdf0e10cSrcweir 155cdf0e10cSrcweir sal_uInt16 GetSelectEntryCount() const; 156cdf0e10cSrcweir XubString GetSelectEntry( sal_uInt16 nIndex ) const; 157cdf0e10cSrcweir sal_uInt16 GetSelectEntryPos( sal_uInt16 nIndex ) const; 158cdf0e10cSrcweir sal_Bool IsEntrySelected( const XubString& rStr ) const; 159cdf0e10cSrcweir sal_Bool IsEntryPosSelected( sal_uInt16 nIndex ) const; 160cdf0e10cSrcweir 161cdf0e10cSrcweir void SetLastSelected( sal_uInt16 nPos ) { mnLastSelected = nPos; } 162cdf0e10cSrcweir sal_uInt16 GetLastSelected() const { return mnLastSelected; } 163cdf0e10cSrcweir 164cdf0e10cSrcweir void SetSelectionAnchor( sal_uInt16 nPos ) { mnSelectionAnchor = nPos; } 165cdf0e10cSrcweir sal_uInt16 GetSelectionAnchor() const { return mnSelectionAnchor; } 166cdf0e10cSrcweir 167cdf0e10cSrcweir 168cdf0e10cSrcweir void SetSelectionChangedHdl( const Link& rLnk ) { maSelectionChangedHdl = rLnk; } 169cdf0e10cSrcweir void SetCallSelectionChangedHdl( sal_Bool bCall ) { mbCallSelectionChangedHdl = bCall; } 170cdf0e10cSrcweir 171cdf0e10cSrcweir void SetMRUCount( sal_uInt16 n ) { mnMRUCount = n; } 172cdf0e10cSrcweir sal_uInt16 GetMRUCount() const { return mnMRUCount; } 173cdf0e10cSrcweir 174cdf0e10cSrcweir void SetMaxMRUCount( sal_uInt16 n ) { mnMaxMRUCount = n; } 175cdf0e10cSrcweir sal_uInt16 GetMaxMRUCount() const { return mnMaxMRUCount; } 176cdf0e10cSrcweir 177cdf0e10cSrcweir /** An Entry is selectable if its mnFlags does not have the 178cdf0e10cSrcweir LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */ 179cdf0e10cSrcweir bool IsEntrySelectable( sal_uInt16 nPos ) const; 180cdf0e10cSrcweir 181cdf0e10cSrcweir /** returns the first entry found from the given position nPos that is selectable 182cdf0e10cSrcweir or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable, 183cdf0e10cSrcweir it returns the first selectable entry after nPos if bForward is true and the 184cdf0e10cSrcweir first selectable entry after nPos is bForward is false. 185cdf0e10cSrcweir */ 186cdf0e10cSrcweir sal_uInt16 FindFirstSelectable( sal_uInt16 nPos, bool bForward = true ); 187cdf0e10cSrcweir }; 188cdf0e10cSrcweir 189cdf0e10cSrcweir // --------------------- 190cdf0e10cSrcweir // - ImplListBoxWindow - 191cdf0e10cSrcweir // --------------------- 192cdf0e10cSrcweir 193cdf0e10cSrcweir class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList 194cdf0e10cSrcweir { 195cdf0e10cSrcweir private: 196cdf0e10cSrcweir ImplEntryList* mpEntryList; // EntryListe 197cdf0e10cSrcweir Rectangle maFocusRect; 198cdf0e10cSrcweir 199cdf0e10cSrcweir Size maUserItemSize; 200cdf0e10cSrcweir 201cdf0e10cSrcweir long mnMaxTxtHeight; // Maximale Hoehe eines Text-Items 202cdf0e10cSrcweir long mnMaxTxtWidth; // Maximale Breite eines Text-Items 203cdf0e10cSrcweir // Entry ohne Image 204cdf0e10cSrcweir long mnMaxImgTxtWidth;// Maximale Breite eines Text-Items 205cdf0e10cSrcweir // Entry UND Image 206cdf0e10cSrcweir long mnMaxImgWidth; // Maximale Breite eines Image-Items 207cdf0e10cSrcweir long mnMaxImgHeight; // Maximale Hoehe eines Image-Items 208cdf0e10cSrcweir long mnMaxWidth; // Maximale Breite eines Eintrags 209cdf0e10cSrcweir long mnMaxHeight; // Maximale Hoehe eines Eintrags 210cdf0e10cSrcweir 211cdf0e10cSrcweir sal_uInt16 mnCurrentPos; // Position (Focus) 212cdf0e10cSrcweir sal_uInt16 mnTrackingSaveSelection; // Selektion vor Tracking(); 213cdf0e10cSrcweir 214cdf0e10cSrcweir sal_uInt16 mnSeparatorPos; // Separator 215cdf0e10cSrcweir 216cdf0e10cSrcweir sal_uInt16 mnUserDrawEntry; 217cdf0e10cSrcweir 218cdf0e10cSrcweir sal_uInt16 mnTop; // Ausgabe ab Zeile 219cdf0e10cSrcweir long mnLeft; // Ausgabe ab Spalte 220cdf0e10cSrcweir long mnBorder; // Abstand Rahmen - Text 221cdf0e10cSrcweir long mnTextHeight; // Texthoehe 222cdf0e10cSrcweir ProminentEntry meProminentType; // where is the "prominent" entry 223cdf0e10cSrcweir 224cdf0e10cSrcweir sal_uInt16 mnSelectModifier; // Modifiers 225cdf0e10cSrcweir 226*a68b38dfSArmin Le Grand /// bitfield 227*a68b38dfSArmin Le Grand bool mbHasFocusRect : 1; 228*a68b38dfSArmin Le Grand bool mbSort : 1; // ListBox sortiert 229*a68b38dfSArmin Le Grand bool mbTrack : 1; // Tracking 230*a68b38dfSArmin Le Grand bool mbMulti : 1; // MultiListBox 231*a68b38dfSArmin Le Grand bool mbStackMode : 1; // StackSelection 232*a68b38dfSArmin Le Grand bool mbSimpleMode : 1; // SimpleMode fuer MultiListBox 233*a68b38dfSArmin Le Grand bool mbImgsDiffSz : 1; // Images haben verschiedene Groessen 234*a68b38dfSArmin Le Grand bool mbTravelSelect : 1; // TravelSelect 235*a68b38dfSArmin Le Grand bool mbTrackingSelect : 1; // Selektiert bei MouseMove 236*a68b38dfSArmin Le Grand bool mbSelectionChanged : 1; // Select() nicht zu oft rufen... 237*a68b38dfSArmin Le Grand bool mbMouseMoveSelect : 1; // Selektieren bei MouseMove 238*a68b38dfSArmin Le Grand bool mbGrabFocus : 1; // Focus bei MBDown grabben 239*a68b38dfSArmin Le Grand bool mbUserDrawEnabled : 1; // UserDraw possible 240*a68b38dfSArmin Le Grand bool mbInUserDraw : 1; // In UserDraw 241*a68b38dfSArmin Le Grand bool mbReadOnly : 1; // ReadOnly 242*a68b38dfSArmin Le Grand bool mbMirroring : 1; // pb: #106948# explicit mirroring for calc 243*a68b38dfSArmin Le Grand bool mbRight : 1; // right align Text output 244*a68b38dfSArmin Le Grand bool mbCenter : 1; // center Text output 245*a68b38dfSArmin Le Grand bool mbEdgeBlending : 1; 246cdf0e10cSrcweir 247cdf0e10cSrcweir Link maScrollHdl; 248cdf0e10cSrcweir Link maSelectHdl; 249cdf0e10cSrcweir Link maCancelHdl; 250cdf0e10cSrcweir Link maDoubleClickHdl; 251cdf0e10cSrcweir Link maUserDrawHdl; 252cdf0e10cSrcweir Link maMRUChangedHdl; 253cdf0e10cSrcweir 254*a68b38dfSArmin Le Grand ::vcl::QuickSelectionEngine maQuickSelectionEngine; 255cdf0e10cSrcweir 256cdf0e10cSrcweir protected: 257cdf0e10cSrcweir virtual void KeyInput( const KeyEvent& rKEvt ); 258cdf0e10cSrcweir virtual void MouseButtonDown( const MouseEvent& rMEvt ); 259cdf0e10cSrcweir virtual void MouseMove( const MouseEvent& rMEvt ); 260cdf0e10cSrcweir virtual void Tracking( const TrackingEvent& rTEvt ); 261cdf0e10cSrcweir virtual void Paint( const Rectangle& rRect ); 262cdf0e10cSrcweir virtual void Resize(); 263cdf0e10cSrcweir virtual void GetFocus(); 264cdf0e10cSrcweir virtual void LoseFocus(); 265cdf0e10cSrcweir 266cdf0e10cSrcweir sal_Bool SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False ); 267cdf0e10cSrcweir void ImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, bool bLayout = false ); 268cdf0e10cSrcweir void ImplDoPaint( const Rectangle& rRect, bool bLayout = false ); 269cdf0e10cSrcweir void ImplCalcMetrics(); 270cdf0e10cSrcweir void ImplUpdateEntryMetrics( ImplEntryType& rEntry ); 271cdf0e10cSrcweir void ImplCallSelect(); 272cdf0e10cSrcweir 273cdf0e10cSrcweir void ImplShowFocusRect(); 274cdf0e10cSrcweir void ImplHideFocusRect(); 275cdf0e10cSrcweir 276cdf0e10cSrcweir 277cdf0e10cSrcweir virtual void StateChanged( StateChangedType nType ); 278cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 279cdf0e10cSrcweir 280cdf0e10cSrcweir public: 281cdf0e10cSrcweir virtual void FillLayoutData() const; 282cdf0e10cSrcweir 283cdf0e10cSrcweir ImplListBoxWindow( Window* pParent, WinBits nWinStyle ); 284cdf0e10cSrcweir ~ImplListBoxWindow(); 285cdf0e10cSrcweir 286cdf0e10cSrcweir ImplEntryList* GetEntryList() const { return mpEntryList; } 287cdf0e10cSrcweir 288cdf0e10cSrcweir sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry ); 289cdf0e10cSrcweir void RemoveEntry( sal_uInt16 nPos ); 290cdf0e10cSrcweir void Clear(); 291cdf0e10cSrcweir void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; } 292cdf0e10cSrcweir sal_uInt16 GetCurrentPos() const { return mnCurrentPos; } 293cdf0e10cSrcweir sal_uInt16 GetDisplayLineCount() const; 294cdf0e10cSrcweir void SetEntryFlags( sal_uInt16 nPos, long nFlags ); 295cdf0e10cSrcweir 296cdf0e10cSrcweir void DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false ); 297cdf0e10cSrcweir 298cdf0e10cSrcweir void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect ); 299cdf0e10cSrcweir void DeselectAll(); 300cdf0e10cSrcweir sal_uInt16 GetEntryPosForPoint( const Point& rPoint ) const; 301cdf0e10cSrcweir sal_uInt16 GetLastVisibleEntry() const; 302cdf0e10cSrcweir 303cdf0e10cSrcweir sal_Bool ProcessKeyInput( const KeyEvent& rKEvt ); 304cdf0e10cSrcweir 305cdf0e10cSrcweir void SetTopEntry( sal_uInt16 nTop ); 306cdf0e10cSrcweir sal_uInt16 GetTopEntry() const { return mnTop; } 307cdf0e10cSrcweir // ShowProminentEntry will set the entry correspoding to nEntryPos 308cdf0e10cSrcweir // either at top or in the middle depending on the chosen style 309cdf0e10cSrcweir void ShowProminentEntry( sal_uInt16 nEntryPos ); 310cdf0e10cSrcweir void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; } 311cdf0e10cSrcweir ProminentEntry GetProminentEntryType() const { return meProminentType; } 312cdf0e10cSrcweir using Window::IsVisible; 313cdf0e10cSrcweir sal_Bool IsVisible( sal_uInt16 nEntry ) const; 314cdf0e10cSrcweir 315cdf0e10cSrcweir long GetLeftIndent() const { return mnLeft; } 316cdf0e10cSrcweir void SetLeftIndent( long n ); 317cdf0e10cSrcweir void ScrollHorz( long nDiff ); 318cdf0e10cSrcweir 319*a68b38dfSArmin Le Grand void AllowGrabFocus( bool b ) { mbGrabFocus = b; } 320*a68b38dfSArmin Le Grand bool IsGrabFocusAllowed() const { return mbGrabFocus; } 321cdf0e10cSrcweir 322cdf0e10cSrcweir void SetSeparatorPos( sal_uInt16 n ) { mnSeparatorPos = n; } 323cdf0e10cSrcweir sal_uInt16 GetSeparatorPos() const { return mnSeparatorPos; } 324cdf0e10cSrcweir 325*a68b38dfSArmin Le Grand void SetTravelSelect( bool bTravelSelect ) { mbTravelSelect = bTravelSelect; } 326*a68b38dfSArmin Le Grand bool IsTravelSelect() const { return mbTravelSelect; } 327*a68b38dfSArmin Le Grand bool IsTrackingSelect() const { return mbTrackingSelect; } 328cdf0e10cSrcweir 329cdf0e10cSrcweir void SetUserItemSize( const Size& rSz ); 330cdf0e10cSrcweir const Size& GetUserItemSize() const { return maUserItemSize; } 331cdf0e10cSrcweir 332*a68b38dfSArmin Le Grand void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; } 333*a68b38dfSArmin Le Grand bool IsUserDrawEnabled() const { return mbUserDrawEnabled; } 334cdf0e10cSrcweir 335*a68b38dfSArmin Le Grand void EnableMultiSelection( bool bMulti, bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; } 336*a68b38dfSArmin Le Grand bool IsMultiSelectionEnabled() const { return mbMulti; } 337cdf0e10cSrcweir 338*a68b38dfSArmin Le Grand void SetMultiSelectionSimpleMode( bool bSimple ) { mbSimpleMode = bSimple; } 339*a68b38dfSArmin Le Grand bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; } 340cdf0e10cSrcweir 341*a68b38dfSArmin Le Grand void EnableMouseMoveSelect( bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; } 342*a68b38dfSArmin Le Grand bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; } 343*a68b38dfSArmin Le Grand bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; } 344cdf0e10cSrcweir 345cdf0e10cSrcweir Size CalcSize( sal_uInt16 nMaxLines ) const; 346cdf0e10cSrcweir Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const; 347cdf0e10cSrcweir 348cdf0e10cSrcweir long GetEntryHeight() const { return mnMaxHeight; } 349cdf0e10cSrcweir long GetMaxEntryWidth() const { return mnMaxWidth; } 350cdf0e10cSrcweir 351cdf0e10cSrcweir void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; } 352cdf0e10cSrcweir const Link& GetScrollHdl() const { return maScrollHdl; } 353cdf0e10cSrcweir void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } 354cdf0e10cSrcweir const Link& GetSelectHdl() const { return maSelectHdl; } 355cdf0e10cSrcweir void SetCancelHdl( const Link& rLink ) { maCancelHdl = rLink; } 356cdf0e10cSrcweir const Link& GetCancelHdl() const { return maCancelHdl; } 357cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; } 358cdf0e10cSrcweir const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; } 359cdf0e10cSrcweir void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; } 360cdf0e10cSrcweir const Link& GetUserDrawHdl() const { return maUserDrawHdl; } 361cdf0e10cSrcweir void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; } 362cdf0e10cSrcweir const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; } 363cdf0e10cSrcweir 364*a68b38dfSArmin Le Grand bool IsSelectionChanged() const { return mbSelectionChanged; } 365cdf0e10cSrcweir sal_uInt16 GetSelectModifier() const { return mnSelectModifier; } 366cdf0e10cSrcweir 367*a68b38dfSArmin Le Grand void EnableSort( bool b ) { mbSort = b; } 368cdf0e10cSrcweir 369*a68b38dfSArmin Le Grand void SetReadOnly( bool bReadOnly ) { mbReadOnly = bReadOnly; } 370*a68b38dfSArmin Le Grand bool IsReadOnly() const { return mbReadOnly; } 371cdf0e10cSrcweir 372cdf0e10cSrcweir using Control::ImplInitSettings; 373cdf0e10cSrcweir void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); 374cdf0e10cSrcweir sal_uInt16 ImplGetTextStyle() const; 375cdf0e10cSrcweir 376cdf0e10cSrcweir // pb: #106948# explicit mirroring for calc 377*a68b38dfSArmin Le Grand inline void EnableMirroring() { mbMirroring = true; } 378*a68b38dfSArmin Le Grand inline bool IsMirroring() const { return mbMirroring; } 379*a68b38dfSArmin Le Grand 380*a68b38dfSArmin Le Grand bool GetEdgeBlending() const { return mbEdgeBlending; } 381*a68b38dfSArmin Le Grand void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; } 382cdf0e10cSrcweir 383cdf0e10cSrcweir protected: 384cdf0e10cSrcweir // ISearchableStringList 385cdf0e10cSrcweir virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const; 386cdf0e10cSrcweir virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const; 387cdf0e10cSrcweir virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry ); 388cdf0e10cSrcweir }; 389cdf0e10cSrcweir 390cdf0e10cSrcweir // --------------- 391cdf0e10cSrcweir // - ImplListBox - 392cdf0e10cSrcweir // --------------- 393cdf0e10cSrcweir 394cdf0e10cSrcweir class ImplListBox : public Control 395cdf0e10cSrcweir { 396cdf0e10cSrcweir private: 397cdf0e10cSrcweir ImplListBoxWindow maLBWindow; 398cdf0e10cSrcweir ScrollBar* mpHScrollBar; 399cdf0e10cSrcweir ScrollBar* mpVScrollBar; 400cdf0e10cSrcweir ScrollBarBox* mpScrollBarBox; 401*a68b38dfSArmin Le Grand 402*a68b38dfSArmin Le Grand /// bitfield 403*a68b38dfSArmin Le Grand bool mbVScroll : 1; // VScroll an oder aus 404*a68b38dfSArmin Le Grand bool mbHScroll : 1; // HScroll an oder aus 405*a68b38dfSArmin Le Grand bool mbAutoHScroll : 1; // AutoHScroll an oder aus 406*a68b38dfSArmin Le Grand bool mbEdgeBlending : 1; 407*a68b38dfSArmin Le Grand 408cdf0e10cSrcweir Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird. 409cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; 410cdf0e10cSrcweir 411cdf0e10cSrcweir protected: 412cdf0e10cSrcweir virtual void GetFocus(); 413cdf0e10cSrcweir virtual void StateChanged( StateChangedType nType ); 414cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 415cdf0e10cSrcweir 416cdf0e10cSrcweir long Notify( NotifyEvent& rNEvt ); 417cdf0e10cSrcweir 418cdf0e10cSrcweir void ImplResizeControls(); 419cdf0e10cSrcweir void ImplCheckScrollBars(); 420cdf0e10cSrcweir void ImplInitScrollBars(); 421cdf0e10cSrcweir 422cdf0e10cSrcweir DECL_LINK( ScrollBarHdl, ScrollBar* ); 423cdf0e10cSrcweir DECL_LINK( LBWindowScrolled, void* ); 424cdf0e10cSrcweir DECL_LINK( MRUChanged, void* ); 425cdf0e10cSrcweir 426cdf0e10cSrcweir public: 427cdf0e10cSrcweir ImplListBox( Window* pParent, WinBits nWinStyle ); 428cdf0e10cSrcweir ~ImplListBox(); 429cdf0e10cSrcweir 430cdf0e10cSrcweir const ImplEntryList* GetEntryList() const { return maLBWindow.GetEntryList(); } 431cdf0e10cSrcweir ImplListBoxWindow* GetMainWindow() { return &maLBWindow; } 432cdf0e10cSrcweir 433cdf0e10cSrcweir virtual void Resize(); 434cdf0e10cSrcweir virtual const Wallpaper& GetDisplayBackground() const; 435cdf0e10cSrcweir virtual Window* GetPreferredKeyInputWindow(); 436cdf0e10cSrcweir 437cdf0e10cSrcweir sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr ); 438cdf0e10cSrcweir sal_uInt16 InsertEntry( sal_uInt16 nPos, const Image& rImage ); 439cdf0e10cSrcweir sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage ); 440cdf0e10cSrcweir void RemoveEntry( sal_uInt16 nPos ); 441cdf0e10cSrcweir void SetEntryData( sal_uInt16 nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); } 442cdf0e10cSrcweir void Clear(); 443cdf0e10cSrcweir 444cdf0e10cSrcweir void SetEntryFlags( sal_uInt16 nPos, long nFlags ); 445cdf0e10cSrcweir long GetEntryFlags( sal_uInt16 nPos ) const; 446cdf0e10cSrcweir 447cdf0e10cSrcweir void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect ); 448cdf0e10cSrcweir void SetNoSelection(); 449cdf0e10cSrcweir void ResetCurrentPos() { maLBWindow.ResetCurrentPos(); } 450cdf0e10cSrcweir sal_uInt16 GetCurrentPos() const { return maLBWindow.GetCurrentPos(); } 451cdf0e10cSrcweir 452cdf0e10cSrcweir sal_Bool ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); } 453cdf0e10cSrcweir sal_Bool HandleWheelAsCursorTravel( const CommandEvent& rCEvt ); 454cdf0e10cSrcweir 455cdf0e10cSrcweir void SetSeparatorPos( sal_uInt16 n ) { maLBWindow.SetSeparatorPos( n ); } 456cdf0e10cSrcweir sal_uInt16 GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); } 457cdf0e10cSrcweir 458cdf0e10cSrcweir void SetTopEntry( sal_uInt16 nTop ) { maLBWindow.SetTopEntry( nTop ); } 459cdf0e10cSrcweir sal_uInt16 GetTopEntry() const { return maLBWindow.GetTopEntry(); } 460cdf0e10cSrcweir void ShowProminentEntry( sal_uInt16 nPos ) { maLBWindow.ShowProminentEntry( nPos ); } 461cdf0e10cSrcweir using Window::IsVisible; 462cdf0e10cSrcweir sal_Bool IsVisible( sal_uInt16 nEntry ) const { return maLBWindow.IsVisible( nEntry ); } 463cdf0e10cSrcweir 464cdf0e10cSrcweir void SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); } 465cdf0e10cSrcweir ProminentEntry GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); } 466cdf0e10cSrcweir 467cdf0e10cSrcweir long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); } 468cdf0e10cSrcweir void SetLeftIndent( sal_uInt16 n ) { maLBWindow.SetLeftIndent( n ); } 469cdf0e10cSrcweir void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); } 470cdf0e10cSrcweir 471cdf0e10cSrcweir void SetTravelSelect( sal_Bool bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); } 472cdf0e10cSrcweir sal_Bool IsTravelSelect() const { return maLBWindow.IsTravelSelect(); } 473cdf0e10cSrcweir sal_Bool IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); } 474cdf0e10cSrcweir 475cdf0e10cSrcweir void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); } 476cdf0e10cSrcweir sal_Bool IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); } 477cdf0e10cSrcweir 478cdf0e10cSrcweir void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); } 479cdf0e10cSrcweir sal_Bool IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); } 480cdf0e10cSrcweir 481cdf0e10cSrcweir void SetReadOnly( sal_Bool b ) { maLBWindow.SetReadOnly( b ); } 482cdf0e10cSrcweir sal_Bool IsReadOnly() const { return maLBWindow.IsReadOnly(); } 483cdf0e10cSrcweir 484cdf0e10cSrcweir 485cdf0e10cSrcweir Size CalcSize( sal_uInt16 nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); } 486cdf0e10cSrcweir long GetEntryHeight() const { return maLBWindow.GetEntryHeight(); } 487cdf0e10cSrcweir long GetMaxEntryWidth() const { return maLBWindow.GetMaxEntryWidth(); } 488cdf0e10cSrcweir 489cdf0e10cSrcweir void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; } 490cdf0e10cSrcweir const Link& GetScrollHdl() const { return maScrollHdl; } 491cdf0e10cSrcweir void SetSelectHdl( const Link& rLink ) { maLBWindow.SetSelectHdl( rLink ); } 492cdf0e10cSrcweir const Link& GetSelectHdl() const { return maLBWindow.GetSelectHdl(); } 493cdf0e10cSrcweir void SetCancelHdl( const Link& rLink ) { maLBWindow.SetCancelHdl( rLink ); } 494cdf0e10cSrcweir const Link& GetCancelHdl() const { return maLBWindow.GetCancelHdl(); } 495cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink ) { maLBWindow.SetDoubleClickHdl( rLink ); } 496cdf0e10cSrcweir const Link& GetDoubleClickHdl() const { return maLBWindow.GetDoubleClickHdl(); } 497cdf0e10cSrcweir void SetUserDrawHdl( const Link& rLink ) { maLBWindow.SetUserDrawHdl( rLink ); } 498cdf0e10cSrcweir const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); } 499cdf0e10cSrcweir 500cdf0e10cSrcweir void SetSelectionChangedHdl( const Link& rLnk ) { maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); } 501cdf0e10cSrcweir void SetCallSelectionChangedHdl( sal_Bool bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); } 502cdf0e10cSrcweir sal_Bool IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); } 503cdf0e10cSrcweir sal_uInt16 GetSelectModifier() const { return maLBWindow.GetSelectModifier(); } 504cdf0e10cSrcweir 505cdf0e10cSrcweir void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep ); 506cdf0e10cSrcweir XubString GetMRUEntries( xub_Unicode cSep ) const; 507cdf0e10cSrcweir void SetMaxMRUCount( sal_uInt16 n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); } 508cdf0e10cSrcweir sal_uInt16 GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); } 509cdf0e10cSrcweir sal_uInt16 GetDisplayLineCount() const 510cdf0e10cSrcweir { return maLBWindow.GetDisplayLineCount(); } 511cdf0e10cSrcweir 512*a68b38dfSArmin Le Grand bool GetEdgeBlending() const { return mbEdgeBlending; } 513*a68b38dfSArmin Le Grand void SetEdgeBlending(bool bNew); 514*a68b38dfSArmin Le Grand 515*a68b38dfSArmin Le Grand // pb: #106948# explicit mirroring for calc 516cdf0e10cSrcweir inline void EnableMirroring() { maLBWindow.EnableMirroring(); } 517cdf0e10cSrcweir inline void SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; } 518cdf0e10cSrcweir }; 519cdf0e10cSrcweir 520cdf0e10cSrcweir // ----------------------------- 521cdf0e10cSrcweir // - ImplListBoxFloatingWindow - 522cdf0e10cSrcweir // ----------------------------- 523cdf0e10cSrcweir 524cdf0e10cSrcweir class ImplListBoxFloatingWindow : public FloatingWindow 525cdf0e10cSrcweir { 526cdf0e10cSrcweir private: 527cdf0e10cSrcweir ImplListBox* mpImplLB; 528cdf0e10cSrcweir Size maPrefSz; 529cdf0e10cSrcweir sal_uInt16 mnDDLineCount; 530cdf0e10cSrcweir sal_uInt16 mnPopupModeStartSaveSelection; 531cdf0e10cSrcweir sal_Bool mbAutoWidth; 532cdf0e10cSrcweir 533cdf0e10cSrcweir protected: 534cdf0e10cSrcweir long PreNotify( NotifyEvent& rNEvt ); 535cdf0e10cSrcweir 536cdf0e10cSrcweir public: 537cdf0e10cSrcweir ImplListBoxFloatingWindow( Window* pParent ); 538cdf0e10cSrcweir 539cdf0e10cSrcweir void SetImplListBox( ImplListBox* pLB ) { mpImplLB = pLB; } 540cdf0e10cSrcweir 541cdf0e10cSrcweir void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; } 542cdf0e10cSrcweir const Size& GetPrefSize() const { return maPrefSz; } 543cdf0e10cSrcweir 544cdf0e10cSrcweir void SetAutoWidth( sal_Bool b ) { mbAutoWidth = b; } 545cdf0e10cSrcweir sal_Bool IsAutoWidth() const { return mbAutoWidth; } 546cdf0e10cSrcweir 547cdf0e10cSrcweir Size CalcFloatSize(); 548cdf0e10cSrcweir void StartFloat( sal_Bool bStartTracking ); 549cdf0e10cSrcweir 550cdf0e10cSrcweir virtual void SetPosSizePixel( long nX, long nY, 551cdf0e10cSrcweir long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ); 552cdf0e10cSrcweir void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) 553cdf0e10cSrcweir { FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); } 554cdf0e10cSrcweir 555cdf0e10cSrcweir void SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; } 556cdf0e10cSrcweir sal_uInt16 GetDropDownLineCount() const { return mnDDLineCount; } 557cdf0e10cSrcweir 558cdf0e10cSrcweir sal_uInt16 GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; } 559cdf0e10cSrcweir 560cdf0e10cSrcweir virtual void Resize(); 561cdf0e10cSrcweir }; 562cdf0e10cSrcweir 563cdf0e10cSrcweir // ----------- 564cdf0e10cSrcweir // - ImplWin - 565cdf0e10cSrcweir // ----------- 566cdf0e10cSrcweir 567cdf0e10cSrcweir class ImplWin : public Control 568cdf0e10cSrcweir { 569cdf0e10cSrcweir private: 570cdf0e10cSrcweir 571cdf0e10cSrcweir sal_uInt16 mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle. 572cdf0e10cSrcweir XubString maString; 573cdf0e10cSrcweir Image maImage; 574cdf0e10cSrcweir Image maImageHC; 575cdf0e10cSrcweir 576cdf0e10cSrcweir Rectangle maFocusRect; 577cdf0e10cSrcweir Size maUserItemSize; 578cdf0e10cSrcweir 579cdf0e10cSrcweir Link maMBDownHdl; 580cdf0e10cSrcweir Link maUserDrawHdl; 581cdf0e10cSrcweir 582*a68b38dfSArmin Le Grand /// bitfield 583*a68b38dfSArmin Le Grand bool mbUserDrawEnabled : 1; 584*a68b38dfSArmin Le Grand bool mbInUserDraw : 1; 585*a68b38dfSArmin Le Grand bool mbEdgeBlending : 1; 586cdf0e10cSrcweir 587cdf0e10cSrcweir void ImplDraw( bool bLayout = false ); 588cdf0e10cSrcweir protected: 589cdf0e10cSrcweir virtual void FillLayoutData() const; 590cdf0e10cSrcweir public: 591cdf0e10cSrcweir 592cdf0e10cSrcweir ImplWin( Window* pParent, WinBits nWinStyle = 0 ); 593cdf0e10cSrcweir ~ImplWin() {}; 594cdf0e10cSrcweir 595cdf0e10cSrcweir virtual void MouseButtonDown( const MouseEvent& rMEvt ); 596cdf0e10cSrcweir virtual void Paint( const Rectangle& rRect ); 597cdf0e10cSrcweir virtual void Resize(); 598cdf0e10cSrcweir virtual void GetFocus(); 599cdf0e10cSrcweir virtual void LoseFocus(); 600cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt ); 601cdf0e10cSrcweir 602cdf0e10cSrcweir sal_uInt16 GetItemPos() const { return mnItemPos; } 603cdf0e10cSrcweir void SetItemPos( sal_uInt16 n ) { mnItemPos = n; } 604cdf0e10cSrcweir 605cdf0e10cSrcweir const XubString& GetString() const { return maString; } 606cdf0e10cSrcweir void SetString( const XubString& rStr ) { maString = rStr; } 607cdf0e10cSrcweir 608cdf0e10cSrcweir const Image& GetImage() const { return maImage; } 609cdf0e10cSrcweir void SetImage( const Image& rImg ) { maImage = rImg; } 610cdf0e10cSrcweir 611cdf0e10cSrcweir sal_Bool SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL ); 612cdf0e10cSrcweir const Image& GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const; 613cdf0e10cSrcweir 614cdf0e10cSrcweir 615cdf0e10cSrcweir virtual void MBDown(); 616cdf0e10cSrcweir void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; } 617cdf0e10cSrcweir const Link& GetMBDownHdl() const { return maMBDownHdl; } 618cdf0e10cSrcweir 619cdf0e10cSrcweir void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; } 620cdf0e10cSrcweir const Link& GetUserDrawHdl() const { return maUserDrawHdl; } 621cdf0e10cSrcweir 622cdf0e10cSrcweir void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; } 623cdf0e10cSrcweir const Size& GetUserItemSize() const { return maUserItemSize; } 624cdf0e10cSrcweir 625*a68b38dfSArmin Le Grand void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; } 626*a68b38dfSArmin Le Grand bool IsUserDrawEnabled() const { return mbUserDrawEnabled; } 627cdf0e10cSrcweir 628cdf0e10cSrcweir void DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false ); 629*a68b38dfSArmin Le Grand 630*a68b38dfSArmin Le Grand bool GetEdgeBlending() const { return mbEdgeBlending; } 631*a68b38dfSArmin Le Grand void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; } 632cdf0e10cSrcweir }; 633cdf0e10cSrcweir 634cdf0e10cSrcweir // ----------- 635cdf0e10cSrcweir // - ImplBtn - 636cdf0e10cSrcweir // ----------- 637cdf0e10cSrcweir 638cdf0e10cSrcweir class ImplBtn : public PushButton 639cdf0e10cSrcweir { 640cdf0e10cSrcweir private: 641cdf0e10cSrcweir sal_Bool mbDown; 642cdf0e10cSrcweir 643cdf0e10cSrcweir Link maMBDownHdl; 644cdf0e10cSrcweir 645cdf0e10cSrcweir public: 646cdf0e10cSrcweir ImplBtn( Window* pParent, WinBits nWinStyle = 0 ); 647cdf0e10cSrcweir ~ImplBtn() {}; 648cdf0e10cSrcweir 649cdf0e10cSrcweir virtual void MouseButtonDown( const MouseEvent& rMEvt ); 650cdf0e10cSrcweir 651cdf0e10cSrcweir virtual void MBDown(); 652cdf0e10cSrcweir void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; } 653cdf0e10cSrcweir const Link& GetMBDownHdl() const { return maMBDownHdl; } 654cdf0e10cSrcweir }; 655cdf0e10cSrcweir 656cdf0e10cSrcweir 657cdf0e10cSrcweir void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); 658cdf0e10cSrcweir void ImplInitDropDownButton( PushButton* pButton ); 659cdf0e10cSrcweir 660cdf0e10cSrcweir #endif // _SV_ILSTBOX_HXX 661