summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-06-02 06:33:35 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-06-11 08:01:23 +0200
commit81f85209212e18b589bce5551cbae645c2cb59c6 (patch)
tree7680d0aafa31da3402063339cecba5fff14fd0be
parentadd gui elements for color scales (diff)
downloadcore-81f85209212e18b589bce5551cbae645c2cb59c6.tar.gz
core-81f85209212e18b589bce5551cbae645c2cb59c6.zip
more for correct color scale dialog behavior
Change-Id: I9543950aaabf671fa9df4deac4be8cc73626143c
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx39
-rw-r--r--sc/source/ui/inc/condformatdlg.hxx1
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 );