remember custom palette changes done in wxColourDialog
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3b9faf4c54
commit
d33dd9ef43
@ -225,29 +225,25 @@ MyFrame::MyFrame(wxWindow *parent,
|
||||
m_dlgReplace = NULL;
|
||||
#endif
|
||||
|
||||
m_clrData.SetChooseFull(true);
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16));
|
||||
}
|
||||
|
||||
CreateStatusBar();
|
||||
}
|
||||
|
||||
void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxColour col = myCanvas->GetBackgroundColour();
|
||||
m_clrData.SetColour(myCanvas->GetBackgroundColour());
|
||||
|
||||
wxColourData data;
|
||||
data.SetColour(col);
|
||||
data.SetChooseFull(TRUE);
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
wxColour colour(i*16, i*16, i*16);
|
||||
data.SetCustomColour(i, colour);
|
||||
}
|
||||
|
||||
wxColourDialog dialog(this, &data);
|
||||
wxColourDialog dialog(this, &m_clrData);
|
||||
dialog.SetTitle(_T("Choose the background colour"));
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxColourData retData = dialog.GetColourData();
|
||||
col = retData.GetColour();
|
||||
myCanvas->SetBackgroundColour(col);
|
||||
m_clrData = dialog.GetColourData();
|
||||
myCanvas->SetBackgroundColour(m_clrData.GetColour());
|
||||
myCanvas->ClearBackground();
|
||||
myCanvas->Refresh();
|
||||
}
|
||||
|
@ -109,6 +109,8 @@ private:
|
||||
*m_dlgReplace;
|
||||
#endif // wxUSE_FINDREPLDLG
|
||||
|
||||
wxColourData m_clrData;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user