1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: expftext.cxx,v $
10 * $Revision: 1.4.32.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 #include "expftext.hxx"
37 #include <vcl/help.hxx>
39 /*************************************************************************
40 #* Member: ScExpandedFixedText Datum:18.09.97
41 #*------------------------------------------------------------------------
45 #* Funktion: Konstruktor der Klasse SvxCtrDial
47 #* Input: Parent- Window, Resource ID
51 #************************************************************************/
53 ScExpandedFixedText::ScExpandedFixedText( Window
* pParent
,
54 const ResId
& rResId
) :
55 FixedText( pParent
, rResId
)
60 /*************************************************************************
61 #* Member: RequestHelp Datum:18.09.97
62 #*------------------------------------------------------------------------
64 #* Klasse: ScExpandedFixedText
66 #* Funktion: Die Methode wird gerufen, um Hilfe fuer das Fenster
67 #* anzuzeigen. Zeigt das Fenster einen gekuerzten Text
68 #* an, so wird selbiger in voller Laenge angezeigt.
74 #************************************************************************/
76 void ScExpandedFixedText::RequestHelp(const HelpEvent
& rEvt
)
78 String aTxtStr
= GetText();
79 long nTxtWidth
= GetTextWidth(aTxtStr
);
80 if ( ( rEvt
.GetMode() & HELPMODE_QUICK
) == HELPMODE_QUICK
&&
81 nTxtWidth
> GetSizePixel().Width())
83 Point aShowPoint
= OutputToScreenPixel(Point(0,0));
84 long nTxtHeight
= GetTextHeight();
86 Help::ShowQuickHelp( this,
87 Rectangle( aShowPoint
, Size(nTxtWidth
,nTxtHeight
) ), aTxtStr
,
88 QUICKHELP_TOP
|QUICKHELP_LEFT
);
92 FixedText::RequestHelp( rEvt
);