Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "TableDesignHelpBar.hxx"
30 : : #include <tools/debug.hxx>
31 : : #include <svtools/svmedit.hxx>
32 : : #include "dbaccess_helpid.hrc"
33 : : #include <memory>
34 : : using namespace dbaui;
35 : : #define STANDARD_MARGIN 6
36 : : //==================================================================
37 : : // class OTableDesignHelpBar
38 : : //==================================================================
39 : : DBG_NAME(OTableDesignHelpBar)
40 : : //------------------------------------------------------------------------------
41 : 0 : OTableDesignHelpBar::OTableDesignHelpBar( Window* pParent ) :
42 [ # # ]: 0 : TabPage( pParent, WB_3DLOOK )
43 : : {
44 : : DBG_CTOR(OTableDesignHelpBar,NULL);
45 [ # # ][ # # ]: 0 : m_pTextWin = new MultiLineEdit( this, WB_VSCROLL | WB_LEFT | WB_BORDER | WB_NOTABSTOP | WB_READONLY);
46 [ # # ]: 0 : m_pTextWin->SetHelpId(HID_TABLE_DESIGN_HELP_WINDOW);
47 [ # # ]: 0 : m_pTextWin->SetReadOnly();
48 [ # # ]: 0 : m_pTextWin->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
49 [ # # ]: 0 : m_pTextWin->Show();
50 : 0 : }
51 : :
52 : : //------------------------------------------------------------------------------
53 [ # # ]: 0 : OTableDesignHelpBar::~OTableDesignHelpBar()
54 : : {
55 : : DBG_DTOR(OTableDesignHelpBar,NULL);
56 : 0 : ::std::auto_ptr<Window> aTemp(m_pTextWin);
57 [ # # ]: 0 : m_pTextWin = NULL;
58 [ # # ]: 0 : }
59 : :
60 : : //------------------------------------------------------------------------------
61 : 0 : void OTableDesignHelpBar::SetHelpText( const String& rText )
62 : : {
63 : : DBG_CHKTHIS(OTableDesignHelpBar,NULL);
64 [ # # ]: 0 : if(m_pTextWin)
65 : 0 : m_pTextWin->SetText( rText );
66 : 0 : Invalidate();
67 : 0 : }
68 : :
69 : : //------------------------------------------------------------------------------
70 : 0 : void OTableDesignHelpBar::Resize()
71 : : {
72 : : DBG_CHKTHIS(OTableDesignHelpBar,NULL);
73 : : //////////////////////////////////////////////////////////////////////
74 : : // Abmessungen parent window
75 : 0 : Size aOutputSize( GetOutputSizePixel() );
76 : :
77 : : //////////////////////////////////////////////////////////////////////
78 : : // TextWin anpassen
79 [ # # ]: 0 : if(m_pTextWin)
80 : : m_pTextWin->SetPosSizePixel( Point(STANDARD_MARGIN+1, STANDARD_MARGIN+1),
81 : 0 : Size(aOutputSize.Width()-(2*STANDARD_MARGIN)-2,
82 [ # # ]: 0 : aOutputSize.Height()-(2*STANDARD_MARGIN)-2) );
83 : :
84 : 0 : }
85 : :
86 : : //------------------------------------------------------------------------------
87 : 0 : long OTableDesignHelpBar::PreNotify( NotifyEvent& rNEvt )
88 : : {
89 [ # # ]: 0 : if (rNEvt.GetType() == EVENT_LOSEFOCUS)
90 [ # # ]: 0 : SetHelpText(String());
91 : 0 : return TabPage::PreNotify(rNEvt);
92 : : }
93 : : // -----------------------------------------------------------------------------
94 : 0 : sal_Bool OTableDesignHelpBar::isCopyAllowed()
95 : : {
96 [ # # ][ # # ]: 0 : return m_pTextWin && m_pTextWin->GetSelected().Len();
[ # # ][ # # ]
[ # # ]
97 : : }
98 : : // -----------------------------------------------------------------------------
99 : 0 : sal_Bool OTableDesignHelpBar::isCutAllowed()
100 : : {
101 : 0 : return sal_False;
102 : : }
103 : : // -----------------------------------------------------------------------------
104 : 0 : sal_Bool OTableDesignHelpBar::isPasteAllowed()
105 : : {
106 : 0 : return sal_False;
107 : : }
108 : : // -----------------------------------------------------------------------------
109 : 0 : void OTableDesignHelpBar::cut()
110 : : {
111 : 0 : }
112 : : // -----------------------------------------------------------------------------
113 : 0 : void OTableDesignHelpBar::copy()
114 : : {
115 [ # # ]: 0 : if ( m_pTextWin )
116 : 0 : m_pTextWin->Copy();
117 : 0 : }
118 : : // -----------------------------------------------------------------------------
119 : 0 : void OTableDesignHelpBar::paste()
120 : : {
121 : 0 : }
122 : :
123 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|