]> git.saurik.com Git - wxWidgets.git/blob - interface/clrpicker.h
latex include not properly working for links and titlepage
[wxWidgets.git] / interface / clrpicker.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: clrpicker.h
3 // Purpose: documentation for wxColourPickerCtrl class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxColourPickerCtrl
11 @wxheader{clrpicker.h}
12
13 This control allows the user to select a colour. The generic implementation is
14 a button which brings up a wxColourDialog when clicked. Native implementation
15 may differ but this is usually a (small) widget which give access to the
16 colour-chooser
17 dialog.
18 It is only available if @c wxUSE_COLOURPICKERCTRL is set to 1 (the default).
19
20 @beginStyleTable
21 @style{wxCLRP_DEFAULT_STYLE}:
22 The default style: 0.
23 @style{wxCLRP_USE_TEXTCTRL}:
24 Creates a text control to the left of the picker button which is
25 completely managed by the wxColourPickerCtrl and which can be used
26 by the user to specify a colour (see SetColour). The text control
27 is automatically synchronized with button's value. Use functions
28 defined in wxPickerBase to modify the text control.
29 @style{wxCLRP_SHOW_LABEL}:
30 Shows the colour in HTML form (AABBCC) as colour button label
31 (instead of no label at all).
32 @endStyleTable
33
34 @library{wxcore}
35 @category{miscpickers}
36 @appearance{colourpickerctrl.png}
37
38 @seealso
39 wxColourDialog, wxColourPickerEvent
40 */
41 class wxColourPickerCtrl : public wxPickerBase
42 {
43 public:
44 /**
45 Initializes the object and calls Create() with
46 all the parameters.
47 */
48 wxColourPickerCtrl(wxWindow * parent, wxWindowID id,
49 const wxColour& colour = wxBLACK,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 long style = wxCLRP_DEFAULT_STYLE,
53 const wxValidator& validator = wxDefaultValidator,
54 const wxString& name = "colourpickerctrl");
55
56 /**
57 @param parent
58 Parent window, must not be non-@NULL.
59
60 @param id
61 The identifier for the control.
62
63 @param colour
64 The initial colour shown in the control.
65
66 @param pos
67 Initial position.
68
69 @param size
70 Initial size.
71
72 @param style
73 The window style, see wxCRLP_* flags.
74
75 @param validator
76 Validator which can be used for additional date checks.
77
78 @param name
79 Control name.
80
81 @returns @true if the control was successfully created or @false if
82 creation failed.
83 */
84 bool Create(wxWindow * parent, wxWindowID id,
85 const wxColour& colour = wxBLACK,
86 const wxPoint& pos = wxDefaultPosition,
87 const wxSize& size = wxDefaultSize,
88 long style = wxCLRP_DEFAULT_STYLE,
89 const wxValidator& validator = wxDefaultValidator,
90 const wxString& name = "colourpickerctrl");
91
92 /**
93 Returns the currently selected colour.
94 */
95 wxColour GetColour();
96
97 //@{
98 /**
99 Sets the currently selected colour. See wxColour::Set.
100 */
101 void SetColour(const wxColour & col);
102 void SetColour(const wxString & colname);
103 //@}
104 };
105
106
107 /**
108 @class wxColourPickerEvent
109 @wxheader{clrpicker.h}
110
111 This event class is used for the events generated by
112 wxColourPickerCtrl.
113
114 @library{wxcore}
115 @category{FIXME}
116
117 @seealso
118 wxColourPickerCtrl
119 */
120 class wxColourPickerEvent : public wxCommandEvent
121 {
122 public:
123 /**
124 The constructor is not normally used by the user code.
125 */
126 wxColourPickerEvent(wxObject * generator, int id,
127 const wxColour& colour);
128
129 /**
130 Retrieve the colour the user has just selected.
131 */
132 wxColour GetColour();
133
134 /**
135 Set the colour associated with the event.
136 */
137 void SetColour(const wxColour & pos);
138 };