#ifndef _WX_PROPGRID_PROPERTY_H_
#define _WX_PROPGRID_PROPERTY_H_
+#include "wx/defs.h"
+
#if wxUSE_PROPGRID
#include "wx/propgrid/propgriddefs.h"
return *this;
}
+ // Used mostly internally to figure out if this cell is supposed
+ // to have default values when attached to a grid.
+ bool IsInvalid() const
+ {
+ return ( m_refData == NULL );
+ }
+
private:
virtual wxObjectRefData *CreateRefData() const
{ return new wxPGCellData(); }
If property is selected, then indicates that validation failed for pending
value.
- If property is not selected, then indicates that the the actual property
- value has failed validation (NB: this behavior is not currently supported,
+ If property is not selected, that indicates that the actual property
+ value has failed validation (NB: this behaviour is not currently supported,
but may be used in future).
*/
wxPG_PROP_INVALID_VALUE = 0x0040,
*/
#define wxPG_FILE_DIALOG_TITLE wxS("DialogTitle")
+/** Specific to wxFileProperty and derivatives, long, default is 0.
+ Sets a specific wxFileDialog style for the file dialog.
+*/
+#define wxPG_FILE_DIALOG_STYLE wxS("DialogStyle")
+
/** Specific to wxDirProperty, wxString, default is empty.
Sets a specific message for the dir dialog.
*/
#define wxPG_DIR_DIALOG_MESSAGE wxS("DialogMessage")
/**
- wxArrayStringProperty's string delimiter character. If this is aquotation
+ wxArrayStringProperty's string delimiter character. If this is a quotation
mark or hyphen, then strings will be quoted instead (with given
character).
#define wxPG_DATE_PICKER_STYLE wxS("PickerStyle")
/** SpinCtrl editor, int or double. How much number changes when button is
- pressed (or up/down on keybard).
+ pressed (or up/down on keyboard).
*/
#define wxPG_ATTR_SPINCTRL_STEP wxS("Step")
*/
#define wxPG_COLOUR_ALLOW_CUSTOM wxS("AllowCustom")
+/**
+ wxColourProperty and its kind: Set to True in order to support editing
+ alpha colour component.
+*/
+#define wxPG_COLOUR_HAS_ALPHA wxS("HasAlpha")
+
/** @}
*/
}
/** Gets a unsigned number identifying this list. */
- wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; };
+ wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; }
const wxString& GetLabel( unsigned int ind ) const
{
You might want to take into account that m_value is Null variant
if property value is unspecified (which is usually only case if
- you explicitly enabled that sort behavior).
+ you explicitly enabled that sort behaviour).
*/
virtual bool StringToValue( wxVariant& variant,
const wxString& text,
instead of OnEvent.
- You might want to take into account that m_value is Null variant if
property value is unspecified (which is usually only case if you
- explicitly enabled that sort behavior).
+ explicitly enabled that sort behaviour).
*/
virtual bool IntToValue( wxVariant& value,
int number,
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
/** Converts string to a value, and if successful, calls SetValue() on it.
- Default behavior is to do nothing.
+ Default behaviour is to do nothing.
@param text
String to get the value from.
@return
*/
bool SetValueFromString( const wxString& text, int flags = wxPG_PROGRAMMATIC_VALUE );
- /** Converts integer to a value, and if succesful, calls SetValue() on it.
- Default behavior is to do nothing.
+ /** Converts integer to a value, and if successful, calls SetValue() on it.
+ Default behaviour is to do nothing.
@param value
Int to get the value from.
@param flags
@param item
Normally -1, but can be an index to the property's list of items.
@remarks
- - Default behavior is to return wxSize(0,0), which means no image.
+ - Default behaviour is to return wxSize(0,0), which means no image.
- Default image width or height is indicated with dimension -1.
- You can also return wxPG_DEFAULT_IMAGE_SIZE, i.e. wxSize(-1, -1).
*/
/**
Called after value of a child property has been altered. Must return
- new value of the whole property (after any alterations warrented by
+ new value of the whole property (after any alterations warranted by
child's new value).
Note that this function is usually called at the time that value of
/** Returns true if property has editable wxTextCtrl when selected.
@remarks
- Altough disabled properties do not displayed editor, they still
+ Although disabled properties do not displayed editor, they still
return True here as being disabled is considered a temporary
condition (unlike being read-only or having limited editing enabled).
*/
modifying the value of the editor control (usually by clearing
it). Currently, this can work with following properties:
wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty.
-
+
@param enable
- Whether to enable or disable this behavior (it is disabled by
+ Whether to enable or disable this behaviour (it is disabled by
default).
*/
void SetAutoUnspecified( bool enable = true )
void InitAfterAdded( wxPropertyGridPageState* pageState,
wxPropertyGrid* propgrid );
+ /**
+ Returns true if child property is selected.
+ */
+ bool IsChildSelected( bool recursive = false ) const;
+
// Removes child property with given pointer. Does not delete it.
void RemoveChild( wxPGProperty* p );
void ClearFlag( FlagType flag ) { m_flags &= ~(flag); }
+ // Called when the property is being removed from the grid and/or
+ // page state (but *not* when it is also deleted).
+ void OnDetached(wxPropertyGridPageState* state,
+ wxPropertyGrid* propgrid);
+
// Call after fixed sub-properties added/removed after creation.
// if oldSelInd >= 0 and < new max items, then selection is
// moved to it.