]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: colordlg.h | |
3 | // Purpose: interface of wxColourDialog | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxColourDialog | |
11 | ||
12 | This class represents the colour chooser dialog. | |
13 | ||
14 | @library{wxcore} | |
15 | @category{cmndlg} | |
16 | ||
17 | @see @ref overview_cmndlg_colour, wxColour, wxColourData, | |
18 | wxGetColourFromUser() | |
19 | */ | |
20 | class wxColourDialog : public wxDialog | |
21 | { | |
22 | public: | |
23 | /** | |
24 | Constructor. Pass a parent window, and optionally a pointer to a block | |
25 | of colour data, which will be copied to the colour dialog's colour | |
26 | data. | |
27 | ||
28 | Custom colours from colour data object will be be used in the dialog's | |
29 | colour palette. Invalid entries in custom colours list will be ignored | |
30 | on some platforms(GTK) or replaced with white colour on platforms where | |
31 | custom colours palette has fixed size (MSW). | |
32 | ||
33 | @see wxColourData | |
34 | */ | |
35 | wxColourDialog(wxWindow* parent, wxColourData* data = NULL); | |
36 | ||
37 | /** | |
38 | Destructor. | |
39 | */ | |
40 | virtual ~wxColourDialog(); | |
41 | ||
42 | /** | |
43 | Same as wxColourDialog(). | |
44 | */ | |
45 | bool Create(wxWindow* parent, wxColourData* data = NULL); | |
46 | ||
47 | /** | |
48 | Returns the colour data associated with the colour dialog. | |
49 | */ | |
50 | wxColourData& GetColourData(); | |
51 | ||
52 | /** | |
53 | Shows the dialog, returning wxID_OK if the user pressed OK, and | |
54 | wxID_CANCEL otherwise. | |
55 | */ | |
56 | virtual int ShowModal(); | |
57 | }; | |
58 | ||
59 | ||
60 | ||
61 | // ============================================================================ | |
62 | // Global functions/macros | |
63 | // ============================================================================ | |
64 | ||
65 | /** @ingroup group_funcmacro_dialog */ | |
66 | //@{ | |
67 | ||
68 | /** | |
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. | |
72 | ||
73 | @param parent | |
74 | The parent window for the colour selection dialog. | |
75 | @param colInit | |
76 | If given, this will be the colour initially selected in the dialog. | |
77 | @param caption | |
78 | If given, this will be used for the dialog caption. | |
79 | @param data | |
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} | |
85 | */ | |
86 | wxColour wxGetColourFromUser(wxWindow* parent, | |
87 | const wxColour& colInit, | |
88 | const wxString& caption = wxEmptyString, | |
89 | wxColourData* data = NULL); | |
90 | ||
91 | //@} | |
92 |