Line data Source code
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 "expftext.hxx"
21 : #include <vcl/help.hxx>
22 :
23 : /*************************************************************************
24 : #* Member: ScExpandedFixedText
25 : #*------------------------------------------------------------------------
26 : #*
27 : #* Klasse: MD_Test
28 : #*
29 : #* Funktion: Konstruktor der Klasse SvxCtrDial
30 : #*
31 : #* Input: Parent- Window, Resource ID
32 : #*
33 : #* Output: ---
34 : #*
35 : #************************************************************************/
36 :
37 0 : ScExpandedFixedText::ScExpandedFixedText( Window* pParent,
38 : const ResId& rResId) :
39 0 : FixedText( pParent, rResId )
40 : {
41 :
42 0 : }
43 :
44 : /*************************************************************************
45 : #* Member: RequestHelp
46 : #*------------------------------------------------------------------------
47 : #*
48 : #* Klasse: ScExpandedFixedText
49 : #*
50 : #* Funktion: Die Methode wird gerufen, um Hilfe fuer das Fenster
51 : #* anzuzeigen. Zeigt das Fenster einen gekuerzten Text
52 : #* an, so wird selbiger in voller Laenge angezeigt.
53 : #*
54 : #* Input: HelpEvent
55 : #*
56 : #* Output: ---
57 : #*
58 : #************************************************************************/
59 :
60 0 : void ScExpandedFixedText::RequestHelp(const HelpEvent& rEvt)
61 : {
62 0 : String aTxtStr = GetText();
63 0 : long nTxtWidth = GetTextWidth(aTxtStr);
64 0 : if ( ( rEvt.GetMode() & HELPMODE_QUICK ) == HELPMODE_QUICK &&
65 0 : nTxtWidth > GetSizePixel().Width())
66 : {
67 0 : Point aShowPoint = OutputToScreenPixel(Point(0,0));
68 0 : long nTxtHeight = GetTextHeight();
69 :
70 : Help::ShowQuickHelp( this,
71 : Rectangle( aShowPoint, Size(nTxtWidth,nTxtHeight) ), aTxtStr,
72 0 : QUICKHELP_TOP|QUICKHELP_LEFT );
73 : }
74 : else
75 : {
76 0 : FixedText::RequestHelp( rEvt );
77 0 : }
78 0 : }
79 :
80 :
81 :
82 :
83 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|