1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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() );
39 OTableDesignHelpBar::~OTableDesignHelpBar()
44 void OTableDesignHelpBar::dispose()
46 m_pTextWin
.disposeAndClear();
50 void OTableDesignHelpBar::SetHelpText( const OUString
& rText
)
53 m_pTextWin
->SetText( rText
);
57 void OTableDesignHelpBar::Resize()
59 // Abmessungen parent window
60 Size
aOutputSize( GetOutputSizePixel() );
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()
87 bool OTableDesignHelpBar::isPasteAllowed()
92 void OTableDesignHelpBar::cut()
96 void OTableDesignHelpBar::copy()
102 void OTableDesignHelpBar::paste()
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */