bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / tabledesign / TableDesignHelpBar.cxx
blobbb3d91675cc8400d5eaeedba9d0d658617acd037
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 "dbaccess_helpid.hrc"
24 #include <memory>
25 using namespace dbaui;
26 #define STANDARD_MARGIN 6
27 //==================================================================
28 // class OTableDesignHelpBar
29 //==================================================================
30 DBG_NAME(OTableDesignHelpBar)
31 //------------------------------------------------------------------------------
32 OTableDesignHelpBar::OTableDesignHelpBar( Window* pParent ) :
33 TabPage( pParent, WB_3DLOOK )
35 DBG_CTOR(OTableDesignHelpBar,NULL);
36 m_pTextWin = new MultiLineEdit( this, WB_VSCROLL | WB_LEFT | WB_BORDER | WB_NOTABSTOP | WB_READONLY);
37 m_pTextWin->SetHelpId(HID_TABLE_DESIGN_HELP_WINDOW);
38 m_pTextWin->SetReadOnly();
39 m_pTextWin->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
40 m_pTextWin->Show();
43 //------------------------------------------------------------------------------
44 OTableDesignHelpBar::~OTableDesignHelpBar()
46 DBG_DTOR(OTableDesignHelpBar,NULL);
47 ::std::auto_ptr<Window> aTemp(m_pTextWin);
48 m_pTextWin = NULL;
51 //------------------------------------------------------------------------------
52 void OTableDesignHelpBar::SetHelpText( const String& rText )
54 DBG_CHKTHIS(OTableDesignHelpBar,NULL);
55 if(m_pTextWin)
56 m_pTextWin->SetText( rText );
57 Invalidate();
60 //------------------------------------------------------------------------------
61 void OTableDesignHelpBar::Resize()
63 DBG_CHKTHIS(OTableDesignHelpBar,NULL);
64 //////////////////////////////////////////////////////////////////////
65 // Abmessungen parent window
66 Size aOutputSize( GetOutputSizePixel() );
68 //////////////////////////////////////////////////////////////////////
69 // TextWin anpassen
70 if(m_pTextWin)
71 m_pTextWin->SetPosSizePixel( Point(STANDARD_MARGIN+1, STANDARD_MARGIN+1),
72 Size(aOutputSize.Width()-(2*STANDARD_MARGIN)-2,
73 aOutputSize.Height()-(2*STANDARD_MARGIN)-2) );
77 //------------------------------------------------------------------------------
78 long OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt )
80 if (rNEvt.GetType() == EVENT_LOSEFOCUS)
81 SetHelpText(String());
82 return TabPage::PreNotify(rNEvt);
84 // -----------------------------------------------------------------------------
85 sal_Bool OTableDesignHelpBar::isCopyAllowed()
87 return m_pTextWin && !m_pTextWin->GetSelected().isEmpty();
89 // -----------------------------------------------------------------------------
90 sal_Bool OTableDesignHelpBar::isCutAllowed()
92 return sal_False;
94 // -----------------------------------------------------------------------------
95 sal_Bool OTableDesignHelpBar::isPasteAllowed()
97 return sal_False;
99 // -----------------------------------------------------------------------------
100 void OTableDesignHelpBar::cut()
103 // -----------------------------------------------------------------------------
104 void OTableDesignHelpBar::copy()
106 if ( m_pTextWin )
107 m_pTextWin->Copy();
109 // -----------------------------------------------------------------------------
110 void OTableDesignHelpBar::paste()
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */