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 "dbaccess_helpid.hrc"
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() );
43 //------------------------------------------------------------------------------
44 OTableDesignHelpBar::~OTableDesignHelpBar()
46 DBG_DTOR(OTableDesignHelpBar
,NULL
);
47 ::std::auto_ptr
<Window
> aTemp(m_pTextWin
);
51 //------------------------------------------------------------------------------
52 void OTableDesignHelpBar::SetHelpText( const String
& rText
)
54 DBG_CHKTHIS(OTableDesignHelpBar
,NULL
);
56 m_pTextWin
->SetText( rText
);
60 //------------------------------------------------------------------------------
61 void OTableDesignHelpBar::Resize()
63 DBG_CHKTHIS(OTableDesignHelpBar
,NULL
);
64 //////////////////////////////////////////////////////////////////////
65 // Abmessungen parent window
66 Size
aOutputSize( GetOutputSizePixel() );
68 //////////////////////////////////////////////////////////////////////
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()
94 // -----------------------------------------------------------------------------
95 sal_Bool
OTableDesignHelpBar::isPasteAllowed()
99 // -----------------------------------------------------------------------------
100 void OTableDesignHelpBar::cut()
103 // -----------------------------------------------------------------------------
104 void OTableDesignHelpBar::copy()
109 // -----------------------------------------------------------------------------
110 void OTableDesignHelpBar::paste()
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */