2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: pickerbase.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxPickerBase
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPickerBase
|
|
|
|
@wxheader{pickerbase.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Base abstract class for all pickers which support an auxiliary text control.
|
|
|
|
This class handles all positioning and sizing of the text control like a
|
|
|
|
an horizontal wxBoxSizer would do, with the text control on
|
|
|
|
the left of the picker button.
|
|
|
|
The proportion (see wxSizer documentation for more info about
|
|
|
|
proportion values) of the picker control defaults to 1 when there isn't a text
|
|
|
|
control
|
|
|
|
associated (see @c wxPB_USE_TEXTCTRL style) and to 0 otherwise.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
|
|
|
@style{wxPB_USE_TEXTCTRL}:
|
|
|
|
Creates a text control to the left of the picker which is
|
|
|
|
completely managed by this wxPickerBase class.
|
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{FIXME}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxColourPickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxPickerBase : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Returns the margin (in pixel) between the picker and the text control.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
int GetInternalMargin() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the proportion value of the picker.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
int GetPickerCtrlProportion() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the text control handled by this window or @NULL if the
|
|
|
|
@b wxPB_USE_TEXTCTRL style was not specified when this control was created.
|
|
|
|
Very important: the contents of the text control could be containing an invalid
|
|
|
|
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).
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxTextCtrl* GetTextCtrl();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the proportion value of the text control.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
int GetTextCtrlProportion() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this window has a valid text control (i.e. if the @b
|
|
|
|
wxPB_USE_TEXTCTRL style was
|
|
|
|
given when creating this control).
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool HasTextCtrl() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the picker control is growable.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsPickerCtrlGrowable() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the text control is growable.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsTextCtrlGrowable() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the margin (in pixel) between the picker and the text control.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
|
|
|
void SetInternalMargin(int margin);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the picker control as growable when @c grow is @true.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetPickerCtrlGrowable(bool grow = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the proportion value of the picker.
|
|
|
|
Look at the overview of wxPickerBase for more details about this.
|
|
|
|
*/
|
|
|
|
void SetPickerCtrlProportion(int prop);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text control as growable when @c grow is @true.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetTextCtrlGrowable(bool grow = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the proportion value of the text control.
|
|
|
|
Look at the overview of wxPickerBase for more details about this.
|
|
|
|
This function can be used only when HasTextCtrl() returns @true.
|
|
|
|
*/
|
|
|
|
void SetTextCtrlProportion(int prop);
|
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|