]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/colordlg.cpp
slowly approaching dcscreen...
[wxWidgets.git] / src / mac / carbon / 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
65571936 10// Licence: wxWindows licence
e9576ca5
SC
11/////////////////////////////////////////////////////////////////////////////
12
a8e9860d 13#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
e9576ca5
SC
14#pragma implementation "colordlg.h"
15#endif
16
a8e9860d
SC
17#include "wx/wxprec.h"
18
519cb848 19#include "wx/mac/colordlg.h"
356c775f
RN
20#include "wx/fontdlg.h"
21
22
23#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
e9576ca5 24
2f1ae414 25#if !USE_SHARED_LIBRARY
e9576ca5 26IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
2f1ae414 27#endif
e9576ca5 28
76a5e5d2 29#include "wx/mac/private.h"
66a09d47
SC
30#ifndef __DARWIN__
31#include <ColorPicker.h>
32#endif
76a5e5d2 33
e9576ca5
SC
34/*
35 * wxColourDialog
36 */
37
38wxColourDialog::wxColourDialog()
39{
40 m_dialogParent = NULL;
41}
42
43wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
44{
45 Create(parent, data);
46}
47
48bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
49{
50 m_dialogParent = parent;
51
52 if (data)
53 m_colourData = *data;
54 return TRUE;
55}
56
57int wxColourDialog::ShowModal()
58{
e40298d5 59 Point where ;
ae500232 60 RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ;
e40298d5
JS
61
62 where.h = where.v = -1;
519cb848 63
e40298d5
JS
64 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
65 {
ae500232 66 m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ;
e40298d5
JS
67 return wxID_OK;
68 }
69 else
70 {
71 return wxID_CANCEL;
72 }
e9576ca5
SC
73
74 return wxID_CANCEL;
75}
76
356c775f 77#endif