LibreOffice Module vcl (master)  1
vclmedit.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 
20 #include <memory>
22 #include <vcl/commandevent.hxx>
23 #include <vcl/builder.hxx>
24 #include <vcl/decoview.hxx>
25 #include <vcl/event.hxx>
26 #include <vcl/specialchars.hxx>
27 #include <vcl/timer.hxx>
28 #include <vcl/vclmedit.hxx>
29 #include <vcl/xtextedt.hxx>
30 #include <vcl/textview.hxx>
31 #include <vcl/ptrstyle.hxx>
32 
33 #include <svl/undo.hxx>
34 #include <svl/lstner.hxx>
35 #include <vcl/uitest/uiobject.hxx>
36 
37 #include <vcl/scrbar.hxx>
38 #include <vcl/settings.hxx>
39 #include <vcl/weld.hxx>
40 #include <osl/diagnose.h>
41 
42 class ImpVclMEdit : public SfxListener
43 {
44 private:
46 
51 
54 
55 protected:
56  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
57  void ImpUpdateSrollBarVis( WinBits nWinStyle );
58  void ImpInitScrollBars();
59  void ImpSetScrollBarRanges();
61  DECL_LINK( ScrollHdl, ScrollBar*, void );
62 
63 public:
64  ImpVclMEdit( VclMultiLineEdit* pVclMultiLineEdit, WinBits nWinStyle );
65  virtual ~ImpVclMEdit() override;
66 
67  void SetModified( bool bMod );
68  bool IsModified() const;
69 
70  void SetReadOnly( bool bRdOnly );
71  bool IsReadOnly() const;
72 
73  void SetMaxTextLen(sal_Int32 nLen);
74  sal_Int32 GetMaxTextLen() const;
75 
76  void SetMaxTextWidth(long nMaxWidth);
77 
78  void InsertText( const OUString& rStr );
79  OUString GetSelected() const;
80  OUString GetSelected( LineEnd aSeparator ) const;
81 
82  void SetSelection( const Selection& rSelection );
83  const Selection& GetSelection() const;
84 
85  void Cut();
86  void Copy();
87  void Paste();
88 
89  void SetText( const OUString& rStr );
90  OUString GetText() const;
91  OUString GetText( LineEnd aSeparator ) const;
92  OUString GetTextLines( LineEnd aSeparator ) const;
93 
94  void Resize();
95  void GetFocus();
96 
97  bool HandleCommand( const CommandEvent& rCEvt );
98 
99  void Enable( bool bEnable );
100 
101  Size CalcMinimumSize() const;
102  Size CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
103  void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
104 
105  void SetAlign( WinBits nWinStyle );
106 
107  void InitFromStyle( WinBits nWinStyle );
108 
112 };
113 
115  : pVclMultiLineEdit(pEdt)
116  , mpTextWindow(VclPtr<TextWindow>::Create(pEdt))
117  , mpHScrollBar(VclPtr<ScrollBar>::Create(pVclMultiLineEdit, WB_HSCROLL|WB_DRAG))
118  , mpVScrollBar(VclPtr<ScrollBar>::Create(pVclMultiLineEdit, WB_VSCROLL|WB_DRAG))
119  , mpScrollBox(VclPtr<ScrollBarBox>::Create(pVclMultiLineEdit, WB_SIZEABLE))
120  , mnTextWidth(0)
121 {
122  mpVScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) );
123  mpHScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) );
124  mpTextWindow->Show();
125  InitFromStyle( nWinStyle );
127 }
128 
130 {
131  const bool bHaveVScroll = mpVScrollBar->IsVisible();
132  const bool bHaveHScroll = mpHScrollBar->IsVisible();
133  const bool bHaveScrollBox = mpScrollBox->IsVisible();
134 
135  bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
136  const bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
137 
138  const bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
139  if ( !bNeedVScroll && bAutoVScroll )
140  {
141  TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
142  long nOverallTextHeight(0);
143  for ( sal_uInt32 i=0; i<rEngine.GetParagraphCount(); ++i )
144  nOverallTextHeight += rEngine.GetTextHeight( i );
145  if ( nOverallTextHeight > mpTextWindow->GetOutputSizePixel().Height() )
146  bNeedVScroll = true;
147  }
148 
149  const bool bNeedScrollBox = bNeedVScroll && bNeedHScroll;
150 
151  bool bScrollbarsChanged = false;
152  if ( bHaveVScroll != bNeedVScroll )
153  {
154  mpVScrollBar->Show(bNeedVScroll);
155  bScrollbarsChanged = true;
156  }
157 
158  if ( bHaveHScroll != bNeedHScroll )
159  {
160  mpHScrollBar->Show(bNeedHScroll);
161  bScrollbarsChanged = true;
162  }
163 
164  if ( bHaveScrollBox != bNeedScrollBox )
165  {
166  mpScrollBox->Show(bNeedScrollBox);
167  }
168 
169  if ( bScrollbarsChanged )
170  {
172  Resize();
173  }
174 }
175 
177 {
178  ImpUpdateSrollBarVis( nWinStyle );
179  SetAlign( nWinStyle );
180 
181  if ( nWinStyle & WB_NOHIDESELECTION )
182  mpTextWindow->SetAutoFocusHide( false );
183  else
185 
186  if ( nWinStyle & WB_READONLY )
188  else
189  mpTextWindow->GetTextView()->SetReadOnly( false );
190 
191  if ( nWinStyle & WB_IGNORETAB )
192  {
193  mpTextWindow->SetIgnoreTab( true );
194  }
195  else
196  {
197  mpTextWindow->SetIgnoreTab( false );
198  // #103667# VclMultiLineEdit has the flag, but focusable window also needs this flag
199  WinBits nStyle = mpTextWindow->GetStyle();
200  nStyle |= WB_NODIALOGCONTROL;
201  mpTextWindow->SetStyle( nStyle );
202  }
203 }
204 
206 {
213 }
214 
216 {
217  const long nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
218  mpVScrollBar->SetRange( Range( 0, nTextHeight-1 ) );
219 
221 }
222 
224 {
225  static const sal_Unicode sampleChar = { 'x' };
226 
228 
229  Size aCharBox;
230  aCharBox.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) );
231  aCharBox.setHeight( mpTextWindow->GetTextHeight() );
233 
234  mpHScrollBar->SetVisibleSize( aOutSz.Width() );
235  mpHScrollBar->SetPageSize( aOutSz.Width() * 8 / 10 );
236  mpHScrollBar->SetLineSize( aCharBox.Width()*10 );
238 
239  mpVScrollBar->SetVisibleSize( aOutSz.Height() );
240  mpVScrollBar->SetPageSize( aOutSz.Height() * 8 / 10 );
241  mpVScrollBar->SetLineSize( aCharBox.Height() );
243 }
244 
246 {
247  long nX = mpTextWindow->GetTextView()->GetStartDocPos().X();
249  mpHScrollBar->SetThumbPos( nX );
250  else
252 
253 }
254 
255 IMPL_LINK( ImpVclMEdit, ScrollHdl, ScrollBar*, pCurScrollBar, void )
256 {
257  long nDiffX = 0, nDiffY = 0;
258 
259  if ( pCurScrollBar == mpVScrollBar )
260  nDiffY = mpTextWindow->GetTextView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos();
261  else if ( pCurScrollBar == mpHScrollBar )
262  nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
263 
264  mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
265  // mpTextWindow->GetTextView()->ShowCursor( false, true );
266 }
267 
269 {
270  bool bRTL = AllSettings::GetLayoutRTL();
272 
273  if ( nWinStyle & WB_CENTER )
275  else if ( nWinStyle & WB_RIGHT )
277  else if ( nWinStyle & WB_LEFT )
278  mpTextWindow->GetTextEngine()->SetTextAlign( !bRTL ? TxtAlign::Left : TxtAlign::Right );
279 }
280 
281 void ImpVclMEdit::SetModified( bool bMod )
282 {
284 }
285 
287 {
289 }
290 
291 void ImpVclMEdit::SetReadOnly( bool bRdOnly )
292 {
293  mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
294  // TODO: Adjust color?
295 }
296 
298 {
299  return mpTextWindow->GetTextView()->IsReadOnly();
300 }
301 
302 void ImpVclMEdit::SetMaxTextLen(sal_Int32 nLen)
303 {
305 }
306 
307 sal_Int32 ImpVclMEdit::GetMaxTextLen() const
308 {
310 }
311 
312 void ImpVclMEdit::InsertText( const OUString& rStr )
313 {
314  mpTextWindow->GetTextView()->InsertText( rStr );
315 }
316 
317 OUString ImpVclMEdit::GetSelected() const
318 {
319  return mpTextWindow->GetTextView()->GetSelected();
320 }
321 
322 OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
323 {
324  return mpTextWindow->GetTextView()->GetSelected( aSeparator );
325 }
326 
327 void ImpVclMEdit::SetMaxTextWidth(long nMaxWidth)
328 {
330 }
331 
333 {
334  int nIteration = 1;
335  do
336  {
337  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
338  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
339  ImpUpdateSrollBarVis( nWinStyle );
340 
342  Size aEditSize = aSz;
344  nSBWidth = pVclMultiLineEdit->CalcZoom( nSBWidth );
345 
346  if (mpHScrollBar->IsVisible())
347  aSz.AdjustHeight( -(nSBWidth+1) );
348  if (mpVScrollBar->IsVisible())
349  aSz.AdjustWidth( -(nSBWidth+1) );
350 
351  if (!mpHScrollBar->IsVisible())
353  else
354  mpHScrollBar->setPosSizePixel( 0, aEditSize.Height()-nSBWidth, aSz.Width(), nSBWidth );
355 
356  Point aTextWindowPos;
357  if (mpVScrollBar->IsVisible())
358  {
360  {
361  mpVScrollBar->setPosSizePixel( 0, 0, nSBWidth, aSz.Height() );
362  aTextWindowPos.AdjustX(nSBWidth );
363  }
364  else
365  mpVScrollBar->setPosSizePixel( aEditSize.Width()-nSBWidth, 0, nSBWidth, aSz.Height() );
366  }
367 
368  if (mpScrollBox->IsVisible())
369  mpScrollBox->setPosSizePixel( aSz.Width(), aSz.Height(), nSBWidth, nSBWidth );
370 
371  Size aTextWindowSize( aSz );
372  if ( aTextWindowSize.Width() < 0 )
373  aTextWindowSize.setWidth( 0 );
374  if ( aTextWindowSize.Height() < 0 )
375  aTextWindowSize.setHeight( 0 );
376 
377  Size aOldTextWindowSize( mpTextWindow->GetSizePixel() );
378  mpTextWindow->SetPosSizePixel( aTextWindowPos, aTextWindowSize );
379  if ( aOldTextWindowSize == aTextWindowSize )
380  break;
381 
382  // Changing the text window size might effectively have changed the need for
383  // scrollbars, so do another iteration.
384  ++nIteration;
385  OSL_ENSURE( nIteration < 3, "ImpVclMEdit::Resize: isn't this expected to terminate with the second iteration?" );
386 
387  } while ( nIteration <= 3 ); // artificial break after four iterations
388 
390 }
391 
393 {
395 }
396 
398 {
399  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
401 }
402 
404 {
406 }
407 
409 {
410  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
412 }
413 
414 void ImpVclMEdit::SetText( const OUString& rStr )
415 {
416  bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
417  mpTextWindow->GetTextEngine()->SetText( rStr );
418  if ( !bWasModified )
420 
422 
423  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
424  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
425  ImpUpdateSrollBarVis( nWinStyle );
426 }
427 
428 OUString ImpVclMEdit::GetText() const
429 {
430  return mpTextWindow->GetTextEngine()->GetText();
431 }
432 
433 OUString ImpVclMEdit::GetText( LineEnd aSeparator ) const
434 {
435  return mpTextWindow->GetTextEngine()->GetText( aSeparator );
436 }
437 
438 OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
439 {
440  return mpTextWindow->GetTextEngine()->GetTextLines( aSeparator );
441 }
442 
444 {
445  const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
446  if ( !pTextHint )
447  return;
448 
449  switch (pTextHint->GetId())
450  {
451  case SfxHintId::TextViewScrolled:
452  if (mpHScrollBar->IsVisible())
454  if (mpVScrollBar->IsVisible())
456  break;
457 
458  case SfxHintId::TextHeightChanged:
459  if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
460  {
461  long nOutHeight = mpTextWindow->GetOutputSizePixel().Height();
462  long nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
463  if ( nTextHeight < nOutHeight )
465  }
467  break;
468 
469  case SfxHintId::TextFormatted:
470  if (mpHScrollBar->IsVisible())
471  {
472  const long nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
473  if ( nWidth != mnTextWidth )
474  {
475  mnTextWidth = nWidth;
478  }
479  }
480  break;
481 
482  case SfxHintId::TextModified:
485  break;
486 
487  case SfxHintId::TextViewSelectionChanged:
489  break;
490 
491  case SfxHintId::TextViewCaretChanged:
493  break;
494 
495  default: break;
496  }
497 }
498 
499 void ImpVclMEdit::SetSelection( const Selection& rSelection )
500 {
501  OUString aText = mpTextWindow->GetTextEngine()->GetText();
502 
503  Selection aNewSelection( rSelection );
504  if ( aNewSelection.Min() < 0 )
505  aNewSelection.Min() = 0;
506  else if ( aNewSelection.Min() > aText.getLength() )
507  aNewSelection.Min() = aText.getLength();
508  if ( aNewSelection.Max() < 0 )
509  aNewSelection.Max() = 0;
510  else if ( aNewSelection.Max() > aText.getLength() )
511  aNewSelection.Max() = aText.getLength();
512 
513  long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
514  TextSelection aTextSel;
515  sal_uInt32 nPara = 0;
516  sal_Int32 nChar = 0;
517  long x = 0;
518  while ( x <= nEnd )
519  {
520  if ( x == aNewSelection.Min() )
521  aTextSel.GetStart() = TextPaM( nPara, nChar );
522  if ( x == aNewSelection.Max() )
523  aTextSel.GetEnd() = TextPaM( nPara, nChar );
524 
525  if ( ( x < aText.getLength() ) && ( aText[ x ] == '\n' ) )
526  {
527  nPara++;
528  nChar = 0;
529  }
530  else
531  nChar++;
532  x++;
533  }
534  mpTextWindow->GetTextView()->SetSelection( aTextSel );
535 }
536 
538 {
541  aTextSel.Justify();
542  // flatten selection => every line-break a character
543 
544  ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
545  // paragraphs before
546  for ( sal_uInt32 n = 0; n < aTextSel.GetStart().GetPara(); ++n )
547  {
548  maSelection.Min() += pExtTextEngine->GetTextLen( n );
549  maSelection.Min()++;
550  }
551 
552  // first paragraph with selection
554  maSelection.Min() += aTextSel.GetStart().GetIndex();
555 
556  for ( sal_uInt32 n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); ++n )
557  {
558  maSelection.Max() += pExtTextEngine->GetTextLen( n );
559  maSelection.Max()++;
560  }
561 
562  maSelection.Max() += aTextSel.GetEnd().GetIndex();
563 
564  return maSelection;
565 }
566 
568 {
571 
572  if (mpHScrollBar->IsVisible())
574  if (mpVScrollBar->IsVisible())
575  aSz.AdjustWidth(mpVScrollBar->GetSizePixel().Width() );
576 
577  return aSz;
578 }
579 
580 Size ImpVclMEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
581 {
582  static const sal_Unicode sampleChar = 'X';
583 
584  Size aSz;
585  Size aCharSz;
586  aCharSz.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) );
587  aCharSz.setHeight( mpTextWindow->GetTextHeight() );
588 
589  if ( nLines )
590  aSz.setHeight( nLines*aCharSz.Height() );
591  else
593 
594  if ( nColumns )
595  aSz.setWidth( nColumns*aCharSz.Width() );
596  else
598 
599  if (mpHScrollBar->IsVisible())
601  if (mpVScrollBar->IsVisible())
603 
604  return aSz;
605 }
606 
607 void ImpVclMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
608 {
609  static const sal_Unicode sampleChar = { 'x' };
611  Size aCharSz( mpTextWindow->GetTextWidth( OUString(sampleChar) ), mpTextWindow->GetTextHeight() );
612  rnCols = static_cast<sal_uInt16>(aOutSz.Width()/aCharSz.Width());
613  rnLines = static_cast<sal_uInt16>(aOutSz.Height()/aCharSz.Height());
614 }
615 
616 void ImpVclMEdit::Enable( bool bEnable )
617 {
618  mpTextWindow->Enable( bEnable );
619  if (mpHScrollBar->IsVisible())
620  mpHScrollBar->Enable( bEnable );
621  if (mpVScrollBar->IsVisible())
622  mpVScrollBar->Enable( bEnable );
623 }
624 
626 {
627  bool bDone = false;
628  CommandEventId nCommand = rCEvt.GetCommand();
629  if (nCommand == CommandEventId::Wheel ||
630  nCommand == CommandEventId::StartAutoScroll ||
631  nCommand == CommandEventId::AutoScroll ||
632  nCommand == CommandEventId::Gesture)
633  {
634  ScrollBar* pHScrollBar = mpHScrollBar->IsVisible() ? mpHScrollBar.get() : nullptr;
635  ScrollBar* pVScrollBar = mpVScrollBar->IsVisible() ? mpVScrollBar.get() : nullptr;
636  mpTextWindow->HandleScrollCommand(rCEvt, pHScrollBar, pVScrollBar);
637  bDone = true;
638  }
639  return bDone;
640 }
641 
643  : Window(pParent)
644  , mxParent(pParent)
645 {
646  mbInMBDown = false;
647  mbFocusSelectionHide = false;
648  mbIgnoreTab = false;
649  mbActivePopup = false;
650  mbSelectOnTab = true;
651 
653 
654  mpExtTextEngine.reset(new ExtTextEngine);
655  mpExtTextEngine->SetMaxTextLen(EDIT_NOLIMIT);
656  if( pParent->GetStyle() & WB_BORDER )
657  mpExtTextEngine->SetLeftMargin( 2 );
658  mpExtTextEngine->SetLocale( GetSettings().GetLanguageTag().getLocale() );
659  mpExtTextView.reset(new TextView( mpExtTextEngine.get(), this ));
660  mpExtTextEngine->InsertView( mpExtTextView.get() );
661  mpExtTextEngine->EnableUndo( true );
662  mpExtTextView->ShowCursor();
663 
664  Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
665  SetBackground( aBackgroundColor );
666  pParent->SetBackground( aBackgroundColor );
667 }
668 
670 {
671  disposeOnce();
672 }
673 
675 {
676  mxParent.clear();
677  mpExtTextView.reset();
678  mpExtTextEngine.reset();
679  Window::dispose();
680 }
681 
682 void TextWindow::MouseMove( const MouseEvent& rMEvt )
683 {
684  mpExtTextView->MouseMove( rMEvt );
685  Window::MouseMove( rMEvt );
686 }
687 
689 {
690  mbInMBDown = true; // so that GetFocus does not select everything
691  mpExtTextView->MouseButtonDown( rMEvt );
692  GrabFocus();
693  mbInMBDown = false;
694 }
695 
697 {
698  mpExtTextView->MouseButtonUp( rMEvt );
699 }
700 
701 void TextWindow::KeyInput( const KeyEvent& rKEvent )
702 {
703  bool bDone = false;
704  sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
705  if ( nCode == css::awt::Key::SELECT_ALL ||
706  ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
707  )
708  {
709  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
710  bDone = true;
711  }
712  else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
713  {
715  {
716  // to maintain the selection
717  mbActivePopup = true;
718  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
719  if (!aChars.isEmpty())
720  {
721  mpExtTextView->InsertText( aChars );
722  mpExtTextView->GetTextEngine()->SetModified( true );
723  }
724  mbActivePopup = false;
725  bDone = true;
726  }
727  }
728  else if ( nCode == KEY_TAB )
729  {
730  if ( !mbIgnoreTab || rKEvent.GetKeyCode().IsMod1() )
731  bDone = mpExtTextView->KeyInput( rKEvent );
732  }
733  else
734  {
735  bDone = mpExtTextView->KeyInput( rKEvent );
736  }
737 
738  if ( !bDone )
739  Window::KeyInput( rKEvent );
740 }
741 
742 void TextWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
743 {
744  mpExtTextView->Paint(rRenderContext, rRect);
745 }
746 
748 {
749 }
750 
751 void TextWindow::Command( const CommandEvent& rCEvt )
752 {
753  if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
754  {
756  bool bEnableCut = true;
757  bool bEnableCopy = true;
758  bool bEnableDelete = true;
759  bool bEnablePaste = true;
760  bool bEnableSpecialChar = true;
761  bool bEnableUndo = true;
762 
763  if ( !mpExtTextView->HasSelection() )
764  {
765  bEnableCut = false;
766  bEnableCopy = false;
767  bEnableDelete = false;
768  }
769  if ( mpExtTextView->IsReadOnly() )
770  {
771  bEnableCut = false;
772  bEnablePaste = false;
773  bEnableDelete = false;
774  bEnableSpecialChar = false;
775  }
776  if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
777  {
778  bEnableUndo = false;
779  }
780  pPopup->EnableItem(pPopup->GetItemId("cut"), bEnableCut);
781  pPopup->EnableItem(pPopup->GetItemId("copy"), bEnableCopy);
782  pPopup->EnableItem(pPopup->GetItemId("delete"), bEnableDelete);
783  pPopup->EnableItem(pPopup->GetItemId("paste"), bEnablePaste);
784  pPopup->EnableItem(pPopup->GetItemId("specialchar"), bEnableSpecialChar);
785  pPopup->EnableItem(pPopup->GetItemId("undo"), bEnableUndo);
786  pPopup->ShowItem(pPopup->GetItemId("specialchar"), !vcl::GetGetSpecialCharsFunction());
787 
788  mbActivePopup = true;
789  Point aPos = rCEvt.GetMousePosPixel();
790  if ( !rCEvt.IsMouseEvent() )
791  {
792  // Sometime do show Menu centered in the selection !!!
793  Size aSize = GetOutputSizePixel();
794  aPos = Point( aSize.Width()/2, aSize.Height()/2 );
795  }
796  sal_uInt16 n = pPopup->Execute( this, aPos );
797  OString sCommand = pPopup->GetItemIdent(n);
798  if (sCommand == "undo")
799  {
800  mpExtTextView->Undo();
801  mpExtTextEngine->SetModified( true );
802  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
803  }
804  else if (sCommand == "cut")
805  {
806  mpExtTextView->Cut();
807  mpExtTextEngine->SetModified( true );
808  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
809  }
810  else if (sCommand == "copy")
811  {
812  mpExtTextView->Copy();
813  }
814  else if (sCommand == "paste")
815  {
816  mpExtTextView->Paste();
817  mpExtTextEngine->SetModified( true );
818  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
819  }
820  else if (sCommand == "delete")
821  {
822  mpExtTextView->DeleteSelected();
823  mpExtTextEngine->SetModified( true );
824  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
825  }
826  else if (sCommand == "selectall")
827  {
828  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
829  }
830  else if (sCommand == "specialchar")
831  {
832  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
833  if (!aChars.isEmpty())
834  {
835  mpExtTextView->InsertText( aChars );
836  mpExtTextEngine->SetModified( true );
837  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
838  }
839  }
840  pPopup.clear();
841  mbActivePopup = false;
842  }
843  else
844  {
845  mpExtTextView->Command( rCEvt );
846  }
847  Window::Command( rCEvt );
848 }
849 
851 {
852  Window::GetFocus();
853  if ( !mbActivePopup )
854  {
855  bool bGotoCursor = !mpExtTextView->IsReadOnly();
857  && ( mbSelectOnTab &&
858  (!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SelectionOptions::Focus ) )) )
859  {
860  // select everything, but do not scroll
861  bool bAutoScroll = mpExtTextView->IsAutoScroll();
862  mpExtTextView->SetAutoScroll( false );
863  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
864  mpExtTextView->SetAutoScroll( bAutoScroll );
865  bGotoCursor = false;
866  }
867  mpExtTextView->SetPaintSelection( true );
868  mpExtTextView->ShowCursor( bGotoCursor );
869  }
870 }
871 
873 {
874  Window::LoseFocus();
875 
877  mpExtTextView->SetPaintSelection( false );
878 }
879 
881  : Edit( pParent, nWinStyle )
882 {
883  SetType( WindowType::MULTILINEEDIT );
884  pImpVclMEdit.reset(new ImpVclMEdit( this, nWinStyle ));
885  ImplInitSettings( true );
886  pUpdateDataTimer = nullptr;
887 
888  SetCompoundControl( true );
889  SetStyle( ImplInitStyle( nWinStyle ) );
890 }
891 
893 {
894  disposeOnce();
895 }
896 
898 {
899  pImpVclMEdit.reset();
900  pUpdateDataTimer.reset();
901  Edit::dispose();
902 }
903 
905 {
906  if ( !(nStyle & WB_NOTABSTOP) )
907  nStyle |= WB_TABSTOP;
908 
909  if ( !(nStyle & WB_NOGROUP) )
910  nStyle |= WB_GROUP;
911 
912  if ( !(nStyle & WB_IGNORETAB ))
913  nStyle |= WB_NODIALOGCONTROL;
914 
915  return nStyle;
916 }
917 
919 {
920  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
921 
922  // The Font has to be adjusted, as the TextEngine does not take care of
923  // TextColor/Background
924 
925  Color aTextColor = rStyleSettings.GetFieldTextColor();
926  if (IsControlForeground())
927  aTextColor = GetControlForeground();
928 
929  if (!IsEnabled())
930  aTextColor = rStyleSettings.GetDisableColor();
931 
932  vcl::Font aFont = rStyleSettings.GetFieldFont();
934  ApplyControlFont(rRenderContext, aFont);
935 
936  vcl::Font theFont = rRenderContext.GetFont();
937  theFont.SetColor(aTextColor);
938  if (IsPaintTransparent())
939  theFont.SetFillColor(COL_TRANSPARENT);
940  else
941  theFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
942 
943  pImpVclMEdit->GetTextWindow()->SetFont(theFont);
944  // FIXME: next call causes infinite invalidation loop, rethink how to properly fix this situation
945  // pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(theFont);
946  pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
947 
948  if (IsPaintTransparent())
949  {
950  pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
951  pImpVclMEdit->GetTextWindow()->SetBackground();
952  pImpVclMEdit->GetTextWindow()->SetControlBackground();
953  rRenderContext.SetBackground();
955  }
956  else
957  {
958  if (IsControlBackground())
959  pImpVclMEdit->GetTextWindow()->SetBackground(GetControlBackground());
960  else
961  pImpVclMEdit->GetTextWindow()->SetBackground(rStyleSettings.GetFieldColor());
962  // also adjust for VclMultiLineEdit as the TextComponent might hide Scrollbars
963  rRenderContext.SetBackground(pImpVclMEdit->GetTextWindow()->GetBackground());
964  }
965 }
966 
968 {
969  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
970 
971  // The Font has to be adjusted, as the TextEngine does not take care of
972  // TextColor/Background
973 
974  Color aTextColor = rStyleSettings.GetFieldTextColor();
975  if (IsControlForeground())
976  aTextColor = GetControlForeground();
977  if (!IsEnabled())
978  aTextColor = rStyleSettings.GetDisableColor();
979 
980  vcl::Font aFont = rStyleSettings.GetFieldFont();
982  ApplyControlFont(*this, aFont);
983 
984  vcl::Font TheFont = GetFont();
985  TheFont.SetColor(aTextColor);
986  if (IsPaintTransparent())
987  TheFont.SetFillColor(COL_TRANSPARENT);
988  else
989  TheFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
990  pImpVclMEdit->GetTextWindow()->SetFont(TheFont);
991  pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(TheFont);
992  pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
993 
994  if (bBackground)
995  {
996  if (IsPaintTransparent())
997  {
998  pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
999  pImpVclMEdit->GetTextWindow()->SetBackground();
1000  pImpVclMEdit->GetTextWindow()->SetControlBackground();
1001  SetBackground();
1003  }
1004  else
1005  {
1006  if (IsControlBackground())
1007  pImpVclMEdit->GetTextWindow()->SetBackground(GetControlBackground());
1008  else
1009  pImpVclMEdit->GetTextWindow()->SetBackground(rStyleSettings.GetFieldColor());
1010  // also adjust for VclMultiLineEdit as the TextComponent might hide Scrollbars
1011  SetBackground(pImpVclMEdit->GetTextWindow()->GetBackground());
1012  }
1013  }
1014 }
1015 
1017 {
1018  aModifyHdlLink.Call( *this );
1019 
1021 
1022  if ( pUpdateDataTimer )
1023  pUpdateDataTimer->Start();
1024 }
1025 
1027 {
1029 }
1030 
1032 {
1034 }
1035 
1036 IMPL_LINK_NOARG(VclMultiLineEdit, ImpUpdateDataHdl, Timer *, void)
1037 {
1038  UpdateData();
1039 }
1040 
1042 {
1043 }
1044 
1046 {
1047  pImpVclMEdit->SetModified( true );
1048 }
1049 
1051 {
1052  pImpVclMEdit->SetModified( false );
1053 }
1054 
1056 {
1057  return pImpVclMEdit->IsModified();
1058 }
1059 
1061 {
1062  if ( !nTimeout )
1064  else
1065  {
1066  if ( !pUpdateDataTimer )
1067  {
1068  pUpdateDataTimer.reset(new Timer("MultiLineEditTimer"));
1069  pUpdateDataTimer->SetInvokeHandler( LINK( this, VclMultiLineEdit, ImpUpdateDataHdl ) );
1070  }
1071  pUpdateDataTimer->SetTimeout( nTimeout );
1072  }
1073 }
1074 
1075 void VclMultiLineEdit::SetReadOnly( bool bReadOnly )
1076 {
1077  pImpVclMEdit->SetReadOnly( bReadOnly );
1078  Edit::SetReadOnly( bReadOnly );
1079 
1080  // #94921# ReadOnly can be overwritten in InitFromStyle() when WB not set.
1081  WinBits nStyle = GetStyle();
1082  if ( bReadOnly )
1083  nStyle |= WB_READONLY;
1084  else
1085  nStyle &= ~WB_READONLY;
1086  SetStyle( nStyle );
1087 }
1088 
1090 {
1091  if (!pImpVclMEdit) // might be called from within the dtor, when pImpVclMEdit == NULL is a valid state
1092  return true;
1093 
1094  return pImpVclMEdit->IsReadOnly();
1095 }
1096 
1097 void VclMultiLineEdit::SetMaxTextLen(sal_Int32 nMaxLen)
1098 {
1099  pImpVclMEdit->SetMaxTextLen(nMaxLen);
1100 }
1101 
1103 {
1104  pImpVclMEdit->SetMaxTextWidth(nMaxWidth );
1105 }
1106 
1108 {
1109  return pImpVclMEdit->GetMaxTextLen();
1110 }
1111 
1112 void VclMultiLineEdit::ReplaceSelected( const OUString& rStr )
1113 {
1114  pImpVclMEdit->InsertText( rStr );
1115 }
1116 
1118 {
1119  pImpVclMEdit->InsertText( OUString() );
1120 }
1121 
1123 {
1124  return pImpVclMEdit->GetSelected();
1125 }
1126 
1127 OUString VclMultiLineEdit::GetSelected( LineEnd aSeparator ) const
1128 {
1129  return pImpVclMEdit->GetSelected( aSeparator );
1130 }
1131 
1133 {
1134  pImpVclMEdit->Cut();
1135 }
1136 
1138 {
1139  pImpVclMEdit->Copy();
1140 }
1141 
1143 {
1144  pImpVclMEdit->Paste();
1145 }
1146 
1147 void VclMultiLineEdit::SetText( const OUString& rStr )
1148 {
1149  pImpVclMEdit->SetText( rStr );
1150 }
1151 
1153 {
1154  return pImpVclMEdit ? pImpVclMEdit->GetText() : OUString();
1155 }
1156 
1157 OUString VclMultiLineEdit::GetText( LineEnd aSeparator ) const
1158 {
1159  return pImpVclMEdit ? pImpVclMEdit->GetText( aSeparator ) : OUString();
1160 }
1161 
1162 OUString VclMultiLineEdit::GetTextLines( LineEnd aSeparator ) const
1163 {
1164  return pImpVclMEdit ? pImpVclMEdit->GetTextLines( aSeparator ) : OUString();
1165 }
1166 
1168 {
1169  pImpVclMEdit->Resize();
1170 }
1171 
1173 {
1174  if ( !pImpVclMEdit ) // might be called from within the dtor, when pImpVclMEdit == NULL is a valid state
1175  return;
1176 
1177  pImpVclMEdit->GetFocus();
1178 }
1179 
1181 {
1182  pImpVclMEdit->SetSelection( rSelection );
1183 }
1184 
1186 {
1187  return pImpVclMEdit->GetSelection();
1188 }
1189 
1191 {
1192  Size aSz = pImpVclMEdit->CalcMinimumSize();
1193 
1194  sal_Int32 nLeft, nTop, nRight, nBottom;
1195  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1196  aSz.AdjustWidth(nLeft+nRight );
1197  aSz.AdjustHeight(nTop+nBottom );
1198 
1199  return aSz;
1200 }
1201 
1203 {
1204  Size aSz = rPrefSize;
1205  sal_Int32 nLeft, nTop, nRight, nBottom;
1206  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1207 
1208  // center vertically for whole lines
1209 
1210  long nHeight = aSz.Height() - nTop - nBottom;
1211  long nLineHeight = pImpVclMEdit->CalcBlockSize( 1, 1 ).Height();
1212  long nLines = nHeight / nLineHeight;
1213  if ( nLines < 1 )
1214  nLines = 1;
1215 
1216  aSz.setHeight( nLines * nLineHeight );
1217  aSz.AdjustHeight(nTop+nBottom );
1218 
1219  return aSz;
1220 }
1221 
1222 Size VclMultiLineEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
1223 {
1224  Size aSz = pImpVclMEdit->CalcBlockSize( nColumns, nLines );
1225 
1226  sal_Int32 nLeft, nTop, nRight, nBottom;
1227  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1228  aSz.AdjustWidth(nLeft+nRight );
1229  aSz.AdjustHeight(nTop+nBottom );
1230  return aSz;
1231 }
1232 
1233 void VclMultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
1234 {
1235  pImpVclMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
1236 }
1237 
1239 {
1240  if( nType == StateChangedType::Enable )
1241  {
1242  pImpVclMEdit->Enable( IsEnabled() );
1243  ImplInitSettings( false );
1244  }
1245  else if( nType == StateChangedType::ReadOnly )
1246  {
1247  pImpVclMEdit->SetReadOnly( IsReadOnly() );
1248  }
1249  else if ( nType == StateChangedType::Zoom )
1250  {
1251  pImpVclMEdit->GetTextWindow()->SetZoom( GetZoom() );
1252  ImplInitSettings( false );
1253  Resize();
1254  }
1255  else if ( nType == StateChangedType::ControlFont )
1256  {
1257  ImplInitSettings( false );
1258  Resize();
1259  Invalidate();
1260  }
1261  else if ( nType == StateChangedType::ControlForeground )
1262  {
1263  ImplInitSettings( false );
1264  Invalidate();
1265  }
1266  else if ( nType == StateChangedType::ControlBackground )
1267  {
1268  ImplInitSettings( true );
1269  Invalidate();
1270  }
1271  else if ( nType == StateChangedType::Style )
1272  {
1273  pImpVclMEdit->InitFromStyle( GetStyle() );
1275  }
1276  else if ( nType == StateChangedType::InitShow )
1277  {
1278  if( IsPaintTransparent() )
1279  {
1280  pImpVclMEdit->GetTextWindow()->SetPaintTransparent( true );
1281  pImpVclMEdit->GetTextWindow()->SetBackground();
1282  pImpVclMEdit->GetTextWindow()->SetControlBackground();
1283  SetBackground();
1285  }
1286  }
1287 
1288  Control::StateChanged( nType );
1289 }
1290 
1292 {
1293  if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
1294  (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
1295  {
1296  ImplInitSettings( true );
1297  Resize();
1298  Invalidate();
1299  }
1300  else
1301  Control::DataChanged( rDCEvt );
1302 }
1303 
1304 void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags )
1305 {
1306  ImplInitSettings(true);
1307 
1308  Point aPos = pDev->LogicToPixel( rPos );
1309  Size aSize = pDev->LogicToPixel( rSize );
1310 
1311  vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont(pDev);
1312  aFont.SetTransparent( true );
1313  OutDevType eOutDevType = pDev->GetOutDevType();
1314 
1315  pDev->Push();
1316  pDev->SetMapMode();
1317  pDev->SetFont( aFont );
1318  pDev->SetTextFillColor();
1319 
1320  // Border/Background
1321  pDev->SetLineColor();
1322  pDev->SetFillColor();
1323  bool bBorder = (GetStyle() & WB_BORDER);
1324  bool bBackground = IsControlBackground();
1325  if ( bBorder || bBackground )
1326  {
1327  tools::Rectangle aRect( aPos, aSize );
1328  if ( bBorder )
1329  {
1330  DecorationView aDecoView( pDev );
1331  aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
1332  }
1333  if ( bBackground )
1334  {
1336  pDev->DrawRect( aRect );
1337  }
1338  }
1339 
1340  // contents
1341  if ( ( nFlags & DrawFlags::Mono ) || ( eOutDevType == OUTDEV_PRINTER ) )
1342  pDev->SetTextColor( COL_BLACK );
1343  else
1344  {
1345  if ( !IsEnabled() )
1346  {
1347  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1348  pDev->SetTextColor( rStyleSettings.GetDisableColor() );
1349  }
1350  else
1351  {
1352  pDev->SetTextColor( GetTextColor() );
1353  }
1354  }
1355 
1356  OUString aText = GetText();
1357  Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
1358  sal_uLong nLines = static_cast<sal_uLong>(aSize.Height() / aTextSz.Height());
1359  if ( !nLines )
1360  nLines = 1;
1361  aTextSz.setHeight( nLines*aTextSz.Height() );
1362  long nOnePixel = GetDrawPixel( pDev, 1 );
1363  long nOffX = 3*nOnePixel;
1364  long nOffY = 2*nOnePixel;
1365 
1366  // Clipping?
1367  if ( ( nOffY < 0 ) || ( (nOffY+aTextSz.Height()) > aSize.Height() ) || ( (nOffX+aTextSz.Width()) > aSize.Width() ) )
1368  {
1369  tools::Rectangle aClip( aPos, aSize );
1370  if ( aTextSz.Height() > aSize.Height() )
1371  aClip.AdjustBottom(aTextSz.Height() - aSize.Height() + 1 ); // so that HP-printer does not 'optimize-away'
1372  pDev->IntersectClipRegion( aClip );
1373  }
1374 
1375  ExtTextEngine aTE;
1376  aTE.SetText( GetText() );
1377  aTE.SetMaxTextWidth( aSize.Width() );
1378  aTE.SetFont( aFont );
1379  aTE.SetTextAlign( pImpVclMEdit->GetTextWindow()->GetTextEngine()->GetTextAlign() );
1380  aTE.Draw( pDev, Point( aPos.X() + nOffX, aPos.Y() + nOffY ) );
1381 
1382  pDev->Pop();
1383 }
1384 
1386 {
1387  bool bDone = false;
1388  if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
1389  {
1390  bDone = pImpVclMEdit->HandleCommand( *rNEvt.GetCommandEvent() );
1391  }
1392  return bDone || Edit::EventNotify( rNEvt );
1393 }
1394 
1396 {
1397  bool bDone = false;
1398 
1399  if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( !GetTextView()->IsCursorEnabled() ) )
1400  {
1401  const KeyEvent& rKEvent = *rNEvt.GetKeyEvent();
1402  if ( !rKEvent.GetKeyCode().IsShift() && ( rKEvent.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) )
1403  {
1404  bDone = true;
1405  TextSelection aSel = pImpVclMEdit->GetTextWindow()->GetTextView()->GetSelection();
1406  if ( aSel.HasRange() )
1407  {
1408  aSel.GetStart() = aSel.GetEnd();
1409  pImpVclMEdit->GetTextWindow()->GetTextView()->SetSelection( aSel );
1410  }
1411  else
1412  {
1413  switch ( rKEvent.GetKeyCode().GetCode() )
1414  {
1415  case KEY_UP:
1416  {
1417  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1418  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineUp );
1419  }
1420  break;
1421  case KEY_DOWN:
1422  {
1423  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1424  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineDown );
1425  }
1426  break;
1427  case KEY_PAGEUP :
1428  {
1429  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1430  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageUp );
1431  }
1432  break;
1433  case KEY_PAGEDOWN:
1434  {
1435  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1436  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageDown );
1437  }
1438  break;
1439  case KEY_LEFT:
1440  {
1441  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1442  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineUp );
1443  }
1444  break;
1445  case KEY_RIGHT:
1446  {
1447  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1448  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineDown );
1449  }
1450  break;
1451  case KEY_HOME:
1452  {
1453  if ( rKEvent.GetKeyCode().IsMod1() )
1454  pImpVclMEdit->GetTextWindow()->GetTextView()->
1455  SetSelection( TextSelection( TextPaM( 0, 0 ) ) );
1456  }
1457  break;
1458  case KEY_END:
1459  {
1460  if ( rKEvent.GetKeyCode().IsMod1() )
1461  pImpVclMEdit->GetTextWindow()->GetTextView()->
1463  }
1464  break;
1465  default:
1466  {
1467  bDone = false;
1468  }
1469  }
1470  }
1471  }
1472  }
1473 
1474  return bDone || Edit::PreNotify( rNEvt );
1475 }
1476 
1477 // Internals for derived classes, e.g. TextComponent
1478 
1480 {
1481  return pImpVclMEdit->GetTextWindow()->GetTextEngine();
1482 }
1483 
1485 {
1486  return pImpVclMEdit->GetTextWindow()->GetTextView();
1487 }
1488 
1490 {
1491  return pImpVclMEdit->GetVScrollBar();
1492 }
1493 
1495 {
1496  pImpVclMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
1497 }
1498 
1499 void VclMultiLineEdit::SetRightToLeft( bool bRightToLeft )
1500 {
1501  if ( GetTextEngine() )
1502  {
1503  GetTextEngine()->SetRightToLeft( bRightToLeft );
1504  GetTextView()->ShowCursor();
1505  }
1506 }
1507 
1509 {
1510  pImpVclMEdit->GetTextWindow()->DisableSelectionOnFocus();
1511 }
1512 
1514 {
1515  GetTextView()->EnableCursor( bEnable );
1516 }
1517 
1519 {
1520  return pImpVclMEdit->GetTextWindow();
1521 }
1522 
1524 {
1526 }
1527 
1528 bool VclMultiLineEdit::set_property(const OString &rKey, const OUString &rValue)
1529 {
1530  if (rKey == "cursor-visible")
1531  EnableCursor(toBool(rValue));
1532  else if (rKey == "accepts-tab")
1533  pImpVclMEdit->GetTextWindow()->SetIgnoreTab(!toBool(rValue));
1534  else
1535  return Edit::set_property(rKey, rValue);
1536  return true;
1537 }
1538 
1539 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
const Color & GetTextColor() const
Definition: outdev.hxx:1117
OutDevType GetOutDevType() const
Definition: outdev.hxx:522
bool IsControlBackground() const
Definition: window2.cxx:1087
bool mbFocusSelectionHide
Definition: vclmedit.hxx:42
void ImpSetScrollBarRanges()
Definition: vclmedit.cxx:215
long GetTextHeight() const
Definition: texteng.cxx:1103
long GetVisibleSize() const
Definition: scrbar.hxx:128
void SetFillColor(const Color &)
Definition: font/font.cxx:88
std::unique_ptr< TextView > mpExtTextView
Definition: vclmedit.hxx:39
void StateChanged(StateChangedType nType) override
Definition: vclmedit.cxx:1238
VclPtr< ScrollBar > mpHScrollBar
Definition: vclmedit.cxx:48
void SetAlign(WinBits nWinStyle)
Definition: vclmedit.cxx:268
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
virtual void GetFocus() override
Definition: vclmedit.cxx:850
bool IsRightToLeft() const
Definition: texteng.hxx:258
void InsertText(const OUString &rNew)
Definition: textview.cxx:1192
virtual void Resize() override
Definition: vclmedit.cxx:747
virtual void UpdateData()
Definition: vclmedit.cxx:1041
void SetFont(const vcl::Font &rFont)
Definition: texteng.cxx:168
Size CalcMinimumSize() const
Definition: vclmedit.cxx:567
long AdjustWidth(long n)
FncGetSpecialChars GetGetSpecialCharsFunction()
Definition: edit.cxx:2709
CommandEventId
void EnableFocusSelectionHide(bool bHide)
Definition: vclmedit.cxx:1494
bool HasRange() const
Definition: textdata.hxx:99
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:327
void SetMaxTextWidth(long nMaxWidth)
Definition: vclmedit.cxx:327
Selection maSelection
Definition: vclmedit.cxx:53
long Height() const
WinBits const WB_NODIALOGCONTROL
void SetRightToLeft(bool bR2L)
Definition: texteng.cxx:2684
WinBits const WB_NOGROUP
OUString GetText(LineEnd aSeparator=LINEEND_LF) const
Definition: texteng.cxx:254
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
sal_uIntPtr sal_uLong
IMPL_LINK(ImpVclMEdit, ScrollHdl, ScrollBar *, pCurScrollBar, void)
Definition: vclmedit.cxx:255
void disposeAndClear()
Definition: vclptr.hxx:200
const StyleSettings & GetStyleSettings() const
WeakReference< XInterface > mxParent
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:848
sal_Int64 n
virtual void Copy() override
Definition: vclmedit.cxx:1137
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2418
WinBits const WB_RIGHT
void SetReadOnly(bool bRdOnly)
Definition: vclmedit.cxx:291
void EnableCursor(bool bEnable)
Definition: vclmedit.cxx:1513
const Color & GetWorkspaceColor() const
virtual void ClearModifyFlag() override
Definition: vclmedit.cxx:1050
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: edit.cxx:216
IMPL_LINK_NOARG(VclMultiLineEdit, ImpUpdateDataHdl, Timer *, void)
Definition: vclmedit.cxx:1036
WinBits const WB_AUTOVSCROLL
const TextPaM & GetEnd() const
Definition: textdata.hxx:94
sal_uInt16 GetGroup() const
Definition: keycod.hxx:66
void SetTextFillColor()
Definition: text.cxx:700
sal_uInt16 GetCode() const
Definition: keycod.hxx:53
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: vclmedit.cxx:674
DataChangedEventType GetType() const
Definition: event.hxx:357
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:311
virtual void Paste() override
Definition: vclmedit.cxx:1142
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: vclmedit.cxx:742
bool mbActivePopup
Definition: vclmedit.hxx:44
void IntersectClipRegion(const tools::Rectangle &rRect)
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
Definition: menu.cxx:2764
long CalcZoom(long n) const
Definition: window2.cxx:397
WinBits const WB_VSCROLL
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: edit.cxx:179
void Copy()
Definition: vclmedit.cxx:403
const Color & GetControlBackground() const
Definition: window2.cxx:1082
TextView * GetTextView() const
Definition: vclmedit.cxx:1484
sal_Int32 GetMaxTextLen() const
Definition: vclmedit.cxx:307
void SetType(WindowType nType)
Definition: window2.cxx:968
void SetIgnoreTab(bool bIgnore)
Definition: vclmedit.hxx:70
float x
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
Definition: window2.cxx:609
long AdjustHeight(long n)
void Draw(OutputDevice *pDev, const Point &rPos)
Definition: texteng.cxx:2643
void SetMapMode()
Definition: map.cxx:655
const vcl::Font & GetFieldFont() const
const Color & GetFieldTextColor() const
SfxHintId GetId() const
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
long AdjustBottom(long nVertMoveDelta)
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
const Fraction & GetZoom() const
Definition: window2.cxx:1210
StateChangedType
Definition: window.hxx:311
void Paste()
Definition: textview.cxx:1042
weld::Window * GetFrameWeld() const
Definition: window2.cxx:853
void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: vclmedit.cxx:1291
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2735
bool IsReadOnly() const
Definition: vclmedit.cxx:297
sal_Int64 WinBits
sal_uInt16 sal_Unicode
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
VclPtr< VclMultiLineEdit > pVclMultiLineEdit
Definition: vclmedit.cxx:45
void SetBackground()
void Scroll(long nHorzScroll, long nVertScroll)
Definition: textview.cxx:910
ESelection aNewSelection(GetSelection())
virtual void LoseFocus() override
Definition: vclmedit.cxx:872
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2449
virtual void Command(const CommandEvent &rCEvt) override
Definition: vclmedit.cxx:751
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:1518
void ImpSetHScrollBarThumbPos()
Definition: vclmedit.cxx:245
const vcl::Font & GetFont() const
Definition: outdev.hxx:643
bool IsModified() const
Definition: vclmedit.cxx:286
virtual void Modify() override
Definition: vclmedit.cxx:1016
bool IsControlForeground() const
Definition: window2.cxx:1077
WinBits const WB_HSCROLL
bool IsMouseEvent() const
virtual bool IsReadOnly() const override
Definition: vclmedit.cxx:1089
AllSettingsFlags GetFlags() const
Definition: event.hxx:358
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
virtual void GetFocus() override
Definition: vclmedit.cxx:1172
Link< Edit &, void > aModifyHdlLink
Definition: vclmedit.hxx:82
void SetMaxTextWidth(long nWidth)
Definition: texteng.cxx:216
ScrollBar & GetVScrollBar()
Definition: vclmedit.cxx:111
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:947
VclPtr< ScrollBar > mpVScrollBar
Definition: vclmedit.cxx:49
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: vclmedit.cxx:1528
void Cut()
Definition: textview.cxx:963
constexpr sal_uInt16 KEYGROUP_CURSOR
Definition: keycodes.hxx:40
void GetMaxVisColumnsAndLines(sal_uInt16 &rnCols, sal_uInt16 &rnLines) const
Definition: vclmedit.cxx:1233
virtual void SetModifyFlag() override
Definition: vclmedit.cxx:1045
Definition: edit.hxx:56
WinBits const WB_NOHIDESELECTION
std::unique_ptr< ImpVclMEdit > pImpVclMEdit
Definition: vclmedit.hxx:80
sal_uInt16 nCode
virtual void SetMaxTextLen(sal_Int32 nMaxLen) override
Definition: vclmedit.cxx:1097
OUString GetTextLines(LineEnd aSeparator=LINEEND_LF) const
Definition: texteng.cxx:259
const Point & GetStartDocPos() const
Definition: textview.cxx:2094
virtual ~TextWindow() override
Definition: vclmedit.cxx:669
virtual ~VclMultiLineEdit() override
Definition: vclmedit.cxx:892
TextView * GetTextView() const
Definition: vclmedit.hxx:53
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: vclmedit.cxx:918
virtual ~ImpVclMEdit() override
Definition: vclmedit.cxx:205
const Color & GetControlForeground() const
Definition: window2.cxx:1072
long GetDrawPixel(::OutputDevice const *pDev, long nPixels) const
Definition: window2.cxx:563
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true)
Definition: textview.cxx:897
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:688
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
void ImpInitScrollBars()
Definition: vclmedit.cxx:223
virtual FactoryFunction GetUITestFactory() const override
Definition: vclmedit.cxx:1523
long Min() const
void SetReadOnly(bool bReadOnly)
Definition: textview.cxx:1067
void SetLineColor()
void SetMaxTextLen(sal_Int32 nLen)
Definition: vclmedit.cxx:302
ScrollBar & GetVScrollBar() const
Definition: vclmedit.cxx:1489
void clear()
Definition: vclptr.hxx:190
VclPtr< PopupMenu > CreatePopupMenu()
Definition: edit.cxx:2715
const Color & GetDisableColor() const
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:109
void Resize()
Definition: vclmedit.cxx:332
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:696
bool IsModified() const
Definition: texteng.hxx:273
void Paste()
Definition: vclmedit.cxx:408
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
void SelectionChanged()
Definition: vclmedit.cxx:1026
int i
DrawFlags
Definition: window.hxx:354
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: vclmedit.cxx:443
void SetMaxTextWidth(long nMaxWidth)
Definition: vclmedit.cxx:1102
void InsertText(const OUString &rStr)
Definition: vclmedit.cxx:312
OutDevType
Definition: outdev.hxx:278
void SetModified(bool bMod)
Definition: vclmedit.cxx:281
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
void DisableSelectionOnFocus()
Definition: vclmedit.cxx:1508
void SetControlBackground()
Definition: window2.cxx:497
void SetVisibleSize(long nNewSize)
Definition: scrbar.cxx:1377
virtual void SetReadOnly(bool bReadOnly=true)
Definition: edit.cxx:2345
void SetRange(const Range &rRange)
Definition: scrbar.cxx:1338
virtual void Cut() override
Definition: vclmedit.cxx:1132
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:634
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1160
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: ctrl.cxx:297
bool IsReadOnly() const
Definition: textview.cxx:2098
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
const Color & GetFieldColor() const
CommandEventId GetCommand() const
void SetTextColor(const Color &rColor)
Definition: text.cxx:665
static bool GetLayoutRTL()
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
const TextPaM & GetStart() const
Definition: textdata.hxx:91
std::unique_ptr< Timer > pUpdateDataTimer
Definition: vclmedit.hxx:84
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1395
Size CalcAdjustedSize(const Size &rPrefSize) const
Definition: vclmedit.cxx:1202
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.cxx:1479
MouseNotifyEvent GetType() const
Definition: event.hxx:303
void SetSelection(const Selection &rSelection)
Definition: vclmedit.cxx:499
void SetPageSize(long nNewSize)
Definition: scrbar.hxx:125
virtual sal_Int32 GetMaxTextLen() const override
Definition: vclmedit.cxx:1107
sal_Int32 GetMaxTextLen() const
Definition: texteng.hxx:238
VclMultiLineEdit(vcl::Window *pParent, WinBits nWinStyle)
Definition: vclmedit.cxx:880
ScrollBar & GetHScrollBar()
Definition: vclmedit.cxx:110
virtual OUString GetSelected() const override
Definition: vclmedit.cxx:1122
void Enable(bool bEnable)
Definition: vclmedit.cxx:616
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.hxx:52
static bool toBool(const OString &rValue)
Definition: builder.cxx:76
const AllSettings & GetSettings() const
Definition: outdev.hxx:420
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
bool mbInMBDown
Definition: vclmedit.hxx:41
void EnableCursor(bool bEnable)
Definition: textview.cxx:2088
void SetSelection(const TextSelection &rNewSel)
Definition: textview.cxx:231
TextWindow(Edit *pParent)
Definition: vclmedit.cxx:642
#define TEXT_PARA_ALL
Definition: textdata.hxx:33
void EnableUpdateData(sal_uLong nTimeout)
Definition: vclmedit.cxx:1060
virtual void SetReadOnly(bool bReadOnly=true) override
Definition: vclmedit.cxx:1075
void GrabFocus()
Definition: window.cxx:3034
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:891
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:580
sal_Int32 GetTextLen() const
Definition: texteng.cxx:285
WinBits const WB_LEFT
bool mbIgnoreTab
Definition: vclmedit.hxx:43
void SetStyle(WinBits nStyle)
Definition: window.cxx:1979
bool IsCursorEnabled() const
Definition: textview.cxx:2090
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
Definition: menu.cxx:905
virtual Size CalcMinimumSize() const override
Definition: vclmedit.cxx:1190
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1268
void SetColor(const Color &)
Definition: font/font.cxx:80
LineEnd
std::unique_ptr< ExtTextEngine > mpExtTextEngine
Definition: vclmedit.hxx:38
bool HandleCommand(const CommandEvent &rCEvt)
Definition: vclmedit.cxx:625
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
void SetLineSize(long nNewSize)
Definition: scrbar.hxx:123
void SetText(const OUString &rStr)
Definition: texteng.cxx:428
OUString GetTextLines(LineEnd aSeparator) const
Definition: vclmedit.cxx:1162
const Point & GetMousePosPixel() const
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:934
DECL_LINK(ScrollHdl, ScrollBar *, void)
const TextSelection & GetSelection() const
Definition: textview.cxx:236
constexpr sal_uInt16 KEY_S
Definition: keycodes.hxx:74
const LanguageTag & getLocale()
virtual void Resize() override
Definition: vclmedit.cxx:1167
WinBits const WB_SIZEABLE
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: window.cxx:2440
virtual const Selection & GetSelection() const override
Definition: vclmedit.cxx:1185
void SetTextAlign(TxtAlign eAlign)
Definition: texteng.cxx:2509
void SetPointer(PointerStyle)
Definition: mouse.cxx:475
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:54
bool IsShift() const
Definition: keycod.hxx:58
OUString GetTextLines(LineEnd aSeparator) const
Definition: vclmedit.cxx:438
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:1222
void SetMaxTextLen(sal_Int32 nLen)
Definition: texteng.cxx:211
void ImpUpdateSrollBarVis(WinBits nWinStyle)
Definition: vclmedit.cxx:129
WinBits const WB_BORDER
void SetFont(const vcl::Font &rNewFont)
WinBits const WB_IGNORETAB
virtual void DeleteSelected() override
Definition: vclmedit.cxx:1117
WinBits const WB_READONLY
void ShowItem(sal_uInt16 nItemId, bool bVisible=true)
Definition: menu.cxx:950
VclPtr< TextWindow > mpTextWindow
Definition: vclmedit.cxx:47
void SetTransparent(bool bTransparent)
Definition: font/font.cxx:95
bool IsVisible() const
Definition: window2.cxx:1102
bool mbSelectOnTab
Definition: vclmedit.hxx:45
virtual void ReplaceSelected(const OUString &rStr) override
Definition: vclmedit.cxx:1112
void Justify()
Definition: textdata.cxx:44
const Selection & GetSelection() const
Definition: vclmedit.cxx:537
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:133
void SetModified(bool bModified)
Definition: texteng.hxx:272
bool IsMod1() const
Definition: keycod.hxx:60
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
long CalcTextWidth()
Definition: texteng.cxx:1142
void Copy()
Definition: textview.cxx:993
void SetRightToLeft(bool bRightToLeft)
Definition: vclmedit.cxx:1499
void InitFromStyle(WinBits nWinStyle)
Definition: vclmedit.cxx:176
OUString GetSelected() const
Definition: vclmedit.cxx:317
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:880
WinBits const WB_TABSTOP
void GetMaxVisColumnsAndLines(sal_uInt16 &rnCols, sal_uInt16 &rnLines) const
Definition: vclmedit.cxx:607
void ImplInitSettings()
Definition: ctrl.cxx:428
virtual void KeyInput(const KeyEvent &rKEvent) override
Definition: vclmedit.cxx:701
bool IsPaintTransparent() const
Definition: window2.cxx:1037
WinBits const WB_CENTER
OUString GetText() const
Definition: vclmedit.cxx:428
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1385
OUString GetSelected()
Definition: textview.cxx:1048
OUString GetText() const override
Definition: vclmedit.cxx:1152
bool IsEnabled() const
Definition: window2.cxx:1122
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: vclmedit.cxx:897
WinBits GetStyle() const
Definition: window2.cxx:953
Definition: timer.hxx:26
void GetFocus()
Definition: vclmedit.cxx:392
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
Definition: window2.cxx:449
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
long Max() const
WinBits const WB_GROUP
long GetScrollBarSize() const
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:682
bool IsReallyVisible() const
Definition: window2.cxx:1107
ImpVclMEdit(VclMultiLineEdit *pVclMultiLineEdit, WinBits nWinStyle)
Definition: vclmedit.cxx:114
#define TEXT_INDEX_ALL
Definition: textdata.hxx:34
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: outdevstate.cxx:60
OString GetItemIdent(sal_uInt16 nItemId) const
Definition: menu.cxx:676
void setWidth(long nWidth)
void SetAutoFocusHide(bool bAutoHide)
Definition: vclmedit.hxx:68
void Draw(OutputDevice *pDev, const Point &rPos, const Size &rSize, DrawFlags nFlags) override
Definition: vclmedit.cxx:1304
void SetText(const OUString &rStr)
Definition: vclmedit.cxx:414
WinBits const WB_NOTABSTOP
static WinBits ImplInitStyle(WinBits nStyle)
Definition: vclmedit.cxx:904
void Cut()
Definition: vclmedit.cxx:397
virtual void SetText(const OUString &rStr) override
Definition: vclmedit.cxx:1147
void SetThumbPos(long nThumbPos)
Definition: scrbar.cxx:1363
virtual void SetSelection(const Selection &rSelection) override
Definition: vclmedit.cxx:1180
VclPtr< ScrollBarBox > mpScrollBox
Definition: vclmedit.cxx:50
constexpr sal_uInt16 KEY_TAB
Definition: keycodes.hxx:121
#define EDIT_NOLIMIT
Definition: edit.hxx:52
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:35
VclPtr< Edit > mxParent
Definition: vclmedit.hxx:37
void DisableUpdateData()
Definition: vclmedit.hxx:117
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: ctrl.cxx:225
bool IsMod2() const
Definition: keycod.hxx:62
WinBits const WB_DRAG
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2204
virtual bool IsModified() const override
Definition: vclmedit.cxx:1055
void setHeight(long nHeight)
long mnTextWidth
Definition: vclmedit.cxx:52