2001-07-05 01:26:15 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-01-07 05:26:57 +00:00
|
|
|
// Name: wx/colordlg.h
|
2001-07-05 01:26:15 +00:00
|
|
|
// Purpose: wxColourDialog
|
2014-03-11 20:48:13 +00:00
|
|
|
// Author: Vadim Zeitlin
|
2001-07-05 01:26:15 +00:00
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) wxWidgets team
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-07-05 01:26:15 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_COLORDLG_H_BASE_
|
|
|
|
#define _WX_COLORDLG_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-06-04 16:02:14 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-07-05 01:26:15 +00:00
|
|
|
#if wxUSE_COLOURDLG
|
|
|
|
|
2011-01-07 05:26:57 +00:00
|
|
|
#include "wx/colourdata.h"
|
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
2001-07-05 01:26:15 +00:00
|
|
|
#include "wx/msw/colordlg.h"
|
2002-12-04 14:11:26 +00:00
|
|
|
#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__)
|
2008-06-11 19:17:41 +00:00
|
|
|
#include "wx/osx/colordlg.h"
|
2004-06-04 16:02:14 +00:00
|
|
|
#elif defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/gtk/colordlg.h"
|
2014-08-24 01:50:11 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/colordlg.h"
|
2001-07-05 01:26:15 +00:00
|
|
|
#else
|
|
|
|
#include "wx/generic/colrdlgg.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-07-05 01:26:15 +00:00
|
|
|
#define wxColourDialog wxGenericColourDialog
|
1998-11-08 22:35:18 +00:00
|
|
|
#endif
|
|
|
|
|
2019-04-20 19:47:42 +00:00
|
|
|
// Under some platforms (currently only wxMSW) wxColourDialog can send events
|
|
|
|
// of this type while it is shown.
|
|
|
|
//
|
|
|
|
// Notice that this class is almost identical to wxColourPickerEvent but it
|
|
|
|
// doesn't really sense to reuse the same class for both controls.
|
|
|
|
class WXDLLIMPEXP_CORE wxColourDialogEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxColourDialogEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
wxColourDialogEvent(wxEventType evtType,
|
|
|
|
wxColourDialog* dialog,
|
|
|
|
const wxColour& colour)
|
|
|
|
: wxCommandEvent(evtType, dialog->GetId()),
|
|
|
|
m_colour(colour)
|
|
|
|
{
|
|
|
|
SetEventObject(dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
// default copy ctor and dtor are ok
|
|
|
|
|
|
|
|
wxColour GetColour() const { return m_colour; }
|
|
|
|
void SetColour(const wxColour& colour) { m_colour = colour; }
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const wxOVERRIDE
|
|
|
|
{
|
|
|
|
return new wxColourDialogEvent(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxColour m_colour;
|
|
|
|
|
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxColourDialogEvent);
|
|
|
|
};
|
|
|
|
|
|
|
|
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COLOUR_CHANGED, wxColourDialogEvent);
|
|
|
|
|
|
|
|
#define wxColourDialogEventHandler(func) \
|
|
|
|
wxEVENT_HANDLER_CAST(wxColourDialogEventFunction, func)
|
|
|
|
|
|
|
|
#define EVT_COLOUR_CHANGED(id, fn) \
|
|
|
|
wx__DECLARE_EVT1(wxEVT_COLOUR_CHANGED, id, wxColourDialogEventHandler(fn))
|
|
|
|
|
|
|
|
|
2000-02-08 01:08:51 +00:00
|
|
|
// get the colour from user and return it
|
2009-01-19 13:55:27 +00:00
|
|
|
WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = NULL,
|
2008-03-26 15:06:00 +00:00
|
|
|
const wxColour& colInit = wxNullColour,
|
|
|
|
const wxString& caption = wxEmptyString,
|
|
|
|
wxColourData *data = NULL);
|
2001-07-05 01:26:15 +00:00
|
|
|
|
|
|
|
#endif // wxUSE_COLOURDLG
|
2000-02-08 01:08:51 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_COLORDLG_H_BASE_
|