Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / querydesign / TableWindow.cxx
blobd7dbc5eef76c061e6347eb1cceb39d457a00e6a8
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 "TableWindow.hxx"
21 #include "TableWindowListBox.hxx"
22 #include "QueryTableView.hxx"
23 #include "QueryDesignView.hxx"
24 #include "TableWindowData.hxx"
25 #include "imageprovider.hxx"
26 #include <tools/diagnose_ex.h>
27 #include <osl/diagnose.h>
28 #include <vcl/svapp.hxx>
29 #include <vcl/wall.hxx>
30 #include <vcl/settings.hxx>
32 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
36 #include <com/sun/star/accessibility/AccessibleRole.hpp>
37 #include "querycontroller.hxx"
38 #include "dbu_qry.hrc"
39 #include "dbustrings.hrc"
40 #include "Query.hrc"
41 #include <comphelper/extract.hxx>
42 #include "UITools.hxx"
43 #include "TableWindowAccess.hxx"
44 #include "browserids.hxx"
45 #include <connectivity/dbtools.hxx>
46 #include "svtools/treelistentry.hxx"
48 using namespace dbaui;
49 using namespace ::utl;
50 using namespace ::com::sun::star;
51 using namespace ::com::sun::star::sdb;
52 using namespace ::com::sun::star::sdbc;
53 using namespace ::com::sun::star::sdbcx;
54 using namespace ::com::sun::star::uno;
55 using namespace ::com::sun::star::beans;
56 using namespace ::com::sun::star::container;
57 using namespace ::com::sun::star::lang;
58 using namespace ::com::sun::star::accessibility;
60 namespace DatabaseObject = css::sdb::application::DatabaseObject;
62 #define TABWIN_SIZING_AREA 4
63 #define TABWIN_WIDTH_MIN 90
64 #define TABWIN_HEIGHT_MIN 80
66 namespace {
68 void Draw3DBorder(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
70 // Use the System Style-Settings for my colours
71 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
73 // Black lines for bottom and right
74 rRenderContext.SetLineColor(aSystemStyle.GetDarkShadowColor());
75 rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight());
76 rRenderContext.DrawLine(rRect.BottomRight(), rRect.TopRight());
78 // Dark grey lines over the black lines
79 rRenderContext.SetLineColor(aSystemStyle.GetShadowColor());
80 Point aEHvector(1, 1);
81 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -1), rRect.BottomRight() - aEHvector);
82 rRenderContext.DrawLine(rRect.BottomRight() - aEHvector, rRect.TopRight() + Point(-1, 1));
84 // Light grey lines for top and left
85 rRenderContext.SetLineColor(aSystemStyle.GetLightColor());
86 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -2), rRect.TopLeft() + aEHvector);
87 rRenderContext.DrawLine(rRect.TopLeft() + aEHvector, rRect.TopRight() + Point(-2, 1));
92 // class OTableWindow
93 OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData )
94 : ::comphelper::OContainerListener(m_aMutex)
95 ,Window( pParent, WB_3DLOOK|WB_MOVEABLE )
96 ,m_aTypeImage( VclPtr<FixedImage>::Create(this) )
97 ,m_xTitle( VclPtr<OTableWindowTitle>::Create(this) )
98 ,m_pAccessible(nullptr)
99 ,m_pData( pTabWinData )
100 ,m_nMoveCount(0)
101 ,m_nMoveIncrement(1)
102 ,m_nSizingFlags( SIZING_NONE )
103 ,m_bActive( false )
106 // Set position and size
107 if( GetData()->HasPosition() )
108 SetPosPixel( GetData()->GetPosition() );
110 if( GetData()->HasSize() )
111 SetSizePixel( GetData()->GetSize() );
113 // Set background
114 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
115 SetBackground(Wallpaper(aSystemStyle.GetFaceColor()));
116 // Set the text colour even though there is no text,
117 // because derived classes might need it
118 SetTextColor(aSystemStyle.GetButtonTextColor());
120 EnableClipSiblings();
123 OTableWindow::~OTableWindow()
125 disposeOnce();
128 void OTableWindow::dispose()
130 if (m_xListBox)
132 OSL_ENSURE(m_xListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!");
134 m_xListBox.disposeAndClear();
135 if ( m_pContainerListener.is() )
136 m_pContainerListener->dispose();
138 m_pAccessible = nullptr;
139 m_aTypeImage.disposeAndClear();
140 m_xTitle.disposeAndClear();
141 vcl::Window::dispose();
144 const OJoinTableView* OTableWindow::getTableView() const
146 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
147 return static_cast<OJoinTableView*>(GetParent());
150 OJoinTableView* OTableWindow::getTableView()
152 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
153 return static_cast<OJoinTableView*>(GetParent());
156 OJoinDesignView* OTableWindow::getDesignView()
158 OSL_ENSURE(static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent()),"No OJoinDesignView!");
159 return static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent());
162 void OTableWindow::SetPosPixel( const Point& rNewPos )
164 Point aNewPosData = rNewPos + getTableView()->GetScrollOffset();
165 GetData()->SetPosition( aNewPosData );
166 Window::SetPosPixel( rNewPos );
169 void OTableWindow::SetSizePixel( const Size& rNewSize )
171 Size aOutSize(rNewSize);
172 if( aOutSize.Width() < TABWIN_WIDTH_MIN )
173 aOutSize.Width() = TABWIN_WIDTH_MIN;
174 if( aOutSize.Height() < TABWIN_HEIGHT_MIN )
175 aOutSize.Height() = TABWIN_HEIGHT_MIN;
177 GetData()->SetSize( aOutSize );
178 Window::SetSizePixel( aOutSize );
181 void OTableWindow::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
183 SetPosPixel( rNewPos );
184 SetSizePixel( rNewSize );
187 VclPtr<OTableWindowListBox> OTableWindow::CreateListBox()
189 return VclPtr<OTableWindowListBox>::Create(this);
192 bool OTableWindow::FillListBox()
194 m_xListBox->Clear();
195 if ( !m_pContainerListener.is() )
197 Reference< XContainer> xContainer(m_pData->getColumns(),UNO_QUERY);
198 if ( xContainer.is() )
199 m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
201 // mark all primary keys with special image
202 ModuleRes TmpRes(IMG_JOINS);
203 ImageList aImageList(TmpRes);
204 Image aPrimKeyImage = aImageList.GetImage(IMG_PRIMARY_KEY);
206 if (GetData()->IsShowAll())
208 SvTreeListEntry* pEntry = m_xListBox->InsertEntry( OUString("*") );
209 pEntry->SetUserData( createUserData(nullptr,false) );
212 Reference<XNameAccess> xPKeyColumns;
215 xPKeyColumns = dbtools::getPrimaryKeyColumns_throw(m_pData->getTable());
217 catch(Exception&)
219 OSL_FAIL("Exception occurred!");
223 Reference< XNameAccess > xColumns = m_pData->getColumns();
224 if( xColumns.is() )
226 Sequence< OUString> aColumns = xColumns->getElementNames();
227 const OUString* pIter = aColumns.getConstArray();
228 const OUString* pEnd = pIter + aColumns.getLength();
230 SvTreeListEntry* pEntry = nullptr;
231 for (; pIter != pEnd; ++pIter)
233 bool bPrimaryKeyColumn = xPKeyColumns.is() && xPKeyColumns->hasByName( *pIter );
234 // is this column in the primary key
235 if ( bPrimaryKeyColumn )
236 pEntry = m_xListBox->InsertEntry(*pIter, aPrimKeyImage, aPrimKeyImage);
237 else
238 pEntry = m_xListBox->InsertEntry(*pIter);
240 Reference<XPropertySet> xColumn(xColumns->getByName(*pIter),UNO_QUERY);
241 if ( xColumn.is() )
242 pEntry->SetUserData( createUserData(xColumn,bPrimaryKeyColumn) );
246 catch(Exception&)
248 OSL_FAIL("Exception occurred!");
251 return true;
254 void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/)
256 return nullptr;
259 void OTableWindow::deleteUserData(void*& _pUserData)
261 OSL_ENSURE(!_pUserData,"INVALID call. Need to delete the userclass!");
262 _pUserData = nullptr;
265 void OTableWindow::clearListBox()
267 if ( m_xListBox )
269 SvTreeListEntry* pEntry = m_xListBox->First();
271 while(pEntry)
273 void* pUserData = pEntry->GetUserData();
274 deleteUserData(pUserData);
275 SvTreeListEntry* pNextEntry = m_xListBox->Next(pEntry);
276 m_xListBox->GetModel()->Remove(pEntry);
277 pEntry = pNextEntry;
282 void OTableWindow::impl_updateImage()
284 ImageProvider aImageProvider( getDesignView()->getController().getConnection() );
286 Image aImage;
287 aImageProvider.getImages( GetComposedName(), m_pData->isQuery() ? DatabaseObject::QUERY : DatabaseObject::TABLE, aImage );
289 if ( !aImage )
291 OSL_FAIL( "OTableWindow::impl_updateImage: no images!" );
292 return;
295 m_aTypeImage->SetModeImage( aImage );
296 m_aTypeImage->Show();
299 bool OTableWindow::Init()
301 // create list box if necessary
302 if ( !m_xListBox )
304 m_xListBox = CreateListBox();
305 OSL_ENSURE( m_xListBox != nullptr, "OTableWindow::Init() : CreateListBox returned NULL !" );
306 m_xListBox->SetSelectionMode( MULTIPLE_SELECTION );
309 // Set the title
310 m_xTitle->SetText( m_pData->GetWinName() );
311 m_xTitle->Show();
313 m_xListBox->Show();
315 // add the fields to the ListBox
316 clearListBox();
317 bool bSuccess = FillListBox();
318 if ( bSuccess )
319 m_xListBox->SelectAll( false );
321 impl_updateImage();
323 return bSuccess;
326 void OTableWindow::DataChanged(const DataChangedEvent& rDCEvt)
328 if (rDCEvt.GetType() == DataChangedEventType::SETTINGS)
330 // In the worst-case the colours have changed so
331 // adapt myself to the new colours
332 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
333 SetBackground(Wallpaper(Color(aSystemStyle.GetFaceColor())));
334 SetTextColor(aSystemStyle.GetButtonTextColor());
338 void OTableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
340 Rectangle aRect(Point(0,0), GetOutputSizePixel());
341 Window::Paint(rRenderContext, rRect);
342 Draw3DBorder(rRenderContext, aRect);
345 Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const
347 Rectangle aSizingRect = Rectangle( GetPosPixel(), GetSizePixel() );
348 sal_uInt16 nSizingFlags = GetSizingFlags();
350 if( nSizingFlags & SIZING_TOP )
352 if( _rPos.Y() < 0 )
353 aSizingRect.Top() = 0;
354 else
355 aSizingRect.Top() = _rPos.Y();
358 if( nSizingFlags & SIZING_BOTTOM )
360 if( _rPos.Y() > _rOutputSize.Height() )
361 aSizingRect.Bottom() = _rOutputSize.Height();
362 else
363 aSizingRect.Bottom() = _rPos.Y();
366 if( nSizingFlags & SIZING_RIGHT )
368 if( _rPos.X() > _rOutputSize.Width() )
369 aSizingRect.Right() = _rOutputSize.Width();
370 else
371 aSizingRect.Right() = _rPos.X();
374 if( nSizingFlags & SIZING_LEFT )
376 if( _rPos.X() < 0 )
377 aSizingRect.Left() = 0;
378 else
379 aSizingRect.Left() = _rPos.X();
381 return aSizingRect;
384 void OTableWindow::setSizingFlag(const Point& _rPos)
386 Size aOutSize = GetOutputSizePixel();
387 // Set the flags when the mouse cursor is in the sizing area
388 m_nSizingFlags = SIZING_NONE;
390 if( _rPos.X() < TABWIN_SIZING_AREA )
391 m_nSizingFlags |= SIZING_LEFT;
393 if( _rPos.Y() < TABWIN_SIZING_AREA )
394 m_nSizingFlags |= SIZING_TOP;
396 if( _rPos.X() > aOutSize.Width()-TABWIN_SIZING_AREA )
397 m_nSizingFlags |= SIZING_RIGHT;
399 if( _rPos.Y() > aOutSize.Height()-TABWIN_SIZING_AREA )
400 m_nSizingFlags |= SIZING_BOTTOM;
403 void OTableWindow::MouseMove( const MouseEvent& rEvt )
405 Window::MouseMove(rEvt);
407 OJoinTableView* pCont = getTableView();
408 if (pCont->getDesignView()->getController().isReadOnly())
409 return;
411 Point aPos = rEvt.GetPosPixel();
412 setSizingFlag(aPos);
413 Pointer aPointer;
415 // Set the mouse cursor when it is in the sizing area
416 switch( m_nSizingFlags )
418 case SIZING_TOP:
419 case SIZING_BOTTOM:
420 aPointer = Pointer( PointerStyle::SSize );
421 break;
423 case SIZING_LEFT:
424 case SIZING_RIGHT:
425 aPointer = Pointer( PointerStyle::ESize );
426 break;
428 case SIZING_LEFT+SIZING_TOP:
429 case SIZING_RIGHT+SIZING_BOTTOM:
430 aPointer = Pointer( PointerStyle::SESize );
431 break;
433 case SIZING_RIGHT+SIZING_TOP:
434 case SIZING_LEFT+SIZING_BOTTOM:
435 aPointer = Pointer( PointerStyle::NESize );
436 break;
439 SetPointer( aPointer );
442 void OTableWindow::MouseButtonDown( const MouseEvent& rEvt )
444 // When resizing, the parent must be informed that
445 // the window size of its child has changed
446 if( m_nSizingFlags )
447 getTableView()->BeginChildSizing( this, GetPointer() );
449 Window::MouseButtonDown( rEvt );
452 void OTableWindow::Resize()
454 // The window must not disappear so we enforce a minimum size
455 Size aOutSize = GetOutputSizePixel();
456 aOutSize = Size(CalcZoom(aOutSize.Width()),CalcZoom(aOutSize.Height()));
458 long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 );
460 // Set the title and ListBox
461 long n5Pos = CalcZoom(5);
462 long nPositionX = n5Pos;
463 long nPositionY = n5Pos;
465 // position the image which indicates the type
466 m_aTypeImage->SetPosPixel( Point( nPositionX, nPositionY ) );
467 Size aImageSize( m_aTypeImage->GetImage().GetSizePixel() );
468 m_aTypeImage->SetSizePixel( aImageSize );
470 if ( nTitleHeight < aImageSize.Height() )
471 nTitleHeight = aImageSize.Height();
473 nPositionX += aImageSize.Width() + CalcZoom( 2 );
474 m_xTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) );
476 long nTitleToList = CalcZoom( 3 );
478 m_xListBox->SetPosSizePixel(
479 Point( n5Pos, nPositionY + nTitleHeight + nTitleToList ),
480 Size( aOutSize.Width() - 2 * n5Pos, aOutSize.Height() - ( nPositionY + nTitleHeight + nTitleToList ) - n5Pos )
483 Window::Invalidate();
486 void OTableWindow::SetBoldTitle( bool bBold )
488 vcl::Font aFont = m_xTitle->GetFont();
489 aFont.SetWeight( bBold?WEIGHT_BOLD:WEIGHT_NORMAL );
490 m_xTitle->SetFont( aFont );
491 m_xTitle->Invalidate();
494 void OTableWindow::GetFocus()
496 Window::GetFocus();
497 // we have to forward the focus to our listbox to enable keystokes
498 if(m_xListBox)
499 m_xListBox->GrabFocus();
502 void OTableWindow::setActive(bool _bActive)
504 SetBoldTitle( _bActive );
505 m_bActive = _bActive;
506 if (!_bActive && m_xListBox && m_xListBox->GetSelectionCount() != 0)
507 m_xListBox->SelectAll(false);
510 void OTableWindow::Remove()
512 // Delete the window
513 OJoinTableView* pTabWinCont = getTableView();
514 pTabWinCont->RemoveTabWin( this );
515 pTabWinCont->Invalidate();
518 bool OTableWindow::HandleKeyInput( const KeyEvent& rEvt )
520 const vcl::KeyCode& rCode = rEvt.GetKeyCode();
521 sal_uInt16 nCode = rCode.GetCode();
522 bool bShift = rCode.IsShift();
523 bool bCtrl = rCode.IsMod1();
525 bool bHandle = false;
527 if( !bCtrl && !bShift && (nCode==KEY_DELETE) )
529 Remove();
530 bHandle = true;
532 return bHandle;
535 bool OTableWindow::ExistsAConn() const
537 return getTableView()->ExistsAConn(this);
540 void OTableWindow::EnumValidFields(::std::vector< OUString>& arrstrFields)
542 arrstrFields.clear();
543 // This default implementation counts every item in the ListBox ... for any other behaviour it must be over-written
544 if ( m_xListBox )
546 arrstrFields.reserve(m_xListBox->GetEntryCount());
547 SvTreeListEntry* pEntryLoop = m_xListBox->First();
548 while (pEntryLoop)
550 arrstrFields.push_back(m_xListBox->GetEntryText(pEntryLoop));
551 pEntryLoop = m_xListBox->Next(pEntryLoop);
556 void OTableWindow::StateChanged( StateChangedType nType )
558 Window::StateChanged( nType );
560 // FIXME RenderContext
562 if ( nType == StateChangedType::Zoom )
564 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
566 vcl::Font aFont = rStyleSettings.GetGroupFont();
567 if ( IsControlFont() )
568 aFont.Merge( GetControlFont() );
569 SetZoomedPointFont(*this, aFont);
571 m_xTitle->SetZoom(GetZoom());
572 m_xListBox->SetZoom(GetZoom());
573 Resize();
574 Invalidate();
578 Reference< XAccessible > OTableWindow::CreateAccessible()
580 OTableWindowAccess* pAccessible = new OTableWindowAccess(this);
581 m_pAccessible = pAccessible;
582 return pAccessible;
585 void OTableWindow::Command(const CommandEvent& rEvt)
587 switch (rEvt.GetCommand())
589 case CommandEventId::ContextMenu:
591 OJoinController& rController = getDesignView()->getController();
592 if(!rController.isReadOnly() && rController.isConnected())
594 Point ptWhere;
595 if ( rEvt.IsMouseEvent() )
596 ptWhere = rEvt.GetMousePosPixel();
597 else
599 SvTreeListEntry* pCurrent = m_xListBox->GetCurEntry();
600 if ( pCurrent )
601 ptWhere = m_xListBox->GetEntryPosition(pCurrent);
602 else
603 ptWhere = m_xTitle->GetPosPixel();
606 PopupMenu aContextMenu(ModuleRes(RID_MENU_JOINVIEW_TABLE));
607 switch (aContextMenu.Execute(this, ptWhere))
609 case SID_DELETE:
610 Remove();
611 break;
614 break;
616 default:
617 Window::Command(rEvt);
621 bool OTableWindow::PreNotify(NotifyEvent& rNEvt)
623 bool bHandled = false;
624 switch (rNEvt.GetType())
626 case MouseNotifyEvent::KEYINPUT:
628 if ( getDesignView()->getController().isReadOnly() )
629 break;
631 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
632 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
633 if ( rCode.IsMod1() )
635 Point aStartPoint = GetPosPixel();
636 if ( rCode.IsShift() )
638 aStartPoint.X() = GetSizePixel().Width();
639 aStartPoint.Y() = GetSizePixel().Height();
642 switch( rCode.GetCode() )
644 case KEY_DOWN:
645 bHandled = true;
646 aStartPoint.Y() += m_nMoveIncrement;
647 break;
648 case KEY_UP:
649 bHandled = true;
650 aStartPoint.Y() += -m_nMoveIncrement;
651 break;
652 case KEY_LEFT:
653 bHandled = true;
654 aStartPoint.X() += -m_nMoveIncrement;
655 break;
656 case KEY_RIGHT:
657 bHandled = true;
658 aStartPoint.X() += m_nMoveIncrement;
659 break;
661 if ( bHandled )
663 if ( rCode.IsShift() )
665 OJoinTableView* pView = getTableView();
666 Point ptOld = GetPosPixel();
667 Size aSize = pView->getRealOutputSize();
668 Size aNewSize(aStartPoint.X(),aStartPoint.Y());
669 if ( ((ptOld.X() + aNewSize.Width()) <= aSize.Width())
670 && ((ptOld.Y() + aNewSize.Height()) <= aSize.Height()) )
672 if ( aNewSize.Width() < TABWIN_WIDTH_MIN )
673 aNewSize.Width() = TABWIN_WIDTH_MIN;
674 if ( aNewSize.Height() < TABWIN_HEIGHT_MIN )
675 aNewSize.Height() = TABWIN_HEIGHT_MIN;
677 Size szOld = GetSizePixel();
679 aNewSize = Size(pView->CalcZoom(aNewSize.Width()),pView->CalcZoom(aNewSize.Height()));
680 SetPosSizePixel( ptOld, aNewSize );
681 pView->TabWinSized(this, ptOld, szOld);
682 Invalidate( InvalidateFlags::NoChildren );
685 else
687 // remember how often the user moved our window
688 ++m_nMoveCount;
689 if( m_nMoveCount == 5 )
690 m_nMoveIncrement = 10;
691 else if( m_nMoveCount > 15 )
692 m_nMoveCount = m_nMoveIncrement = 20;
694 Point aOldDataPoint = GetData()->GetPosition();
695 Point aNewDataPoint = aStartPoint + getTableView()->GetScrollOffset();
696 if ( aNewDataPoint.X() > -1 && aNewDataPoint.Y() > -1 )
698 OJoinTableView* pView = getTableView();
699 if ( pView->isMovementAllowed(aNewDataPoint, GetData()->GetSize()) )
701 SetPosPixel(aStartPoint);
703 // aNewDataPoint can not be used here because SetPosPixel reset it
704 pView->EnsureVisible(GetData()->GetPosition(), GetData()->GetSize());
705 pView->TabWinMoved(this,aOldDataPoint);
706 Invalidate(InvalidateFlags::NoChildren);
707 getDesignView()->getController().setModified( true );
709 else
711 m_nMoveCount = 0; // reset our movement count
712 m_nMoveIncrement = 1;
715 else
717 m_nMoveCount = 0; // reset our movement count
718 m_nMoveIncrement = 1;
721 resetSizingFlag();
723 else
725 m_nMoveCount = 0; // reset our movement count
726 m_nMoveIncrement = 1;
729 else
731 m_nMoveCount = 0; // reset our movement count
732 m_nMoveIncrement = 1;
734 break;
736 case MouseNotifyEvent::KEYUP:
738 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
739 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
740 sal_uInt16 nKeyCode = rCode.GetCode();
741 if ( rCode.IsMod2() && nKeyCode != KEY_UP && nKeyCode != KEY_DOWN && nKeyCode != KEY_LEFT && nKeyCode != KEY_RIGHT )
743 m_nMoveCount = 0; // reset our movement count
744 m_nMoveIncrement = 1;
746 break;
748 default:
749 break;
751 if (!bHandled)
752 return Window::PreNotify(rNEvt);
753 return true;
756 OUString OTableWindow::getTitle() const
758 return m_xTitle->GetText();
761 void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(css::uno::RuntimeException, std::exception)
763 FillListBox();
766 void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(css::uno::RuntimeException, std::exception)
768 FillListBox();
771 void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(css::uno::RuntimeException, std::exception)
773 FillListBox();
776 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */