diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-02 06:33:35 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-11 08:01:23 +0200 |
commit | 81f85209212e18b589bce5551cbae645c2cb59c6 (patch) | |
tree | 7680d0aafa31da3402063339cecba5fff14fd0be | |
parent | 9587d014884c0e679e416fb028b4b46ef27cebce (diff) |
more for correct color scale dialog behavior
Change-Id: I9543950aaabf671fa9df4deac4be8cc73626143c
-rw-r--r-- | sc/source/ui/condformat/condformatdlg.cxx | 39 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 1 |
2 files changed, 38 insertions, 2 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index ac0e3c09c0ae..41b8d3e2c7cf 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -73,6 +73,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): maLbType.SelectEntryPos(1); maLbType.SetSelectHdl( LINK( this, ScCondFrmtEntry, TypeListHdl ) ); + maLbColorFormat.SetSelectHdl( LINK( this, ScCondFrmtEntry, ColFormatTypeHdl ) ); maLbCondType.SelectEntryPos(0); maEdVal2.Hide(); @@ -87,6 +88,20 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): //disable entries for color formats maLbColorFormat.SelectEntryPos(0); + maLbEntryTypeMin.SelectEntryPos(0); + Point aPointLb = maLbEntryTypeMiddle.GetPosPixel(); + Point aPointEd = maEdMiddle.GetPosPixel(); + const long nMovePos = 150; + aPointLb.X() += nMovePos; + aPointEd.X() += nMovePos; + maLbEntryTypeMiddle.SetPosPixel(aPointLb); + maEdMiddle.SetPosPixel(aPointEd); + maLbEntryTypeMiddle.SelectEntryPos(3); + aPointLb.X() += nMovePos; + aPointEd.X() += nMovePos; + maLbEntryTypeMax.SelectEntryPos(1); + maLbEntryTypeMax.SetPosPixel(aPointLb); + maEdMax.SetPosPixel(aPointEd); SetCondType(); } @@ -178,6 +193,7 @@ void ScCondFrmtEntry::SetCondType() maEdVal1.Show(); maEdVal2.Show(); maLbStyle.Show(); + maLbCondType.Show(); maFtStyle.Show(); HideColorScaleElements(); HideDataBarElements(); @@ -202,11 +218,20 @@ void ScCondFrmtEntry::SetColorScaleType() HideDataBarElements(); maLbColorFormat.Show(); if(maLbColorFormat.GetSelectEntryPos() == 0) + { + maEdMiddle.Hide(); + maLbEntryTypeMiddle.Hide(); maLbColScale2.Show(); + maLbColScale3.Hide(); + } else + { + maEdMiddle.Show(); + maLbEntryTypeMiddle.Show(); + maLbColScale2.Hide(); maLbColScale3.Show(); + } maLbEntryTypeMin.Show(); - maLbEntryTypeMiddle.Show(); maLbEntryTypeMax.Show(); maEdMin.Show(); maEdMiddle.Show(); @@ -230,7 +255,7 @@ void ScCondFrmtEntry::Select() Size aSize = GetSizePixel(); aSize.Height() = 130; SetSizePixel(aSize); - SetControlBackground(Color(COL_RED)); + SetControlForeground(Color(COL_RED)); SwitchToType(meType); mbActive = true; } @@ -273,6 +298,16 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl) return 0; } +IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl) +{ + if(maLbColorFormat.GetSelectEntryPos() < 2) + SetColorScaleType(); + else + SetDataBarType(); + + return 0; +} + ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc): Control(pParent, rResId), mbHasScrollBar(false), diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index b820fc4093c8..adf80f752514 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -97,6 +97,7 @@ private: ScDocument* mpDoc; DECL_LINK( TypeListHdl, void*); + DECL_LINK( ColFormatTypeHdl, void*); public: ScCondFrmtEntry( Window* pParent, ScDocument* pDoc ); |