]> git.saurik.com Git - wxWidgets.git/blob - interface/pickerbase.h
Commented out appearance sections in docs temporarily until screenshots are added.
[wxWidgets.git] / interface / pickerbase.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: pickerbase.h
3 // Purpose: interface of wxPickerBase
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPickerBase
11 @wxheader{pickerbase.h}
12
13 Base abstract class for all pickers which support an auxiliary text control.
14
15 This class handles all positioning and sizing of the text control like a
16 an horizontal wxBoxSizer would do, with the text control on the left of the
17 picker button.
18
19 The proportion (see wxSizer documentation for more info about proportion values)
20 of the picker control defaults to 1 when there isn't a text control associated
21 (see @c wxPB_USE_TEXTCTRL style) and to 0 otherwise.
22
23 @beginStyleTable
24 @style{wxPB_USE_TEXTCTRL}
25 Creates a text control to the left of the picker which is
26 completely managed by this wxPickerBase class.
27 @endStyleTable
28
29 @library{wxcore}
30 @category{pickers}
31
32 @see wxColourPickerCtrl
33 */
34 class wxPickerBase : public wxControl
35 {
36 public:
37 /**
38 Returns the margin (in pixel) between the picker and the text control.
39
40 This function can be used only when HasTextCtrl() returns @true.
41 */
42 int GetInternalMargin() const;
43
44 /**
45 Returns the proportion value of the picker.
46 */
47 int GetPickerCtrlProportion() const;
48
49 /**
50 Returns a pointer to the text control handled by this window or @NULL if the
51 @c wxPB_USE_TEXTCTRL style was not specified when this control was created.
52
53 @remarks
54 The contents of the text control could be containing an invalid
55 representation of the entity which can be chosen through the picker
56 (e.g. the user entered an invalid colour syntax because of a typo).
57 Thus you should never parse the content of the textctrl to get the
58 user's input; rather use the derived-class getter
59 (e.g. wxColourPickerCtrl::GetColour(), wxFilePickerCtrl::GetPath(), etc).
60 */
61 wxTextCtrl* GetTextCtrl();
62
63 /**
64 Returns the proportion value of the text control.
65
66 This function can be used only when HasTextCtrl() returns @true.
67 */
68 int GetTextCtrlProportion() const;
69
70 /**
71 Returns @true if this window has a valid text control (i.e. if the @c
72 wxPB_USE_TEXTCTRL style was given when creating this control).
73 */
74 bool HasTextCtrl() const;
75
76 /**
77 Returns @true if the picker control is growable.
78 */
79 bool IsPickerCtrlGrowable() const;
80
81 /**
82 Returns @true if the text control is growable.
83
84 This function can be used only when HasTextCtrl() returns @true.
85 */
86 bool IsTextCtrlGrowable() const;
87
88 /**
89 Sets the margin (in pixel) between the picker and the text control.
90
91 This function can be used only when HasTextCtrl() returns @true.
92 */
93 void SetInternalMargin(int margin);
94
95 /**
96 Sets the picker control as growable when @c grow is @true.
97 */
98 void SetPickerCtrlGrowable(bool grow = true);
99
100 /**
101 Sets the proportion value of the picker.
102
103 Look at the detailed description of wxPickerBase for more info.
104 */
105 void SetPickerCtrlProportion(int prop);
106
107 /**
108 Sets the text control as growable when @c grow is @true.
109
110 This function can be used only when HasTextCtrl() returns @true.
111 */
112 void SetTextCtrlGrowable(bool grow = true);
113
114 /**
115 Sets the proportion value of the text control.
116
117 Look at the detailed description of wxPickerBase for more info.
118
119 This function can be used only when HasTextCtrl() returns @true.
120 */
121 void SetTextCtrlProportion(int prop);
122 };
123