]> git.saurik.com Git - wxWidgets.git/blame - src/mac/colordlg.cpp
fixed missing wxprec.h
[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.
5// Author: AUTHOR
6// Modified by:
7// Created: ??/??/98
8// RCS-ID: $Id$
9// Copyright: (c) AUTHOR
10// Licence: wxWindows licence
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
SC
22
23/*
24 * wxColourDialog
25 */
26
27wxColourDialog::wxColourDialog()
28{
29 m_dialogParent = NULL;
30}
31
32wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
33{
34 Create(parent, data);
35}
36
37bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
38{
39 m_dialogParent = parent;
40
41 if (data)
42 m_colourData = *data;
43 return TRUE;
44}
45
46int wxColourDialog::ShowModal()
47{
519cb848
SC
48 Point where ;
49 RGBColor currentColor = m_colourData.dataColour.GetPixel() , newColor ;
50
51 where.h = where.v = -1;
52
53 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
54 {
55 m_colourData.dataColour.Set( newColor ) ;
56 return wxID_OK;
57 }
58 else
59 {
60 return wxID_CANCEL;
61 }
e9576ca5
SC
62
63 return wxID_CANCEL;
64}
65