fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / ui / tabledesign / TableDesignHelpBar.cxx
blob5c1fcc11f3406e8cbde9a89264d2bd1ef039adee
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 "TableDesignHelpBar.hxx"
21 #include <tools/debug.hxx>
22 #include <svtools/svmedit.hxx>
23 #include <vcl/settings.hxx>
24 #include "dbaccess_helpid.hrc"
25 #include <boost/scoped_ptr.hpp>
26 using namespace dbaui;
27 #define STANDARD_MARGIN 6
28 // class OTableDesignHelpBar
29 OTableDesignHelpBar::OTableDesignHelpBar( vcl::Window* pParent ) :
30 TabPage( pParent, WB_3DLOOK )
32 m_pTextWin = VclPtr<MultiLineEdit>::Create( this, WB_VSCROLL | WB_LEFT | WB_BORDER | WB_NOTABSTOP | WB_READONLY);
33 m_pTextWin->SetHelpId(HID_TABLE_DESIGN_HELP_WINDOW);
34 m_pTextWin->SetReadOnly();
35 m_pTextWin->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
36 m_pTextWin->Show();
39 OTableDesignHelpBar::~OTableDesignHelpBar()
41 disposeOnce();
44 void OTableDesignHelpBar::dispose()
46 m_pTextWin.disposeAndClear();
47 TabPage::dispose();
50 void OTableDesignHelpBar::SetHelpText( const OUString& rText )
52 if(m_pTextWin)
53 m_pTextWin->SetText( rText );
54 Invalidate();
57 void OTableDesignHelpBar::Resize()
59 // Abmessungen parent window
60 Size aOutputSize( GetOutputSizePixel() );
62 // TextWin anpassen
63 if(m_pTextWin)
64 m_pTextWin->SetPosSizePixel( Point(STANDARD_MARGIN+1, STANDARD_MARGIN+1),
65 Size(aOutputSize.Width()-(2*STANDARD_MARGIN)-2,
66 aOutputSize.Height()-(2*STANDARD_MARGIN)-2) );
70 bool OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt )
72 if (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS)
73 SetHelpText(OUString());
74 return TabPage::PreNotify(rNEvt);
77 bool OTableDesignHelpBar::isCopyAllowed()
79 return m_pTextWin && !m_pTextWin->GetSelected().isEmpty();
82 bool OTableDesignHelpBar::isCutAllowed()
84 return false;
87 bool OTableDesignHelpBar::isPasteAllowed()
89 return false;
92 void OTableDesignHelpBar::cut()
96 void OTableDesignHelpBar::copy()
98 if ( m_pTextWin )
99 m_pTextWin->Copy();
102 void OTableDesignHelpBar::paste()
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */