]> git.saurik.com Git - wxWidgets.git/commitdiff
fix bug where color chosen by sliders wouldn't be registered. Optimized a bit.
authorRyan Norton <wxprojects@comcast.net>
Thu, 18 Nov 2004 16:24:11 +0000 (16:24 +0000)
committerRyan Norton <wxprojects@comcast.net>
Thu, 18 Nov 2004 16:24:11 +0000 (16:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/colrdlgg.cpp

index 8bc0f1e75c5a8abc2e1714d5ace9f15b95c2ae15..98d59a9ca0a82e2eafe1a50751e73f448b14e982 100644 (file)
@@ -161,7 +161,9 @@ bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
 
 int wxGenericColourDialog::ShowModal()
 {
-  return wxDialog::ShowModal();
+  int nResult = wxDialog::ShowModal();
+  colourData.SetColour(singleCustomColour);
+  return nResult;
 }
 
 
@@ -483,7 +485,6 @@ void wxGenericColourDialog::OnBasicColourClick(int which)
     PaintHighlight(dc, false);
     whichKind = 1;
     colourSelection = which;
-    colourData.SetColour(standardColours[colourSelection]);
     redSlider->SetValue( standardColours[colourSelection].Red() );
     greenSlider->SetValue( standardColours[colourSelection].Green() );
     blueSlider->SetValue( standardColours[colourSelection].Blue() );
@@ -499,7 +500,6 @@ void wxGenericColourDialog::OnCustomColourClick(int which)
     PaintHighlight(dc, false);
     whichKind = 2;
     colourSelection = which;
-    colourData.SetColour(customColours[colourSelection]);
     redSlider->SetValue( customColours[colourSelection].Red() );
     greenSlider->SetValue( customColours[colourSelection].Green() );
     blueSlider->SetValue( customColours[colourSelection].Blue() );
@@ -533,7 +533,6 @@ void wxGenericColourDialog::OnAddCustom(wxCommandEvent& WXUNUSED(event))
   }
 
   customColours[colourSelection].Set(singleCustomColour.Red(), singleCustomColour.Green(), singleCustomColour.Blue());
-  colourData.SetColour(customColours[colourSelection]);
   colourData.SetCustomColour(colourSelection, customColours[colourSelection]);
 
   PaintCustomColours(dc);