summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx59
-rw-r--r--dbaccess/source/ui/querydesign/JoinDesignView.cxx24
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx62
-rw-r--r--dbaccess/source/ui/querydesign/QueryViewSwitch.cxx23
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignView.cxx21
5 files changed, 77 insertions, 112 deletions
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx
index 3b39365f0c3f..dec0b49bfb09 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: brwview.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: fs $ $Date: 2001-04-12 15:31:09 $
+ * last change: $Author: fs $ $Date: 2001-08-15 13:40:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -228,43 +228,39 @@ void UnoDataBrowserView::hideStatus()
}
// -------------------------------------------------------------------------
-void UnoDataBrowserView::resizeControl(Rectangle& _rRect)
+void UnoDataBrowserView::resizeControl(Rectangle& _rPlayground)
{
- Point aSplitPos(0,0);
- Size aSplitSize(0,0);
- Size aNewSize( _rRect.GetSize() );
-
- Size aToolBoxSize;
- ToolBox* pToolBox = getToolBox();
- if(pToolBox)
- {
- aToolBoxSize = pToolBox->GetOutputSizePixel();
- pToolBox->SetSizePixel(aToolBoxSize);
- }
+ Point aSplitPos;
+ Size aSplitSize;
+ Point aPlaygroundPos( _rPlayground.TopLeft() );
+ Size aPlaygroundSize( _rPlayground.GetSize() );
if (m_pTreeView && m_pTreeView->IsVisible() && m_pSplitter)
{
+ // calculate the splitter pos and size
aSplitPos = m_pSplitter->GetPosPixel();
- aSplitPos.Y() = aToolBoxSize.Height();
+ aSplitPos.Y() = aPlaygroundPos.Y();
aSplitSize = m_pSplitter->GetOutputSizePixel();
- aSplitSize.Height() = aNewSize.Height() - aToolBoxSize.Height();
+ aSplitSize.Height() = aPlaygroundSize.Height();
- if( ( aSplitPos.X() + aSplitSize.Width() ) > ( aNewSize.Width() ))
- aSplitPos.X() = aNewSize.Width() - aSplitSize.Width();
+ if( ( aSplitPos.X() + aSplitSize.Width() ) > ( aPlaygroundSize.Width() ))
+ aSplitPos.X() = aPlaygroundSize.Width() - aSplitSize.Width();
- if( aSplitPos.X() <= 0)
- aSplitPos.X() = LogicToPixel( Size(sal_Int32(aNewSize.Width() * 0.2), 0 ), MAP_APPFONT ).Width();
+ if( aSplitPos.X() <= aPlaygroundPos.X() )
+ aSplitPos.X() = aPlaygroundPos.X() + sal_Int32(aPlaygroundSize.Width() * 0.2);
- Point aTreeViewPos( 0, aToolBoxSize.Height() );
- Size aTreeViewSize( aSplitPos.X(), aNewSize.Height() - aToolBoxSize.Height() );
+ // the tree pos and size
+ Point aTreeViewPos( aPlaygroundPos );
+ Size aTreeViewSize( aSplitPos.X(), aPlaygroundSize.Height() );
+ // the status pos and size
if (m_pStatus && m_pStatus->IsVisible())
{
- Size aStatusSize(0, GetTextHeight() + 2);
+ Size aStatusSize(aPlaygroundPos.X(), GetTextHeight() + 2);
aStatusSize = LogicToPixel(aStatusSize, MAP_APPFONT);
aStatusSize.Width() = aTreeViewSize.Width() - 2 - 2;
- Point aStatusPos( 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() );
+ Point aStatusPos( aPlaygroundPos.X() + 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() );
m_pStatus->SetPosSizePixel( aStatusPos, aStatusSize );
aTreeViewSize.Height() -= aStatusSize.Height();
}
@@ -273,20 +269,19 @@ void UnoDataBrowserView::resizeControl(Rectangle& _rRect)
m_pTreeView->SetPosSizePixel( aTreeViewPos, aTreeViewSize );
//set the size of the splitter
- m_pSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aNewSize.Height() - aToolBoxSize.Height() ) );
- m_pSplitter->SetDragRectPixel( Rectangle( Point( 0, aToolBoxSize.Height() ),
- Size( aNewSize.Width(), aNewSize.Height() - aToolBoxSize.Height() ) ) );
+ m_pSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aPlaygroundSize.Height() ) );
+ m_pSplitter->SetDragRectPixel( _rPlayground );
}
// set the size of grid control
Reference< ::com::sun::star::awt::XWindow > xGridAsWindow(m_xGrid, UNO_QUERY);
if (xGridAsWindow.is())
- xGridAsWindow->setPosSize( aSplitPos.X() + aSplitSize.Width(), aToolBoxSize.Height() ,
- aNewSize.Width() - aSplitSize.Width() - aSplitPos.X(),_rRect.GetHeight() - aToolBoxSize.Height(), ::com::sun::star::awt::PosSize::POSSIZE);
+ xGridAsWindow->setPosSize( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
+ aPlaygroundSize.Width() - aSplitSize.Width() - aSplitPos.X(), aPlaygroundSize.Height(), ::com::sun::star::awt::PosSize::POSSIZE);
- // set the rect for the baseclass
- _rRect.SetPos(Point(0, 0));
- _rRect.SetSize(Size(aNewSize.Width(),aToolBoxSize.Height()));
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
}
//------------------------------------------------------------------
diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
index c408880b677d..411dd55b736c 100644
--- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JoinDesignView.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-03-15 08:26:26 $
+ * last change: $Author: fs $ $Date: 2001-08-15 13:41:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,23 +166,13 @@ void OJoinDesignView::initialize()
getAddTableDialog()->Update();
}
// -------------------------------------------------------------------------
-void OJoinDesignView::resizeControl(Rectangle& _rRect)
+void OJoinDesignView::resizeControl(Rectangle& _rPlayground)
{
- Window::Resize();
- Size aSize = GetOutputSizePixel();
+ m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
- Size aToolBoxSize;
- ToolBox* pToolBox = getToolBox();
- if(pToolBox)
- aToolBoxSize = pToolBox->GetOutputSizePixel();
- Point aTopLeft(_rRect.TopLeft());
- aTopLeft.Y() += aToolBoxSize.Height();
-
- aSize.Height() -= aToolBoxSize.Height();
- m_pScrollWindow->SetPosSizePixel(aTopLeft,aSize);
-
- aToolBoxSize.Width() += _rRect.getWidth();
- _rRect.SetSize(aToolBoxSize);
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
}
// -----------------------------------------------------------------------------
void OJoinDesignView::setReadOnly(sal_Bool _bReadOnly)
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 596760f72b7b..4b5cb4cc2ac2 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryDesignView.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: oj $ $Date: 2001-08-14 14:21:46 $
+ * last change: $Author: fs $ $Date: 2001-08-15 13:41:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -219,52 +219,44 @@ void OQueryDesignView::initialize()
m_pSelectionBox->Fill();
}
// -------------------------------------------------------------------------
-void OQueryDesignView::resizeControl(Rectangle& _rRect)
+void OQueryDesignView::resizeControl(Rectangle& _rPlayground)
{
- Window::Resize();
-
- Size aSize = GetOutputSizePixel();
+ Point aPlaygroundPos( _rPlayground.TopLeft() );
+ Size aPlaygroundSize( _rPlayground.GetSize() );
+ // calc the split pos, and forward it to the controller
sal_Int32 nSplitPos = static_cast<OQueryController*>(getController())->getSplitPos();
- if( nSplitPos == -1 || nSplitPos >= aSize.Height())
+ if( nSplitPos == -1 || nSplitPos >= aPlaygroundSize.Height())
{
- nSplitPos = sal_Int32(aSize.Height()*0.5);
+ nSplitPos = sal_Int32(aPlaygroundSize.Height()*0.5);
static_cast<OQueryController*>(getController())->setSplitPos(nSplitPos);
}
- Size aToolBoxSize;
- ToolBox* pToolBox = getToolBox();
- if(pToolBox)
- aToolBoxSize = pToolBox->GetOutputSizePixel();
- Point aTopLeft(_rRect.TopLeft());
- aTopLeft.Y() += aToolBoxSize.Height();
-
- Point aSplitPos(0,0);
- Size aSplitSize(0,0);
-
- aSplitPos = m_aSplitter.GetPosPixel();
- aSplitPos.Y() = nSplitPos;
- aSplitSize = m_aSplitter.GetOutputSizePixel();
- aSplitSize.Width() = aSize.Width();
+ // normalize the split pos
+ Point aSplitPos = Point( _rPlayground.Left(), nSplitPos );
+ Size aSplitSize = Size( _rPlayground.GetSize().Width(), m_aSplitter.GetSizePixel().Height() );
- if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aSize.Height() ))
- aSplitPos.Y() = aSize.Height() - aSplitSize.Height();
+ if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aPlaygroundSize.Height() ))
+ aSplitPos.Y() = aPlaygroundSize.Height() - aSplitSize.Height();
- if( aSplitPos.Y() <= 0)
- aSplitPos.Y() = LogicToPixel( Size(0,sal_Int32(aSize.Height() * 0.2) ), MAP_APPFONT ).Height();
+ if( aSplitPos.Y() <= aPlaygroundPos.Y() )
+ aSplitPos.Y() = aPlaygroundPos.Y() + sal_Int32(aPlaygroundSize.Height() * 0.2);
- Size aTableView(aSize.Width(),aSplitPos.Y()-aToolBoxSize.Height());
- m_pScrollWindow->SetPosSizePixel(aTopLeft,aTableView);
+ // position the table
+ Size aTableViewSize(aPlaygroundSize.Width(), aSplitPos.Y() - aPlaygroundPos.Y());
+ m_pScrollWindow->SetPosSizePixel(aPlaygroundPos, aTableViewSize);
- Point aPos(0,aSplitPos.Y()+aSplitSize.Height());
- m_pSelectionBox->SetPosSizePixel(aPos,Size( aSize.Width(), aSize.Height() - aSplitSize.Height() - aSplitPos.Y() ));
+ // position the selection browse box
+ Point aPos( aPlaygroundPos.X(), aSplitPos.Y() + aSplitSize.Height() );
+ m_pSelectionBox->SetPosSizePixel( aPos, Size( aPlaygroundSize.Width(), aPlaygroundSize.Height() - aSplitSize.Height() - aTableViewSize.Height() ));
- //set the size of the splitter
- m_aSplitter.SetPosSizePixel( aSplitPos, Size( aSize.Width(), aSplitSize.Height()) );
- m_aSplitter.SetDragRectPixel( Rectangle( Point( 0, 0 ), aSize) );
+ // set the size of the splitter
+ m_aSplitter.SetPosSizePixel( aSplitPos, aSplitSize );
+ m_aSplitter.SetDragRectPixel( _rPlayground );
- aToolBoxSize.Width() += _rRect.getWidth();
- _rRect.SetSize(aToolBoxSize);
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
}
// -----------------------------------------------------------------------------
void OQueryDesignView::setReadOnly(sal_Bool _bReadOnly)
diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
index 132e1d9b4dd2..8f3a48bf3e2d 100644
--- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
+++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryViewSwitch.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2001-08-15 13:19:03 $
+ * last change: $Author: fs $ $Date: 2001-08-15 13:41:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -148,21 +148,14 @@ void OQueryViewSwitch::initialize()
switchView();
}
// -------------------------------------------------------------------------
-void OQueryViewSwitch::resizeControl(Rectangle& _rRect)
+void OQueryViewSwitch::resizeControl(Rectangle& _rPlayground)
{
- Size aToolBoxSize;
- ToolBox* pToolBox = m_pDesignView->getToolBox();
- if(pToolBox)
- aToolBoxSize = pToolBox->GetOutputSizePixel();
-
- Point aStart(_rRect.TopLeft());
- aStart.Y() += aToolBoxSize.Height();
-
- m_pTextView->SetPosSizePixel(aStart,Size(_rRect.GetSize().Width(),_rRect.GetSize().Height()-aToolBoxSize.Height()));
- m_pDesignView->SetPosSizePixel(aStart,Size(_rRect.GetSize().Width(),_rRect.GetSize().Height()-aToolBoxSize.Height()));
+ m_pTextView->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
+ m_pDesignView->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
- aToolBoxSize.Width() += _rRect.getWidth();
- _rRect.SetSize(aToolBoxSize);
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
}
// -----------------------------------------------------------------------------
::rtl::OUString OQueryViewSwitch::getStatement()
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index 9084bb04b376..9b3dff491905 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableDesignView.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-07-16 07:55:35 $
+ * last change: $Author: fs $ $Date: 2001-08-15 13:43:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -288,20 +288,15 @@ void OTableDesignView::initialize()
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void OTableDesignView::resizeControl(Rectangle& _rRect)
+void OTableDesignView::resizeControl(Rectangle& _rPlayground)
{
- Size aToolBoxSize;
- ToolBox* pToolBox = getToolBox();
- if(pToolBox)
- aToolBoxSize = pToolBox->GetOutputSizePixel();
- Size aSize = GetOutputSizePixel();
+ m_pWin->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
- m_pWin->SetPosSizePixel(Point(0,aToolBoxSize.Height()),Size(aSize.Width(),aSize.Height() - aToolBoxSize.Height()));
-
- aToolBoxSize.Width() = _rRect.getWidth();
- _rRect.SetPos(Point(0,0));
- _rRect.SetSize(aToolBoxSize);
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
}
+
//------------------------------------------------------------------------------
IMPL_LINK( OTableDesignView, SwitchHdl, Accelerator*, pAcc )
{