]> git.saurik.com Git - wxWidgets.git/blob - interface/pickerbase.h
9c2f93140cf2842e9fd77fac7240f2e152dc9da0
[wxWidgets.git] / interface / pickerbase.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: pickerbase.h
3 // Purpose: documentation for wxPickerBase class
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 This class handles all positioning and sizing of the text control like a
15 an horizontal wxBoxSizer would do, with the text control on
16 the left of the picker button.
17 The proportion (see wxSizer documentation for more info about
18 proportion values) of the picker control defaults to 1 when there isn't a text
19 control
20 associated (see @c wxPB_USE_TEXTCTRL style) and to 0 otherwise.
21
22 @beginStyleTable
23 @style{wxPB_USE_TEXTCTRL}:
24 Creates a text control to the left of the picker which is
25 completely managed by this wxPickerBase class.
26 @endStyleTable
27
28 @library{wxcore}
29 @category{FIXME}
30
31 @seealso
32 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 This function can be used only when HasTextCtrl() returns @true.
40 */
41 int GetInternalMargin();
42
43 /**
44 Returns the proportion value of the picker.
45 */
46 int GetPickerCtrlProportion();
47
48 /**
49 Returns a pointer to the text control handled by this window or @NULL if the
50 @b wxPB_USE_TEXTCTRL style was not specified when this control was created.
51 Very important: the contents of the text control could be containing an invalid
52 representation of the entity which can be chosen through the picker (e.g. the user entered an invalid colour syntax because of a typo). Thus you should never parse the content of the textctrl to get the user's input; rather use the derived-class getter (e.g. wxColourPickerCtrl::GetColour, wxFilePickerCtrl::GetPath, etc).
53 */
54 wxTextCtrl * GetTextCtrl();
55
56 /**
57 Returns the proportion value of the text control.
58 This function can be used only when HasTextCtrl() returns @true.
59 */
60 int GetTextCtrlProportion();
61
62 /**
63 Returns @true if this window has a valid text control (i.e. if the @b
64 wxPB_USE_TEXTCTRL style was
65 given when creating this control).
66 */
67 bool HasTextCtrl();
68
69 /**
70 Returns @true if the picker control is growable.
71 */
72 bool IsPickerCtrlGrowable();
73
74 /**
75 Returns @true if the text control is growable.
76 This function can be used only when HasTextCtrl() returns @true.
77 */
78 bool IsTextCtrlGrowable();
79
80 /**
81 Sets the margin (in pixel) between the picker and the text control.
82 This function can be used only when HasTextCtrl() returns @true.
83 */
84 void SetInternalMargin(int margin);
85
86 /**
87 Sets the picker control as growable when @c grow is @true.
88 */
89 void SetPickerCtrlGrowable(bool grow = @true);
90
91 /**
92 Sets the proportion value of the picker.
93 Look at the overview of wxPickerBase for more details about this.
94 */
95 void SetPickerCtrlProportion(int prop);
96
97 /**
98 Sets the text control as growable when @c grow is @true.
99 This function can be used only when HasTextCtrl() returns @true.
100 */
101 void SetTextCtrlGrowable(bool grow = @true);
102
103 /**
104 Sets the proportion value of the text control.
105 Look at the overview of wxPickerBase for more details about this.
106 This function can be used only when HasTextCtrl() returns @true.
107 */
108 void SetTextCtrlProportion(int prop);
109 };