]>
git.saurik.com Git - wxWidgets.git/blob - interface/pickerbase.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPickerBase
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @wxheader{pickerbase.h}
13 Base abstract class for all pickers which support an auxiliary text control.
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
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.
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.
32 @see wxColourPickerCtrl
34 class wxPickerBase
: public wxControl
38 Returns the margin (in pixel) between the picker and the text control.
40 This function can be used only when HasTextCtrl() returns @true.
42 int GetInternalMargin() const;
45 Returns the proportion value of the picker.
47 int GetPickerCtrlProportion() const;
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.
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).
61 wxTextCtrl
* GetTextCtrl();
64 Returns the proportion value of the text control.
66 This function can be used only when HasTextCtrl() returns @true.
68 int GetTextCtrlProportion() const;
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).
74 bool HasTextCtrl() const;
77 Returns @true if the picker control is growable.
79 bool IsPickerCtrlGrowable() const;
82 Returns @true if the text control is growable.
84 This function can be used only when HasTextCtrl() returns @true.
86 bool IsTextCtrlGrowable() const;
89 Sets the margin (in pixel) between the picker and the text control.
91 This function can be used only when HasTextCtrl() returns @true.
93 void SetInternalMargin(int margin
);
96 Sets the picker control as growable when @c grow is @true.
98 void SetPickerCtrlGrowable(bool grow
= true);
101 Sets the proportion value of the picker.
103 Look at the detailed description of wxPickerBase for more info.
105 void SetPickerCtrlProportion(int prop
);
108 Sets the text control as growable when @c grow is @true.
110 This function can be used only when HasTextCtrl() returns @true.
112 void SetTextCtrlGrowable(bool grow
= true);
115 Sets the proportion value of the text control.
117 Look at the detailed description of wxPickerBase for more info.
119 This function can be used only when HasTextCtrl() returns @true.
121 void SetTextCtrlProportion(int prop
);