]> git.saurik.com Git - wxWidgets.git/blame - src/mac/colordlg.cpp
wxGenericDirDialog related corrections for wxMac
[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 22
76a5e5d2
SC
23#include "wx/mac/private.h"
24
e9576ca5
SC
25/*
26 * wxColourDialog
27 */
28
29wxColourDialog::wxColourDialog()
30{
31 m_dialogParent = NULL;
32}
33
34wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
35{
36 Create(parent, data);
37}
38
39bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
40{
41 m_dialogParent = parent;
42
43 if (data)
44 m_colourData = *data;
45 return TRUE;
46}
47
48int wxColourDialog::ShowModal()
49{
519cb848 50 Point where ;
76a5e5d2 51 RGBColor currentColor = *((RGBColor*)m_colourData.dataColour.GetPixel()) , newColor ;
519cb848
SC
52
53 where.h = where.v = -1;
54
55 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
56 {
76a5e5d2 57 m_colourData.dataColour.Set( (WXCOLORREF*) &newColor ) ;
519cb848
SC
58 return wxID_OK;
59 }
60 else
61 {
62 return wxID_CANCEL;
63 }
e9576ca5
SC
64
65 return wxID_CANCEL;
66}
67