xref: /trunk/main/svtools/source/control/stdctrl.cxx (revision 79aad27f)
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_svtools.hxx"
26 
27 #include <svtools/stdctrl.hxx>
28 
29 // =======================================================================
30 
FixedInfo(Window * pParent,WinBits nWinStyle)31 FixedInfo::FixedInfo( Window* pParent, WinBits nWinStyle ) :
32 	FixedText( pParent, nWinStyle | WB_INFO )
33 {
34 }
35 
36 // -----------------------------------------------------------------------
37 
FixedInfo(Window * pParent,const ResId & rResId)38 FixedInfo::FixedInfo( Window* pParent, const ResId& rResId ) :
39 	FixedText( pParent, rResId )
40 {
41 	SetStyle( GetStyle() | WB_INFO );
42 }
43 
44 namespace svt
45 {
46     // class svt::SelectableFixedText ----------------------------------------
47 
SelectableFixedText(Window * pParent,WinBits nWinStyle)48     SelectableFixedText::SelectableFixedText( Window* pParent, WinBits nWinStyle ) :
49         Edit( pParent, nWinStyle )
50     {
51         Init();
52     }
53 
54     // -----------------------------------------------------------------------
55 
SelectableFixedText(Window * pParent,const ResId & rResId)56     SelectableFixedText::SelectableFixedText( Window* pParent, const ResId& rResId ) :
57         Edit( pParent, rResId )
58     {
59         Init();
60     }
61 
62     // -----------------------------------------------------------------------
63 
~SelectableFixedText()64     SelectableFixedText::~SelectableFixedText()
65     {
66     }
67 
68     // -----------------------------------------------------------------------
69 
Init()70     void SelectableFixedText::Init()
71     {
72         // no border
73         SetBorderStyle( WINDOW_BORDER_NOBORDER );
74         // read-only
75         SetReadOnly();
76         // make it transparent
77         SetControlBackground();
78         SetBackground();
79         SetPaintTransparent( sal_True );
80     }
81 
82     // -----------------------------------------------------------------------
83 
LoseFocus()84     void SelectableFixedText::LoseFocus()
85     {
86         Edit::LoseFocus();
87         // clear cursor
88         Invalidate();
89     }
90 
91 } // namespace svt
92 
93