]> git.saurik.com Git - wxWidgets.git/blame - interface/pickerbase.h
use wxWANTS_CHARS to allow arrows to work inside the control
[wxWidgets.git] / interface / pickerbase.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: pickerbase.h
e54c96f1 3// Purpose: interface of wxPickerBase
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxPickerBase
11 @wxheader{pickerbase.h}
7c913512 12
23324ae1
FM
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.
7c913512 21
23324ae1
FM
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
7c913512 27
23324ae1
FM
28 @library{wxcore}
29 @category{FIXME}
7c913512 30
e54c96f1 31 @see wxColourPickerCtrl
23324ae1
FM
32*/
33class wxPickerBase : public wxControl
34{
35public:
36 /**
37 Returns the margin (in pixel) between the picker and the text control.
38 This function can be used only when HasTextCtrl() returns @true.
39 */
328f5751 40 int GetInternalMargin() const;
23324ae1
FM
41
42 /**
43 Returns the proportion value of the picker.
44 */
328f5751 45 int GetPickerCtrlProportion() const;
23324ae1
FM
46
47 /**
48 Returns a pointer to the text control handled by this window or @NULL if the
49 @b wxPB_USE_TEXTCTRL style was not specified when this control was created.
50 Very important: the contents of the text control could be containing an invalid
51 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).
52 */
4cc4bfaf 53 wxTextCtrl* GetTextCtrl();
23324ae1
FM
54
55 /**
56 Returns the proportion value of the text control.
57 This function can be used only when HasTextCtrl() returns @true.
58 */
328f5751 59 int GetTextCtrlProportion() const;
23324ae1
FM
60
61 /**
62 Returns @true if this window has a valid text control (i.e. if the @b
63 wxPB_USE_TEXTCTRL style was
64 given when creating this control).
65 */
328f5751 66 bool HasTextCtrl() const;
23324ae1
FM
67
68 /**
69 Returns @true if the picker control is growable.
70 */
328f5751 71 bool IsPickerCtrlGrowable() const;
23324ae1
FM
72
73 /**
74 Returns @true if the text control is growable.
75 This function can be used only when HasTextCtrl() returns @true.
76 */
328f5751 77 bool IsTextCtrlGrowable() const;
23324ae1
FM
78
79 /**
80 Sets the margin (in pixel) between the picker and the text control.
81 This function can be used only when HasTextCtrl() returns @true.
82 */
83 void SetInternalMargin(int margin);
84
85 /**
86 Sets the picker control as growable when @c grow is @true.
87 */
4cc4bfaf 88 void SetPickerCtrlGrowable(bool grow = true);
23324ae1
FM
89
90 /**
91 Sets the proportion value of the picker.
92 Look at the overview of wxPickerBase for more details about this.
93 */
94 void SetPickerCtrlProportion(int prop);
95
96 /**
97 Sets the text control as growable when @c grow is @true.
98 This function can be used only when HasTextCtrl() returns @true.
99 */
4cc4bfaf 100 void SetTextCtrlGrowable(bool grow = true);
23324ae1
FM
101
102 /**
103 Sets the proportion value of the text control.
104 Look at the overview of wxPickerBase for more details about this.
105 This function can be used only when HasTextCtrl() returns @true.
106 */
107 void SetTextCtrlProportion(int prop);
108};
e54c96f1 109