]> git.saurik.com Git - wxWidgets.git/blame - src/mac/colordlg.cpp
Acutally use the m_maxChars parameter value instead of ignoring it
[wxWidgets.git] / src / mac / colordlg.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: colordlg.cpp
3// Purpose: wxColourDialog class. NOTE: you can use the generic class
4// if you wish, instead of implementing this.
a31a5f85 5// Author: Stefan Csomor
e9576ca5 6// Modified by:
a31a5f85 7// Created: 1998-01-01
e9576ca5 8// RCS-ID: $Id$
a31a5f85 9// Copyright: (c) Stefan Csomor
e40298d5 10// Licence: wxWindows licence
e9576ca5
SC
11/////////////////////////////////////////////////////////////////////////////
12
13#ifdef __GNUG__
14#pragma implementation "colordlg.h"
15#endif
16
519cb848 17#include "wx/mac/colordlg.h"
e9576ca5 18
2f1ae414 19#if !USE_SHARED_LIBRARY
e9576ca5 20IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
2f1ae414 21#endif
e9576ca5 22
76a5e5d2 23#include "wx/mac/private.h"
66a09d47
SC
24#ifndef __DARWIN__
25#include <ColorPicker.h>
26#endif
76a5e5d2 27
e9576ca5
SC
28/*
29 * wxColourDialog
30 */
31
32wxColourDialog::wxColourDialog()
33{
34 m_dialogParent = NULL;
35}
36
37wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
38{
39 Create(parent, data);
40}
41
42bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
43{
44 m_dialogParent = parent;
45
46 if (data)
47 m_colourData = *data;
48 return TRUE;
49}
50
51int wxColourDialog::ShowModal()
52{
e40298d5
JS
53 Point where ;
54 RGBColor currentColor = *((RGBColor*)m_colourData.dataColour.GetPixel()) , newColor ;
55
56 where.h = where.v = -1;
519cb848 57
e40298d5
JS
58 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
59 {
60 m_colourData.dataColour.Set( (WXCOLORREF*) &newColor ) ;
61 return wxID_OK;
62 }
63 else
64 {
65 return wxID_CANCEL;
66 }
e9576ca5
SC
67
68 return wxID_CANCEL;
69}
70