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