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/menu.hxx>
27 #include <vcl/specialchars.hxx>
28 #include <vcl/timer.hxx>
29 #include <vcl/toolkit/vclmedit.hxx>
30 #include <vcl/vclevent.hxx>
31 #include <vcl/xtextedt.hxx>
32 #include <vcl/textview.hxx>
33 #include <vcl/ptrstyle.hxx>
34 
35 #include <svl/undo.hxx>
36 #include <svl/lstner.hxx>
37 #include <vcl/uitest/uiobject.hxx>
38 
39 #include <vcl/scrbar.hxx>
40 #include <vcl/settings.hxx>
41 #include <vcl/weld.hxx>
42 #include <osl/diagnose.h>
43 #include <tools/json_writer.hxx>
44 
45 class ImpVclMEdit : public SfxListener
46 {
47 private:
49 
54 
57 
58 protected:
59  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
60  void ImpUpdateScrollBarVis( WinBits nWinStyle );
61  void ImpInitScrollBars();
62  void ImpSetScrollBarRanges();
64  DECL_LINK( ScrollHdl, ScrollBar*, void );
65 
66 public:
67  ImpVclMEdit( VclMultiLineEdit* pVclMultiLineEdit, WinBits nWinStyle );
68  virtual ~ImpVclMEdit() override;
69 
70  void SetModified( bool bMod );
71 
72  void SetReadOnly( bool bRdOnly );
73  bool IsReadOnly() const;
74 
75  void SetMaxTextLen(sal_Int32 nLen);
76  sal_Int32 GetMaxTextLen() const;
77 
78  void SetMaxTextWidth(tools::Long nMaxWidth);
79 
80  void InsertText( const OUString& rStr );
81  OUString GetSelected() const;
82  OUString GetSelected( LineEnd aSeparator ) const;
83 
84  void SetSelection( const Selection& rSelection );
85  const Selection& GetSelection() const;
86 
87  void Cut();
88  void Copy();
89  void Paste();
90 
91  void SetText( const OUString& rStr );
92  OUString GetText() const;
93  OUString GetText( LineEnd aSeparator ) const;
94  OUString GetTextLines( LineEnd aSeparator ) const;
95 
96  void Resize();
97  void GetFocus();
98 
99  bool HandleCommand( const CommandEvent& rCEvt );
100 
101  void Enable( bool bEnable );
102 
103  Size CalcMinimumSize() const;
104  Size CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
105  void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
106 
107  void SetAlign( WinBits nWinStyle );
108 
109  void InitFromStyle( WinBits nWinStyle );
110 
114 };
115 
117  : pVclMultiLineEdit(pEdt)
118  , mpTextWindow(VclPtr<TextWindow>::Create(pEdt))
119  , mpHScrollBar(VclPtr<ScrollBar>::Create(pVclMultiLineEdit, WB_HSCROLL|WB_DRAG))
120  , mpVScrollBar(VclPtr<ScrollBar>::Create(pVclMultiLineEdit, WB_VSCROLL|WB_DRAG))
121  , mpScrollBox(VclPtr<ScrollBarBox>::Create(pVclMultiLineEdit, WB_SIZEABLE))
122  , mnTextWidth(0)
123 {
124  mpVScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) );
125  mpHScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) );
126  mpTextWindow->Show();
127  InitFromStyle( nWinStyle );
129 }
130 
132 {
133  const bool bHaveVScroll = mpVScrollBar->IsVisible();
134  const bool bHaveHScroll = mpHScrollBar->IsVisible();
135  const bool bHaveScrollBox = mpScrollBox->IsVisible();
136 
137  bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
138  const bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
139 
140  const bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
141  if ( !bNeedVScroll && bAutoVScroll )
142  {
143  TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
144  tools::Long nOverallTextHeight(0);
145  for ( sal_uInt32 i=0; i<rEngine.GetParagraphCount(); ++i )
146  nOverallTextHeight += rEngine.GetTextHeight( i );
147  if ( nOverallTextHeight > mpTextWindow->GetOutputSizePixel().Height() )
148  bNeedVScroll = true;
149  }
150 
151  const bool bNeedScrollBox = bNeedVScroll && bNeedHScroll;
152 
153  bool bScrollbarsChanged = false;
154  if ( bHaveVScroll != bNeedVScroll )
155  {
156  mpVScrollBar->Show(bNeedVScroll);
157  bScrollbarsChanged = true;
158  }
159 
160  if ( bHaveHScroll != bNeedHScroll )
161  {
162  mpHScrollBar->Show(bNeedHScroll);
163  bScrollbarsChanged = true;
164  }
165 
166  if ( bHaveScrollBox != bNeedScrollBox )
167  {
168  mpScrollBox->Show(bNeedScrollBox);
169  }
170 
171  if ( bScrollbarsChanged )
172  {
174  Resize();
175  }
176 }
177 
179 {
180  ImpUpdateScrollBarVis( nWinStyle );
181  SetAlign( nWinStyle );
182 
183  if ( nWinStyle & WB_NOHIDESELECTION )
184  mpTextWindow->SetAutoFocusHide( false );
185  else
187 
188  if ( nWinStyle & WB_READONLY )
190  else
191  mpTextWindow->GetTextView()->SetReadOnly( false );
192 
193  if ( nWinStyle & WB_IGNORETAB )
194  {
195  mpTextWindow->SetIgnoreTab( true );
196  }
197  else
198  {
199  mpTextWindow->SetIgnoreTab( false );
200  // #103667# VclMultiLineEdit has the flag, but focusable window also needs this flag
201  WinBits nStyle = mpTextWindow->GetStyle();
202  nStyle |= WB_NODIALOGCONTROL;
203  mpTextWindow->SetStyle( nStyle );
204  }
205 }
206 
208 {
215 }
216 
218 {
219  const tools::Long nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
220  mpVScrollBar->SetRange( Range( 0, nTextHeight-1 ) );
221 
223 }
224 
226 {
227  static const sal_Unicode sampleChar = { 'x' };
228 
230 
231  Size aCharBox;
232  aCharBox.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) );
233  aCharBox.setHeight( mpTextWindow->GetTextHeight() );
235 
236  mpHScrollBar->SetVisibleSize( aOutSz.Width() );
237  mpHScrollBar->SetPageSize( aOutSz.Width() * 8 / 10 );
238  mpHScrollBar->SetLineSize( aCharBox.Width()*10 );
240 
241  mpVScrollBar->SetVisibleSize( aOutSz.Height() );
242  mpVScrollBar->SetPageSize( aOutSz.Height() * 8 / 10 );
243  mpVScrollBar->SetLineSize( aCharBox.Height() );
245 }
246 
248 {
251  mpHScrollBar->SetThumbPos( nX );
252  else
254 
255 }
256 
257 IMPL_LINK( ImpVclMEdit, ScrollHdl, ScrollBar*, pCurScrollBar, void )
258 {
259  tools::Long nDiffX = 0, nDiffY = 0;
260 
261  if ( pCurScrollBar == mpVScrollBar )
262  nDiffY = mpTextWindow->GetTextView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos();
263  else if ( pCurScrollBar == mpHScrollBar )
264  nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
265 
266  mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
267  // mpTextWindow->GetTextView()->ShowCursor( false, true );
268 }
269 
271 {
272  bool bRTL = AllSettings::GetLayoutRTL();
274 
275  if ( nWinStyle & WB_CENTER )
277  else if ( nWinStyle & WB_RIGHT )
279  else if ( nWinStyle & WB_LEFT )
280  mpTextWindow->GetTextEngine()->SetTextAlign( !bRTL ? TxtAlign::Left : TxtAlign::Right );
281 }
282 
283 void ImpVclMEdit::SetModified( bool bMod )
284 {
286 }
287 
288 void ImpVclMEdit::SetReadOnly( bool bRdOnly )
289 {
290  mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
291  // TODO: Adjust color?
292 }
293 
295 {
296  return mpTextWindow->GetTextView()->IsReadOnly();
297 }
298 
299 void ImpVclMEdit::SetMaxTextLen(sal_Int32 nLen)
300 {
302 }
303 
304 sal_Int32 ImpVclMEdit::GetMaxTextLen() const
305 {
307 }
308 
309 void ImpVclMEdit::InsertText( const OUString& rStr )
310 {
311  mpTextWindow->GetTextView()->InsertText( rStr );
312 }
313 
314 OUString ImpVclMEdit::GetSelected() const
315 {
316  return mpTextWindow->GetTextView()->GetSelected();
317 }
318 
319 OUString ImpVclMEdit::GetSelected( LineEnd aSeparator ) const
320 {
321  return mpTextWindow->GetTextView()->GetSelected( aSeparator );
322 }
323 
325 {
327 }
328 
330 {
331  int nIteration = 1;
332  do
333  {
334  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
335  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
336  ImpUpdateScrollBarVis( nWinStyle );
337 
339  Size aEditSize = aSz;
341  nSBWidth = pVclMultiLineEdit->CalcZoom( nSBWidth );
342 
343  if (mpHScrollBar->IsVisible())
344  aSz.AdjustHeight( -(nSBWidth+1) );
345  if (mpVScrollBar->IsVisible())
346  aSz.AdjustWidth( -(nSBWidth+1) );
347 
348  if (!mpHScrollBar->IsVisible())
350  else
351  mpHScrollBar->setPosSizePixel( 0, aEditSize.Height()-nSBWidth, aSz.Width(), nSBWidth );
352 
353  Point aTextWindowPos;
354  if (mpVScrollBar->IsVisible())
355  {
357  {
358  mpVScrollBar->setPosSizePixel( 0, 0, nSBWidth, aSz.Height() );
359  aTextWindowPos.AdjustX(nSBWidth );
360  }
361  else
362  mpVScrollBar->setPosSizePixel( aEditSize.Width()-nSBWidth, 0, nSBWidth, aSz.Height() );
363  }
364 
365  if (mpScrollBox->IsVisible())
366  mpScrollBox->setPosSizePixel( aSz.Width(), aSz.Height(), nSBWidth, nSBWidth );
367 
368  Size aTextWindowSize( aSz );
369  if ( aTextWindowSize.Width() < 0 )
370  aTextWindowSize.setWidth( 0 );
371  if ( aTextWindowSize.Height() < 0 )
372  aTextWindowSize.setHeight( 0 );
373 
374  Size aOldTextWindowSize( mpTextWindow->GetSizePixel() );
375  mpTextWindow->SetPosSizePixel( aTextWindowPos, aTextWindowSize );
376  if ( aOldTextWindowSize == aTextWindowSize )
377  break;
378 
379  // Changing the text window size might effectively have changed the need for
380  // scrollbars, so do another iteration.
381  ++nIteration;
382  OSL_ENSURE( nIteration < 3, "ImpVclMEdit::Resize: isn't this expected to terminate with the second iteration?" );
383 
384  } while ( nIteration <= 3 ); // artificial break after four iterations
385 
387 }
388 
390 {
392 }
393 
395 {
396  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
398 }
399 
401 {
403 }
404 
406 {
407  if ( !mpTextWindow->GetTextView()->IsReadOnly() )
409 }
410 
411 void ImpVclMEdit::SetText( const OUString& rStr )
412 {
413  bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
414  mpTextWindow->GetTextEngine()->SetText( rStr );
415  if ( !bWasModified )
417 
419 
420  WinBits nWinStyle( pVclMultiLineEdit->GetStyle() );
421  if ( ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL )
422  ImpUpdateScrollBarVis( nWinStyle );
423 }
424 
425 OUString ImpVclMEdit::GetText() const
426 {
427  return mpTextWindow->GetTextEngine()->GetText();
428 }
429 
430 OUString ImpVclMEdit::GetText( LineEnd aSeparator ) const
431 {
432  return mpTextWindow->GetTextEngine()->GetText( aSeparator );
433 }
434 
435 OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
436 {
437  return mpTextWindow->GetTextEngine()->GetTextLines( aSeparator );
438 }
439 
441 {
442  const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
443  if ( !pTextHint )
444  return;
445 
446  switch (pTextHint->GetId())
447  {
448  case SfxHintId::TextViewScrolled:
449  if (mpHScrollBar->IsVisible())
451  if (mpVScrollBar->IsVisible())
453  break;
454 
455  case SfxHintId::TextHeightChanged:
456  if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
457  {
460  if ( nTextHeight < nOutHeight )
462  }
464  break;
465 
466  case SfxHintId::TextFormatted:
467  if (mpHScrollBar->IsVisible())
468  {
470  if ( nWidth != mnTextWidth )
471  {
472  mnTextWidth = nWidth;
475  }
476  }
477  break;
478 
479  case SfxHintId::TextModified:
482  break;
483 
484  case SfxHintId::TextViewSelectionChanged:
486  break;
487 
488  case SfxHintId::TextViewCaretChanged:
490  break;
491 
492  default: break;
493  }
494 }
495 
496 void ImpVclMEdit::SetSelection( const Selection& rSelection )
497 {
498  OUString aText = mpTextWindow->GetTextEngine()->GetText();
499 
500  Selection aNewSelection( rSelection );
501  if ( aNewSelection.Min() < 0 )
502  aNewSelection.Min() = 0;
503  else if ( aNewSelection.Min() > aText.getLength() )
504  aNewSelection.Min() = aText.getLength();
505  if ( aNewSelection.Max() < 0 )
506  aNewSelection.Max() = 0;
507  else if ( aNewSelection.Max() > aText.getLength() )
508  aNewSelection.Max() = aText.getLength();
509 
510  tools::Long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
511  TextSelection aTextSel;
512  sal_uInt32 nPara = 0;
513  sal_Int32 nChar = 0;
514  tools::Long x = 0;
515  while ( x <= nEnd )
516  {
517  if ( x == aNewSelection.Min() )
518  aTextSel.GetStart() = TextPaM( nPara, nChar );
519  if ( x == aNewSelection.Max() )
520  aTextSel.GetEnd() = TextPaM( nPara, nChar );
521 
522  if ( ( x < aText.getLength() ) && ( aText[ x ] == '\n' ) )
523  {
524  nPara++;
525  nChar = 0;
526  }
527  else
528  nChar++;
529  x++;
530  }
531  mpTextWindow->GetTextView()->SetSelection( aTextSel );
532 }
533 
535 {
538  aTextSel.Justify();
539  // flatten selection => every line-break a character
540 
541  ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
542  // paragraphs before
543  for ( sal_uInt32 n = 0; n < aTextSel.GetStart().GetPara(); ++n )
544  {
545  maSelection.Min() += pExtTextEngine->GetTextLen( n );
546  maSelection.Min()++;
547  }
548 
549  // first paragraph with selection
551  maSelection.Min() += aTextSel.GetStart().GetIndex();
552 
553  for ( sal_uInt32 n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); ++n )
554  {
555  maSelection.Max() += pExtTextEngine->GetTextLen( n );
556  maSelection.Max()++;
557  }
558 
559  maSelection.Max() += aTextSel.GetEnd().GetIndex();
560 
561  return maSelection;
562 }
563 
565 {
568 
569  if (mpHScrollBar->IsVisible())
571  if (mpVScrollBar->IsVisible())
572  aSz.AdjustWidth(mpVScrollBar->GetSizePixel().Width() );
573 
574  return aSz;
575 }
576 
577 Size ImpVclMEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
578 {
579  static const sal_Unicode sampleChar = 'X';
580 
581  Size aSz;
582  Size aCharSz;
583  aCharSz.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) );
584  aCharSz.setHeight( mpTextWindow->GetTextHeight() );
585 
586  if ( nLines )
587  aSz.setHeight( nLines*aCharSz.Height() );
588  else
590 
591  if ( nColumns )
592  aSz.setWidth( nColumns*aCharSz.Width() );
593  else
595 
596  if (mpHScrollBar->IsVisible())
598  if (mpVScrollBar->IsVisible())
600 
601  return aSz;
602 }
603 
604 void ImpVclMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
605 {
606  static const sal_Unicode sampleChar = { 'x' };
608  Size aCharSz( mpTextWindow->GetTextWidth( OUString(sampleChar) ), mpTextWindow->GetTextHeight() );
609  rnCols = static_cast<sal_uInt16>(aOutSz.Width()/aCharSz.Width());
610  rnLines = static_cast<sal_uInt16>(aOutSz.Height()/aCharSz.Height());
611 }
612 
613 void ImpVclMEdit::Enable( bool bEnable )
614 {
615  mpTextWindow->Enable( bEnable );
616  if (mpHScrollBar->IsVisible())
617  mpHScrollBar->Enable( bEnable );
618  if (mpVScrollBar->IsVisible())
619  mpVScrollBar->Enable( bEnable );
620 }
621 
623 {
624  bool bDone = false;
625  CommandEventId nCommand = rCEvt.GetCommand();
626  if (nCommand == CommandEventId::Wheel ||
627  nCommand == CommandEventId::StartAutoScroll ||
628  nCommand == CommandEventId::AutoScroll ||
629  nCommand == CommandEventId::Gesture)
630  {
631  ScrollBar* pHScrollBar = mpHScrollBar->IsVisible() ? mpHScrollBar.get() : nullptr;
632  ScrollBar* pVScrollBar = mpVScrollBar->IsVisible() ? mpVScrollBar.get() : nullptr;
633  mpTextWindow->HandleScrollCommand(rCEvt, pHScrollBar, pVScrollBar);
634  bDone = true;
635  }
636  return bDone;
637 }
638 
640  : Window(pParent)
641  , mxParent(pParent)
642 {
643  mbInMBDown = false;
644  mbFocusSelectionHide = false;
645  mbIgnoreTab = false;
646  mbActivePopup = false;
647  mbSelectOnTab = true;
648 
650 
651  mpExtTextEngine.reset(new ExtTextEngine);
652  mpExtTextEngine->SetMaxTextLen(EDIT_NOLIMIT);
653  if( pParent->GetStyle() & WB_BORDER )
654  mpExtTextEngine->SetLeftMargin( 2 );
655  mpExtTextEngine->SetLocale( GetSettings().GetLanguageTag().getLocale() );
656  mpExtTextView.reset(new TextView( mpExtTextEngine.get(), this ));
657  mpExtTextEngine->InsertView( mpExtTextView.get() );
658  mpExtTextEngine->EnableUndo( true );
659  mpExtTextView->ShowCursor();
660 
661  Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
662  SetBackground( aBackgroundColor );
663  pParent->SetBackground( aBackgroundColor );
664 }
665 
667 {
668  disposeOnce();
669 }
670 
672 {
673  mxParent.clear();
674  mpExtTextView.reset();
675  mpExtTextEngine.reset();
676  Window::dispose();
677 }
678 
679 void TextWindow::MouseMove( const MouseEvent& rMEvt )
680 {
681  mpExtTextView->MouseMove( rMEvt );
682  Window::MouseMove( rMEvt );
683 }
684 
686 {
687  mbInMBDown = true; // so that GetFocus does not select everything
688  mpExtTextView->MouseButtonDown( rMEvt );
689  GrabFocus();
690  mbInMBDown = false;
691 }
692 
694 {
695  mpExtTextView->MouseButtonUp( rMEvt );
696 }
697 
698 void TextWindow::KeyInput( const KeyEvent& rKEvent )
699 {
700  bool bDone = false;
701  sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
702  if ( nCode == css::awt::Key::SELECT_ALL ||
703  ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
704  )
705  {
706  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
707  bDone = true;
708  }
709  else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
710  {
712  {
713  // to maintain the selection
714  mbActivePopup = true;
715  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
716  if (!aChars.isEmpty())
717  {
718  mpExtTextView->InsertText( aChars );
719  mpExtTextView->GetTextEngine()->SetModified( true );
720  }
721  mbActivePopup = false;
722  bDone = true;
723  }
724  }
725  else if ( nCode == KEY_TAB )
726  {
727  if ( !mbIgnoreTab || rKEvent.GetKeyCode().IsMod1() )
728  bDone = mpExtTextView->KeyInput( rKEvent );
729  }
730  else
731  {
732  bDone = mpExtTextView->KeyInput( rKEvent );
733  }
734 
735  if ( !bDone )
736  Window::KeyInput( rKEvent );
737 }
738 
739 void TextWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
740 {
741  mpExtTextView->Paint(rRenderContext, rRect);
742 }
743 
745 {
746 }
747 
748 void TextWindow::Command( const CommandEvent& rCEvt )
749 {
750  if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
751  {
753  bool bEnableCut = true;
754  bool bEnableCopy = true;
755  bool bEnableDelete = true;
756  bool bEnablePaste = true;
757  bool bEnableSpecialChar = true;
758  bool bEnableUndo = true;
759 
760  if ( !mpExtTextView->HasSelection() )
761  {
762  bEnableCut = false;
763  bEnableCopy = false;
764  bEnableDelete = false;
765  }
766  if ( mpExtTextView->IsReadOnly() )
767  {
768  bEnableCut = false;
769  bEnablePaste = false;
770  bEnableDelete = false;
771  bEnableSpecialChar = false;
772  }
773  if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
774  {
775  bEnableUndo = false;
776  }
777  pPopup->EnableItem(pPopup->GetItemId("cut"), bEnableCut);
778  pPopup->EnableItem(pPopup->GetItemId("copy"), bEnableCopy);
779  pPopup->EnableItem(pPopup->GetItemId("delete"), bEnableDelete);
780  pPopup->EnableItem(pPopup->GetItemId("paste"), bEnablePaste);
781  pPopup->EnableItem(pPopup->GetItemId("specialchar"), bEnableSpecialChar);
782  pPopup->EnableItem(pPopup->GetItemId("undo"), bEnableUndo);
783  pPopup->ShowItem(pPopup->GetItemId("specialchar"), !vcl::GetGetSpecialCharsFunction());
784 
785  mbActivePopup = true;
786  Point aPos = rCEvt.GetMousePosPixel();
787  if ( !rCEvt.IsMouseEvent() )
788  {
789  // Sometime do show Menu centered in the selection !!!
790  Size aSize = GetOutputSizePixel();
791  aPos = Point( aSize.Width()/2, aSize.Height()/2 );
792  }
793  sal_uInt16 n = pPopup->Execute( this, aPos );
794  OString sCommand = pPopup->GetItemIdent(n);
795  if (sCommand == "undo")
796  {
797  mpExtTextView->Undo();
798  mpExtTextEngine->SetModified( true );
799  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
800  }
801  else if (sCommand == "cut")
802  {
803  mpExtTextView->Cut();
804  mpExtTextEngine->SetModified( true );
805  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
806  }
807  else if (sCommand == "copy")
808  {
809  mpExtTextView->Copy();
810  }
811  else if (sCommand == "paste")
812  {
813  mpExtTextView->Paste();
814  mpExtTextEngine->SetModified( true );
815  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
816  }
817  else if (sCommand == "delete")
818  {
819  mpExtTextView->DeleteSelected();
820  mpExtTextEngine->SetModified( true );
821  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
822  }
823  else if (sCommand == "selectall")
824  {
825  mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
826  }
827  else if (sCommand == "specialchar")
828  {
829  OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
830  if (!aChars.isEmpty())
831  {
832  mpExtTextView->InsertText( aChars );
833  mpExtTextEngine->SetModified( true );
834  mpExtTextEngine->Broadcast( TextHint( SfxHintId::TextModified ) );
835  }
836  }
837  pPopup.clear();
838  mbActivePopup = false;
839  }
840  else
841  {
842  mpExtTextView->Command( rCEvt );
843  }
844  Window::Command( rCEvt );
845 }
846 
848 {
849  Window::GetFocus();
850  if ( mbActivePopup )
851  return;
852 
853  bool bGotoCursor = !mpExtTextView->IsReadOnly();
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(*GetOutDev(), 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  tools::Long nHeight = aSz.Height() - nTop - nBottom;
1167  tools::Long nLineHeight = pImpVclMEdit->CalcBlockSize( 1, 1 ).Height();
1168  tools::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, SystemTextColorFlags 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 
1270  pDev->Push();
1271  pDev->SetMapMode();
1272  pDev->SetFont( aFont );
1273  pDev->SetTextFillColor();
1274 
1275  // Border/Background
1276  pDev->SetLineColor();
1277  pDev->SetFillColor();
1278  bool bBorder = (GetStyle() & WB_BORDER);
1279  bool bBackground = IsControlBackground();
1280  if ( bBorder || bBackground )
1281  {
1282  tools::Rectangle aRect( aPos, aSize );
1283  if ( bBorder )
1284  {
1285  DecorationView aDecoView( pDev );
1286  aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
1287  }
1288  if ( bBackground )
1289  {
1291  pDev->DrawRect( aRect );
1292  }
1293  }
1294 
1295  pDev->SetSystemTextColor(nFlags, IsEnabled());
1296 
1297  OUString aText = GetText();
1298  Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
1299  sal_uLong nLines = static_cast<sal_uLong>(aSize.Height() / aTextSz.Height());
1300  if ( !nLines )
1301  nLines = 1;
1302  aTextSz.setHeight( nLines*aTextSz.Height() );
1303  tools::Long nOnePixel = GetDrawPixel( pDev, 1 );
1304  tools::Long nOffX = 3*nOnePixel;
1305  tools::Long nOffY = 2*nOnePixel;
1306 
1307  // Clipping?
1308  if ( ( nOffY < 0 ) || ( (nOffY+aTextSz.Height()) > aSize.Height() ) || ( (nOffX+aTextSz.Width()) > aSize.Width() ) )
1309  {
1310  tools::Rectangle aClip( aPos, aSize );
1311  if ( aTextSz.Height() > aSize.Height() )
1312  aClip.AdjustBottom(aTextSz.Height() - aSize.Height() + 1 ); // so that HP-printer does not 'optimize-away'
1313  pDev->IntersectClipRegion( aClip );
1314  }
1315 
1316  ExtTextEngine aTE;
1317  aTE.SetText( GetText() );
1318  aTE.SetMaxTextWidth( aSize.Width() );
1319  aTE.SetFont( aFont );
1320  aTE.SetTextAlign( pImpVclMEdit->GetTextWindow()->GetTextEngine()->GetTextAlign() );
1321  aTE.Draw( pDev, Point( aPos.X() + nOffX, aPos.Y() + nOffY ) );
1322 
1323  pDev->Pop();
1324 }
1325 
1327 {
1328  bool bDone = false;
1329  if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
1330  {
1331  bDone = pImpVclMEdit->HandleCommand( *rNEvt.GetCommandEvent() );
1332  }
1333  return bDone || Edit::EventNotify( rNEvt );
1334 }
1335 
1337 {
1338  bool bDone = false;
1339 
1340  if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( !GetTextView()->IsCursorEnabled() ) )
1341  {
1342  const KeyEvent& rKEvent = *rNEvt.GetKeyEvent();
1343  if ( !rKEvent.GetKeyCode().IsShift() && ( rKEvent.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) )
1344  {
1345  bDone = true;
1346  TextSelection aSel = pImpVclMEdit->GetTextWindow()->GetTextView()->GetSelection();
1347  if ( aSel.HasRange() )
1348  {
1349  aSel.GetStart() = aSel.GetEnd();
1350  pImpVclMEdit->GetTextWindow()->GetTextView()->SetSelection( aSel );
1351  }
1352  else
1353  {
1354  switch ( rKEvent.GetKeyCode().GetCode() )
1355  {
1356  case KEY_UP:
1357  {
1358  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1359  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineUp );
1360  }
1361  break;
1362  case KEY_DOWN:
1363  {
1364  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1365  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::LineDown );
1366  }
1367  break;
1368  case KEY_PAGEUP :
1369  {
1370  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1371  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageUp );
1372  }
1373  break;
1374  case KEY_PAGEDOWN:
1375  {
1376  if ( pImpVclMEdit->GetVScrollBar().IsVisible() )
1377  pImpVclMEdit->GetVScrollBar().DoScrollAction( ScrollType::PageDown );
1378  }
1379  break;
1380  case KEY_LEFT:
1381  {
1382  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1383  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineUp );
1384  }
1385  break;
1386  case KEY_RIGHT:
1387  {
1388  if ( pImpVclMEdit->GetHScrollBar().IsVisible() )
1389  pImpVclMEdit->GetHScrollBar().DoScrollAction( ScrollType::LineDown );
1390  }
1391  break;
1392  case KEY_HOME:
1393  {
1394  if ( rKEvent.GetKeyCode().IsMod1() )
1395  pImpVclMEdit->GetTextWindow()->GetTextView()->
1396  SetSelection( TextSelection( TextPaM( 0, 0 ) ) );
1397  }
1398  break;
1399  case KEY_END:
1400  {
1401  if ( rKEvent.GetKeyCode().IsMod1() )
1402  pImpVclMEdit->GetTextWindow()->GetTextView()->
1404  }
1405  break;
1406  default:
1407  {
1408  bDone = false;
1409  }
1410  }
1411  }
1412  }
1413  }
1414 
1415  return bDone || Edit::PreNotify( rNEvt );
1416 }
1417 
1418 // Internals for derived classes, e.g. TextComponent
1419 
1421 {
1422  return pImpVclMEdit->GetTextWindow()->GetTextEngine();
1423 }
1424 
1426 {
1427  return pImpVclMEdit->GetTextWindow()->GetTextView();
1428 }
1429 
1431 {
1432  return pImpVclMEdit->GetVScrollBar();
1433 }
1434 
1436 {
1437  pImpVclMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
1438 }
1439 
1441 {
1442  pImpVclMEdit->GetTextWindow()->DisableSelectionOnFocus();
1443 }
1444 
1446 {
1447  GetTextView()->EnableCursor( bEnable );
1448 }
1449 
1451 {
1452  TextView* pTextView = GetTextView();
1453  const TextSelection& rTextSelection = pTextView->GetSelection();
1454  TextPaM aPaM(rTextSelection.GetEnd());
1455  return aPaM != pTextView->CursorUp(aPaM);
1456 }
1457 
1459 {
1460  TextView* pTextView = GetTextView();
1461  const TextSelection& rTextSelection = pTextView->GetSelection();
1462  TextPaM aPaM(rTextSelection.GetEnd());
1463  return aPaM != pTextView->CursorDown(aPaM);
1464 }
1465 
1467 {
1468  return pImpVclMEdit->GetTextWindow();
1469 }
1470 
1472 {
1474 }
1475 
1476 bool VclMultiLineEdit::set_property(const OString &rKey, const OUString &rValue)
1477 {
1478  if (rKey == "cursor-visible")
1479  EnableCursor(toBool(rValue));
1480  else if (rKey == "accepts-tab")
1481  pImpVclMEdit->GetTextWindow()->SetIgnoreTab(!toBool(rValue));
1482  else
1483  return Edit::set_property(rKey, rValue);
1484  return true;
1485 }
1486 
1488 {
1489  Edit::DumpAsPropertyTree(rJsonWriter);
1490 
1491  rJsonWriter.put("cursor", pImpVclMEdit->GetTextWindow()->GetTextView()->IsCursorEnabled());
1492 }
1493 
1494 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long Max() const
static bool toBool(std::string_view rValue)
Definition: builder.cxx:89
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
bool IsControlBackground() const
Definition: window2.cxx:1081
bool mbFocusSelectionHide
Definition: vclmedit.hxx:45
void ImpSetScrollBarRanges()
Definition: vclmedit.cxx:217
void SetBackground()
Definition: window3.cxx:100
void SetFillColor(const Color &)
Definition: font/font.cxx:111
std::unique_ptr< TextView > mpExtTextView
Definition: vclmedit.hxx:42
void StateChanged(StateChangedType nType) override
Definition: vclmedit.cxx:1194
VclPtr< ScrollBar > mpHScrollBar
Definition: vclmedit.cxx:51
tools::Long mnTextWidth
Definition: vclmedit.cxx:55
void SetAlign(WinBits nWinStyle)
Definition: vclmedit.cxx:270
virtual void GetFocus() override
Definition: vclmedit.cxx:847
bool IsRightToLeft() const
Definition: texteng.hxx:254
void InsertText(const OUString &rNew)
Definition: textview.cxx:1106
virtual void Resize() override
Definition: vclmedit.cxx:744
void SetFont(const vcl::Font &rFont)
Definition: texteng.cxx:167
void setWidth(tools::Long nWidth)
Size CalcMinimumSize() const
Definition: vclmedit.cxx:564
FncGetSpecialChars GetGetSpecialCharsFunction()
Definition: edit.cxx:2691
CommandEventId
void EnableFocusSelectionHide(bool bHide)
Definition: vclmedit.cxx:1435
bool HasRange() const
Definition: textdata.hxx:98
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:332
Selection maSelection
Definition: vclmedit.cxx:56
WinBits const WB_NODIALOGCONTROL
void SetRightToLeft(bool bR2L)
Definition: texteng.cxx:2681
WinBits const WB_NOGROUP
OUString GetText(LineEnd aSeparator=LINEEND_LF) const
Definition: texteng.cxx:253
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
sal_uIntPtr sal_uLong
IMPL_LINK(ImpVclMEdit, ScrollHdl, ScrollBar *, pCurScrollBar, void)
Definition: vclmedit.cxx:257
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void disposeAndClear()
Definition: vclptr.hxx:200
const StyleSettings & GetStyleSettings() const
WeakReference< XInterface > mxParent
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:33
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:255
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:804
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:2402
WinBits const WB_RIGHT
void SetReadOnly(bool bRdOnly)
Definition: vclmedit.cxx:288
void EnableCursor(bool bEnable)
Definition: vclmedit.cxx:1445
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:223
tools::Long GetTextHeight() const
Definition: texteng.cxx:1102
WinBits const WB_AUTOVSCROLL
const TextPaM & GetEnd() const
Definition: textdata.hxx:93
sal_uInt16 GetGroup() const
Definition: keycod.hxx:62
void SetTextFillColor()
Definition: text.cxx:731
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: vclmedit.cxx:671
DataChangedEventType GetType() const
Definition: event.hxx:362
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:316
virtual void Paste() override
Definition: vclmedit.cxx:1098
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: vclmedit.cxx:739
bool mbActivePopup
Definition: vclmedit.hxx:47
void IntersectClipRegion(const tools::Rectangle &rRect)
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
Definition: menu.cxx:2769
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: edit.cxx:2916
WinBits const WB_VSCROLL
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: edit.cxx:181
void Copy()
Definition: vclmedit.cxx:400
const Color & GetControlBackground() const
Definition: window2.cxx:1076
TextView * GetTextView() const
Definition: vclmedit.cxx:1425
sal_Int32 GetMaxTextLen() const
Definition: vclmedit.cxx:304
void SetType(WindowType nType)
Definition: window2.cxx:962
void SetIgnoreTab(bool bIgnore)
Definition: vclmedit.hxx:73
float x
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
Definition: window2.cxx:598
void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll)
Definition: textview.cxx:824
void Draw(OutputDevice *pDev, const Point &rPos)
Definition: texteng.cxx:2640
void SetMapMode()
Definition: map.cxx:594
const vcl::Font & GetFieldFont() const
const Color & GetFieldTextColor() const
SfxHintId GetId() const
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
const Fraction & GetZoom() const
Definition: window2.cxx:1204
StateChangedType
Definition: window.hxx:289
constexpr tools::Long Width() const
void Paste()
Definition: textview.cxx:956
weld::Window * GetFrameWeld() const
Definition: window2.cxx:842
void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: vclmedit.cxx:1247
bool IsReadOnly() const
Definition: vclmedit.cxx:294
sal_Int64 WinBits
sal_uInt16 sal_Unicode
VclPtr< VclMultiLineEdit > pVclMultiLineEdit
Definition: vclmedit.cxx:48
void SetBackground()
Definition: background.cxx:27
ESelection aNewSelection(GetSelection())
virtual void LoseFocus() override
Definition: vclmedit.cxx:867
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2433
virtual void SetSystemTextColor(SystemTextColorFlags nFlags, bool bEnabled)
Definition: text.cxx:2505
void SetPageSize(tools::Long nNewSize)
Definition: scrbar.hxx:125
virtual void Command(const CommandEvent &rCEvt) override
Definition: vclmedit.cxx:748
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:1466
void ImpSetHScrollBarThumbPos()
Definition: vclmedit.cxx:247
const vcl::Font & GetFont() const
Definition: outdev.hxx:532
virtual void Modify() override
Definition: vclmedit.cxx:1009
bool IsControlForeground() const
Definition: window2.cxx:1071
WinBits const WB_HSCROLL
bool IsMouseEvent() const
virtual bool IsReadOnly() const override
Definition: vclmedit.cxx:1045
AllSettingsFlags GetFlags() const
Definition: event.hxx:363
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
ScrollBar & GetVScrollBar()
Definition: vclmedit.cxx:113
SystemTextColorFlags
void Pop()
Definition: stack.cxx:92
void SetCompoundControl(bool bCompound)
Definition: window2.cxx:941
VclPtr< ScrollBar > mpVScrollBar
Definition: vclmedit.cxx:52
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: vclmedit.cxx:1476
void Cut()
Definition: textview.cxx:877
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
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
void SetThumbPos(tools::Long nThumbPos)
Definition: scrbar.cxx:1361
sal_uInt16 nCode
virtual void SetMaxTextLen(sal_Int32 nMaxLen) override
Definition: vclmedit.cxx:1053
OUString GetTextLines(LineEnd aSeparator=LINEEND_LF) const
Definition: texteng.cxx:258
const Point & GetStartDocPos() const
Definition: textview.cxx:2008
virtual ~TextWindow() override
Definition: vclmedit.cxx:666
virtual ~VclMultiLineEdit() override
Definition: vclmedit.cxx:886
TextView * GetTextView() const
Definition: vclmedit.hxx:56
void SetLineSize(tools::Long nNewSize)
Definition: scrbar.hxx:123
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:207
const Color & GetControlForeground() const
Definition: window2.cxx:1066
tools::Long CalcTextWidth()
Definition: texteng.cxx:1141
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:685
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
void ImpInitScrollBars()
Definition: vclmedit.cxx:225
virtual FactoryFunction GetUITestFactory() const override
Definition: vclmedit.cxx:1471
void SetReadOnly(bool bReadOnly)
Definition: textview.cxx:981
void SetLineColor()
Definition: line.cxx:36
void SetMaxTextLen(sal_Int32 nLen)
Definition: vclmedit.cxx:299
bool CanUp() const
Definition: vclmedit.cxx:1450
sal_Int32 GetScrollBarSize() const
ScrollBar & GetVScrollBar() const
Definition: vclmedit.cxx:1430
void clear()
Definition: vclptr.hxx:190
VclPtr< PopupMenu > CreatePopupMenu()
Definition: edit.cxx:2697
const Color & GetDisableColor() const
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:111
void Resize()
Definition: vclmedit.cxx:329
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:693
bool IsModified() const
Definition: texteng.hxx:269
void Paste()
Definition: vclmedit.cxx:405
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
void SelectionChanged()
Definition: vclmedit.cxx:1016
int i
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:888
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: vclmedit.cxx:440
void InsertText(const OUString &rStr)
Definition: vclmedit.cxx:309
void SetModified(bool bMod)
Definition: vclmedit.cxx:283
void SetMaxTextWidth(tools::Long nMaxWidth)
Definition: vclmedit.cxx:324
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
void DisableSelectionOnFocus()
Definition: vclmedit.cxx:1440
void SetControlBackground()
Definition: window2.cxx:491
virtual void SetReadOnly(bool bReadOnly=true)
Definition: edit.cxx:2347
void SetVisibleSize(tools::Long nNewSize)
Definition: scrbar.cxx:1375
OUString GetSelected() const
Definition: textview.cxx:962
void SetRange(const Range &rRange)
Definition: scrbar.cxx:1337
virtual void Cut() override
Definition: vclmedit.cxx:1088
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:645
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: ctrl.cxx:292
bool IsReadOnly() const
Definition: textview.cxx:2012
void SetFillColor()
Definition: fill.cxx:29
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:175
const AllSettings & GetSettings() const
Definition: window3.cxx:129
const Color & GetFieldColor() const
CommandEventId GetCommand() const
static bool GetLayoutRTL()
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
const TextPaM & GetStart() const
Definition: textdata.hxx:90
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1336
Size CalcAdjustedSize(const Size &rPrefSize) const
Definition: vclmedit.cxx:1158
void ImpUpdateScrollBarVis(WinBits nWinStyle)
Definition: vclmedit.cxx:131
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.cxx:1420
MouseNotifyEvent GetType() const
Definition: event.hxx:308
void SetSelection(const Selection &rSelection)
Definition: vclmedit.cxx:496
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:112
virtual OUString GetSelected() const override
Definition: vclmedit.cxx:1078
void Enable(bool bEnable)
Definition: vclmedit.cxx:613
ExtTextEngine * GetTextEngine() const
Definition: vclmedit.hxx:55
const AllSettings & GetSettings() const
Definition: outdev.hxx:294
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
bool mbInMBDown
Definition: vclmedit.hxx:44
void EnableCursor(bool bEnable)
Definition: textview.cxx:2002
void SetSelection(const TextSelection &rNewSel)
Definition: textview.cxx:226
TextWindow(Edit *pParent)
Definition: vclmedit.cxx:639
#define TEXT_PARA_ALL
Definition: textdata.hxx:32
virtual void SetReadOnly(bool bReadOnly=true) override
Definition: vclmedit.cxx:1031
void GrabFocus()
Definition: window.cxx:2976
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:577
sal_Int32 GetTextLen() const
Definition: texteng.cxx:284
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:1487
bool mbIgnoreTab
Definition: vclmedit.hxx:46
void SetStyle(WinBits nStyle)
Definition: window.cxx:1962
bool IsCursorEnabled() const
Definition: textview.cxx:2004
void put(const char *pPropName, const OUString &rPropValue)
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
Definition: menu.cxx:916
virtual Size CalcMinimumSize() const override
Definition: vclmedit.cxx:1146
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
Definition: window2.cxx:1262
void SetColor(const Color &)
Definition: font/font.cxx:103
LineEnd
std::unique_ptr< ExtTextEngine > mpExtTextEngine
Definition: vclmedit.hxx:41
bool HandleCommand(const CommandEvent &rCEvt)
Definition: vclmedit.cxx:622
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
void SetText(const OUString &rStr)
Definition: texteng.cxx:427
OUString GetTextLines(LineEnd aSeparator) const
Definition: vclmedit.cxx:1118
const Point & GetMousePosPixel() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:878
DECL_LINK(ScrollHdl, ScrollBar *, void)
const TextSelection & GetSelection() const
Definition: textview.cxx:231
constexpr sal_uInt16 KEY_S
Definition: keycodes.hxx:74
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2666
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:2424
virtual const Selection & GetSelection() const override
Definition: vclmedit.cxx:1141
void SetTextAlign(TxtAlign eAlign)
Definition: texteng.cxx:2506
void SetPointer(PointerStyle)
Definition: mouse.cxx:480
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
bool IsShift() const
Definition: keycod.hxx:54
void SetMaxTextWidth(tools::Long nMaxWidth)
Definition: vclmedit.cxx:1058
OUString GetTextLines(LineEnd aSeparator) const
Definition: vclmedit.cxx:435
Size CalcBlockSize(sal_uInt16 nColumns, sal_uInt16 nLines) const
Definition: vclmedit.cxx:1178
void SetMaxTextLen(sal_Int32 nLen)
Definition: texteng.cxx:210
void SetMaxTextWidth(tools::Long nWidth)
Definition: texteng.cxx:215
constexpr tools::Long Height() const
WinBits const WB_BORDER
void SetFont(const vcl::Font &rNewFont)
Definition: outdev/font.cxx:53
WinBits const WB_IGNORETAB
virtual void DeleteSelected() override
Definition: vclmedit.cxx:1073
tools::Long Min() const
WinBits const WB_READONLY
void ShowItem(sal_uInt16 nItemId, bool bVisible=true)
Definition: menu.cxx:961
VclPtr< TextWindow > mpTextWindow
Definition: vclmedit.cxx:50
void SetTransparent(bool bTransparent)
Definition: font/font.cxx:121
bool IsVisible() const
Definition: window2.cxx:1096
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:899
bool mbSelectOnTab
Definition: vclmedit.hxx:48
virtual void ReplaceSelected(const OUString &rStr) override
Definition: vclmedit.cxx:1068
void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
Definition: vclmedit.cxx:1260
::OutputDevice const * GetOutDev() const
Definition: window.cxx:568
void Justify()
Definition: textdata.cxx:44
tools::Long AdjustWidth(tools::Long n)
const Selection & GetSelection() const
Definition: vclmedit.cxx:534
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:56
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
TextPaM CursorDown(const TextPaM &rPaM)
Definition: textview.cxx:1309
void Copy()
Definition: textview.cxx:907
tools::Long CalcZoom(tools::Long n) const
Definition: window2.cxx:391
tools::Long GetDrawPixel(::OutputDevice const *pDev, tools::Long nPixels) const
Definition: window2.cxx:557
bool CanDown() const
Definition: vclmedit.cxx:1458
const vcl::Font & GetFont() const
Definition: window3.cxx:58
void InitFromStyle(WinBits nWinStyle)
Definition: vclmedit.cxx:178
OUString GetSelected() const
Definition: vclmedit.cxx:314
tools::Long AdjustHeight(tools::Long n)
WinBits const WB_TABSTOP
void GetMaxVisColumnsAndLines(sal_uInt16 &rnCols, sal_uInt16 &rnLines) const
Definition: vclmedit.cxx:604
Size GetOutputSizePixel() const
Definition: window3.cxx:89
void setHeight(tools::Long nHeight)
void ImplInitSettings()
Definition: ctrl.cxx:422
virtual void KeyInput(const KeyEvent &rKEvent) override
Definition: vclmedit.cxx:698
tools::Long GetVisibleSize() const
Definition: scrbar.hxx:128
bool IsPaintTransparent() const
Definition: window2.cxx:1031
WinBits const WB_CENTER
OUString GetText() const
Definition: vclmedit.cxx:425
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: vclmedit.cxx:1326
OUString GetText() const override
Definition: vclmedit.cxx:1108
bool IsEnabled() const
Definition: window2.cxx:1116
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:947
void GetFocus()
Definition: vclmedit.cxx:389
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
Definition: window2.cxx:443
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
WinBits const WB_GROUP
TextPaM CursorUp(const TextPaM &rPaM)
Definition: textview.cxx:1273
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: vclmedit.cxx:679
bool IsReallyVisible() const
Definition: window2.cxx:1101
ImpVclMEdit(VclMultiLineEdit *pVclMultiLineEdit, WinBits nWinStyle)
Definition: vclmedit.cxx:116
#define TEXT_INDEX_ALL
Definition: textdata.hxx:33
OString GetItemIdent(sal_uInt16 nItemId) const
Definition: menu.cxx:687
void SetAutoFocusHide(bool bAutoHide)
Definition: vclmedit.hxx:71
void SetText(const OUString &rStr)
Definition: vclmedit.cxx:411
WinBits const WB_NOTABSTOP
static WinBits ImplInitStyle(WinBits nStyle)
Definition: vclmedit.cxx:897
void Cut()
Definition: vclmedit.cxx:394
virtual void SetText(const OUString &rStr) override
Definition: vclmedit.cxx:1103
virtual void SetSelection(const Selection &rSelection) override
Definition: vclmedit.cxx:1136
VclPtr< ScrollBarBox > mpScrollBox
Definition: vclmedit.cxx:53
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:36
VclPtr< Edit > mxParent
Definition: vclmedit.hxx:40
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: ctrl.cxx:224
bool IsMod2() const
Definition: keycod.hxx:58
WinBits const WB_DRAG
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187