]> git.saurik.com Git - wxWidgets.git/blame - interface/colordlg.h
added convenient wxON_BLOCK_EXIT_THISn() macros wrapping wxON_BLOCK_EXIT_OBJn(*this)
[wxWidgets.git] / interface / colordlg.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: colordlg.h
e54c96f1 3// Purpose: interface of wxColourDialog
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxColourDialog
11 @wxheader{colordlg.h}
7c913512 12
23324ae1 13 This class represents the colour chooser dialog.
7c913512 14
23324ae1
FM
15 @library{wxcore}
16 @category{cmndlg}
7c913512 17
e54c96f1
FM
18 @see @ref overview_wxcolourdialogoverview "wxColourDialog Overview", wxColour,
19 wxColourData, wxGetColourFromUser()
23324ae1
FM
20*/
21class wxColourDialog : public wxDialog
22{
23public:
24 /**
25 Constructor. Pass a parent window, and optionally a pointer to a block of colour
26 data, which will be copied to the colour dialog's colour data. Custom
27 colours from colour data object will be be used in dialog's colour palette.
28 Invalid entries in custom colours list will be ignored on some platforms (GTK)
29 or replaced with white colour on platforms where custom colours palette has
30 fixed size (MSW).
3c4f71cc 31
4cc4bfaf 32 @see wxColourData
23324ae1 33 */
4cc4bfaf 34 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
23324ae1
FM
35
36 /**
37 Destructor.
38 */
39 ~wxColourDialog();
40
41 /**
42 Same as @ref ctor() constructor.
43 */
4cc4bfaf 44 bool Create(wxWindow* parent, wxColourData* data = NULL);
23324ae1
FM
45
46 /**
47 Returns the @ref overview_wxcolourdata "colour data" associated with the colour
48 dialog.
49 */
50 wxColourData GetColourData();
51
52 /**
53 Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL
54 otherwise.
55 */
56 int ShowModal();
57};
58
59
e54c96f1 60
23324ae1
FM
61// ============================================================================
62// Global functions/macros
63// ============================================================================
64
ba2874ff
BP
65/** @ingroup group_funcmacro_dialog */
66//@{
67
23324ae1 68/**
ba2874ff
BP
69 Shows the colour selection dialog and returns the colour selected by user
70 or invalid colour (use wxColour::IsOk() to test whether a colour is valid)
71 if the dialog was cancelled.
7c913512
FM
72
73 @param parent
ba2874ff 74 The parent window for the colour selection dialog.
7c913512 75 @param colInit
4cc4bfaf 76 If given, this will be the colour initially selected in the dialog.
7c913512 77 @param caption
4cc4bfaf 78 If given, this will be used for the dialog caption.
7c913512 79 @param data
ba2874ff
BP
80 Optional object storing additional colour dialog settings, such as
81 custom colours. If none is provided the same settings as the last time
82 are used.
83
84 @header{wx/colordlg.h}
23324ae1 85*/
4cc4bfaf 86wxColour wxGetColourFromUser(wxWindow* parent,
23324ae1
FM
87 const wxColour& colInit,
88 const wxString& caption = wxEmptyString,
4cc4bfaf 89 wxColourData* data = NULL);
23324ae1 90
ba2874ff
BP
91//@}
92