Fix the slider in the color picker for non-GTK platforms. wx2.9 appears to have synchronized the behavior of changing the value of a slider across all platforms to how it behaved on GTK.

Originally committed to SVN as r3341.
This commit is contained in:
Thomas Goyne 2009-07-31 23:42:15 +00:00
parent 4472dfee12
commit 4eba7657a2
1 changed files with 1 additions and 13 deletions

View File

@ -1380,7 +1380,7 @@ void DialogColorPicker::OnSpectrumChange(wxCommandEvent &evt)
/// @brief DOCME /// @brief DOCME
/// @param evt /// @param evt Ignored
/// ///
void DialogColorPicker::OnSliderChange(wxCommandEvent &evt) void DialogColorPicker::OnSliderChange(wxCommandEvent &evt)
{ {
@ -1389,37 +1389,25 @@ void DialogColorPicker::OnSliderChange(wxCommandEvent &evt)
int x, y; // only y is used, x is garbage for this control int x, y; // only y is used, x is garbage for this control
slider->GetXY(x, y); slider->GetXY(x, y);
switch (i) { switch (i) {
// setting the value of a component input automatically invalidates the spectrum
// and calls the according UpdateFromXXX() function in wxMSW and wxMac, wxGTK must be manually updated
case 0: case 0:
rgb_input[0]->SetValue(y); rgb_input[0]->SetValue(y);
#ifdef __WXGTK__
UpdateFromRGB(); UpdateFromRGB();
#endif
break; break;
case 1: case 1:
rgb_input[1]->SetValue(y); rgb_input[1]->SetValue(y);
#ifdef __WXGTK__
UpdateFromRGB(); UpdateFromRGB();
#endif
break; break;
case 2: case 2:
rgb_input[2]->SetValue(y); rgb_input[2]->SetValue(y);
#ifdef __WXGTK__
UpdateFromRGB(); UpdateFromRGB();
#endif
break; break;
case 3: case 3:
hsl_input[2]->SetValue(y); hsl_input[2]->SetValue(y);
#ifdef __WXGTK__
UpdateFromHSL(); UpdateFromHSL();
#endif
break; break;
case 4: case 4:
hsv_input[0]->SetValue(y); hsv_input[0]->SetValue(y);
#ifdef __WXGTK__
UpdateFromHSV(); UpdateFromHSV();
#endif
break; break;
} }
} }