diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-04-25 12:34:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-04-25 13:40:16 -0400 |
commit | 9698bb97a9a0e03fda6fc7c6f5077d9eb6052e3f (patch) | |
tree | 75f7ad2b9421d2b0fd2705c95d6c16b14836c815 /sc | |
parent | ac5a0bf3c59828128f43153d481abb1865c767f6 (diff) |
Fixed layout problem on Windows. It was not entirely platform independent.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/dpuiglobal.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/dbgui/fieldwnd.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pvlaydlg.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/inc/fieldwnd.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/pvlaydlg.hxx | 2 |
5 files changed, 29 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)); diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx index 78358557444c..edd8aec6a568 100644 --- a/sc/source/ui/inc/fieldwnd.hxx +++ b/sc/source/ui/inc/fieldwnd.hxx @@ -195,6 +195,7 @@ protected: void AppendPaintable(Window* p); void DrawPaintables(); void DrawInvertSelection(); + Size GetStdFieldBtnSize() const; /** @return The new selection index after moving to the given direction. */ virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const = 0; diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index 19176e7fdc61..875f25dbcde1 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -104,6 +104,8 @@ public: void NotifyMoveFieldToEnd ( ScDPFieldType eToType ); void NotifyRemoveField ( ScDPFieldType eType, size_t nFieldIndex ); + Size GetStdFieldBtnSize() const; + protected: virtual void Deactivate(); |