1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26
27
28
29 #include "expftext.hxx"
30 #include <vcl/help.hxx>
31
32 /*************************************************************************
33 #* Member: ScExpandedFixedText Datum:18.09.97
34 #*------------------------------------------------------------------------
35 #*
36 #* Klasse: MD_Test
37 #*
38 #* Funktion: Konstruktor der Klasse SvxCtrDial
39 #*
40 #* Input: Parent- Window, Resource ID
41 #*
42 #* Output: ---
43 #*
44 #************************************************************************/
45
ScExpandedFixedText(Window * pParent,const ResId & rResId)46 ScExpandedFixedText::ScExpandedFixedText( Window* pParent,
47 const ResId& rResId) :
48 FixedText( pParent, rResId )
49 {
50
51 }
52
53 /*************************************************************************
54 #* Member: RequestHelp Datum:18.09.97
55 #*------------------------------------------------------------------------
56 #*
57 #* Klasse: ScExpandedFixedText
58 #*
59 #* Funktion: Die Methode wird gerufen, um Hilfe fuer das Fenster
60 #* anzuzeigen. Zeigt das Fenster einen gekuerzten Text
61 #* an, so wird selbiger in voller Laenge angezeigt.
62 #*
63 #* Input: HelpEvent
64 #*
65 #* Output: ---
66 #*
67 #************************************************************************/
68
RequestHelp(const HelpEvent & rEvt)69 void ScExpandedFixedText::RequestHelp(const HelpEvent& rEvt)
70 {
71 String aTxtStr = GetText();
72 long nTxtWidth = GetTextWidth(aTxtStr);
73 if ( ( rEvt.GetMode() & HELPMODE_QUICK ) == HELPMODE_QUICK &&
74 nTxtWidth > GetSizePixel().Width())
75 {
76 Point aShowPoint = OutputToScreenPixel(Point(0,0));
77 long nTxtHeight = GetTextHeight();
78
79 Help::ShowQuickHelp( this,
80 Rectangle( aShowPoint, Size(nTxtWidth,nTxtHeight) ), aTxtStr,
81 QUICKHELP_TOP|QUICKHELP_LEFT );
82 }
83 else
84 {
85 FixedText::RequestHelp( rEvt );
86 }
87 }
88
89
90
91
92