]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/pickerbase.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPickerBase
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 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 the left of the
18 The proportion (see wxSizer documentation for more info about proportion values)
19 of the picker control defaults to 1 when there isn't a text control associated
20 (see @c wxPB_USE_TEXTCTRL style) and to 0 otherwise.
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.
31 @see wxColourPickerCtrl
33 class wxPickerBase
: public wxControl
37 Returns the margin (in pixel) between the picker and the text control.
39 This function can be used only when HasTextCtrl() returns @true.
41 int GetInternalMargin() const;
44 Returns the proportion value of the picker.
46 int GetPickerCtrlProportion() const;
49 Returns a pointer to the text control handled by this window or @NULL if the
50 @c wxPB_USE_TEXTCTRL style was not specified when this control was created.
53 The contents of the text control could be an invalid representation of
54 the entity which can be chosen through the picker
55 (e.g. when the user enters an invalid colour syntax because of a typo).
56 Thus you should never parse the content of the textctrl to get the
57 user's input; rather use the derived-class getter
58 (e.g. wxColourPickerCtrl::GetColour(), wxFilePickerCtrl::GetPath(), etc).
60 wxTextCtrl
* GetTextCtrl();
63 Returns the native implementation of the real picker control.
66 The returned control in the generic implementation of wxFilePickerCtrl,
67 wxDirPickerCtrl, wxFontPickerCtrl and wxColourPickerCtrl is a specialized
68 wxButton class so that you can change its label doing, e.g.:
71 // wxMSW is one of the platforms where the generic implementation
72 // of wxFilePickerCtrl is used...
74 wxButton *pButt = wx_static_cast(wxButton*, myFilePickerCtrl->GetPickerCtrl());
76 pButt->SetLabel("Custom browse string");
80 wxControl
* GetPickerCtrl();
83 Returns the proportion value of the text control.
85 This function can be used only when HasTextCtrl() returns @true.
87 int GetTextCtrlProportion() const;
90 Returns @true if this window has a valid text control (i.e. if the @c
91 wxPB_USE_TEXTCTRL style was given when creating this control).
93 bool HasTextCtrl() const;
96 Returns @true if the picker control is growable.
98 bool IsPickerCtrlGrowable() const;
101 Returns @true if the text control is growable.
103 This function can be used only when HasTextCtrl() returns @true.
105 bool IsTextCtrlGrowable() const;
108 Sets the margin (in pixel) between the picker and the text control.
110 This function can be used only when HasTextCtrl() returns @true.
112 void SetInternalMargin(int margin
);
115 Sets the picker control as growable when @c grow is @true.
117 void SetPickerCtrlGrowable(bool grow
= true);
120 Sets the proportion value of the picker.
122 Look at the detailed description of wxPickerBase for more info.
124 void SetPickerCtrlProportion(int prop
);
127 Sets the text control as growable when @c grow is @true.
129 This function can be used only when HasTextCtrl() returns @true.
131 void SetTextCtrlGrowable(bool grow
= true);
134 Sets the proportion value of the text control.
136 Look at the detailed description of wxPickerBase for more info.
138 This function can be used only when HasTextCtrl() returns @true.
140 void SetTextCtrlProportion(int prop
);