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