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