1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*96de5490SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*96de5490SAndrew Rist * distributed with this work for additional information
6*96de5490SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*96de5490SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*96de5490SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*96de5490SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist * software distributed under the License is distributed on an
15*96de5490SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist * KIND, either express or implied. See the License for the
17*96de5490SAndrew Rist * specific language governing permissions and limitations
18*96de5490SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*96de5490SAndrew Rist *************************************************************/
21*96de5490SAndrew Rist
22*96de5490SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir #ifndef DBAUI_TABLEDESIGNVIEW_HXX
27cdf0e10cSrcweir #include "TableDesignView.hxx"
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _TOOLS_DEBUG_HXX
30cdf0e10cSrcweir #include <tools/debug.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef DBUI_TABLECONTROLLER_HXX
33cdf0e10cSrcweir #include "TableController.hxx"
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _DBA_DBACCESS_HELPID_HRC_
36cdf0e10cSrcweir #include "dbaccess_helpid.hrc"
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef DBAUI_FIELDDESCRIPTIONS_HXX
39cdf0e10cSrcweir #include "FieldDescriptions.hxx"
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef DBAUI_TABLEEDITORCONTROL_HXX
42cdf0e10cSrcweir #include "TEditControl.hxx"
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef DBAUI_TABLEFIELDDESCRIPTION_HXX
45cdf0e10cSrcweir #include "TableFieldDescWin.hxx"
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef DBAUI_TABLEROW_HXX
48cdf0e10cSrcweir #include "TableRow.hxx"
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _UTL_CONFIGMGR_HXX_
51cdf0e10cSrcweir #include <unotools/configmgr.hxx>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _COMPHELPER_TYPES_HXX_
54cdf0e10cSrcweir #include <comphelper/types.hxx>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARD_HPP_
57cdf0e10cSrcweir #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
60cdf0e10cSrcweir #include <unotools/syslocale.hxx>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir #ifndef DBAUI_TOOLS_HXX
63cdf0e10cSrcweir #include "UITools.hxx"
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir
66cdf0e10cSrcweir
67cdf0e10cSrcweir using namespace ::dbaui;
68cdf0e10cSrcweir using namespace ::utl;
69cdf0e10cSrcweir using namespace ::com::sun::star::uno;
70cdf0e10cSrcweir using namespace ::com::sun::star::datatransfer::clipboard;
71cdf0e10cSrcweir using namespace ::com::sun::star::lang;
72cdf0e10cSrcweir using namespace ::com::sun::star::beans;
73cdf0e10cSrcweir
74cdf0e10cSrcweir //==================================================================
75cdf0e10cSrcweir // class OTableBorderWindow
DBG_NAME(OTableBorderWindow)76cdf0e10cSrcweir DBG_NAME(OTableBorderWindow)
77cdf0e10cSrcweir //==================================================================
78cdf0e10cSrcweir OTableBorderWindow::OTableBorderWindow(Window* pParent) : Window(pParent,WB_BORDER)
79cdf0e10cSrcweir ,m_aHorzSplitter( this )
80cdf0e10cSrcweir {
81cdf0e10cSrcweir DBG_CTOR(OTableBorderWindow,NULL);
82cdf0e10cSrcweir
83cdf0e10cSrcweir ImplInitSettings( sal_True, sal_True, sal_True );
84cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
85cdf0e10cSrcweir // Childs erzeugen
86cdf0e10cSrcweir m_pEditorCtrl = new OTableEditorCtrl( this);
87cdf0e10cSrcweir m_pFieldDescWin = new OTableFieldDescWin( this );
88cdf0e10cSrcweir
89cdf0e10cSrcweir m_pFieldDescWin->SetHelpId(HID_TAB_DESIGN_DESCWIN);
90cdf0e10cSrcweir
91cdf0e10cSrcweir // set depending windows and controls
92cdf0e10cSrcweir m_pEditorCtrl->SetDescrWin(m_pFieldDescWin);
93cdf0e10cSrcweir
94cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
95cdf0e10cSrcweir // Splitter einrichten
96cdf0e10cSrcweir m_aHorzSplitter.SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) );
97cdf0e10cSrcweir m_aHorzSplitter.Show();
98cdf0e10cSrcweir }
99cdf0e10cSrcweir // -----------------------------------------------------------------------------
~OTableBorderWindow()100cdf0e10cSrcweir OTableBorderWindow::~OTableBorderWindow()
101cdf0e10cSrcweir {
102cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
103cdf0e10cSrcweir // Childs zerstoeren
104cdf0e10cSrcweir // ::dbaui::notifySystemWindow(this,m_pFieldDescWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
105cdf0e10cSrcweir m_pEditorCtrl->Hide();
106cdf0e10cSrcweir m_pFieldDescWin->Hide();
107cdf0e10cSrcweir
108cdf0e10cSrcweir {
109cdf0e10cSrcweir ::std::auto_ptr<Window> aTemp(m_pEditorCtrl);
110cdf0e10cSrcweir m_pEditorCtrl = NULL;
111cdf0e10cSrcweir }
112cdf0e10cSrcweir {
113cdf0e10cSrcweir ::std::auto_ptr<Window> aTemp(m_pFieldDescWin);
114cdf0e10cSrcweir m_pFieldDescWin = NULL;
115cdf0e10cSrcweir }
116cdf0e10cSrcweir
117cdf0e10cSrcweir DBG_DTOR(OTableBorderWindow,NULL);
118cdf0e10cSrcweir }
119cdf0e10cSrcweir // -----------------------------------------------------------------------------
Resize()120cdf0e10cSrcweir void OTableBorderWindow::Resize()
121cdf0e10cSrcweir {
122cdf0e10cSrcweir const long nSplitterHeight(3);
123cdf0e10cSrcweir
124cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
125cdf0e10cSrcweir // Abmessungen parent window
126cdf0e10cSrcweir Size aOutputSize( GetOutputSize() );
127cdf0e10cSrcweir long nOutputWidth = aOutputSize.Width();
128cdf0e10cSrcweir long nOutputHeight = aOutputSize.Height();
129cdf0e10cSrcweir long nSplitPos = m_aHorzSplitter.GetSplitPosPixel();
130cdf0e10cSrcweir
131cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
132cdf0e10cSrcweir // Verschiebebereich Splitter mittleres Drittel des Outputs
133cdf0e10cSrcweir long nDragPosY = nOutputHeight/3;
134cdf0e10cSrcweir long nDragSizeHeight = nOutputHeight/3;
135cdf0e10cSrcweir m_aHorzSplitter.SetDragRectPixel( Rectangle(Point(0,nDragPosY), Size(nOutputWidth,nDragSizeHeight) ), this );
136cdf0e10cSrcweir if( (nSplitPos < nDragPosY) || (nSplitPos > (nDragPosY+nDragSizeHeight)) )
137cdf0e10cSrcweir nSplitPos = nDragPosY+nDragSizeHeight-5;
138cdf0e10cSrcweir
139cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
140cdf0e10cSrcweir // Splitter setzen
141cdf0e10cSrcweir m_aHorzSplitter.SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight));
142cdf0e10cSrcweir m_aHorzSplitter.SetSplitPosPixel( nSplitPos );
143cdf0e10cSrcweir
144cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
145cdf0e10cSrcweir // Fenster setzen
146cdf0e10cSrcweir m_pEditorCtrl->SetPosSizePixel( Point(0, 0), Size(nOutputWidth , nSplitPos) );
147cdf0e10cSrcweir
148cdf0e10cSrcweir m_pFieldDescWin->SetPosSizePixel( Point(0, nSplitPos+nSplitterHeight),
149cdf0e10cSrcweir Size(nOutputWidth, nOutputHeight-nSplitPos-nSplitterHeight) );
150cdf0e10cSrcweir }
151cdf0e10cSrcweir //------------------------------------------------------------------------------
IMPL_LINK(OTableBorderWindow,SplitHdl,Splitter *,pSplit)152cdf0e10cSrcweir IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit )
153cdf0e10cSrcweir {
154cdf0e10cSrcweir if(pSplit == &m_aHorzSplitter)
155cdf0e10cSrcweir {
156cdf0e10cSrcweir m_aHorzSplitter.SetPosPixel( Point( m_aHorzSplitter.GetPosPixel().X(),m_aHorzSplitter.GetSplitPosPixel() ) );
157cdf0e10cSrcweir Resize();
158cdf0e10cSrcweir }
159cdf0e10cSrcweir return 0;
160cdf0e10cSrcweir }
161cdf0e10cSrcweir // -----------------------------------------------------------------------------
ImplInitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)162cdf0e10cSrcweir void OTableBorderWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
163cdf0e10cSrcweir {
164cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
165cdf0e10cSrcweir
166cdf0e10cSrcweir if ( bFont )
167cdf0e10cSrcweir {
168cdf0e10cSrcweir Font aFont = rStyleSettings.GetAppFont();
169cdf0e10cSrcweir if ( IsControlFont() )
170cdf0e10cSrcweir aFont.Merge( GetControlFont() );
171cdf0e10cSrcweir SetPointFont( aFont );
172cdf0e10cSrcweir // Set/*Zoomed*/PointFont( aFont );
173cdf0e10cSrcweir }
174cdf0e10cSrcweir
175cdf0e10cSrcweir if ( bFont || bForeground )
176cdf0e10cSrcweir {
177cdf0e10cSrcweir Color aTextColor = rStyleSettings.GetButtonTextColor();
178cdf0e10cSrcweir if ( IsControlForeground() )
179cdf0e10cSrcweir aTextColor = GetControlForeground();
180cdf0e10cSrcweir SetTextColor( aTextColor );
181cdf0e10cSrcweir }
182cdf0e10cSrcweir
183cdf0e10cSrcweir if ( bBackground )
184cdf0e10cSrcweir {
185cdf0e10cSrcweir if( IsControlBackground() )
186cdf0e10cSrcweir SetBackground( GetControlBackground() );
187cdf0e10cSrcweir else
188cdf0e10cSrcweir SetBackground( rStyleSettings.GetFaceColor() );
189cdf0e10cSrcweir }
190cdf0e10cSrcweir }
191cdf0e10cSrcweir // -----------------------------------------------------------------------
DataChanged(const DataChangedEvent & rDCEvt)192cdf0e10cSrcweir void OTableBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
193cdf0e10cSrcweir {
194cdf0e10cSrcweir Window::DataChanged( rDCEvt );
195cdf0e10cSrcweir
196cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
197cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) )
198cdf0e10cSrcweir {
199cdf0e10cSrcweir ImplInitSettings( sal_True, sal_True, sal_True );
200cdf0e10cSrcweir Invalidate();
201cdf0e10cSrcweir }
202cdf0e10cSrcweir }
203cdf0e10cSrcweir // -----------------------------------------------------------------------------
GetFocus()204cdf0e10cSrcweir void OTableBorderWindow::GetFocus()
205cdf0e10cSrcweir {
206cdf0e10cSrcweir Window::GetFocus();
207cdf0e10cSrcweir
208cdf0e10cSrcweir // forward the focus to the current cell of the editor control
209cdf0e10cSrcweir if (m_pEditorCtrl)
210cdf0e10cSrcweir m_pEditorCtrl->GrabFocus();
211cdf0e10cSrcweir }
212cdf0e10cSrcweir
213cdf0e10cSrcweir //==================================================================
214cdf0e10cSrcweir // class OTableDesignView
215cdf0e10cSrcweir //==================================================================
216cdf0e10cSrcweir DBG_NAME(OTableDesignView);
217cdf0e10cSrcweir //------------------------------------------------------------------------------
OTableDesignView(Window * pParent,const Reference<XMultiServiceFactory> & _rxOrb,OTableController & _rController)218cdf0e10cSrcweir OTableDesignView::OTableDesignView( Window* pParent,
219cdf0e10cSrcweir const Reference< XMultiServiceFactory >& _rxOrb,
220cdf0e10cSrcweir OTableController& _rController
221cdf0e10cSrcweir ) :
222cdf0e10cSrcweir ODataView( pParent, _rController,_rxOrb )
223cdf0e10cSrcweir ,m_rController( _rController )
224cdf0e10cSrcweir ,m_eChildFocus(NONE)
225cdf0e10cSrcweir {
226cdf0e10cSrcweir DBG_CTOR(OTableDesignView,NULL);
227cdf0e10cSrcweir
228cdf0e10cSrcweir try
229cdf0e10cSrcweir {
230cdf0e10cSrcweir m_aLocale = SvtSysLocale().GetLocaleData().getLocale();
231cdf0e10cSrcweir }
232cdf0e10cSrcweir catch(Exception&)
233cdf0e10cSrcweir {
234cdf0e10cSrcweir }
235cdf0e10cSrcweir
236cdf0e10cSrcweir m_pWin = new OTableBorderWindow(this);
237cdf0e10cSrcweir m_pWin->Show();
238cdf0e10cSrcweir }
239cdf0e10cSrcweir
240cdf0e10cSrcweir //------------------------------------------------------------------------------
~OTableDesignView()241cdf0e10cSrcweir OTableDesignView::~OTableDesignView()
242cdf0e10cSrcweir {
243cdf0e10cSrcweir DBG_DTOR(OTableDesignView,NULL);
244cdf0e10cSrcweir m_pWin->Hide();
245cdf0e10cSrcweir
246cdf0e10cSrcweir {
247cdf0e10cSrcweir ::std::auto_ptr<Window> aTemp(m_pWin);
248cdf0e10cSrcweir m_pWin = NULL;
249cdf0e10cSrcweir }
250cdf0e10cSrcweir }
251cdf0e10cSrcweir
252cdf0e10cSrcweir // -----------------------------------------------------------------------------
initialize()253cdf0e10cSrcweir void OTableDesignView::initialize()
254cdf0e10cSrcweir {
255cdf0e10cSrcweir GetEditorCtrl()->Init();
256cdf0e10cSrcweir GetDescWin()->Init();
257cdf0e10cSrcweir // first call after the editctrl has been set
258cdf0e10cSrcweir
259cdf0e10cSrcweir GetEditorCtrl()->Show();
260cdf0e10cSrcweir GetDescWin()->Show();
261cdf0e10cSrcweir
262cdf0e10cSrcweir GetEditorCtrl()->DisplayData(0);
263cdf0e10cSrcweir }
264cdf0e10cSrcweir //------------------------------------------------------------------------------
265cdf0e10cSrcweir
266cdf0e10cSrcweir //------------------------------------------------------------------------------
resizeDocumentView(Rectangle & _rPlayground)267cdf0e10cSrcweir void OTableDesignView::resizeDocumentView(Rectangle& _rPlayground)
268cdf0e10cSrcweir {
269cdf0e10cSrcweir m_pWin->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
270cdf0e10cSrcweir
271cdf0e10cSrcweir // just for completeness: there is no space left, we occupied it all ...
272cdf0e10cSrcweir _rPlayground.SetPos( _rPlayground.BottomRight() );
273cdf0e10cSrcweir _rPlayground.SetSize( Size( 0, 0 ) );
274cdf0e10cSrcweir }
275cdf0e10cSrcweir
276cdf0e10cSrcweir //------------------------------------------------------------------------------
277cdf0e10cSrcweir IMPL_LINK( OTableDesignView, SwitchHdl, Accelerator*, /*pAcc*/ )
278cdf0e10cSrcweir {
279cdf0e10cSrcweir if( getController().isReadOnly() )
280cdf0e10cSrcweir return 0;
281cdf0e10cSrcweir
282cdf0e10cSrcweir if( GetDescWin()->HasChildPathFocus() )
283cdf0e10cSrcweir {
284cdf0e10cSrcweir GetDescWin()->LoseFocus();
285cdf0e10cSrcweir GetEditorCtrl()->GrabFocus();
286cdf0e10cSrcweir }
287cdf0e10cSrcweir else
288cdf0e10cSrcweir {
289cdf0e10cSrcweir ::boost::shared_ptr<OTableRow> pRow = (*GetEditorCtrl()->GetRowList())[GetEditorCtrl()->GetCurRow()];
290cdf0e10cSrcweir OFieldDescription* pFieldDescr = pRow ? pRow->GetActFieldDescr() : NULL;
291cdf0e10cSrcweir if ( pFieldDescr )
292cdf0e10cSrcweir GetDescWin()->GrabFocus();
293cdf0e10cSrcweir else
294cdf0e10cSrcweir GetEditorCtrl()->GrabFocus();
295cdf0e10cSrcweir }
296cdf0e10cSrcweir
297cdf0e10cSrcweir return 0;
298cdf0e10cSrcweir }
299cdf0e10cSrcweir //------------------------------------------------------------------------------
PreNotify(NotifyEvent & rNEvt)300cdf0e10cSrcweir long OTableDesignView::PreNotify( NotifyEvent& rNEvt )
301cdf0e10cSrcweir {
302cdf0e10cSrcweir sal_Bool bHandled = sal_False;
303cdf0e10cSrcweir switch(rNEvt.GetType())
304cdf0e10cSrcweir {
305cdf0e10cSrcweir case EVENT_GETFOCUS:
306cdf0e10cSrcweir if( GetDescWin() && GetDescWin()->HasChildPathFocus() )
307cdf0e10cSrcweir m_eChildFocus = DESCRIPTION;
308cdf0e10cSrcweir else if ( GetEditorCtrl() && GetEditorCtrl()->HasChildPathFocus() )
309cdf0e10cSrcweir m_eChildFocus = EDITOR;
310cdf0e10cSrcweir else
311cdf0e10cSrcweir m_eChildFocus = NONE;
312cdf0e10cSrcweir break;
313cdf0e10cSrcweir }
314cdf0e10cSrcweir
315cdf0e10cSrcweir return bHandled ? 1L : ODataView::PreNotify(rNEvt);
316cdf0e10cSrcweir }
317cdf0e10cSrcweir // -----------------------------------------------------------------------------
getActiveChild() const318cdf0e10cSrcweir IClipboardTest* OTableDesignView::getActiveChild() const
319cdf0e10cSrcweir {
320cdf0e10cSrcweir IClipboardTest* pTest = NULL;
321cdf0e10cSrcweir switch(m_eChildFocus)
322cdf0e10cSrcweir {
323cdf0e10cSrcweir case DESCRIPTION:
324cdf0e10cSrcweir pTest = GetDescWin();
325cdf0e10cSrcweir break;
326cdf0e10cSrcweir case EDITOR:
327cdf0e10cSrcweir pTest = GetEditorCtrl();
328cdf0e10cSrcweir break;
329cdf0e10cSrcweir case NONE:
330cdf0e10cSrcweir break;
331cdf0e10cSrcweir }
332cdf0e10cSrcweir return pTest;
333cdf0e10cSrcweir }
334cdf0e10cSrcweir // -----------------------------------------------------------------------------
isCopyAllowed()335cdf0e10cSrcweir sal_Bool OTableDesignView::isCopyAllowed()
336cdf0e10cSrcweir {
337cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
338cdf0e10cSrcweir return pTest && pTest->isCopyAllowed();
339cdf0e10cSrcweir }
340cdf0e10cSrcweir // -----------------------------------------------------------------------------
isCutAllowed()341cdf0e10cSrcweir sal_Bool OTableDesignView::isCutAllowed()
342cdf0e10cSrcweir {
343cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
344cdf0e10cSrcweir return pTest && pTest->isCutAllowed();
345cdf0e10cSrcweir }
346cdf0e10cSrcweir // -----------------------------------------------------------------------------
isPasteAllowed()347cdf0e10cSrcweir sal_Bool OTableDesignView::isPasteAllowed()
348cdf0e10cSrcweir {
349cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
350cdf0e10cSrcweir return pTest && pTest->isPasteAllowed();
351cdf0e10cSrcweir }
352cdf0e10cSrcweir // -----------------------------------------------------------------------------
copy()353cdf0e10cSrcweir void OTableDesignView::copy()
354cdf0e10cSrcweir {
355cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
356cdf0e10cSrcweir if ( pTest )
357cdf0e10cSrcweir pTest->copy();
358cdf0e10cSrcweir }
359cdf0e10cSrcweir // -----------------------------------------------------------------------------
cut()360cdf0e10cSrcweir void OTableDesignView::cut()
361cdf0e10cSrcweir {
362cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
363cdf0e10cSrcweir if ( pTest )
364cdf0e10cSrcweir pTest->cut();
365cdf0e10cSrcweir }
366cdf0e10cSrcweir // -----------------------------------------------------------------------------
paste()367cdf0e10cSrcweir void OTableDesignView::paste()
368cdf0e10cSrcweir {
369cdf0e10cSrcweir IClipboardTest* pTest = getActiveChild();
370cdf0e10cSrcweir if ( pTest )
371cdf0e10cSrcweir pTest->paste();
372cdf0e10cSrcweir }
373cdf0e10cSrcweir // -----------------------------------------------------------------------------
374cdf0e10cSrcweir // set the view readonly or not
setReadOnly(sal_Bool _bReadOnly)375cdf0e10cSrcweir void OTableDesignView::setReadOnly(sal_Bool _bReadOnly)
376cdf0e10cSrcweir {
377cdf0e10cSrcweir GetDescWin()->SetReadOnly(_bReadOnly);
378cdf0e10cSrcweir GetEditorCtrl()->SetReadOnly(_bReadOnly);
379cdf0e10cSrcweir }
380cdf0e10cSrcweir // -----------------------------------------------------------------------------
reSync()381cdf0e10cSrcweir void OTableDesignView::reSync()
382cdf0e10cSrcweir {
383cdf0e10cSrcweir GetEditorCtrl()->DeactivateCell();
384cdf0e10cSrcweir ::boost::shared_ptr<OTableRow> pRow = (*GetEditorCtrl()->GetRowList())[GetEditorCtrl()->GetCurRow()];
385cdf0e10cSrcweir OFieldDescription* pFieldDescr = pRow ? pRow->GetActFieldDescr() : NULL;
386cdf0e10cSrcweir if ( pFieldDescr )
387cdf0e10cSrcweir GetDescWin()->DisplayData(pFieldDescr);
388cdf0e10cSrcweir }
389cdf0e10cSrcweir // -----------------------------------------------------------------------------
GetFocus()390cdf0e10cSrcweir void OTableDesignView::GetFocus()
391cdf0e10cSrcweir {
392cdf0e10cSrcweir if ( GetEditorCtrl() )
393cdf0e10cSrcweir GetEditorCtrl()->GrabFocus();
394cdf0e10cSrcweir }
395cdf0e10cSrcweir // -----------------------------------------------------------------------------
396cdf0e10cSrcweir
397