changed wxColourData default palette to NULL colours instead of white

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-06-04 16:03:03 +00:00
parent 274ad000d2
commit 393c836c33
4 changed files with 20 additions and 14 deletions

View File

@@ -27,7 +27,11 @@ This class represents the colour chooser dialog.
\func{}{wxColourDialog}{\param{wxWindow* }{parent}, \param{wxColourData* }{data = NULL}}
Constructor. Pass a parent window, and optionally a pointer to a block of colour
data, which will be copied to the colour dialog's colour data.
data, which will be copied to the colour dialog's colour data. Custom
colours from colour data object will be be used in dialog's colour palette.
Invalid entries in custom colours list will be ignored on some platforms (GTK)
or replaced with white colour on platforms where custom colours palette has
fixed size (MSW).
\wxheading{See also}

View File

@@ -181,7 +181,8 @@ This class holds a variety of information related to colour dialogs.
\func{}{wxColourData}{\void}
Constructor. Initializes the custom colours to white, the {\it data colour} setting
Constructor. Initializes the custom colours to {\tt wxNullColour},
the {\it data colour} setting
to black, and the {\it choose full} setting to true.
@@ -218,7 +219,7 @@ The default colour is black.
Gets the {\it i}th custom colour associated with the colour dialog. {\it i} should
be an integer between 0 and 15.
The default custom colours are all white.
The default custom colours are invalid colours.
\membersection{wxColourData::SetChooseFull}\label{wxcolourdatasetchoosefull}
@@ -247,7 +248,7 @@ The default colour is black.
Sets the {\it i}th custom colour for the colour dialog. {\it i} should
be an integer between 0 and 15.
The default custom colours are all white.
The default custom colours are invalid colours.
\membersection{wxColourData::operator $=$}\label{wxcolourdataassign}

View File

@@ -88,12 +88,9 @@
wxColourData::wxColourData()
{
int i;
for (i = 0; i < 16; i++)
m_custColours[i].Set(255, 255, 255);
m_chooseFull = FALSE;
m_chooseFull = false;
m_dataColour.Set(0,0,0);
// m_custColours are wxNullColours initially
}
wxColourData::wxColourData(const wxColourData& data)
@@ -108,16 +105,15 @@ wxColourData::~wxColourData()
void wxColourData::SetCustomColour(int i, const wxColour& colour)
{
if (i > 15 || i < 0)
return;
wxCHECK_RET( (i >= 0 && i < 16), _T("custom colour index out of range") );
m_custColours[i] = colour;
}
wxColour wxColourData::GetCustomColour(int i)
{
if (i > 15 || i < 0)
return wxColour(0,0,0);
wxCHECK_MSG( (i >= 0 && i < 16), wxColour(0,0,0),
_T("custom colour index out of range") );
return m_custColours[i];
}

View File

@@ -128,7 +128,12 @@ int wxColourDialog::ShowModal()
int i;
for (i = 0; i < 16; i++)
{
if (m_colourData.m_custColours[i].Ok())
custColours[i] = wxColourToRGB(m_colourData.m_custColours[i]);
else
custColours[i] = RGB(255,255,255);
}
chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR);
if ( m_parent )