Fix initialization of custom colours for generic colour dialogs in dialogs sample.

Use number of custom colours taken from wxColourData instead of using explicit numeric value.
This commit is contained in:
Artur Wieczorek
2015-11-02 21:12:35 +01:00
parent 8fee6a9a2b
commit 02c03096b6

View File

@@ -753,14 +753,10 @@ void MyFrame::ChooseColourGeneric(wxCommandEvent& event)
m_clrData.SetChooseFull(true);
m_clrData.SetChooseAlpha(event.GetId() == DIALOGS_CHOOSE_COLOUR_GENERIC_ALPHA);
for (int i = 0; i < 16; i++)
for (int i = 0; i < wxColourData::NUM_CUSTOM; i++)
{
wxColour colour(
(unsigned char)(i*16),
(unsigned char)(i*16),
(unsigned char)(i*16)
);
m_clrData.SetCustomColour(i, colour);
unsigned char n = i*(256/wxColourData::NUM_CUSTOM);
m_clrData.SetCustomColour(i, wxColour(n, n, n));
}
wxGenericColourDialog *dialog = new wxGenericColourDialog(this, &m_clrData);