summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign/TableDesignView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableDesignView.cxx')
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignView.cxx51
1 files changed, 16 insertions, 35 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index a82ae839d9cc..29c8c5554b67 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -31,7 +31,6 @@
#include <unotools/syslocale.hxx>
#include "UITools.hxx"
-
using namespace ::dbaui;
using namespace ::utl;
using namespace ::com::sun::star::uno;
@@ -39,17 +38,14 @@ using namespace ::com::sun::star::datatransfer::clipboard;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
-//==================================================================
// class OTableBorderWindow
DBG_NAME(OTableBorderWindow)
-//==================================================================
OTableBorderWindow::OTableBorderWindow(Window* pParent) : Window(pParent,WB_BORDER)
,m_aHorzSplitter( this )
{
DBG_CTOR(OTableBorderWindow,NULL);
ImplInitSettings( sal_True, sal_True, sal_True );
- //////////////////////////////////////////////////////////////////////
// Children erzeugen
m_pEditorCtrl = new OTableEditorCtrl( this);
m_pFieldDescWin = new OTableFieldDescWin( this );
@@ -59,15 +55,13 @@ OTableBorderWindow::OTableBorderWindow(Window* pParent) : Window(pParent,WB_BORD
// set depending windows and controls
m_pEditorCtrl->SetDescrWin(m_pFieldDescWin);
- //////////////////////////////////////////////////////////////////////
// Splitter einrichten
m_aHorzSplitter.SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) );
m_aHorzSplitter.Show();
}
-// -----------------------------------------------------------------------------
+
OTableBorderWindow::~OTableBorderWindow()
{
- //////////////////////////////////////////////////////////////////////
// Children zerstoeren
// ::dbaui::notifySystemWindow(this,m_pFieldDescWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
m_pEditorCtrl->Hide();
@@ -88,19 +82,17 @@ OTableBorderWindow::~OTableBorderWindow()
DBG_DTOR(OTableBorderWindow,NULL);
}
-// -----------------------------------------------------------------------------
+
void OTableBorderWindow::Resize()
{
const long nSplitterHeight(3);
- //////////////////////////////////////////////////////////////////////
// Abmessungen parent window
Size aOutputSize( GetOutputSize() );
long nOutputWidth = aOutputSize.Width();
long nOutputHeight = aOutputSize.Height();
long nSplitPos = m_aHorzSplitter.GetSplitPosPixel();
- //////////////////////////////////////////////////////////////////////
// Verschiebebereich Splitter mittleres Drittel des Outputs
long nDragPosY = nOutputHeight/3;
long nDragSizeHeight = nOutputHeight/3;
@@ -108,19 +100,17 @@ void OTableBorderWindow::Resize()
if( (nSplitPos < nDragPosY) || (nSplitPos > (nDragPosY+nDragSizeHeight)) )
nSplitPos = nDragPosY+nDragSizeHeight-5;
- //////////////////////////////////////////////////////////////////////
// Splitter setzen
m_aHorzSplitter.SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight));
m_aHorzSplitter.SetSplitPosPixel( nSplitPos );
- //////////////////////////////////////////////////////////////////////
// Fenster setzen
m_pEditorCtrl->SetPosSizePixel( Point(0, 0), Size(nOutputWidth , nSplitPos) );
m_pFieldDescWin->SetPosSizePixel( Point(0, nSplitPos+nSplitterHeight),
Size(nOutputWidth, nOutputHeight-nSplitPos-nSplitterHeight) );
}
-//------------------------------------------------------------------------------
+
IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit )
{
if(pSplit == &m_aHorzSplitter)
@@ -130,7 +120,7 @@ IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit )
}
return 0;
}
-// -----------------------------------------------------------------------------
+
void OTableBorderWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -159,7 +149,7 @@ void OTableBorderWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground,
SetBackground( rStyleSettings.GetFaceColor() );
}
}
-// -----------------------------------------------------------------------
+
void OTableBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -171,7 +161,7 @@ void OTableBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
Invalidate();
}
}
-// -----------------------------------------------------------------------------
+
void OTableBorderWindow::GetFocus()
{
Window::GetFocus();
@@ -181,11 +171,8 @@ void OTableBorderWindow::GetFocus()
m_pEditorCtrl->GrabFocus();
}
-//==================================================================
// class OTableDesignView
-//==================================================================
DBG_NAME(OTableDesignView);
-//------------------------------------------------------------------------------
OTableDesignView::OTableDesignView( Window* pParent,
const Reference< XComponentContext >& _rxOrb,
OTableController& _rController
@@ -208,7 +195,6 @@ OTableDesignView::OTableDesignView( Window* pParent,
m_pWin->Show();
}
-//------------------------------------------------------------------------------
OTableDesignView::~OTableDesignView()
{
DBG_DTOR(OTableDesignView,NULL);
@@ -222,7 +208,6 @@ OTableDesignView::~OTableDesignView()
}
}
-// -----------------------------------------------------------------------------
void OTableDesignView::initialize()
{
GetEditorCtrl()->Init();
@@ -234,9 +219,7 @@ void OTableDesignView::initialize()
GetEditorCtrl()->DisplayData(0);
}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
void OTableDesignView::resizeDocumentView(Rectangle& _rPlayground)
{
m_pWin->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
@@ -246,7 +229,6 @@ void OTableDesignView::resizeDocumentView(Rectangle& _rPlayground)
_rPlayground.SetSize( Size( 0, 0 ) );
}
-//------------------------------------------------------------------------------
long OTableDesignView::PreNotify( NotifyEvent& rNEvt )
{
sal_Bool bHandled = sal_False;
@@ -264,7 +246,7 @@ long OTableDesignView::PreNotify( NotifyEvent& rNEvt )
return bHandled ? 1L : ODataView::PreNotify(rNEvt);
}
-// -----------------------------------------------------------------------------
+
IClipboardTest* OTableDesignView::getActiveChild() const
{
IClipboardTest* pTest = NULL;
@@ -281,53 +263,53 @@ IClipboardTest* OTableDesignView::getActiveChild() const
}
return pTest;
}
-// -----------------------------------------------------------------------------
+
sal_Bool OTableDesignView::isCopyAllowed()
{
IClipboardTest* pTest = getActiveChild();
return pTest && pTest->isCopyAllowed();
}
-// -----------------------------------------------------------------------------
+
sal_Bool OTableDesignView::isCutAllowed()
{
IClipboardTest* pTest = getActiveChild();
return pTest && pTest->isCutAllowed();
}
-// -----------------------------------------------------------------------------
+
sal_Bool OTableDesignView::isPasteAllowed()
{
IClipboardTest* pTest = getActiveChild();
return pTest && pTest->isPasteAllowed();
}
-// -----------------------------------------------------------------------------
+
void OTableDesignView::copy()
{
IClipboardTest* pTest = getActiveChild();
if ( pTest )
pTest->copy();
}
-// -----------------------------------------------------------------------------
+
void OTableDesignView::cut()
{
IClipboardTest* pTest = getActiveChild();
if ( pTest )
pTest->cut();
}
-// -----------------------------------------------------------------------------
+
void OTableDesignView::paste()
{
IClipboardTest* pTest = getActiveChild();
if ( pTest )
pTest->paste();
}
-// -----------------------------------------------------------------------------
+
// set the view readonly or not
void OTableDesignView::setReadOnly(sal_Bool _bReadOnly)
{
GetDescWin()->SetReadOnly(_bReadOnly);
GetEditorCtrl()->SetReadOnly(_bReadOnly);
}
-// -----------------------------------------------------------------------------
+
void OTableDesignView::reSync()
{
GetEditorCtrl()->DeactivateCell();
@@ -336,12 +318,11 @@ void OTableDesignView::reSync()
if ( pFieldDescr )
GetDescWin()->DisplayData(pFieldDescr);
}
-// -----------------------------------------------------------------------------
+
void OTableDesignView::GetFocus()
{
if ( GetEditorCtrl() )
GetEditorCtrl()->GrabFocus();
}
-// -----------------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */