Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ui / control / FieldControls.cxx
blobe827fccdda3a84591dd7561ea23d8e1ea36d67cb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "FieldControls.hxx"
21 #include "SqlNameEdit.hxx"
23 #include <vcl/settings.hxx>
25 namespace dbaui {
27 namespace {
29 void lcl_setSpecialReadOnly( bool _bReadOnly, vcl::Window* _pWin )
31 StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings();
32 const Color& rNewColor = _bReadOnly ? aSystemStyle.GetDialogColor() : aSystemStyle.GetFieldColor();
33 _pWin->SetBackground(Wallpaper(rNewColor));
34 _pWin->SetControlBackground(rNewColor);
39 OPropColumnEditCtrl::OPropColumnEditCtrl(vcl::Window* pParent,
40 rtl::OUString& _rAllowedChars,
41 sal_uInt16 nHelpId,
42 short nPosition,
43 WinBits nWinStyle)
44 :OSQLNameEdit(pParent, nWinStyle, _rAllowedChars)
45 ,m_nPos(nPosition)
47 m_strHelpText = ModuleRes(nHelpId);
50 OPropEditCtrl::OPropEditCtrl(vcl::Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle)
51 :Edit(pParent, nWinStyle)
52 ,m_nPos(nPosition)
54 m_strHelpText = ModuleRes(nHelpId);
57 void
58 OPropNumericEditCtrl::SetSpecialReadOnly(bool _bReadOnly)
60 SetReadOnly(_bReadOnly);
61 lcl_setSpecialReadOnly(_bReadOnly,this);
65 OPropNumericEditCtrl::OPropNumericEditCtrl(vcl::Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle)
66 :NumericField(pParent, nWinStyle)
67 ,m_nPos(nPosition)
69 m_strHelpText = ModuleRes(nHelpId);
72 OPropListBoxCtrl::OPropListBoxCtrl(vcl::Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle)
73 :ListBox(pParent, nWinStyle)
74 ,m_nPos(nPosition)
76 m_strHelpText = ModuleRes(nHelpId);
79 } // end namespace dbaui