]> git.saurik.com Git - wxWidgets.git/blame - interface/pickerbase.h
change longs used for bitmap types to wxBitmapType (#9126)
[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 13 Base abstract class for all pickers which support an auxiliary text control.
74bf4e64 14
23324ae1 15 This class handles all positioning and sizing of the text control like a
74bf4e64
FM
16 an horizontal wxBoxSizer would do, with the text control on the left of the
17 picker button.
4d7b68d1 18
74bf4e64
FM
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.
7c913512 22
23324ae1 23 @beginStyleTable
8c6791e4 24 @style{wxPB_USE_TEXTCTRL}
23324ae1
FM
25 Creates a text control to the left of the picker which is
26 completely managed by this wxPickerBase class.
27 @endStyleTable
7c913512 28
23324ae1 29 @library{wxcore}
74bf4e64 30 @category{pickers}
7c913512 31
e54c96f1 32 @see wxColourPickerCtrl
23324ae1
FM
33*/
34class wxPickerBase : public wxControl
35{
36public:
37 /**
38 Returns the margin (in pixel) between the picker and the text control.
74bf4e64 39
23324ae1
FM
40 This function can be used only when HasTextCtrl() returns @true.
41 */
328f5751 42 int GetInternalMargin() const;
23324ae1
FM
43
44 /**
45 Returns the proportion value of the picker.
46 */
328f5751 47 int GetPickerCtrlProportion() const;
23324ae1
FM
48
49 /**
50 Returns a pointer to the text control handled by this window or @NULL if the
74bf4e64
FM
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).
23324ae1 60 */
4cc4bfaf 61 wxTextCtrl* GetTextCtrl();
23324ae1
FM
62
63 /**
64 Returns the proportion value of the text control.
74bf4e64 65
23324ae1
FM
66 This function can be used only when HasTextCtrl() returns @true.
67 */
328f5751 68 int GetTextCtrlProportion() const;
23324ae1
FM
69
70 /**
74bf4e64
FM
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).
23324ae1 73 */
328f5751 74 bool HasTextCtrl() const;
23324ae1
FM
75
76 /**
77 Returns @true if the picker control is growable.
78 */
328f5751 79 bool IsPickerCtrlGrowable() const;
23324ae1
FM
80
81 /**
82 Returns @true if the text control is growable.
74bf4e64 83
23324ae1
FM
84 This function can be used only when HasTextCtrl() returns @true.
85 */
328f5751 86 bool IsTextCtrlGrowable() const;
23324ae1
FM
87
88 /**
89 Sets the margin (in pixel) between the picker and the text control.
74bf4e64 90
23324ae1
FM
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 */
4cc4bfaf 98 void SetPickerCtrlGrowable(bool grow = true);
23324ae1
FM
99
100 /**
101 Sets the proportion value of the picker.
74bf4e64 102
4d7b68d1 103 Look at the detailed description of wxPickerBase for more info.
23324ae1
FM
104 */
105 void SetPickerCtrlProportion(int prop);
106
107 /**
108 Sets the text control as growable when @c grow is @true.
74bf4e64 109
23324ae1
FM
110 This function can be used only when HasTextCtrl() returns @true.
111 */
4cc4bfaf 112 void SetTextCtrlGrowable(bool grow = true);
23324ae1
FM
113
114 /**
115 Sets the proportion value of the text control.
74bf4e64 116
4d7b68d1
FM
117 Look at the detailed description of wxPickerBase for more info.
118
23324ae1
FM
119 This function can be used only when HasTextCtrl() returns @true.
120 */
121 void SetTextCtrlProportion(int prop);
122};
e54c96f1 123