summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r--sc/source/ui/dbgui/dpuiglobal.hxx1
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx9
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx22
3 files changed, 26 insertions, 6 deletions
diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
index b64875030bcf..d27d8278d83b 100644
--- a/sc/source/ui/dbgui/dpuiglobal.hxx
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -33,7 +33,6 @@
#define OUTER_MARGIN_VER 4
#define DATA_FIELD_BTN_GAP 2 // must be an even number
#define ROW_FIELD_BTN_GAP 2 // must be an even number
-#define FIELD_BTN_WIDTH 81
#define FIELD_BTN_HEIGHT 23
#define SELECT_FIELD_BTN_SPACE 2
#define FIELD_AREA_GAP 3 // gap between row/column/data/page areas
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 32ba4a949769..061900ce5e4d 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -611,6 +611,11 @@ void ScDPFieldControlBase::DrawInvertSelection()
InvertTracking(aSel, SHOWTRACK_SMALL | SHOWTRACK_WINDOW);
}
+Size ScDPFieldControlBase::GetStdFieldBtnSize() const
+{
+ return mpDlg->GetStdFieldBtnSize();
+}
+
bool ScDPFieldControlBase::IsShortenedText( size_t nIndex ) const
{
const FieldNames& rFields = GetFieldNames();
@@ -726,7 +731,7 @@ Point ScDPHorFieldControl::GetFieldPosition( size_t nIndex )
Size ScDPHorFieldControl::GetFieldSize() const
{
- return Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+ return GetStdFieldBtnSize();
}
bool ScDPHorFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
@@ -1032,7 +1037,7 @@ Point ScDPRowFieldControl::GetFieldPosition(size_t nIndex)
Size ScDPRowFieldControl::GetFieldSize() const
{
- return Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+ return GetStdFieldBtnSize();
}
bool ScDPRowFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
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));