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$
|
|
|
|
// Copyright: (c)
|
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__
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 10:01:55 -04:00
|
|
|
#pragma interface "colrdlgg.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/setup.h"
|
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
#include "wx/cmndata.h"
|
|
|
|
|
|
|
|
#define wxID_ADD_CUSTOM 3000
|
|
|
|
#define wxID_RED_SLIDER 3001
|
|
|
|
#define wxID_GREEN_SLIDER 3002
|
|
|
|
#define wxID_BLUE_SLIDER 3003
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxSlider;
|
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
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
wxColourData &GetColourData() { return 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
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
void OnRedSlider(wxCommandEvent& event);
|
|
|
|
void OnGreenSlider(wxCommandEvent& event);
|
|
|
|
void OnBlueSlider(wxCommandEvent& event);
|
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:
|
|
|
|
wxColourData colourData;
|
|
|
|
wxWindow *dialogParent;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// Area reserved for grids of colours
|
|
|
|
wxRect standardColoursRect;
|
|
|
|
wxRect customColoursRect;
|
|
|
|
wxRect singleCustomColourRect;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// Size of each colour rectangle
|
|
|
|
wxPoint smallRectangleSize;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// For single customizable colour
|
|
|
|
wxPoint customRectangleSize;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// Grid spacing (between rectangles)
|
|
|
|
int 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)
|
|
|
|
int sectionSpacing;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// 48 'standard' colours
|
|
|
|
wxColour standardColours[48];
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// 16 'custom' colours
|
|
|
|
wxColour customColours[16];
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// One single custom colour (use sliders)
|
|
|
|
wxColour singleCustomColour;
|
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.
|
|
|
|
int colourSelection;
|
|
|
|
int whichKind; // 1 for standard colours, 2 for custom colours,
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
wxSlider *redSlider;
|
|
|
|
wxSlider *greenSlider;
|
|
|
|
wxSlider *blueSlider;
|
1999-02-05 18:55:04 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
int buttonY;
|
|
|
|
|
|
|
|
int okButtonX;
|
|
|
|
int customButtonX;
|
|
|
|
|
|
|
|
// static bool colourDialogCancelled;
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|