X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..9a0774600bfb08f46a3e3b9874648027f32e826a:/interface/wx/checkbox.h diff --git a/interface/wx/checkbox.h b/interface/wx/checkbox.h index 82ed45ac9d..ccd199fd37 100644 --- a/interface/wx/checkbox.h +++ b/interface/wx/checkbox.h @@ -3,9 +3,31 @@ // Purpose: interface of wxCheckBox // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/* + * wxCheckBox style flags + * (Using wxCHK_* because wxCB_* is used by wxComboBox). + * Determine whether to use a 3-state or 2-state + * checkbox. 3-state enables to differentiate + * between 'unchecked', 'checked' and 'undetermined'. + * + * In addition to the styles here it is also possible to specify just 0 which + * is treated the same as wxCHK_2STATE for compatibility (but using explicit + * flag is preferred). + */ +#define wxCHK_2STATE 0x4000 +#define wxCHK_3STATE 0x1000 + +/* + * If this style is set the user can set the checkbox to the + * undetermined state. If not set the undetermined set can only + * be set programmatically. + * This style can only be used with 3 state checkboxes. + */ +#define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000 + /** The possible states of a 3-state wxCheckBox (Compatible with the 2-state wxCheckBox). @@ -39,15 +61,15 @@ enum wxCheckBoxState Makes the text appear on the left of the checkbox. @endStyleTable - @beginEventTable{wxCommandEvent} + @beginEventEmissionTable{wxCommandEvent} @event{EVT_CHECKBOX(id, func)} - Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox + Process a @c wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked. @endEventTable @library{wxcore} @category{ctrl} - + @appearance{checkbox.png} @see wxRadioButton, wxCommandEvent */ @@ -71,11 +93,11 @@ public: @param label Text to be displayed next to the checkbox. @param pos - Checkbox position. If wxDefaultPosition is specified then a default - position is chosen. + Checkbox position. + If ::wxDefaultPosition is specified then a default position is chosen. @param size - Checkbox size. If wxDefaultSize is specified then a default size is - chosen. + Checkbox size. + If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxCheckBox. @param validator @@ -90,32 +112,30 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& val = wxDefaultValidator, - const wxString& name = "checkBox"); + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxCheckBoxNameStr); /** Destructor, destroying the checkbox. */ - ~wxCheckBox(); + virtual ~wxCheckBox(); /** Creates the checkbox for two-step construction. See wxCheckBox() for details. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& label, + bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& val = wxDefaultValidator, - const wxString& name = "checkBox"); + const wxSize& size = wxDefaultSize, long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxCheckBoxNameStr); /** Gets the state of a 2-state checkbox. @return Returns @true if it is checked, @false otherwise. */ - bool GetValue() const; + virtual bool GetValue() const; /** Gets the state of a 3-state checkbox. Asserts when the function is used @@ -150,20 +170,20 @@ public: /** Sets the checkbox to the given state. This does not cause a - wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted. + @c wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted. @param state If @true, the check is on, otherwise it is off. */ - void SetValue(bool state); + virtual void SetValue(bool state); /** Sets the checkbox to the given state. This does not cause a - wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted. + @c wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted. Asserts when the checkbox is a 2-state checkbox and setting the state to wxCHK_UNDETERMINED. */ - void Set3StateValue(const wxCheckBoxState state); + void Set3StateValue(wxCheckBoxState state); };