12722ceddSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
32722ceddSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
42722ceddSAndrew Rist * or more contributor license agreements. See the NOTICE file
52722ceddSAndrew Rist * distributed with this work for additional information
62722ceddSAndrew Rist * regarding copyright ownership. The ASF licenses this file
72722ceddSAndrew Rist * to you under the Apache License, Version 2.0 (the
82722ceddSAndrew Rist * "License"); you may not use this file except in compliance
92722ceddSAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
112722ceddSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
132722ceddSAndrew Rist * Unless required by applicable law or agreed to in writing,
142722ceddSAndrew Rist * software distributed under the License is distributed on an
152722ceddSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162722ceddSAndrew Rist * KIND, either express or implied. See the License for the
172722ceddSAndrew Rist * specific language governing permissions and limitations
182722ceddSAndrew Rist * under the License.
19cdf0e10cSrcweir *
202722ceddSAndrew Rist *************************************************************/
212722ceddSAndrew Rist
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_desktop.hxx"
24cdf0e10cSrcweir
25cdf0e10cSrcweir #include "svtools/svmedit2.hxx"
26cdf0e10cSrcweir #include "svl/lstner.hxx"
27cdf0e10cSrcweir #include "svtools/xtextedt.hxx"
28cdf0e10cSrcweir #include "vcl/scrbar.hxx"
29cdf0e10cSrcweir
30cdf0e10cSrcweir #include "dp_gui_autoscrolledit.hxx"
31cdf0e10cSrcweir
32cdf0e10cSrcweir namespace dp_gui {
33cdf0e10cSrcweir
AutoScrollEdit(Window * pParent,const ResId & rResId)34cdf0e10cSrcweir AutoScrollEdit::AutoScrollEdit( Window* pParent, const ResId& rResId )
35cdf0e10cSrcweir : ExtMultiLineEdit( pParent, rResId )
36cdf0e10cSrcweir {
37cdf0e10cSrcweir ScrollBar* pScroll = GetVScrollBar();
38cdf0e10cSrcweir if (pScroll)
39cdf0e10cSrcweir pScroll->Hide();
40cdf0e10cSrcweir // SetLeftMargin( 0 );
41cdf0e10cSrcweir StartListening( *GetTextEngine() );
42cdf0e10cSrcweir }
43cdf0e10cSrcweir
~AutoScrollEdit()44cdf0e10cSrcweir AutoScrollEdit::~AutoScrollEdit()
45cdf0e10cSrcweir {
46cdf0e10cSrcweir EndListeningAll();
47cdf0e10cSrcweir }
48cdf0e10cSrcweir
Notify(SfxBroadcaster &,const SfxHint & rHint)49cdf0e10cSrcweir void AutoScrollEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
50cdf0e10cSrcweir {
51cdf0e10cSrcweir if ( rHint.IsA( TYPE(TextHint) ) )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir sal_uLong nId = ((const TextHint&)rHint).GetId();
54cdf0e10cSrcweir if ( nId == TEXT_HINT_VIEWSCROLLED )
55cdf0e10cSrcweir {
56cdf0e10cSrcweir ScrollBar* pScroll = GetVScrollBar();
57cdf0e10cSrcweir if ( pScroll )
58cdf0e10cSrcweir pScroll->Show();
59cdf0e10cSrcweir }
60cdf0e10cSrcweir }
61cdf0e10cSrcweir }
62cdf0e10cSrcweir
63cdf0e10cSrcweir } // namespace dp_gui
64*ec11f87aSmseidel
65*ec11f87aSmseidel /* vim: set noet sw=4 ts=4: */
66