1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-07-15 19:51:35 +00:00
|
|
|
// Name: wx/generic/colrdlgg.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose: wxGenericColourDialog
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2005-05-04 18:57:50 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __COLORDLGH_G__
|
|
|
|
#define __COLORDLGH_G__
|
|
|
|
|
2006-01-26 17:20:50 +00:00
|
|
|
#include "wx/defs.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
#include "wx/cmndata.h"
|
|
|
|
|
|
|
|
#define wxID_ADD_CUSTOM 3000
|
|
|
|
|
2004-11-24 16:08:12 +00:00
|
|
|
#if wxUSE_SLIDER
|
|
|
|
|
|
|
|
#define wxID_RED_SLIDER 3001
|
|
|
|
#define wxID_GREEN_SLIDER 3002
|
|
|
|
#define wxID_BLUE_SLIDER 3003
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSlider;
|
2004-11-24 16:08:12 +00:00
|
|
|
|
|
|
|
#endif // wxUSE_SLIDER
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2000-07-15 19:51:35 +00:00
|
|
|
public:
|
|
|
|
wxGenericColourDialog();
|
|
|
|
wxGenericColourDialog(wxWindow *parent,
|
|
|
|
wxColourData *data = (wxColourData *) NULL);
|
|
|
|
virtual ~wxGenericColourDialog();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
bool Create(wxWindow *parent, wxColourData *data = (wxColourData *) NULL);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-04-22 20:20:51 +00:00
|
|
|
wxColourData &GetColourData() { return m_colourData; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
virtual int ShowModal();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Internal functions
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
virtual void CalculateMeasurements();
|
|
|
|
virtual void CreateWidgets();
|
|
|
|
virtual void InitializeColours();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
virtual void PaintBasicColours(wxDC& dc);
|
|
|
|
virtual void PaintCustomColours(wxDC& dc);
|
|
|
|
virtual void PaintCustomColour(wxDC& dc);
|
|
|
|
virtual void PaintHighlight(wxDC& dc, bool draw);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
virtual void OnBasicColourClick(int which);
|
|
|
|
virtual void OnCustomColourClick(int which);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
void OnAddCustom(wxCommandEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-11-24 16:08:12 +00:00
|
|
|
#if wxUSE_SLIDER
|
2000-07-15 19:51:35 +00:00
|
|
|
void OnRedSlider(wxCommandEvent& event);
|
|
|
|
void OnGreenSlider(wxCommandEvent& event);
|
|
|
|
void OnBlueSlider(wxCommandEvent& event);
|
2004-11-24 16:08:12 +00:00
|
|
|
#endif // wxUSE_SLIDER
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
protected:
|
2007-04-22 20:20:51 +00:00
|
|
|
wxColourData m_colourData;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Area reserved for grids of colours
|
2007-04-22 20:20:51 +00:00
|
|
|
wxRect m_standardColoursRect;
|
|
|
|
wxRect m_customColoursRect;
|
|
|
|
wxRect m_singleCustomColourRect;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Size of each colour rectangle
|
2007-04-22 20:20:51 +00:00
|
|
|
wxPoint m_smallRectangleSize;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// For single customizable colour
|
2007-04-22 20:20:51 +00:00
|
|
|
wxPoint m_customRectangleSize;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Grid spacing (between rectangles)
|
2007-04-22 20:20:51 +00:00
|
|
|
int m_gridSpacing;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Section spacing (between left and right halves of dialog box)
|
2007-04-22 20:20:51 +00:00
|
|
|
int m_sectionSpacing;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// 48 'standard' colours
|
2007-04-22 20:20:51 +00:00
|
|
|
wxColour m_standardColours[48];
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// 16 'custom' colours
|
2007-04-22 20:20:51 +00:00
|
|
|
wxColour m_customColours[16];
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// Which colour is selected? An index into one of the two areas.
|
2007-04-22 20:20:51 +00:00
|
|
|
int m_colourSelection;
|
|
|
|
int m_whichKind; // 1 for standard colours, 2 for custom colours,
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-11-24 16:08:12 +00:00
|
|
|
#if wxUSE_SLIDER
|
2007-04-22 20:20:51 +00:00
|
|
|
wxSlider *m_redSlider;
|
|
|
|
wxSlider *m_greenSlider;
|
|
|
|
wxSlider *m_blueSlider;
|
2004-11-24 16:08:12 +00:00
|
|
|
#endif // wxUSE_SLIDER
|
1999-02-05 23:55:04 +00:00
|
|
|
|
2007-04-22 20:20:51 +00:00
|
|
|
int m_buttonY;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2007-04-22 20:20:51 +00:00
|
|
|
int m_okButtonX;
|
|
|
|
int m_customButtonX;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
// static bool colourDialogCancelled;
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|