summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/pvlaydlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/dbgui/pvlaydlg.cxx')
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index d7109d1f7315..f280af43f7e0 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1132,6 +1132,14 @@ void ScDPLayoutDlg::NotifyRemoveField( ScDPFieldType eType, size_t nFieldIndex )
RemoveField( eType, nFieldIndex );
}
+Size ScDPLayoutDlg::GetStdFieldBtnSize() const
+{
+ // This size is static but is platform dependent. The field button size
+ // is calculated relative to the size of the OK button.
+ double w = static_cast<double>(aBtnOk.GetSizePixel().Width()) * 0.70;
+ return Size(static_cast<long>(w), FIELD_BTN_HEIGHT);
+}
+
void ScDPLayoutDlg::Deactivate()
{
/* If the dialog has been deactivated (click into document), the LoseFocus
@@ -1290,10 +1298,18 @@ Point ScDPLayoutDlg::DlgPos2WndPos( const Point& rPt, Window& rWnd )
void ScDPLayoutDlg::CalcWndSizes()
{
+ // The pivot.src file only specifies the positions of the controls. Here,
+ // we calculate appropriate size of each control based on how they are
+ // positioned relative to each other.
+
// row/column/data area sizes
- long nFldW = FIELD_BTN_WIDTH;
- long nFldH = FIELD_BTN_HEIGHT;
- aWndData.SetSizePixel(Size(338, 185));
+ long nFldW = GetStdFieldBtnSize().Width();
+ long nFldH = GetStdFieldBtnSize().Height();
+
+ aWndData.SetSizePixel(
+ Size(aWndSelect.GetPosPixel().X() - aWndData.GetPosPixel().X() - FIELD_AREA_GAP*4,
+ 185));
+
aWndPage.SetSizePixel(
Size(aWndData.GetSizePixel().Width() + 85,
aWndCol.GetPosPixel().Y() - aWndPage.GetPosPixel().Y() - FIELD_AREA_GAP));