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/toolkit/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 #include <tools/json_writer.hxx>
42 
43 class ImpVclMEdit : public SfxListener
44 {
45 private:
47 
52 
55 
56 protected:
57  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
58  void ImpUpdateScrollBarVis( WinBits nWinStyle );
59  void ImpInitScrollBars();
60  void ImpSetScrollBarRanges();
62  DECL_LINK( ScrollHdl, ScrollBar*, void );
63 
64 public:
65  ImpVclMEdit( VclMultiLineEdit* pVclMultiLineEdit, WinBits nWinStyle );
66  virtual ~ImpVclMEdit() override;
67 
68  void SetModified( bool bMod );
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  ImpUpdateScrollBarVis( 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 
286 void ImpVclMEdit::SetReadOnly( bool bRdOnly )
287 {
288  mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
289  // TODO: Adjust color?
290 }
291 
293 {
294  return mpTextWindow->GetTextView()->IsReadOnly();
295 }
296 
297 void ImpVclMEdit::SetMaxTextLen(sal_Int32 nLen)
298 {
300 }
301 
302 sal_Int32 ImpVclMEdit::GetMaxTextLen() const
303 {
305 }
306 
307 void ImpVclMEdit::InsertText( const OUString& rStr )
308 {
309  mpTextWindow->GetTextView()->InsertText( rStr );
310 }
311 
312 OUString ImpVclMEdit::GetSelected() const
313 {
314  return mpTextWindow->GetTextView()->GetSelected();
315 }
316 
317 OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
318 {
319  return mpTextWindow->GetTextView()->GetSelected( aSeparator );
320 }
321 
322 void ImpVclMEdit::SetMaxTextWidth(long nMaxWidth)
323 {
325 }
326 
328 {
329  int nIteration = 1;
330  do
331  {
332  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
333  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
334  ImpUpdateScrollBarVis( nWinStyle );
335 
337  Size aEditSize = aSz;
339  nSBWidth = pVclMultiLineEdit->CalcZoom( nSBWidth );
340 
341  if (mpHScrollBar->IsVisible())
342  aSz.AdjustHeight( -(nSBWidth+1) );
343  if (mpVScrollBar->IsVisible())
344  aSz.AdjustWidth( -(nSBWidth+1) );
345 
346  if (!mpHScrollBar->IsVisible())
348  else
349  mpHScrollBar->setPosSizePixel( 0, aEditSize.Height()-nSBWidth, aSz.Width(), nSBWidth );
350 
351  Point aTextWindowPos;
352  if (mpVScrollBar->IsVisible())
353  {
355  {
356  mpVScrollBar->setPosSizePixel( 0, 0, nSBWidth, aSz.Height() );
357  aTextWindowPos.AdjustX(nSBWidth );
358  }
359  else
360  mpVScrollBar->setPosSizePixel( aEditSize.Width()-nSBWidth, 0, nSBWidth, aSz.Height() );
361  }
362 
363  if (mpScrollBox->IsVisible())
364  mpScrollBox->setPosSizePixel( aSz.Width(), aSz.Height(), nSBWidth, nSBWidth );
365 
366  Size aTextWindowSize( aSz );
367  if ( aTextWindowSize.Width() < 0 )
368  aTextWindowSize.setWidth( 0 );
369  if ( aTextWindowSize.Height() < 0 )
370  aTextWindowSize.setHeight( 0 );
371 
372  Size aOldTextWindowSize( mpTextWindow->GetSizePixel() );
373  mpTextWindow->SetPosSizePixel( aTextWindowPos, aTextWindowSize );
374  if ( aOldTextWindowSize == aTextWindowSize )
375  break;
376 
377  // Changing the text window size might effectively have changed the need for
378  // scrollbars, so do another iteration.
379  ++nIteration;
380  OSL_ENSURE( nIteration < 3, "ImpVclMEdit::Resize: isn't this expected to terminate with the second iteration?" );
381 
382  } while ( nIteration <= 3 ); // artificial break after four iterations
383 
385 }
386 
388 {
390 }
391 
393 {
394  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
396 }
397 
399 {
401 }
402 
404 {
405  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
407 }
408 
409 void ImpVclMEdit::SetText( const OUString& rStr )
410 {
411  bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
412  mpTextWindow->GetTextEngine()->SetText( rStr );
413  if ( !bWasModified )
415 
417 
418  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
419  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
420  ImpUpdateScrollBarVis( nWinStyle );
421 }
422 
423 OUString ImpVclMEdit::GetText() const
424 {
425  return mpTextWindow->GetTextEngine()->GetText();
426 }
427 
428 OUString ImpVclMEdit::GetText( LineEnd aSeparator ) const
429 {
430  return mpTextWindow->GetTextEngine()->GetText( aSeparator );
431 }
432 
433 OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
434 {
435  return mpTextWindow->GetTextEngine()->GetTextLines( aSeparator );
436 }
437 
439 {
440  const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
441  if ( !pTextHint )
442  return;
443 
444  switch (pTextHint->GetId())
445  {
446  case SfxHintId::TextViewScrolled:
447  if (mpHScrollBar->IsVisible())
449  if (mpVScrollBar->IsVisible())
451  break;
452 
453  case SfxHintId::TextHeightChanged:
454  if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
455  {
456  long nOutHeight = mpTextWindow->GetOutputSizePixel().Height();
457  long nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
458  if ( nTextHeight < nOutHeight )
460  }
462  break;
463 
464  case SfxHintId::TextFormatted:
465  if (mpHScrollBar->IsVisible())
466  {
467  const long nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
468  if ( nWidth != mnTextWidth )
469  {
470  mnTextWidth = nWidth;
473  }
474  }
475  break;
476 
477  case SfxHintId::TextModified:
480  break;
481 
482  case SfxHintId::TextViewSelectionChanged:
484  break;
485 
486  case SfxHintId::TextViewCaretChanged:
488  break;
489 
490  default: break;
491  }
492 }
493 
494 void ImpVclMEdit::SetSelection( const Selection& rSelection )
495 {
496  OUString aText = mpTextWindow->GetTextEngine()->GetText();
497 
498  Selection aNewSelection( rSelection );
499  if ( aNewSelection.Min() < 0 )
500  aNewSelection.Min() = 0;
501  else if ( aNewSelection.Min() > aText.getLength() )
502  aNewSelection.Min() = aText.getLength();
503  if ( aNewSelection.Max() < 0 )
504  aNewSelection.Max() = 0;
505  else if ( aNewSelection.Max() > aText.getLength() )
506  aNewSelection.Max() = aText.getLength();
507 
508  long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
509  TextSelection aTextSel;
510  sal_uInt32 nPara = 0;
511  sal_Int32 nChar = 0;
512  long x = 0;
513  while ( x <= nEnd )
514  {
515  if ( x == aNewSelection.Min() )
516  aTextSel.GetStart() = TextPaM( nPara, nChar );
517  if ( x == aNewSelection.Max() )
518  aTextSel.GetEnd() = TextPaM( nPara, nChar );
519 
520  if ( ( x < aText.getLength() ) && ( aText[ x ] == '\n' ) )
521  {
522  nPara++;
523  nChar = 0;
524  }
525  else
526  nChar++;
527  x++;
528  }
529  mpTextWindow->GetTextView()->SetSelection( aTextSel );
530 }
531 
533 {
536  aTextSel.Justify();
537  // flatten selection => every line-break a character
538 
539  ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
540  // paragraphs before
541  for ( sal_uInt32 n = 0; n < aTextSel.GetStart().GetPara(); ++n )
542  {
543  maSelection.Min() += pExtTextEngine->GetTextLen( n );
544  maSelection.Min()++;
545  }
546 
547  // first paragraph with selection
549  maSelection.Min() += aTextSel.GetStart().GetIndex();
550 
551  for ( sal_uInt32 n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); ++n )
552  {
553  maSelection.Max() += pExtTextEngine->GetTextLen( n );
554  maSelection.Max()++;
555  }
556 
557  maSelection.Max() += aTextSel.GetEnd().GetIndex();
558 
559  return maSelection;
560 }
561 
563 {
566 
567  if (mpHScrollBar->IsVisible())
569  if (mpVScrollBar->IsVisible())
570  aSz.AdjustWidth(mpVScrollBar->GetSizePixel().Width() );
571 
572  return aSz;
573 }
574 
575 Size ImpVclMEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
576 {
577  static const sal_Unicode sampleChar = 'X';
578 
579  Size aSz;
580  Size aCharSz;
581  aCharSz.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) );
582  aCharSz.setHeight( mpTextWindow->GetTextHeight() );
583 
584  if ( nLines )
585  aSz.setHeight( nLines*aCharSz.Height() );
586  else
588 
589  if ( nColumns )
590  aSz.setWidth( nColumns*aCharSz.Width() );
591  else
593 
594  if (mpHScrollBar->IsVisible())
596  if (mpVScrollBar->IsVisible())
598 
599  return aSz;
600 }
601 
602 void ImpVclMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
603 {
604  static const sal_Unicode sampleChar = { 'x' };
606  Size aCharSz( mpTextWindow->GetTextWidth( OUString(sampleChar) ), mpTextWindow->GetTextHeight() );
607  rnCols = static_cast<sal_uInt16>(aOutSz.Width()/aCharSz.Width());
608  rnLines = static_cast<sal_uInt16>(aOutSz.Height()/aCharSz.Height());
609 }
610 
611 void ImpVclMEdit::Enable( bool bEnable )
612 {
613  mpTextWindow->Enable( bEnable );
614  if (mpHScrollBar->IsVisible())
615  mpHScrollBar->Enable( bEnable );
616  if (mpVScrollBar->IsVisible())
617  mpVScrollBar->Enable( bEnable );
618 }
619 
621 {
622  bool bDone = false;
623  CommandEventId nCommand = rCEvt.GetCommand();
624  if (nCommand == CommandEventId::Wheel ||
625  nCommand == CommandEventId::StartAutoScroll ||
626  nCommand == CommandEventId::AutoScroll ||
627  nCommand == CommandEventId::Gesture)
628  {
629  ScrollBar* pHScrollBar = mpHScrollBar->IsVisible() ? mpHScrollBar.get() : nullptr;
630  ScrollBar* pVScrollBar = mpVScrollBar->IsVisible() ? mpVScrollBar.get() : nullptr;
631  mpTextWindow->HandleScrollCommand(rCEvt, pHScrollBar, pVScrollBar);
632  bDone = true;
633  }
634  return bDone;
635 }
636 
638  : Window(pParent)
639  , mxParent(pParent)
640 {
641  mbInMBDown = false;
642  mbFocusSelectionHide = false;
643  mbIgnoreTab = false;
644  mbActivePopup = false;
645  mbSelectOnTab = true;
646 
648 
649  mpExtTextEngine.reset(new ExtTextEngine);
650  mpExtTextEngine->SetMaxTextLen(EDIT_NOLIMIT);
651  if( pParent->GetStyle() & WB_BORDER )
652  mpExtTextEngine->SetLeftMargin( 2 );
653  mpExtTextEngine->SetLocale( GetSettings().GetLanguageTag().getLocale() );
654  mpExtTextView.reset(new TextView( mpExtTextEngine.get(), this ));
655  mpExtTextEngine->InsertView( mpExtTextView.get() );
656  mpExtTextEngine->EnableUndo( true );
657  mpExtTextView->ShowCursor();
658 
659  Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
660  SetBackground( aBackgroundColor );
661  pParent->SetBackground( aBackgroundColor );
662 }
663 
665 {
666  disposeOnce();
667 }
668 
670 {
671  mxParent.clear();
672  mpExtTextView.reset();
673  mpExtTextEngine.reset();
674  Window::dispose();
675 }
676 
677 void TextWindow::MouseMove( const MouseEvent& rMEvt )
678 {
679  mpExtTextView->MouseMove( rMEvt );
680  Window::MouseMove( rMEvt );
681 }
682 
684 {
685  mbInMBDown = true; // so that GetFocus does not select everything
686  mpExtTextView->MouseButtonDown( rMEvt );
687  GrabFocus();
688  mbInMBDown = false;
689 }
690 
692 {
693  mpExtTextView->MouseButtonUp( rMEvt );
694 }
695 
696 void TextWindow::KeyInput( const KeyEvent& rKEvent )
697 {
698  bool bDone = false;
699  sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
700  if ( nCode == css::awt::Key::SELECT_ALL ||
701  ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
702  )
703  {
704  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
705  bDone = true;
706  }
707  else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
708  {
710  {
711  // to maintain the selection
712  mbActivePopup = true;
713  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
714  if (!aChars.isEmpty())
715  {
716  mpExtTextView->InsertText( aChars );
717  mpExtTextView->GetTextEngine()->SetModified( true );
718  }
719  mbActivePopup = false;
720  bDone = true;
721  }
722  }
723  else if ( nCode == KEY_TAB )
724  {
725  if ( !mbIgnoreTab || rKEvent.GetKeyCode().IsMod1() )
726  bDone = mpExtTextView->KeyInput( rKEvent );
727  }
728  else
729  {
730  bDone = mpExtTextView->KeyInput( rKEvent );
731  }
732 
733  if ( !bDone )
734  Window::KeyInput( rKEvent );
735 }
736 
737 void TextWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
738 {
739  mpExtTextView->Paint(rRenderContext, rRect);
740 }
741 
743 {
744 }
745 
746 void TextWindow::Command( const CommandEvent& rCEvt )
747 {
748  if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
749  {
751  bool bEnableCut = true;
752  bool bEnableCopy = true;
753  bool bEnableDelete = true;
754  bool bEnablePaste = true;
755  bool bEnableSpecialChar = true;
756  bool bEnableUndo = true;
757 
758  if ( !mpExtTextView->HasSelection() )
759  {
760  bEnableCut = false;
761  bEnableCopy = false;
762  bEnableDelete = false;
763  }
764  if ( mpExtTextView->IsReadOnly() )
765  {
766  bEnableCut = false;
767  bEnablePaste = false;
768  bEnableDelete = false;
769  bEnableSpecialChar = false;
770  }
771  if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
772  {
773  bEnableUndo = false;
774  }
775  pPopup->EnableItem(pPopup->GetItemId("cut"), bEnableCut);
776  pPopup->EnableItem(pPopup->GetItemId("copy"), bEnableCopy);
777  pPopup->EnableItem(pPopup->GetItemId("delete"), bEnableDelete);
778  pPopup->EnableItem(pPopup->GetItemId("paste"), bEnablePaste);
779  pPopup->EnableItem(pPopup->GetItemId("specialchar"), bEnableSpecialChar);
780  pPopup->EnableItem(pPopup->GetItemId("undo"), bEnableUndo);
781  pPopup->ShowItem(pPopup->GetItemId("specialchar"), !vcl::GetGetSpecialCharsFunction());
782 
783  mbActivePopup = true;
784  Point aPos = rCEvt.GetMousePosPixel();
785  if ( !rCEvt.IsMouseEvent() )
786  {
787  // Sometime do show Menu centered in the selection !!!
788  Size aSize = GetOutputSizePixel();
789  aPos = Point( aSize.Width()/2, aSize.Height()/2 );
790  }
791  sal_uInt16 n = pPopup->Execute( this, aPos );
792  OString sCommand = pPopup->GetItemIdent(n);
793  if (sCommand == "undo")
794  {
795  mpExtTextView->Undo();
796  mpExtTextEngine->SetModified( true );
797  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
798  }
799  else if (sCommand == "cut")
800  {
801  mpExtTextView->Cut();
802  mpExtTextEngine->SetModified( true );
803  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
804  }
805  else if (sCommand == "copy")
806  {
807  mpExtTextView->Copy();
808  }
809  else if (sCommand == "paste")
810  {
811  mpExtTextView->Paste();
812  mpExtTextEngine->SetModified( true );
813  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
814  }
815  else if (sCommand == "delete")
816  {
817  mpExtTextView->DeleteSelected();
818  mpExtTextEngine->SetModified( true );
819  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
820  }
821  else if (sCommand == "selectall")
822  {
823  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
824  }
825  else if (sCommand == "specialchar")
826  {
827  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
828  if (!aChars.isEmpty())
829  {
830  mpExtTextView->InsertText( aChars );
831  mpExtTextEngine->SetModified( true );
832  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
833  }
834  }
835  pPopup.clear();
836  mbActivePopup = false;
837  }
838  else
839  {
840  mpExtTextView->Command( rCEvt );
841  }
842  Window::Command( rCEvt );
843 }
844 
846 {
847  Window::GetFocus();
848  if ( mbActivePopup )
849  return;
850 
851  bool bGotoCursor = !mpExtTextView->IsReadOnly();
853  && ( mbSelectOnTab &&
854  (!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SelectionOptions::Focus ) )) )
855  {
856  // select everything, but do not scroll
857  bool bAutoScroll = mpExtTextView->IsAutoScroll();
858  mpExtTextView->SetAutoScroll( false );
859  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
860  mpExtTextView->SetAutoScroll( bAutoScroll );
861  bGotoCursor = false;
862  }
863  mpExtTextView->SetPaintSelection( true );
864  mpExtTextView->ShowCursor( bGotoCursor );
865 }
866 
868 {
869  Window::LoseFocus();
870 
872  mpExtTextView->SetPaintSelection( false );
873 }
874 
876  : Edit( pParent, nWinStyle )
877 {
878  SetType( WindowType::MULTILINEEDIT );
879  pImpVclMEdit.reset(new ImpVclMEdit( this, nWinStyle ));
880  ImplInitSettings( true );
881 
882  SetCompoundControl( true );
883  SetStyle( ImplInitStyle( nWinStyle ) );
884 }
885 
887 {
888  disposeOnce();
889 }
890 
892 {
893  pImpVclMEdit.reset();
894  Edit::dispose();
895 }
896 
898 {
899  if ( !(nStyle & WB_NOTABSTOP) )
900  nStyle |= WB_TABSTOP;
901 
902  if ( !(nStyle & WB_NOGROUP) )
903  nStyle |= WB_GROUP;
904 
905  if ( !(nStyle & WB_IGNORETAB ))
906  nStyle |= WB_NODIALOGCONTROL;
907 
908  return nStyle;
909 }
910 
912 {
913  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
914 
915  // The Font has to be adjusted, as the TextEngine does not take care of
916  // TextColor/Background
917 
918  Color aTextColor = rStyleSettings.GetFieldTextColor();
919  if (IsControlForeground())
920  aTextColor = GetControlForeground();
921 
922  if (!IsEnabled())
923  aTextColor = rStyleSettings.GetDisableColor();
924 
925  vcl::Font aFont = rStyleSettings.GetFieldFont();
927  ApplyControlFont(rRenderContext, aFont);
928 
929  vcl::Font theFont = rRenderContext.GetFont();
930  theFont.SetColor(aTextColor);
931  if (IsPaintTransparent())
932  theFont.SetFillColor(COL_TRANSPARENT);
933  else
934  theFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
935 
936  pImpVclMEdit->GetTextWindow()->SetFont(theFont);
937  // FIXME: next call causes infinite invalidation loop, rethink how to properly fix this situation
938  // pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(theFont);
939  pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
940 
941  if (IsPaintTransparent())
942  {
943  pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
944  pImpVclMEdit->GetTextWindow()->SetBackground();
945  pImpVclMEdit->GetTextWindow()->SetControlBackground();
946  rRenderContext.SetBackground();
948  }
949  else
950  {
951  if (IsControlBackground())
952  pImpVclMEdit->GetTextWindow()->SetBackground(GetControlBackground());
953  else
954  pImpVclMEdit->GetTextWindow()->SetBackground(rStyleSettings.GetFieldColor());
955  // also adjust for VclMultiLineEdit as the TextComponent might hide Scrollbars
956  rRenderContext.SetBackground(pImpVclMEdit->GetTextWindow()->GetBackground());
957  }
958 }
959 
961 {
962  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
963 
964  // The Font has to be adjusted, as the TextEngine does not take care of
965  // TextColor/Background
966 
967  Color aTextColor = rStyleSettings.GetFieldTextColor();
968  if (IsControlForeground())
969  aTextColor = GetControlForeground();
970  if (!IsEnabled())
971  aTextColor = rStyleSettings.GetDisableColor();
972 
973  vcl::Font aFont = rStyleSettings.GetFieldFont();
975  ApplyControlFont(*this, aFont);
976 
977  vcl::Font TheFont = GetFont();
978  TheFont.SetColor(aTextColor);
979  if (IsPaintTransparent())
980  TheFont.SetFillColor(COL_TRANSPARENT);
981  else
982  TheFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
983  pImpVclMEdit->GetTextWindow()->SetFont(TheFont);
984  pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(TheFont);
985  pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
986 
987  if (!bBackground)
988  return;
989 
990  if (IsPaintTransparent())
991  {
992  pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
993  pImpVclMEdit->GetTextWindow()->SetBackground();
994  pImpVclMEdit->GetTextWindow()->SetControlBackground();
995  SetBackground();
997  }
998  else
999  {
1000  if (IsControlBackground())
1001  pImpVclMEdit->GetTextWindow()->SetBackground(GetControlBackground());
1002  else
1003  pImpVclMEdit->GetTextWindow()->SetBackground(rStyleSettings.GetFieldColor());
1004  // also adjust for VclMultiLineEdit as the TextComponent might hide Scrollbars
1005  SetBackground(pImpVclMEdit->GetTextWindow()->GetBackground());
1006  }
1007 }
1008 
1010 {
1011  aModifyHdlLink.Call( *this );
1012 
1014 }
1015 
1017 {
1019 }
1020 
1022 {
1024 }
1025 
1027 {
1028  pImpVclMEdit->SetModified( true );
1029 }
1030 
1031 void VclMultiLineEdit::SetReadOnly( bool bReadOnly )
1032 {
1033  pImpVclMEdit->SetReadOnly( bReadOnly );
1034  Edit::SetReadOnly( bReadOnly );
1035 
1036  // #94921# ReadOnly can be overwritten in InitFromStyle() when WB not set.
1037  WinBits nStyle = GetStyle();
1038  if ( bReadOnly )
1039  nStyle |= WB_READONLY;
1040  else
1041  nStyle &= ~WB_READONLY;
1042  SetStyle( nStyle );
1043 }
1044 
1046 {
1047  if (!pImpVclMEdit) // might be called from within the dtor, when pImpVclMEdit == NULL is a valid state
1048  return true;
1049 
1050  return pImpVclMEdit->IsReadOnly();
1051 }
1052 
1053 void VclMultiLineEdit::SetMaxTextLen(sal_Int32 nMaxLen)
1054 {
1055  pImpVclMEdit->SetMaxTextLen(nMaxLen);
1056 }
1057 
1059 {
1060  pImpVclMEdit->SetMaxTextWidth(nMaxWidth );
1061 }
1062 
1064 {
1065  return pImpVclMEdit->GetMaxTextLen();
1066 }
1067 
1068 void VclMultiLineEdit::ReplaceSelected( const OUString& rStr )
1069 {
1070  pImpVclMEdit->InsertText( rStr );
1071 }
1072 
1074 {
1075  pImpVclMEdit->InsertText( OUString() );
1076 }
1077 
1079 {
1080  return pImpVclMEdit->GetSelected();
1081 }
1082 
1083 OUString VclMultiLineEdit::GetSelected( LineEnd aSeparator ) const
1084 {
1085  return pImpVclMEdit->GetSelected( aSeparator );
1086 }
1087 
1089 {
1090  pImpVclMEdit->Cut();
1091 }
1092 
1094 {
1095  pImpVclMEdit->Copy();
1096 }
1097 
1099 {
1100  pImpVclMEdit->Paste();
1101 }
1102 
1103 void VclMultiLineEdit::SetText( const OUString& rStr )
1104 {
1105  pImpVclMEdit->SetText( rStr );
1106 }
1107 
1109 {
1110  return pImpVclMEdit ? pImpVclMEdit->GetText() : OUString();
1111 }
1112 
1113 OUString VclMultiLineEdit::GetText( LineEnd aSeparator ) const
1114 {
1115  return pImpVclMEdit ? pImpVclMEdit->GetText( aSeparator ) : OUString();
1116 }
1117 
1118 OUString VclMultiLineEdit::GetTextLines( LineEnd aSeparator ) const
1119 {
1120  return pImpVclMEdit ? pImpVclMEdit->GetTextLines( aSeparator ) : OUString();
1121 }
1122 
1124 {
1125  pImpVclMEdit->Resize();
1126 }
1127 
1129 {
1130  if ( !pImpVclMEdit ) // might be called from within the dtor, when pImpVclMEdit == NULL is a valid state
1131  return;
1132 
1133  pImpVclMEdit->GetFocus();
1134 }
1135 
1137 {
1138  pImpVclMEdit->SetSelection( rSelection );
1139 }
1140 
1142 {
1143  return pImpVclMEdit->GetSelection();
1144 }
1145 
1147 {
1148  Size aSz = pImpVclMEdit->CalcMinimumSize();
1149 
1150  sal_Int32 nLeft, nTop, nRight, nBottom;
1151  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1152  aSz.AdjustWidth(nLeft+nRight );
1153  aSz.AdjustHeight(nTop+nBottom );
1154 
1155  return aSz;
1156 }
1157 
1159 {
1160  Size aSz = rPrefSize;
1161  sal_Int32 nLeft, nTop, nRight, nBottom;
1162  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1163 
1164  // center vertically for whole lines
1165 
1166  long nHeight = aSz.Height() - nTop - nBottom;
1167  long nLineHeight = pImpVclMEdit->CalcBlockSize( 1, 1 ).Height();
1168  long nLines = nHeight / nLineHeight;
1169  if ( nLines < 1 )
1170  nLines = 1;
1171 
1172  aSz.setHeight( nLines * nLineHeight );
1173  aSz.AdjustHeight(nTop+nBottom );
1174 
1175  return aSz;
1176 }
1177 
1178 Size VclMultiLineEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
1179 {
1180  Size aSz = pImpVclMEdit->CalcBlockSize( nColumns, nLines );
1181 
1182  sal_Int32 nLeft, nTop, nRight, nBottom;
1183  static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom );
1184  aSz.AdjustWidth(nLeft+nRight );
1185  aSz.AdjustHeight(nTop+nBottom );
1186  return aSz;
1187 }
1188 
1189 void VclMultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
1190 {
1191  pImpVclMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
1192 }
1193 
1195 {
1196  if( nType == StateChangedType::Enable )
1197  {
1198  pImpVclMEdit->Enable( IsEnabled() );
1199  ImplInitSettings( false );
1200  }
1201  else if( nType == StateChangedType::ReadOnly )
1202  {
1203  pImpVclMEdit->SetReadOnly( IsReadOnly() );
1204  }
1205  else if ( nType == StateChangedType::Zoom )
1206  {
1207  pImpVclMEdit->GetTextWindow()->SetZoom( GetZoom() );
1208  ImplInitSettings( false );
1209  Resize();
1210  }
1211  else if ( nType == StateChangedType::ControlFont )
1212  {
1213  ImplInitSettings( false );
1214  Resize();
1215  Invalidate();
1216  }
1217  else if ( nType == StateChangedType::ControlForeground )
1218  {
1219  ImplInitSettings( false );
1220  Invalidate();
1221  }
1222  else if ( nType == StateChangedType::ControlBackground )
1223  {
1224  ImplInitSettings( true );
1225  Invalidate();
1226  }
1227  else if ( nType == StateChangedType::Style )
1228  {
1229  pImpVclMEdit->InitFromStyle( GetStyle() );
1231  }
1232  else if ( nType == StateChangedType::InitShow )
1233  {
1234  if( IsPaintTransparent() )
1235  {
1236  pImpVclMEdit->GetTextWindow()->SetPaintTransparent( true );
1237  pImpVclMEdit->GetTextWindow()->SetBackground();
1238  pImpVclMEdit->GetTextWindow()->SetControlBackground();
1239  SetBackground();
1241  }
1242  }
1243 
1244  Control::StateChanged( nType );
1245 }
1246 
1248 {
1249  if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
1250  (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
1251  {
1252  ImplInitSettings( true );
1253  Resize();
1254  Invalidate();
1255  }
1256  else
1257  Control::DataChanged( rDCEvt );
1258 }
1259 
1260 void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
1261 {
1262  ImplInitSettings(true);
1263 
1264  Point aPos = pDev->LogicToPixel( rPos );
1265  Size aSize = GetSizePixel();
1266 
1267  vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont(pDev);
1268  aFont.SetTransparent( true );
1269  OutDevType eOutDevType = pDev->GetOutDevType();
1270 
1271  pDev->Push();
1272  pDev->SetMapMode();
1273  pDev->SetFont( aFont );
1274  pDev->SetTextFillColor();
1275 
1276  // Border/Background
1277  pDev->SetLineColor();
1278  pDev->SetFillColor();
1279  bool bBorder = (GetStyle() & WB_BORDER);
1280  bool bBackground = IsControlBackground();
1281  if ( bBorder || bBackground )
1282  {
1283  tools::Rectangle aRect( aPos, aSize );
1284  if ( bBorder )
1285  {
1286  DecorationView aDecoView( pDev );
1287  aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
1288  }
1289  if ( bBackground )
1290  {
1292  pDev->DrawRect( aRect );
1293  }
1294  }
1295 
1296  // contents
1297  if ( ( nFlags & DrawFlags::Mono ) || ( eOutDevType == OUTDEV_PRINTER ) )
1298  pDev->SetTextColor( COL_BLACK );
1299  else
1300  {
1301  if ( !IsEnabled() )
1302  {
1303  const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1304  pDev->SetTextColor( rStyleSettings.GetDisableColor() );
1305  }
1306  else
1307  {
1308  pDev->SetTextColor( GetTextColor() );
1309  }
1310  }
1311 
1312  OUString aText = GetText();
1313  Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
1314  sal_uLong nLines = static_cast<sal_uLong>(aSize.Height() / aTextSz.Height());
1315  if ( !nLines )
1316  nLines = 1;
1317  aTextSz.setHeight( nLines*aTextSz.Height() );
1318  long nOnePixel = GetDrawPixel( pDev, 1 );
1319  long nOffX = 3*nOnePixel;
1320  long nOffY = 2*nOnePixel;
1321 
1322  // Clipping?
1323  if ( ( nOffY < 0 ) || ( (nOffY+aTextSz.Height()) > aSize.Height() ) || ( (nOffX+aTextSz.Width()) > aSize.Width() ) )
1324  {
1325  tools::Rectangle aClip( aPos, aSize );
1326  if ( aTextSz.Height() > aSize.Height() )
1327  aClip.AdjustBottom(aTextSz.Height() - aSize.Height() + 1 ); // so that HP-printer does not 'optimize-away'
1328  pDev->IntersectClipRegion( aClip );
1329  }
1330 
1331  ExtTextEngine aTE;
1332  aTE.SetText( GetText() );
1333  aTE.SetMaxTextWidth( aSize.Width() );
1334  aTE.SetFont( aFont );
1335  aTE.SetTextAlign( pImpVclMEdit->GetTextWindow()->GetTextEngine()->GetTextAlign() );
1336  aTE.Draw( pDev, Point( aPos.X() + nOffX, aPos.Y() + nOffY ) );
1337 
1338  pDev->Pop();
1339 }
1340 
1342 {
1343  bool bDone = false;
1344  if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
1345  {
1346  bDone = pImpVclMEdit->HandleCommand( *rNEvt.GetCommandEvent() );
1347  }
1348  return bDone || Edit::EventNotify( rNEvt );
1349 }
1350 
1352 {
1353  bool bDone = false;
1354 
1355  if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( !GetTextView()->IsCursorEnabled() ) )
1356  {
1357  const KeyEvent& rKEvent = *rNEvt.GetKeyEvent();
1358  if ( !rKEvent.GetKeyCode().IsShift() && ( rKEvent.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) )
1359  {
1360  bDone = true;
1361  TextSelection aSel = pImpVclMEdit->GetTextWindow()->GetTextView()->GetSelection();
1362  if ( aSel.HasRange() )
1363  {
1364  aSel.GetStart() = aSel.GetEnd();
1365  pImpVclMEdit->GetTextWindow()->GetTextView()->SetSelection( aSel );
1366  }
1367  else
1368  {
1369  switch ( rKEvent.GetKeyCode().GetCode() )
1370  {
1371  case KEY_UP:
1372  {
1373  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1374  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineUp );
1375  }
1376  break;
1377  case KEY_DOWN:
1378  {
1379  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1380  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineDown );
1381  }
1382  break;
1383  case KEY_PAGEUP :
1384  {
1385  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1386  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageUp );
1387  }
1388  break;
1389  case KEY_PAGEDOWN:
1390  {
1391  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1392  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageDown );
1393  }
1394  break;
1395  case KEY_LEFT:
1396  {
1397  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1398  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineUp );
1399  }
1400  break;
1401  case KEY_RIGHT:
1402  {
1403  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1404  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineDown );
1405  }
1406  break;
1407  case KEY_HOME:
1408  {
1409  if ( rKEvent.GetKeyCode().IsMod1() )
1410  pImpVclMEdit->GetTextWindow()->GetTextView()->
1411  SetSelection( TextSelection( TextPaM( 0, 0 ) ) );
1412  }
1413  break;
1414  case KEY_END:
1415  {
1416  if ( rKEvent.GetKeyCode().IsMod1() )
1417  pImpVclMEdit->GetTextWindow()->GetTextView()->
1419  }
1420  break;
1421  default:
1422  {
1423  bDone = false;
1424  }
1425  }
1426  }
1427  }
1428  }
1429 
1430  return bDone || Edit::PreNotify( rNEvt );
1431 }
1432 
1433 // Internals for derived classes, e.g. TextComponent
1434 
1436 {
1437  return pImpVclMEdit->GetTextWindow()->GetTextEngine();
1438 }
1439 
1441 {
1442  return pImpVclMEdit->GetTextWindow()->GetTextView();
1443 }
1444 
1446 {
1447  return pImpVclMEdit->GetVScrollBar();
1448 }
1449 
1451 {
1452  pImpVclMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
1453 }
1454 
1456 {
1457  pImpVclMEdit->GetTextWindow()->DisableSelectionOnFocus();
1458 }
1459 
1461 {
1462  GetTextView()->EnableCursor( bEnable );
1463 }
1464 
1466 {
1467  TextView* pTextView = GetTextView();
1468  const TextSelection& rTextSelection = pTextView->GetSelection();
1469  TextPaM aPaM(rTextSelection.GetEnd());
1470  return aPaM != pTextView->CursorUp(aPaM);
1471 }
1472 
1474 {
1475  TextView* pTextView = GetTextView();
1476  const TextSelection& rTextSelection = pTextView->GetSelection();
1477  TextPaM aPaM(rTextSelection.GetEnd());
1478  return aPaM != pTextView->CursorDown(aPaM);
1479 }
1480 
1482 {
1483  return pImpVclMEdit->GetTextWindow();
1484 }
1485 
1487 {
1489 }
1490 
1491 bool VclMultiLineEdit::set_property(const OString &rKey, const OUString &rValue)
1492 {
1493  if (rKey == "cursor-visible")
1494  EnableCursor(toBool(rValue));
1495  else if (rKey == "accepts-tab")
1496  pImpVclMEdit->GetTextWindow()->SetIgnoreTab(!toBool(rValue));
1497  else
1498  return Edit::set_property(rKey, rValue);
1499  return true;
1500 }
1501 
1503 {
1504  Edit::DumpAsPropertyTree(rJsonWriter);
1505 
1506  rJsonWriter.put("cursor", pImpVclMEdit->GetTextWindow()->GetTextView()->IsCursorEnabled());
1507 }
1508 
1509 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
const Color & GetTextColor() const
Definition: outdev.hxx:1135
OutDevType GetOutDevType() const
Definition: outdev.hxx:524
bool IsControlBackground() const
Definition: window2.cxx:1087
bool mbFocusSelectionHide
Definition: vclmedit.hxx:45
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:42
void StateChanged(StateChangedType nType) override
Definition: vclmedit.cxx:1194
VclPtr< ScrollBar > mpHScrollBar
Definition: vclmedit.cxx:49
void SetAlign(WinBits nWinStyle)
Definition: vclmedit.cxx:268
virtual void GetFocus() override
Definition: vclmedit.cxx:845
bool IsRightToLeft() const
Definition: texteng.hxx:254
void InsertText(const OUString &rNew)
Definition: textview.cxx:1192
virtual void Resize() override
Definition: vclmedit.cxx:742
void SetFont(const vcl::Font &rFont)
Definition: texteng.cxx:168
Size CalcMinimumSize() const
Definition: vclmedit.cxx:562
long AdjustWidth(long n)
FncGetSpecialChars GetGetSpecialCharsFunction()
Definition: edit.cxx:2703
CommandEventId
void EnableFocusSelectionHide(bool bHide)
Definition: vclmedit.cxx:1450
bool HasRange() const
Definition: textdata.hxx:99
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:327
void SetMaxTextWidth(long nMaxWidth)
Definition: vclmedit.cxx:322
Selection maSelection
Definition: vclmedit.cxx:54
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:837
sal_Int64 n
virtual void Copy() override
Definition: vclmedit.cxx:1093
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2395
WinBits const WB_RIGHT
void SetReadOnly(bool bRdOnly)
Definition: vclmedit.cxx:286
void EnableCursor(bool bEnable)
Definition: vclmedit.cxx:1460
const Color & GetWorkspaceColor() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: edit.cxx:222
WinBits const WB_AUTOVSCROLL
const TextPaM & GetEnd() const
Definition: textdata.hxx:94
sal_uInt16 GetGroup() const
Definition: keycod.hxx:64
void SetTextFillColor()
Definition: text.cxx:701
sal_uInt16 GetCode() const
Definition: keycod.hxx:51
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: vclmedit.cxx:669
DataChangedEventType GetType() const
Definition: event.hxx:357
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:311
virtual void Paste() override
Definition: vclmedit.cxx:1098
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: vclmedit.cxx:737
bool mbActivePopup
Definition: vclmedit.hxx:47
void IntersectClipRegion(const tools::Rectangle &rRect)
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
Definition: menu.cxx:2794
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:180
void Copy()
Definition: vclmedit.cxx:398
const Color & GetControlBackground() const
Definition: window2.cxx:1082
TextView * GetTextView() const
Definition: vclmedit.cxx:1440
sal_Int32 GetMaxTextLen() const
Definition: vclmedit.cxx:302
void SetType(WindowType nType)
Definition: window2.cxx:968
void SetIgnoreTab(bool bIgnore)
Definition: vclmedit.hxx:73
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:654
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:317
void Paste()
Definition: textview.cxx:1042
weld::Window * GetFrameWeld() const
Definition: window2.cxx:853
void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: vclmedit.cxx:1247
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2667
void Draw(OutputDevice *pDev, const Point &rPos, DrawFlags nFlags) override
Definition: vclmedit.cxx:1260
bool IsReadOnly() const
Definition: vclmedit.cxx:292
sal_Int64 WinBits
sal_uInt16 sal_Unicode
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
VclPtr< VclMultiLineEdit > pVclMultiLineEdit
Definition: vclmedit.cxx:46
void SetBackground()
void Scroll(long nHorzScroll, long nVertScroll)
Definition: textview.cxx:910
ESelection aNewSelection(GetSelection())
virtual void LoseFocus() override
Definition: vclmedit.cxx:867
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2426
virtual void Command(const CommandEvent &rCEvt) override
Definition: vclmedit.cxx:746
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: window.cxx:3334
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:1481
void ImpSetHScrollBarThumbPos()
Definition: vclmedit.cxx:245
const vcl::Font & GetFont() const
Definition: outdev.hxx:649
virtual void Modify() override
Definition: vclmedit.cxx:1009
bool IsControlForeground() const
Definition: window2.cxx:1077
WinBits const WB_HSCROLL
bool IsMouseEvent() const
virtual bool IsReadOnly() const override
Definition: vclmedit.cxx:1045
AllSettingsFlags GetFlags() const
Definition: event.hxx:358
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
virtual void GetFocus() override
Definition: vclmedit.cxx:1128
Link< Edit &, void > aModifyHdlLink
Definition: vclmedit.hxx:85
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:50
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: vclmedit.cxx:1491
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:1189
virtual void SetModifyFlag() override
Definition: vclmedit.cxx:1026
Definition: edit.hxx:55
WinBits const WB_NOHIDESELECTION
std::unique_ptr< ImpVclMEdit > pImpVclMEdit
Definition: vclmedit.hxx:83
sal_uInt16 nCode
virtual void SetMaxTextLen(sal_Int32 nMaxLen) override
Definition: vclmedit.cxx:1053
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:664
virtual ~VclMultiLineEdit() override
Definition: vclmedit.cxx:886
TextView * GetTextView() const
Definition: vclmedit.hxx:56
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: vclmedit.cxx:911
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
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:683
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
void ImpInitScrollBars()
Definition: vclmedit.cxx:223
virtual FactoryFunction GetUITestFactory() const override
Definition: vclmedit.cxx:1486
long Min() const
void SetReadOnly(bool bReadOnly)
Definition: textview.cxx:1067
void SetLineColor()
void SetMaxTextLen(sal_Int32 nLen)
Definition: vclmedit.cxx:297
bool CanUp() const
Definition: vclmedit.cxx:1465
ScrollBar & GetVScrollBar() const
Definition: vclmedit.cxx:1445
void clear()
Definition: vclptr.hxx:190
VclPtr< PopupMenu > CreatePopupMenu()
Definition: edit.cxx:2709
const Color & GetDisableColor() const
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:109
void Resize()
Definition: vclmedit.cxx:327
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:691
bool IsModified() const
Definition: texteng.hxx:269
void Paste()
Definition: vclmedit.cxx:403
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
void SelectionChanged()
Definition: vclmedit.cxx:1016
int i
DrawFlags
Definition: window.hxx:360
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: vclmedit.cxx:438
void SetMaxTextWidth(long nMaxWidth)
Definition: vclmedit.cxx:1058
void InsertText(const OUString &rStr)
Definition: vclmedit.cxx:307
OutDevType
Definition: outdev.hxx:276
void SetModified(bool bMod)
Definition: vclmedit.cxx:281
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
void DisableSelectionOnFocus()
Definition: vclmedit.cxx:1455
void SetControlBackground()
Definition: window2.cxx:497
void SetVisibleSize(long nNewSize)
Definition: scrbar.cxx:1376
virtual void SetReadOnly(bool bReadOnly=true)
Definition: edit.cxx:2359
void SetRange(const Range &rRange)
Definition: scrbar.cxx:1338
virtual void Cut() override
Definition: vclmedit.cxx:1088
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:634
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1162
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:302
const Color & GetFieldColor() const
CommandEventId GetCommand() const
void SetTextColor(const Color &rColor)
Definition: text.cxx:666
static bool GetLayoutRTL()
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
const TextPaM & GetStart() const
Definition: textdata.hxx:91
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1351
Size CalcAdjustedSize(const Size &rPrefSize) const
Definition: vclmedit.cxx:1158
void ImpUpdateScrollBarVis(WinBits nWinStyle)
Definition: vclmedit.cxx:129
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.cxx:1435
MouseNotifyEvent GetType() const
Definition: event.hxx:303
void SetSelection(const Selection &rSelection)
Definition: vclmedit.cxx:494
void SetPageSize(long nNewSize)
Definition: scrbar.hxx:125
virtual sal_Int32 GetMaxTextLen() const override
Definition: vclmedit.cxx:1063
sal_Int32 GetMaxTextLen() const
Definition: texteng.hxx:234
VclMultiLineEdit(vcl::Window *pParent, WinBits nWinStyle)
Definition: vclmedit.cxx:875
ScrollBar & GetHScrollBar()
Definition: vclmedit.cxx:110
virtual OUString GetSelected() const override
Definition: vclmedit.cxx:1078
void Enable(bool bEnable)
Definition: vclmedit.cxx:611
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.hxx:55
static bool toBool(const OString &rValue)
Definition: builder.cxx:78
const AllSettings & GetSettings() const
Definition: outdev.hxx:418
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
bool mbInMBDown
Definition: vclmedit.hxx:44
void EnableCursor(bool bEnable)
Definition: textview.cxx:2088
void SetSelection(const TextSelection &rNewSel)
Definition: textview.cxx:231
TextWindow(Edit *pParent)
Definition: vclmedit.cxx:637
#define TEXT_PARA_ALL
Definition: textdata.hxx:33
virtual void SetReadOnly(bool bReadOnly=true) override
Definition: vclmedit.cxx:1031
void GrabFocus()
Definition: window.cxx:2960
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:903
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:575
sal_Int32 GetTextLen() const
Definition: texteng.cxx:285
WinBits const WB_LEFT
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: vclmedit.cxx:1502
bool mbIgnoreTab
Definition: vclmedit.hxx:46
void SetStyle(WinBits nStyle)
Definition: window.cxx:1956
bool IsCursorEnabled() const
Definition: textview.cxx:2090
void put(const char *pPropName, const OUString &rPropValue)
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
Definition: menu.cxx:905
virtual Size CalcMinimumSize() const override
Definition: vclmedit.cxx:1146
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:41
bool HandleCommand(const CommandEvent &rCEvt)
Definition: vclmedit.cxx:620
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:1118
const Point & GetMousePosPixel() const
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:941
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:1123
WinBits const WB_SIZEABLE
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: window.cxx:2417
virtual const Selection & GetSelection() const override
Definition: vclmedit.cxx:1141
void SetTextAlign(TxtAlign eAlign)
Definition: texteng.cxx:2509
void SetPointer(PointerStyle)
Definition: mouse.cxx:474
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:54
bool IsShift() const
Definition: keycod.hxx:56
OUString GetTextLines(LineEnd aSeparator) const
Definition: vclmedit.cxx:433
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:1178
void SetMaxTextLen(sal_Int32 nLen)
Definition: texteng.cxx:211
WinBits const WB_BORDER
void SetFont(const vcl::Font &rNewFont)
WinBits const WB_IGNORETAB
virtual void DeleteSelected() override
Definition: vclmedit.cxx:1073
WinBits const WB_READONLY
void ShowItem(sal_uInt16 nItemId, bool bVisible=true)
Definition: menu.cxx:950
VclPtr< TextWindow > mpTextWindow
Definition: vclmedit.cxx:48
void SetTransparent(bool bTransparent)
Definition: font/font.cxx:95
bool IsVisible() const
Definition: window2.cxx:1102
bool mbSelectOnTab
Definition: vclmedit.hxx:48
virtual void ReplaceSelected(const OUString &rStr) override
Definition: vclmedit.cxx:1068
void Justify()
Definition: textdata.cxx:44
const Selection & GetSelection() const
Definition: vclmedit.cxx:532
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:133
void SetModified(bool bModified)
Definition: texteng.hxx:268
bool IsMod1() const
Definition: keycod.hxx:58
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
TextPaM CursorDown(const TextPaM &rPaM)
Definition: textview.cxx:1395
long CalcTextWidth()
Definition: texteng.cxx:1142
void Copy()
Definition: textview.cxx:993
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
bool CanDown() const
Definition: vclmedit.cxx:1473
void InitFromStyle(WinBits nWinStyle)
Definition: vclmedit.cxx:176
OUString GetSelected() const
Definition: vclmedit.cxx:312
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:892
WinBits const WB_TABSTOP
void GetMaxVisColumnsAndLines(sal_uInt16 &rnCols, sal_uInt16 &rnLines) const
Definition: vclmedit.cxx:602
void ImplInitSettings()
Definition: ctrl.cxx:428
virtual void KeyInput(const KeyEvent &rKEvent) override
Definition: vclmedit.cxx:696
bool IsPaintTransparent() const
Definition: window2.cxx:1037
WinBits const WB_CENTER
OUString GetText() const
Definition: vclmedit.cxx:423
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1341
OUString GetSelected()
Definition: textview.cxx:1048
OUString GetText() const override
Definition: vclmedit.cxx:1108
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:891
WinBits GetStyle() const
Definition: window2.cxx:953
void GetFocus()
Definition: vclmedit.cxx:387
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
TextPaM CursorUp(const TextPaM &rPaM)
Definition: textview.cxx:1359
long GetScrollBarSize() const
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:677
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:71
void SetText(const OUString &rStr)
Definition: vclmedit.cxx:409
WinBits const WB_NOTABSTOP
static WinBits ImplInitStyle(WinBits nStyle)
Definition: vclmedit.cxx:897
void Cut()
Definition: vclmedit.cxx:392
virtual void SetText(const OUString &rStr) override
Definition: vclmedit.cxx:1103
void SetThumbPos(long nThumbPos)
Definition: scrbar.cxx:1362
virtual void SetSelection(const Selection &rSelection) override
Definition: vclmedit.cxx:1136
VclPtr< ScrollBarBox > mpScrollBox
Definition: vclmedit.cxx:51
constexpr sal_uInt16 KEY_TAB
Definition: keycodes.hxx:121
#define EDIT_NOLIMIT
Definition: edit.hxx:51
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:40
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: ctrl.cxx:225
bool IsMod2() const
Definition: keycod.hxx:60
WinBits const WB_DRAG
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2181
void setHeight(long nHeight)
long mnTextWidth
Definition: vclmedit.cxx:53