Exemplo n.º 1
0
void wxGenericColourDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
{
    wxPaintDC dc(this);

    PaintBasicColours(dc);
    PaintCustomColours(dc);
    PaintCustomColour(dc);
    PaintHighlight(dc, true);
}
Exemplo n.º 2
0
void wxGenericColourDialog::OnAddCustom(wxCommandEvent& WXUNUSED(event))
{
  wxClientDC dc(this);
  if (whichKind != 2)
  {
    PaintHighlight(dc, false);
    whichKind = 2;
    colourSelection = 0;
    PaintHighlight(dc, true);
  }

  customColours[colourSelection].Set(colourData.m_dataColour.Red(),
                                     colourData.m_dataColour.Green(),
                                     colourData.m_dataColour.Blue());

  colourData.SetCustomColour(colourSelection, customColours[colourSelection]);

  PaintCustomColours(dc);
}
Exemplo n.º 3
0
void wxGenericColourDialog::OnCustomColourClick(int which)
{
    wxClientDC dc(this);
    PaintHighlight(dc, false);
    whichKind = 2;
    colourSelection = which;

#if wxUSE_SLIDER
    redSlider->SetValue( customColours[colourSelection].Red() );
    greenSlider->SetValue( customColours[colourSelection].Green() );
    blueSlider->SetValue( customColours[colourSelection].Blue() );
#endif // wxUSE_SLIDER

    colourData.m_dataColour.Set(customColours[colourSelection].Red(),
                                customColours[colourSelection].Green(),
                                customColours[colourSelection].Blue());

    PaintCustomColour(dc);
    PaintHighlight(dc, true);
}
Exemplo n.º 4
0
void wxGenericColourDialog::OnBasicColourClick(int which)
{
    wxClientDC dc(this);

    PaintHighlight(dc, false);
    m_whichKind = 1;
    m_colourSelection = which;

#if wxUSE_SLIDER
    m_redSlider->SetValue( m_standardColours[m_colourSelection].Red() );
    m_greenSlider->SetValue( m_standardColours[m_colourSelection].Green() );
    m_blueSlider->SetValue( m_standardColours[m_colourSelection].Blue() );
#endif // wxUSE_SLIDER

    m_colourData.m_dataColour.Set(m_standardColours[m_colourSelection].Red(),
                                m_standardColours[m_colourSelection].Green(),
                                m_standardColours[m_colourSelection].Blue());

    PaintCustomColour(dc);
    PaintHighlight(dc, true);
}
Exemplo n.º 5
0
void wxGenericColourDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
{
    wxPaintDC dc(this);

    PaintBasicColours(dc);
    // wxStaticBitmap controls are updated on their own.
#if !wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
    PaintCustomColours(dc, -1);
    PaintCustomColour(dc);
#endif // !wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
    PaintHighlight(dc, true);
}
Exemplo n.º 6
0
void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
{
#if !defined(__WXMOTIF__) && !defined(__WXPM__) && !defined(__WXCOCOA__)
  wxDialog::OnPaint(event);
#endif

  wxPaintDC dc(this);

  PaintBasicColours(dc);
  PaintCustomColours(dc);
  PaintCustomColour(dc);
  PaintHighlight(dc, true);
}
Exemplo n.º 7
0
void wxGenericColourDialog::OnCustomColourClick(int which)
{
    wxClientDC dc(this);
    PaintHighlight(dc, false);
    m_whichKind = 2;
    m_colourSelection = which;

#if wxUSE_SLIDER
    m_redSlider->SetValue( m_customColours[m_colourSelection].Red() );
    m_greenSlider->SetValue( m_customColours[m_colourSelection].Green() );
    m_blueSlider->SetValue( m_customColours[m_colourSelection].Blue() );
    if ( m_colourData.GetChooseAlpha() )
    {
        m_alphaSlider->SetValue( m_customColours[m_colourSelection].Alpha() );
    }
#endif // wxUSE_SLIDER

    m_colourData.SetColour(m_customColours[m_colourSelection]);

    PaintCustomColour(dc);
    PaintHighlight(dc, true);
}
Exemplo n.º 8
0
void wxGenericColourDialog::OnAddCustom(wxCommandEvent& WXUNUSED(event))
{
  wxClientDC dc(this);
  if (m_whichKind != 2)
  {
    PaintHighlight(dc, false);
    m_whichKind = 2;
    m_colourSelection = 0;
    PaintHighlight(dc, true);
  }

  m_customColours[m_colourSelection] = m_colourData.GetColour();

  m_colourData.SetCustomColour(m_colourSelection, m_customColours[m_colourSelection]);

#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
    wxBitmap bmp(m_smallRectangleSize, 32);
    bmp.UseAlpha();
    DoPreviewBitmap(bmp, m_customColours[m_colourSelection]);
    m_customColoursBmp[m_colourSelection]->SetBitmap(bmp);
#else
    PaintCustomColours(dc, m_colourSelection);
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA/!wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
}