summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/QueryDesignView.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-08-15 12:43:46 +0000
committerFrank Schönheit <fs@openoffice.org>2001-08-15 12:43:46 +0000
commit5bfca1f12ff8206b2eafb1e1a0766b63d991186a (patch)
treeb7defac345ebd393b047c3413ee19128fa12ee70 /dbaccess/source/ui/querydesign/QueryDesignView.cxx
parentb28c4e7fb0263a86210b5946207738a90fc057fc (diff)
#88637# resize semantics changed
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryDesignView.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx62
1 files changed, 27 insertions, 35 deletions
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)