LibreOffice Module svtools (master) 1
editbrowsebox.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21
22#include <tools/debug.hxx>
23#include <vcl/image.hxx>
24#include <vcl/settings.hxx>
25#include <vcl/window.hxx>
26#include <vcl/svapp.hxx>
27
28#include <bitmaps.hlst>
29
30#include <algorithm>
31#include "editbrowseboximpl.hxx"
32#include <com/sun/star/accessibility/AccessibleEventId.hpp>
33
34
35namespace svt
36{
37
38 namespace
39 {
40
41 GetFocusFlags getRealGetFocusFlags( vcl::Window* _pWindow )
42 {
43 GetFocusFlags nFlags = GetFocusFlags::NONE;
44 while ( _pWindow && nFlags == GetFocusFlags::NONE )
45 {
46 nFlags = _pWindow->GetGetFocusFlags( );
47 _pWindow = _pWindow->GetParent();
48 }
49 return nFlags;
50 }
51 }
52
53 using namespace ::com::sun::star::uno;
54 using namespace com::sun::star::accessibility::AccessibleEventId;
55
56
58 {
59 }
60
61 //= EditBrowserHeader
62
64 {
65 sal_uInt16 nColId = GetCurItemId();
66 if (nColId)
67 {
68 sal_uInt32 nAutoWidth = static_cast<EditBrowseBox*>(GetParent())->GetAutoColumnWidth(nColId);
69 if (nAutoWidth != static_cast<EditBrowseBox*>(GetParent())->GetColumnWidth(nColId))
70 {
71 static_cast<EditBrowseBox*>(GetParent())->SetColumnWidth(nColId, nAutoWidth);
72 static_cast<EditBrowseBox*>(GetParent())->ColumnResized(nColId);
73 }
74 }
75 }
76
77 //= EditBrowseBox
78
80 {
81 pEvent.reset();
82 }
83
85 {
86 if (pEvt == pEvent.get())
87 {
88 bDown = bIsDown;
89 return;
90 }
91 pEvent.reset();
92 if (pEvt)
93 {
94 pEvent.reset(new BrowserMouseEvent(pEvt->GetWindow(),
95 *pEvt,
96 pEvt->GetRow(),
97 pEvt->GetColumn(),
98 pEvt->GetColumnId(),
99 pEvt->GetRect()));
100 bDown = bIsDown;
101 }
102 }
103
105 :BrowseBox( pParent, nBits, _nMode )
106 ,nStartEvent(nullptr)
107 ,nEndEvent(nullptr)
108 ,nCellModifiedEvent(nullptr)
109 ,m_pFocusWhileRequest(nullptr)
110 ,nPaintRow(-1)
111 ,nEditRow(-1)
112 ,nEditCol(0)
113 ,bHasFocus(false)
114 ,bPaintStatus(true)
115 ,bActiveBeforeTracking( false )
116 ,m_nBrowserFlags(nBrowserFlags)
117 ,pHeader(nullptr)
118 {
119 m_aImpl.reset(new EditBrowseBoxImpl);
120
121 SetCompoundControl(true);
122
123 ImplInitSettings(true, true, true);
124
126 pCheckBoxPaint->SetPaintTransparent( true );
127 pCheckBoxPaint->SetBackground();
128 }
129
131 {
132 // late construction
133 }
134
136 {
137 disposeOnce();
138 }
139
141 {
142 if (nStartEvent)
144 if (nEndEvent)
148
149 pCheckBoxPaint.disposeAndClear();
151 pHeader.clear();
153 }
154
155
157 {
159 nEditRow = nPaintRow = -1;
160 nEditCol = 0;
161 }
162
164 {
165 pHeader = imp_CreateHeaderBar(pParent);
166 if (!IsUpdateMode())
167 pHeader->SetUpdateMode(false);
168 return pHeader;
169 }
170
172 {
173 return VclPtr<EditBrowserHeader>::Create(pParent);
174 }
175
177 {
180 }
181
183 {
185
186 // This should handle the case that the BrowseBox (or one of its children)
187 // gets the focus from outside by pressing Tab
188 if (IsEditing() && Controller()->GetWindow().IsVisible())
189 Controller()->GetWindow().GrabFocus();
190
191 DetermineFocus(getRealGetFocusFlags(this));
192 }
193
194 bool EditBrowseBox::SeekRow(sal_Int32 nRow)
195 {
196 nPaintRow = nRow;
197 return true;
198 }
199
200 IMPL_LINK_NOARG(EditBrowseBox, StartEditHdl, void*, void)
201 {
202 nStartEvent = nullptr;
203 if (IsEditing())
204 {
205 EnableAndShow();
206 if (!ControlHasFocus() && (m_pFocusWhileRequest.get() == Application::GetFocusWindow()))
207 aController->GetWindow().GrabFocus();
208 }
209 }
210
212 sal_uInt16 nColumnId ) const
213 {
214 if (nColumnId == HandleColumnId)
215 {
216 if (bPaintStatus)
217 PaintStatusCell(rDev, rRect);
218 }
219 else
220 {
221 // don't paint the current cell
222 if (rDev.GetOwnerWindow() == &GetDataWindow())
223 // but only if we're painting onto our data win (which is the usual painting)
224 if (nPaintRow == nEditRow)
225 {
226 if (IsEditing() && nEditCol == nColumnId && aController->GetWindow().IsVisible())
227 return;
228 }
229 PaintCell(rDev, rRect, nColumnId);
230 }
231 }
232
234 {
235 BitmapEx aBitmap;
236 bool bNeedMirror = IsRTLEnabled();
237 switch (eStatus)
238 {
239 case CURRENT:
240 aBitmap = BitmapEx(BMP_CURRENT);
241 break;
242 case CURRENTNEW:
243 aBitmap = BitmapEx(BMP_CURRENTNEW);
244 break;
245 case MODIFIED:
246 aBitmap = BitmapEx(BMP_MODIFIED);
247 bNeedMirror = false; // the pen is not mirrored
248 break;
249 case NEW:
250 aBitmap = BitmapEx(BMP_NEW);
251 break;
252 case DELETED:
253 aBitmap = BitmapEx(BMP_DELETED);
254 break;
255 case PRIMARYKEY:
256 aBitmap = BitmapEx(BMP_PRIMARYKEY);
257 break;
259 aBitmap = BitmapEx(BMP_CURRENT_PRIMARYKEY);
260 break;
261 case FILTER:
262 aBitmap = BitmapEx(BMP_FILTER);
263 break;
264 case HEADERFOOTER:
265 aBitmap = BitmapEx(BMP_HEADERFOOTER);
266 break;
267 case CLEAN:
268 break;
269 }
270 if ( bNeedMirror )
271 {
272 aBitmap.Mirror( BmpMirrorFlags::Horizontal );
273 }
274 return Image(aBitmap);
275 }
276
278 {
279 if (nPaintRow < 0)
280 return;
281
282 RowStatus eStatus = GetRowStatus( nPaintRow );
283 EditBrowseBoxFlags nBrowserFlags = GetBrowserFlags();
284
286 return;
287
288 // draw the text of the header column
289 if (nBrowserFlags & EditBrowseBoxFlags::HANDLE_COLUMN_TEXT )
290 {
291 rDev.DrawText( rRect, GetCellText( nPaintRow, 0 ),
292 DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::Clip );
293 }
294 // draw an image
295 else if (eStatus != CLEAN && rDev.GetOutDevType() == OUTDEV_WINDOW)
296 {
297 Image aImage(GetImage(eStatus));
298 // calc the image position
299 Size aImageSize(aImage.GetSizePixel());
300 aImageSize.setWidth( CalcZoom(aImageSize.Width()) );
301 aImageSize.setHeight( CalcZoom(aImageSize.Height()) );
302 Point aPos( rRect.TopLeft() );
303
304 if ( ( aImageSize.Width() > rRect.GetWidth() ) || ( aImageSize.Height() > rRect.GetHeight() ) )
305 rDev.SetClipRegion(vcl::Region(rRect));
306
307 if ( aImageSize.Width() < rRect.GetWidth() )
308 aPos.AdjustX(( rRect.GetWidth() - aImageSize.Width() ) / 2 );
309
310 if ( aImageSize.Height() < rRect.GetHeight() )
311 aPos.AdjustY(( rRect.GetHeight() - aImageSize.Height() ) / 2 );
312
313 if ( IsZoom() )
314 rDev.DrawImage( aPos, aImageSize, aImage );
315 else
316 rDev.DrawImage( aPos, aImage );
317
318 if (rDev.IsClipRegion())
319 rDev.SetClipRegion();
320 }
321 }
322
323
325 {
328 {
331 }
332
334 }
335
336
338 {
340 ActivateCell();
341 bActiveBeforeTracking = false;
342
344 }
345
346
348 {
349 if ( IsEditing() )
350 {
351 tools::Rectangle aRect( GetCellRect( nEditRow, nEditCol, false ) );
352 CellControllerRef aCellController( Controller() );
353 ResizeController( aCellController, aRect );
354 aCellController->GetWindow().GrabFocus();
355 }
356
358 }
359
360
362 {
363 return CLEAN;
364 }
365
366
368 {
369 sal_uInt16 nCode = rEvt.GetKeyCode().GetCode();
370 bool bShift = rEvt.GetKeyCode().IsShift();
371 bool bCtrl = rEvt.GetKeyCode().IsMod1();
372
373 switch (nCode)
374 {
375 case KEY_RETURN:
376 if (!bCtrl && !bShift && IsTabAllowed(true))
377 {
379 }
380 else
382 return;
383 case KEY_TAB:
384 if (!bCtrl && !bShift)
385 {
386 if (IsTabAllowed(true))
388 else
389 // do NOT call BrowseBox::KeyInput : this would handle the tab, but we already now
390 // that tab isn't allowed here. So give the Control class a chance
391 Control::KeyInput(rEvt);
392 return;
393 }
394 else if (!bCtrl && bShift)
395 {
396 if (IsTabAllowed(false))
398 else
399 // do NOT call BrowseBox::KeyInput : this would handle the tab, but we already now
400 // that tab isn't allowed here. So give the Control class a chance
401 Control::KeyInput(rEvt);
402 return;
403 }
404 [[fallthrough]];
405 default:
407 }
408 }
409
411 {
412 DetermineFocus(getRealGetFocusFlags(this));
413 }
414
416 {
418 }
419
421 {
422 // absorb double clicks
423 if (rEvt.GetClicks() > 1 && rEvt.GetRow() >= 0)
424 return;
425
426 // we are about to leave the current cell. If there is a "this cell has been modified" notification
427 // pending (asynchronously), this may be deadly -> do it synchronously
428 if ( nCellModifiedEvent )
429 {
431 nCellModifiedEvent = nullptr;
432 LINK( this, EditBrowseBox, CellModifiedHdl ).Call( nullptr );
433 }
434
435 if (rEvt.GetColumnId() == HandleColumnId)
436 { // it was the handle column. save the current cell content if necessary
437 // (clicking on the handle column results in selecting the current row)
438 if (IsEditing() && aController->IsValueChangedFromSaved())
439 SaveModified();
440 }
441
442 aMouseEvent.Set(&rEvt,true);
445
447 {
448 // the base class does not travel upon MouseButtonDown, but implActivateCellOnMouseEvent assumes we traveled ...
449 GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() );
450 if (rEvt.GetRow() >= 0)
451 implActivateCellOnMouseEvent(rEvt, false);
452 }
453 }
454
456 {
457 // absorb double clicks
458 if (rEvt.GetClicks() > 1 && rEvt.GetRow() >= 0)
459 return;
460
461 aMouseEvent.Set(&rEvt,false);
464
466 if (rEvt.GetRow() >= 0)
468 }
469
471 {
472 Window* pControlWindow = aController ? &aController->GetWindow() : nullptr;
473 if (ControlBase* pControlBase = dynamic_cast<ControlBase*>(pControlWindow))
474 return pControlBase->ControlHasFocus();
475 return pControlWindow && pControlWindow->HasChildPathFocus();
476 }
477
479 {
480 if (!IsEditing())
481 ActivateCell();
482 else if (IsEditing() && !aController->GetWindow().IsEnabled())
484 else if (IsEditing() && !ControlHasFocus())
486
487 if (!IsEditing() || !aController->GetWindow().IsEnabled())
488 return;
489
490 // forwards the event to the control
491 aController->ActivatingMouseEvent(_rEvt, _bUp);
492 }
493
494 void EditBrowseBox::Dispatch( sal_uInt16 _nId )
495 {
496 if ( _nId == BROWSER_ENHANCESELECTION )
497 { // this is a workaround for the bug in the base class:
498 // if the row selection is to be extended (which is what BROWSER_ENHANCESELECTION tells us)
499 // then the base class does not revert any column selections, while, for doing a "simple"
500 // selection (BROWSER_SELECT), it does. In fact, it does not only revert the col selection then,
501 // but also any current row selections.
502 // This clearly tells me that the both ids are for row selection only - there this behaviour does
503 // make sense.
504 // But here, where we have column selection, too, we take care of this ourself.
505 if ( GetSelectColumnCount( ) )
506 {
507 while ( GetSelectColumnCount( ) )
509 sal::static_int_cast< sal_uInt16 >(FirstSelectedColumn()),
510 false );
511 Select();
512 }
513 }
514 BrowseBox::Dispatch( _nId );
515 }
516
517 bool EditBrowseBox::ProcessKey(const KeyEvent& rKeyEvent)
518 {
519 sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode();
520 bool bShift = rKeyEvent.GetKeyCode().IsShift();
521 bool bCtrl = rKeyEvent.GetKeyCode().IsMod1();
522 bool bAlt = rKeyEvent.GetKeyCode().IsMod2();
523 bool bLocalSelect = false;
524 bool bNonEditOnly = false;
525 sal_uInt16 nId = BROWSER_NONE;
526
527 if (!bAlt && !bCtrl && !bShift )
528 switch ( nCode )
529 {
530 case KEY_DOWN: nId = BROWSER_CURSORDOWN; break;
531 case KEY_UP: nId = BROWSER_CURSORUP; break;
533 case KEY_PAGEUP: nId = BROWSER_CURSORPAGEUP; break;
534 case KEY_HOME: nId = BROWSER_CURSORHOME; break;
535 case KEY_END: nId = BROWSER_CURSOREND; break;
536
537 case KEY_TAB:
538 // ask if traveling to the next cell is allowed
539 if (IsTabAllowed(true))
541 break;
542
543 case KEY_RETURN:
544 // save the cell content (if necessary)
545 if (IsEditing() && aController->IsValueChangedFromSaved() && !SaveModified())
546 {
547 // maybe we're not visible ...
549 aController->GetWindow().GrabFocus();
550 return true;
551 }
552 // ask if traveling to the next cell is allowed
553 if (IsTabAllowed(true))
555
556 break;
557 case KEY_RIGHT: nId = BROWSER_CURSORRIGHT; break;
558 case KEY_LEFT: nId = BROWSER_CURSORLEFT; break;
559 case KEY_SPACE: nId = BROWSER_SELECT; bNonEditOnly = bLocalSelect = true; break;
560 }
561
562 if ( !bAlt && !bCtrl && bShift )
563 switch ( nCode )
564 {
565 case KEY_DOWN: nId = BROWSER_SELECTDOWN; bLocalSelect = true; break;
566 case KEY_UP: nId = BROWSER_SELECTUP; bLocalSelect = true; break;
567 case KEY_HOME: nId = BROWSER_SELECTHOME; bLocalSelect = true; break;
568 case KEY_END: nId = BROWSER_SELECTEND; bLocalSelect = true; break;
569 case KEY_TAB:
570 if (IsTabAllowed(false))
572 break;
573 }
574
575 if ( !bAlt && bCtrl && bShift )
576 switch ( nCode )
577 {
578 case KEY_SPACE: nId = BROWSER_SELECTCOLUMN; bLocalSelect = true; break;
579 }
580
581
582 if ( !bAlt && bCtrl && !bShift )
583 switch ( nCode )
584 {
585 case KEY_DOWN: nId = BROWSER_SCROLLUP; break;
586 case KEY_UP: nId = BROWSER_SCROLLDOWN; break;
591 case KEY_SPACE: nId = BROWSER_ENHANCESELECTION; bLocalSelect = true; break;
592 }
593
594
595 if ( ( nId != BROWSER_NONE )
596 && ( !IsEditing()
597 || ( !bNonEditOnly
598 && aController->MoveAllowed(rKeyEvent)
599 )
600 )
601 )
602 {
604 {
605 // save the cell content (if necessary)
606 if (IsEditing() && aController->IsValueChangedFromSaved() && !SaveModified())
607 {
608 // maybe we're not visible ...
610 aController->GetWindow().GrabFocus();
611 return true;
612 }
613 }
614
615 Dispatch(nId);
616
617 if (bLocalSelect && (GetSelectRowCount() || GetSelection() != nullptr))
619 return true;
620 }
621 return false;
622 }
623
625 {
626 if (rEvt.GetType() == NotifyEventType::KEYINPUT)
627 {
628 if ( (IsEditing() && ControlHasFocus())
629 || rEvt.GetWindow() == &GetDataWindow()
630 || (!IsEditing() && HasChildPathFocus())
631 )
632 {
633 if (ProcessKey(*rEvt.GetKeyEvent()))
634 return true;
635 }
636 }
637 return BrowseBox::PreNotify(rEvt);
638 }
639
641 {
642 return true;
643 }
644
645
647 {
648 switch (rEvt.GetType())
649 {
650 case NotifyEventType::GETFOCUS:
651 DetermineFocus(getRealGetFocusFlags(this));
652 break;
653
654 case NotifyEventType::LOSEFOCUS:
656 break;
657
658 default:
659 break;
660 }
661 return BrowseBox::EventNotify(rEvt);
662 }
663
664
666 {
668
669 bool bNeedCellReActivation = false;
670 if ( nType == StateChangedType::Mirroring )
671 {
672 bNeedCellReActivation = true;
673 }
674 else if ( nType == StateChangedType::Zoom )
675 {
676 ImplInitSettings( true, false, false );
677 bNeedCellReActivation = true;
678 }
679 else if ( nType == StateChangedType::ControlFont )
680 {
681 ImplInitSettings( true, false, false );
682 Invalidate();
683 }
684 else if ( nType == StateChangedType::ControlForeground )
685 {
686 ImplInitSettings( false, true, false );
687 Invalidate();
688 }
689 else if ( nType == StateChangedType::ControlBackground )
690 {
691 ImplInitSettings( false, false, true );
692 Invalidate();
693 }
694 else if (nType == StateChangedType::Style)
695 {
696 WinBits nStyle = GetStyle();
697 if (!(nStyle & WB_NOTABSTOP) )
698 nStyle |= WB_TABSTOP;
699
700 SetStyle(nStyle);
701 }
702 if ( bNeedCellReActivation )
703 {
704 if ( IsEditing() )
705 {
707 ActivateCell();
708 }
709 }
710 }
711
712
714 {
715 BrowseBox::DataChanged( rDCEvt );
716
717 if ((( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) ||
718 ( rDCEvt.GetType() == DataChangedEventType::DISPLAY )) &&
719 ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ))
720 {
721 ImplInitSettings( true, true, true );
722 Invalidate();
723 }
724 }
725
726 void EditBrowseBox::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
727 {
728 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
729
730 if (bFont)
731 {
732 vcl::Font aFont = rStyleSettings.GetFieldFont();
733 if (IsControlFont())
734 {
736 aFont.Merge(GetControlFont());
737 }
738 else
740
742 }
743
744 if (bFont || bForeground)
745 {
746 Color aTextColor = rStyleSettings.GetFieldTextColor();
748 {
749 aTextColor = GetControlForeground();
751 }
752 else
754
755 GetDataWindow().SetTextColor( aTextColor );
756 }
757
758 if (!bBackground) // FIXME: Outside of Paint Hierarchy
759 return;
760
762 {
766 }
767 else
768 {
770 GetDataWindow().SetBackground(rStyleSettings.GetFieldColor());
771 GetDataWindow().GetOutDev()->SetFillColor(rStyleSettings.GetFieldColor());
772 }
773 }
774
775
776 bool EditBrowseBox::IsCursorMoveAllowed(sal_Int32 nNewRow, sal_uInt16 nNewColId) const
777 {
778 sal_uInt16 nInfo = 0;
779
781 nInfo |= COLSELECT;
782 if ((GetSelection() != nullptr && GetSelectRowCount()) ||
784 nInfo |= ROWSELECT;
785 if (!nInfo && nNewRow != nEditRow)
786 nInfo |= ROWCHANGE;
787 if (!nInfo && nNewColId != nEditCol)
788 nInfo |= COLCHANGE;
789
790 if (nInfo == 0) // nothing happened
791 return true;
792
793 // save the cell content
794 if (IsEditing() && aController->IsValueChangedFromSaved() && !const_cast<EditBrowseBox *>(this)->SaveModified())
795 {
796 // maybe we're not visible ...
798 aController->GetWindow().GrabFocus();
799 return false;
800 }
801
802 EditBrowseBox * pTHIS = const_cast<EditBrowseBox *> (this);
803
804 // save the cell content if
805 // a) a selection is being made
806 // b) the row is changing
807 if (IsModified() && (nInfo & (ROWCHANGE | COLSELECT | ROWSELECT)) &&
808 !pTHIS->SaveRow())
809 {
810 if (nInfo & COLSELECT ||
811 nInfo & ROWSELECT)
812 {
813 // cancel selected
814 pTHIS->SetNoSelection();
815 }
816
817 if (IsEditing())
818 {
819 if (!Controller()->GetWindow().IsVisible())
820 {
822 }
823 aController->GetWindow().GrabFocus();
824 }
825 return false;
826 }
827
828 if (nNewRow != nEditRow)
829 {
830 vcl::Window& rWindow = GetDataWindow();
832 {
833 tools::Rectangle aRect = GetFieldRectPixel(nEditRow, 0, false );
834 // status cell should be painted if and only if text is displayed
836 rWindow.Invalidate(aRect);
837 pTHIS->bPaintStatus = true;
838 }
839
840 // don't paint during row change
841 rWindow.EnablePaint(false);
842
843 // the last veto chance for derived classes
844 if (!pTHIS->CursorMoving(nNewRow, nNewColId))
845 {
847 rWindow.EnablePaint(true);
848 return false;
849 }
850 else
851 {
852 rWindow.EnablePaint(true);
853 return true;
854 }
855 }
856 else
857 return pTHIS->CursorMoving(nNewRow, nNewColId);
858 }
859
860
861 void EditBrowseBox::ColumnMoved(sal_uInt16 nId)
862 {
864 if (IsEditing())
865 {
867 CellControllerRef aControllerRef = Controller();
868 ResizeController(aControllerRef, aRect);
869 Controller()->GetWindow().GrabFocus();
870 }
871 }
872
873
875 {
876 return true;
877 }
878
879
880 bool EditBrowseBox::CursorMoving(sal_Int32, sal_uInt16)
881 {
882 DeactivateCell(false);
883 return true;
884 }
885
886
888 {
889 sal_Int32 nNewRow = GetCurRow();
890 if (nEditRow != nNewRow)
891 {
893 InvalidateStatusCell(nNewRow);
894 nEditRow = nNewRow;
895 }
896 ActivateCell();
898 // should not be called here because the descant event is not needed here
899 //BrowseBox::CursorMoved();
900 }
901
902
904 {
905 if (IsEditing())
906 {
910 }
912 }
913
914
915 void EditBrowseBox::ActivateCell(sal_Int32 nRow, sal_uInt16 nCol, bool bCellFocus)
916 {
917 if (IsEditing())
918 return;
919
920 nEditCol = nCol;
921
922 if ((GetSelectRowCount() && GetSelection() != nullptr) || GetSelectColumnCount() ||
923 (aMouseEvent.Is() && (aMouseEvent.IsDown() || aMouseEvent->GetClicks() > 1))) // nothing happens on MouseDown
924 {
925 return;
926 }
927
928 if (nEditRow < 0 || nEditCol <= HandleColumnId)
929 return;
930
931 aController = GetController(nRow, nCol);
932 if (aController.is())
933 {
936
938
939 aController->SaveValue();
940 aController->SetModifyHdl(LINK(this,EditBrowseBox,ModifyHdl));
942
943 if ( isAccessibleAlive() )
945
946 // activate the cell only of the browser has the focus
947 if ( bHasFocus && bCellFocus )
949 }
950 else
951 {
952 // no controller -> we have a new "active descendant"
953 if ( isAccessibleAlive() && HasFocus() )
954 {
957 Any( CreateAccessibleCell( nRow, GetColumnPos( nCol -1) ) ),
958 Any()
959 );
960 }
961 }
962 }
963
964
966 {
967 if (!IsEditing())
968 return;
969
970 if ( isAccessibleAlive() )
971 {
972 commitBrowseBoxEvent( CHILD, Any(), Any( m_aImpl->m_xActiveCell ) );
973 m_aImpl->clearActiveCell();
974 }
975
978
979 // reset the modify handler
981
982 if (bHasFocus)
983 GrabFocus(); // ensure that we have (and keep) the focus
984
985 aOldController->suspend();
986
987 // update if requested
988 if (bUpdate)
990
991 // release the controller (asynchronously)
992 if (nEndEvent)
994 nEndEvent = Application::PostUserEvent(LINK(this,EditBrowseBox,EndEditHdl), nullptr, true);
995 }
996
997
998 tools::Rectangle EditBrowseBox::GetCellRect(sal_Int32 nRow, sal_uInt16 nColId, bool bRel) const
999 {
1000 tools::Rectangle aRect( GetFieldRectPixel(nRow, nColId, bRel));
1002 {
1003 aRect.AdjustTop(1 );
1004 aRect.AdjustBottom( -1 );
1005 }
1006 return aRect;
1007 }
1008
1009
1010 IMPL_LINK_NOARG(EditBrowseBox, EndEditHdl, void*, void)
1011 {
1012 nEndEvent = nullptr;
1013
1014 aOldController = CellControllerRef();
1015 }
1016
1017
1019 {
1020 if (nCellModifiedEvent)
1021 Application::RemoveUserEvent(nCellModifiedEvent);
1022 nCellModifiedEvent = Application::PostUserEvent(LINK(this,EditBrowseBox,CellModifiedHdl), nullptr, true);
1023 }
1024
1025
1026 IMPL_LINK_NOARG(EditBrowseBox, CellModifiedHdl, void*, void)
1027 {
1028 nCellModifiedEvent = nullptr;
1029 CellModified();
1030 }
1031
1033 {
1034 if (IsEditing())
1035 {
1037 CellControllerRef aControllerRef = Controller();
1038 ResizeController(aControllerRef, aRect);
1039 // don't grab focus if Field Properties panel is being
1040 // resized by split pane drag resizing
1042 return;
1043 Controller()->GetWindow().GrabFocus();
1044 }
1045 }
1046
1047 sal_uInt16 EditBrowseBox::AppendColumn(const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos, sal_uInt16 nId)
1048 {
1049 if (nId == BROWSER_INVALIDID)
1050 {
1051 // look for the next free id
1052 for (nId = ColCount(); nId > 0 && GetColumnPos(nId) != BROWSER_INVALIDID; nId--)
1053 ;
1054
1055 if (!nId)
1056 {
1057 // if there is no handle column
1058 // increment the id
1059 if ( ColCount() == 0 || GetColumnId(0) != HandleColumnId )
1060 nId = ColCount() + 1;
1061 }
1062 }
1063
1064 DBG_ASSERT(nId, "EditBrowseBox::AppendColumn: invalid id!");
1065
1066 tools::Long w = nWidth;
1067 if (!w)
1068 w = GetDefaultColumnWidth(rName);
1069
1070 InsertDataColumn(nId, rName, w, (HeaderBarItemBits::CENTER | HeaderBarItemBits::CLICKABLE), nPos);
1071 return nId;
1072 }
1073
1075 {
1077
1078 // if the window is smaller than "title line height" + "control area",
1079 // do nothing
1080 if (GetOutputSizePixel().Height() <
1081 (GetControlArea().GetHeight() + GetDataWindow().GetPosPixel().Y()))
1082 return;
1083
1084 // the size of the control area
1085 Point aPoint(GetControlArea().TopLeft());
1086 sal_uInt16 nX = static_cast<sal_uInt16>(aPoint.X());
1087
1088 ArrangeControls(nX, static_cast<sal_uInt16>(aPoint.Y()));
1089
1090 if (!nX)
1091 nX = USHRT_MAX;
1092
1093 bool bChanged = ReserveControlArea(nX);
1094
1095 //tdf#97731 if the reserved area changed size, give the controls a
1096 //chance to adapt to the new size
1097 if (bChanged)
1098 {
1099 nX = static_cast<sal_uInt16>(aPoint.X());
1100 ArrangeControls(nX, static_cast<sal_uInt16>(aPoint.Y()));
1101 }
1102 }
1103
1104 void EditBrowseBox::ArrangeControls(sal_uInt16&, sal_uInt16)
1105 {
1106 }
1107
1109 {
1110 return nullptr;
1111 }
1112
1114 {
1115 Point aPoint(rRect.TopLeft());
1116 Size aSize(rRect.GetSize());
1117 Control& rControl = rController->GetWindow();
1118 auto nMinHeight = rControl.get_preferred_size().Height();
1119 if (nMinHeight > aSize.Height())
1120 {
1121 auto nOffset = (nMinHeight - aSize.Height()) / 2;
1122 aPoint.AdjustY(-nOffset);
1123 aSize.setHeight(nMinHeight);
1124 }
1125 rControl.SetPosSizePixel(aPoint, aSize);
1126 }
1127
1129 {
1130 }
1131
1132
1134 {
1135 }
1136
1137
1139 {
1140 return true;
1141 }
1142
1143
1145 {
1146 // when double clicking on the column, the optimum size will be calculated
1147 sal_uInt16 nColId = rEvt.GetColumnId();
1148 if (nColId != HandleColumnId)
1149 SetColumnWidth(nColId, GetAutoColumnWidth(nColId));
1150 }
1151
1152
1153 sal_uInt32 EditBrowseBox::GetAutoColumnWidth(sal_uInt16 nColId)
1154 {
1155 sal_uInt32 nCurColWidth = GetColumnWidth(nColId);
1156 sal_uInt32 nMinColWidth = CalcZoom(20); // minimum
1157 sal_uInt32 nNewColWidth = nMinColWidth;
1158 sal_Int32 nMaxRows = std::min(sal_Int32(GetVisibleRows()), GetRowCount());
1159 sal_Int32 nLastVisRow = GetTopRow() + nMaxRows - 1;
1160
1161 if (GetTopRow() <= nLastVisRow) // calc the column with using the cell contents
1162 {
1163 for (tools::Long i = GetTopRow(); i <= nLastVisRow; ++i)
1164 nNewColWidth = std::max(nNewColWidth,GetTotalCellWidth(i,nColId) + 12);
1165
1166 if (nNewColWidth == nCurColWidth) // size has not changed
1167 nNewColWidth = GetDefaultColumnWidth(GetColumnTitle(nColId));
1168 }
1169 else
1170 nNewColWidth = GetDefaultColumnWidth(GetColumnTitle(nColId));
1171 return nNewColWidth;
1172 }
1173
1174 sal_uInt32 EditBrowseBox::GetTotalCellWidth(sal_Int32, sal_uInt16)
1175 {
1176 return 0;
1177 }
1178
1180 {
1181 tools::Rectangle aHdlFieldRect( GetFieldRectPixel( 0, 0 ));
1182 tools::Rectangle aInvalidRect( Point(0,0), GetOutputSizePixel() );
1183 aInvalidRect.SetRight( aHdlFieldRect.Right() );
1184 Invalidate( aInvalidRect );
1185 }
1186
1187 void EditBrowseBox::PaintTristate(const tools::Rectangle& rRect, const TriState& eState, bool _bEnabled) const
1188 {
1189 pCheckBoxPaint->SetState(eState);
1190
1191 pCheckBoxPaint->GetBox().set_sensitive(_bEnabled);
1192
1193 Size aBoxSize = pCheckBoxPaint->GetBox().get_preferred_size();
1194 tools::Rectangle aRect(Point(rRect.Left() + ((rRect.GetWidth() - aBoxSize.Width()) / 2),
1195 rRect.Top() + ((rRect.GetHeight() - aBoxSize.Height()) / 2)),
1196 aBoxSize);
1197 pCheckBoxPaint->SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
1198
1199 pCheckBoxPaint->Draw(GetDataWindow().GetOutDev(), aRect.TopLeft(), SystemTextColorFlags::NONE);
1200 }
1201
1203 {
1204 if (nStartEvent)
1206
1208 nStartEvent = Application::PostUserEvent(LINK(this,EditBrowseBox,StartEditHdl), nullptr, true);
1209 }
1210
1211
1213 {
1214 if (m_nBrowserFlags == nFlags)
1215 return;
1216
1217 bool RowPicturesChanges = ((m_nBrowserFlags & EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT) !=
1219 m_nBrowserFlags = nFlags;
1220
1221 if (RowPicturesChanges)
1223 }
1224
1226 {
1227 Controller()->resume();
1228 }
1229
1231 : pWindow(pW)
1232 , bSuspended( true )
1233 {
1234
1235 DBG_ASSERT(pWindow, "CellController::CellController: missing the window!");
1236 DBG_ASSERT(!pWindow->IsVisible(), "CellController::CellController: window should not be visible!");
1237 }
1238
1240 {
1241 }
1242
1244 {
1245 DBG_ASSERT( bSuspended == !GetWindow().IsVisible(), "CellController::suspend: inconsistence!" );
1246 if ( !isSuspended( ) )
1247 {
1249 GetWindow().Hide( );
1250 GetWindow().Disable( );
1251 bSuspended = true;
1252 }
1253 }
1254
1256 {
1257 DBG_ASSERT( bSuspended == !GetWindow().IsVisible(), "CellController::resume: inconsistence!" );
1258 if ( isSuspended( ) )
1259 {
1260 GetWindow().Enable( );
1261 GetWindow().Show( );
1262 bSuspended = false;
1263 }
1264 }
1265
1267 {
1268 // nothing to do in this base class
1269 }
1270
1272 {
1273 // nothing to do in this base class
1274 }
1275
1277 {
1278 return true;
1279 }
1280
1281} // namespace svt
1282
1283
1284/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BROWSER_CURSORDOWN
Definition: brwbox.hxx:97
#define BROWSER_SELECTDOWN
Definition: brwbox.hxx:95
#define BROWSER_SCROLLDOWN
Definition: brwbox.hxx:109
#define BROWSER_SELECT
Definition: brwbox.hxx:93
#define BROWSER_CURSORLEFT
Definition: brwbox.hxx:99
#define BROWSER_CURSORHOME
Definition: brwbox.hxx:107
#define BROWSER_CURSOREND
Definition: brwbox.hxx:108
#define BROWSER_SCROLLUP
Definition: brwbox.hxx:110
#define BROWSER_SELECTEND
Definition: brwbox.hxx:112
#define BROWSER_SELECTUP
Definition: brwbox.hxx:96
#define BROWSER_SELECTHOME
Definition: brwbox.hxx:111
#define BROWSER_INVALIDID
Definition: brwbox.hxx:55
#define BROWSER_CURSORENDOFSCREEN
Definition: brwbox.hxx:105
BrowserMode
Definition: brwbox.hxx:59
#define BROWSER_ENHANCESELECTION
Definition: brwbox.hxx:94
#define BROWSER_CURSORENDOFFILE
Definition: brwbox.hxx:103
#define BROWSER_CURSORPAGEUP
Definition: brwbox.hxx:102
#define BROWSER_CURSORTOPOFSCREEN
Definition: brwbox.hxx:106
#define BROWSER_CURSORPAGEDOWN
Definition: brwbox.hxx:101
#define BROWSER_NONE
Definition: brwbox.hxx:92
#define BROWSER_CURSORRIGHT
Definition: brwbox.hxx:100
#define BROWSER_CURSORTOPOFFILE
Definition: brwbox.hxx:104
#define BROWSER_SELECTCOLUMN
Definition: brwbox.hxx:113
#define BROWSER_CURSORUP
Definition: brwbox.hxx:98
const StyleSettings & GetStyleSettings() const
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
static bool IsUICaptured()
static vcl::Window * GetFocusWindow()
bool Mirror(BmpMirrorFlags nMirrorFlags)
sal_uInt16 GetVisibleRows() const
Definition: brwbox1.cxx:2390
sal_uInt16 GetColumnId(sal_uInt16 nPos) const
Definition: brwbox2.cxx:379
virtual void GetFocus() override
Definition: brwbox1.cxx:2370
tools::Rectangle GetControlArea() const
Definition: brwbox1.cxx:2135
virtual void dispose() override
Definition: brwbox1.cxx:194
void Clear()
Definition: brwbox1.cxx:1090
virtual void MouseButtonDown(const MouseEvent &rEvt) override
Definition: brwbox2.cxx:1322
BrowserDataWin & GetDataWindow() const
Definition: brwbox1.cxx:2395
void InsertDataColumn(sal_uInt16 nItemId, const OUString &rText, tools::Long nSize, HeaderBarItemBits nBits=HeaderBarItemBits::STDSTYLE, sal_uInt16 nPos=HEADERBAR_APPEND)
Definition: brwbox1.cxx:308
sal_Int32 FirstSelectedColumn() const
Definition: brwbox1.cxx:1871
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 nRow, sal_uInt16 nColumnPos) override
Creates the accessible object of a data table cell.
Definition: brwbox3.cxx:110
sal_Int32 GetCurRow() const
Definition: brwbox.hxx:544
sal_uInt16 GetSelectColumnCount() const
Definition: brwbox1.cxx:1862
virtual void ImplStartTracking()
Definition: brwbox2.cxx:193
virtual void StateChanged(StateChangedType nStateChange) override
Definition: brwbox2.cxx:102
virtual void GrabFocus() override
Definition: brwbox3.cxx:544
const MultiSelection * GetSelection() const
Definition: brwbox.hxx:566
virtual void Select()
Definition: brwbox2.cxx:177
sal_Int32 GetTopRow() const
Definition: brwbox.hxx:434
sal_uInt16 ColCount() const
Definition: brwbox1.cxx:849
void SelectColumnPos(sal_uInt16 nCol, bool _bSelect, bool bMakeVisible)
Definition: brwbox1.cxx:1798
void commitTableEvent(sal_Int16 nEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
commitTableEvent commit the event at all listeners of the table
Definition: brwbox3.cxx:411
bool GoToRowColumnId(sal_Int32 nRow, sal_uInt16 nColId)
Definition: brwbox1.cxx:1584
virtual void MouseButtonUp(const MouseEvent &rEvt) override
Definition: brwbox2.cxx:1426
void SetColumnWidth(sal_uInt16 nColumnId, sal_uLong nWidth)
Definition: brwbox1.cxx:573
sal_uInt16 GetColumnPos(sal_uInt16 nColumnId) const
Definition: brwbox2.cxx:388
sal_Int32 GetSelectRowCount() const
Definition: brwbox1.cxx:1790
OUString GetColumnTitle(sal_uInt16 nColumnId) const
Definition: brwbox1.cxx:835
static const sal_uInt16 HandleColumnId
Definition: brwbox.hxx:267
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const
GetCellText returns the text at the given position.
Definition: brwbox3.cxx:396
sal_uLong GetDefaultColumnWidth(const OUString &_rText) const
suggests a default width for a column containing a given text
Definition: brwbox1.cxx:275
tools::Rectangle GetFieldRectPixel(sal_Int32 nRow, sal_uInt16 nColId, bool bRelToBrowser=true) const
Definition: brwbox1.cxx:2004
void Dispatch(sal_uInt16 nId)
Definition: brwbox2.cxx:1729
virtual void Resize() override
Definition: brwbox2.cxx:469
bool ReserveControlArea(sal_uInt16 nWidth=USHRT_MAX)
Definition: brwbox1.cxx:2123
virtual sal_Int32 GetRowCount() const override
Definition: brwbox1.cxx:844
bool isAccessibleAlive() const
return <TRUE> if and only if the accessible object for this instance has been created and is alive
Definition: brwbox3.cxx:428
BrowserMode GetMode() const
Definition: brwbox.hxx:598
virtual void LoseFocus() override
Definition: brwbox1.cxx:2349
virtual void SetNoSelection() override
Definition: brwbox1.cxx:1614
virtual void KeyInput(const KeyEvent &rEvt) override
Definition: brwbox2.cxx:1645
virtual void EndScroll()
Definition: brwbox2.cxx:224
virtual void ColumnMoved(sal_uInt16 nColId)
Definition: brwbox2.cxx:213
virtual void ImplEndTracking()
Definition: brwbox2.cxx:198
virtual void RowHeightChanged()
called when the row height has been changed interactively
Definition: brwbox2.cxx:203
sal_uLong GetColumnWidth(sal_uInt16 nColumnId) const
Definition: brwbox2.cxx:369
void commitBrowseBoxEvent(sal_Int16 nEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue)
commitBrowseBoxEvent commit the event at all listeners of the browsebox
Definition: brwbox3.cxx:417
sal_Int32 GetRow() const
Definition: brwbox.hxx:133
vcl::Window * GetWindow() const
Definition: brwbox.hxx:132
const tools::Rectangle & GetRect() const
Definition: brwbox.hxx:136
sal_uInt16 GetColumn() const
Definition: brwbox.hxx:134
sal_uInt16 GetColumnId() const
Definition: brwbox.hxx:135
virtual bool EventNotify(NotifyEvent &rNEvt) override
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
sal_uInt16 GetCurItemId() const
Size GetSizePixel() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
NotifyEventType GetType() const
bool IsClipRegion() const
void SetClipRegion()
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
void SetFillColor()
OutDevType GetOutDevType() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
virtual vcl::Window * GetOwnerWindow() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetFieldTextColor() const
const Color & GetFieldColor() const
const vcl::Font & GetFieldFont() const
void clear()
static VclPtr< reference_type > Create(Arg &&... arg)
ControlBase & GetWindow() const
virtual ~CellController() override
CellController(ControlBase *pW)
bool isSuspended() const
virtual void ActivatingMouseEvent(const BrowserMouseEvent &rEvt, bool bUp)
virtual bool MoveAllowed(const KeyEvent &rEvt) const
virtual void CommitModifications()
VclPtr< ControlBase > pWindow
void Set(const BrowserMouseEvent *pEvt, bool bIsDown)
std::unique_ptr< BrowserMouseEvent > pEvent
VclPtr< CheckBoxControl > pCheckBoxPaint
virtual CellController * GetController(sal_Int32 nRow, sal_uInt16 nCol)
ImplSVEvent * nStartEvent
SVT_DLLPRIVATE void DetermineFocus(const GetFocusFlags _nGetFocusFlags=GetFocusFlags::NONE)
EditBrowseBox(EditBrowseBox const &)=delete
virtual ~EditBrowseBox() override
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const =0
sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId)
CellControllerRef aOldController
virtual bool SaveRow()
virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId)
virtual void ColumnResized(sal_uInt16 nColId) override
CellControllerRef aController
virtual void EndScroll() override
virtual void Dispatch(sal_uInt16 nId)
std::unique_ptr< EditBrowseBoxImpl > m_aImpl
virtual bool IsTabAllowed(bool bForward) const
tools::Rectangle GetCellRect(sal_Int32 nRow, sal_uInt16 nColId, bool bRelToBrowser=true) const
void implCreateActiveAccessible()
ImplSVEvent * nEndEvent
virtual void ChildFocusIn() override
virtual void ChildFocusOut() override
virtual void CursorMoved() override
bool IsEditing() const
virtual void DeactivateCell(bool bUpdate=true)
virtual void MouseButtonDown(const BrowserMouseEvent &rEvt) override
const CellControllerRef & Controller() const
virtual void KeyInput(const KeyEvent &rEvt) override
Image GetImage(RowStatus) const
class svt::EditBrowseBox::BrowserMouseEventPtr aMouseEvent
virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol)
virtual VclPtr< BrowserHeader > CreateHeaderBar(BrowseBox *pParent) override
virtual void Resize() override
void EnableAndShow() const
virtual RowStatus GetRowStatus(sal_Int32 nRow) const
virtual void RemoveRows()
virtual void LoseFocus() override
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void StateChanged(StateChangedType nType) override
virtual bool SaveModified()
EditBrowseBoxFlags GetBrowserFlags() const
virtual bool IsCursorMoveAllowed(sal_Int32 nNewRow, sal_uInt16 nNewColId) const override
virtual void ColumnMoved(sal_uInt16 nId) override
virtual void ImplEndTracking() override
void InvalidateStatusCell(sal_Int32 nRow)
bool ControlHasFocus() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
ImplSVEvent * nCellModifiedEvent
EditBrowseBoxFlags m_nBrowserFlags
void SetBrowserFlags(EditBrowseBoxFlags nFlags)
virtual void PaintStatusCell(OutputDevice &rDev, const tools::Rectangle &rRect) const
void PaintTristate(const tools::Rectangle &rRect, const TriState &eState, bool _bEnabled=true) const
virtual void Init()
virtual sal_uInt16 AppendColumn(const OUString &rName, sal_uInt16 nWidth, sal_uInt16 nPos=HEADERBAR_APPEND, sal_uInt16 nId=sal_uInt16(-1))
virtual bool SeekRow(sal_Int32 nRow) override
seeks for the given row position
VclPtr< vcl::Window > m_pFocusWhileRequest
virtual bool ProcessKey(const KeyEvent &rEvt) override
virtual void MouseButtonUp(const BrowserMouseEvent &rEvt) override
virtual VclPtr< BrowserHeader > imp_CreateHeaderBar(BrowseBox *pParent)
virtual bool IsModified() const
virtual void GetFocus() override
virtual void ImplStartTracking() override
virtual void ArrangeControls(sal_uInt16 &nX, sal_uInt16 nY)
virtual void DoubleClick(const BrowserMouseEvent &) override
virtual void PaintField(vcl::RenderContext &rDev, const tools::Rectangle &rRect, sal_uInt16 nColumnId) const override
virtual void dispose() override
virtual bool EventNotify(NotifyEvent &rNEvt) override
VclPtr< BrowserHeader > pHeader
static void ResizeController(CellControllerRef const &rController, const tools::Rectangle &)
virtual void RowHeightChanged() override
called when the row height has been changed interactively
SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent &_rEvt, bool _bUp)
virtual void InitController(CellControllerRef &rController, sal_Int32 nRow, sal_uInt16 nCol)
virtual void CellModified()
virtual void DoubleClick() override
virtual ~IEditImplementation()=0
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
constexpr tools::Long Left() const
bool is() const
void Merge(const Font &rFont)
bool IsMod1() const
sal_uInt16 GetCode() const
bool IsShift() const
bool IsMod2() const
void SetStyle(WinBits nStyle)
vcl::Window * GetParent() const
GetFocusFlags GetGetFocusFlags() const
void PaintImmediately()
void SetControlForeground()
bool HasChildPathFocus(bool bSystemWindow=false) const
bool IsControlFont() const
void SetControlFont()
void SetZoomedPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Size get_preferred_size() const
tools::Long CalcZoom(tools::Long n) const
vcl::Window * GetWindow(GetWindowType nType) const
const Color & GetControlForeground() const
void SetControlBackground()
bool IsUpdateMode() const
bool HasFocus() const
void Disable(bool bChild=true)
virtual Point GetPosPixel() const
void Enable(bool bEnable=true, bool bChild=true)
bool IsControlForeground() const
WinBits GetStyle() const
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
virtual bool PreNotify(NotifyEvent &rNEvt)
vcl::Font GetControlFont() const
bool IsZoom() const
::OutputDevice const * GetOutDev() const
bool IsRTLEnabled() const
Size GetOutputSizePixel() const
Window(vcl::Window *pParent, WinBits nStyle=0)
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
const Color & GetControlBackground() const
bool IsVisible() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void SetCompoundControl(bool bCompound)
void SetTextColor(const Color &rColor)
void EnablePaint(bool bEnable)
void SetBackground()
#define DBG_ASSERT(sCon, aError)
EditBrowseBoxFlags
@ ACTIVATE_ON_BUTTONDOWN
set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event
@ HANDLE_COLUMN_TEXT
if this bit is set and EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT is not set, the handle column is ...
@ NO_HANDLE_COLUMN_CONTENT
if this bit is not set, the handle column will be invalidated upon changing the row in the browse box...
TriState
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_END
sal_uInt16 nPos
int i
tools::SvRef< CellController > CellControllerRef
IMPL_LINK_NOARG(OCommonPicker, OnCancelPicker, void *, void)
long Long
sal_Int32 w
sal_Int16 nId
OUTDEV_WINDOW
#define Y
QPRO_FUNC_TYPE nType
@ ACTIVE_DESCENDANT_CHANGED
GetFocusFlags
StateChangedType
sal_Int64 WinBits
WinBits const WB_NOTABSTOP
WinBits const WB_TABSTOP