1*2ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*2ee96f1cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*2ee96f1cSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*2ee96f1cSAndrew Rist * distributed with this work for additional information
6*2ee96f1cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*2ee96f1cSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*2ee96f1cSAndrew Rist * "License"); you may not use this file except in compliance
9*2ee96f1cSAndrew Rist * with the License. You may obtain a copy of the License at
10*2ee96f1cSAndrew Rist *
11*2ee96f1cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*2ee96f1cSAndrew Rist *
13*2ee96f1cSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*2ee96f1cSAndrew Rist * software distributed under the License is distributed on an
15*2ee96f1cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2ee96f1cSAndrew Rist * KIND, either express or implied. See the License for the
17*2ee96f1cSAndrew Rist * specific language governing permissions and limitations
18*2ee96f1cSAndrew Rist * under the License.
19*2ee96f1cSAndrew Rist *
20*2ee96f1cSAndrew Rist *************************************************************/
21*2ee96f1cSAndrew Rist
22*2ee96f1cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <readonlyimage.hxx>
28cdf0e10cSrcweir #include <vcl/help.hxx>
29cdf0e10cSrcweir #include <dialmgr.hxx>
30cdf0e10cSrcweir #include <cuires.hrc>
31cdf0e10cSrcweir
32cdf0e10cSrcweir /*-- 26.02.2004 13:31:04---------------------------------------------------
33cdf0e10cSrcweir
34cdf0e10cSrcweir -----------------------------------------------------------------------*/
ReadOnlyImage(Window * pParent,const ResId rResId)35cdf0e10cSrcweir ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) :
36cdf0e10cSrcweir FixedImage(pParent, rResId)
37cdf0e10cSrcweir {
38cdf0e10cSrcweir sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode();
39cdf0e10cSrcweir SetImage( Image(CUI_RES(bHighContrast ? RID_SVXBMP_LOCK_HC : RID_SVXBMP_LOCK )));
40cdf0e10cSrcweir }
41cdf0e10cSrcweir
42cdf0e10cSrcweir /*-- 26.02.2004 13:31:04---------------------------------------------------
43cdf0e10cSrcweir
44cdf0e10cSrcweir -----------------------------------------------------------------------*/
~ReadOnlyImage()45cdf0e10cSrcweir ReadOnlyImage::~ReadOnlyImage()
46cdf0e10cSrcweir {
47cdf0e10cSrcweir }
48cdf0e10cSrcweir /*-- 26.02.2004 13:31:04---------------------------------------------------
49cdf0e10cSrcweir
50cdf0e10cSrcweir -----------------------------------------------------------------------*/
RequestHelp(const HelpEvent & rHEvt)51cdf0e10cSrcweir void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir if( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() )
54cdf0e10cSrcweir {
55cdf0e10cSrcweir Rectangle aLogicPix( LogicToPixel( Rectangle( Point(), GetOutputSize() ) ) );
56cdf0e10cSrcweir Rectangle aScreenRect( OutputToScreenPixel( aLogicPix.TopLeft() ),
57cdf0e10cSrcweir OutputToScreenPixel( aLogicPix.BottomRight() ) );
58cdf0e10cSrcweir
59cdf0e10cSrcweir String aStr(ReadOnlyImage::GetHelpTip());
60cdf0e10cSrcweir if ( Help::IsBalloonHelpEnabled() )
61cdf0e10cSrcweir Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aScreenRect,
62cdf0e10cSrcweir aStr );
63cdf0e10cSrcweir else if ( Help::IsQuickHelpEnabled() )
64cdf0e10cSrcweir Help::ShowQuickHelp( this, aScreenRect, aStr );
65cdf0e10cSrcweir }
66cdf0e10cSrcweir else
67cdf0e10cSrcweir Window::RequestHelp( rHEvt );
68cdf0e10cSrcweir }
69cdf0e10cSrcweir
70cdf0e10cSrcweir /*-- 26.02.2004 14:20:21---------------------------------------------------
71cdf0e10cSrcweir
72cdf0e10cSrcweir -----------------------------------------------------------------------*/
GetHelpTip()73cdf0e10cSrcweir const String& ReadOnlyImage::GetHelpTip()
74cdf0e10cSrcweir {
75cdf0e10cSrcweir static String aStr(CUI_RES(RID_SVXSTR_READONLY_CONFIG_TIP));
76cdf0e10cSrcweir return aStr;
77cdf0e10cSrcweir }
78