2008-09-12 16:57:41 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: propgrid.h
|
|
|
|
// Purpose: interface of wxPropertyGrid
|
|
|
|
// Author: wxWidgets team
|
2008-10-06 11:14:06 -04:00
|
|
|
// RCS-ID: $Id$
|
2008-09-12 16:57:41 -04:00
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
@section propgrid_window_styles wxPropertyGrid Window Styles
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
SetWindowStyleFlag method can be used to modify some of these at run-time.
|
|
|
|
@{
|
|
|
|
*/
|
|
|
|
enum wxPG_WINDOW_STYLES
|
|
|
|
{
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
This will cause Sort() automatically after an item is added.
|
2008-09-12 16:57:41 -04:00
|
|
|
When inserting a lot of items in this mode, it may make sense to
|
|
|
|
use Freeze() before operations and Thaw() afterwards to increase
|
|
|
|
performance.
|
|
|
|
*/
|
|
|
|
wxPG_AUTO_SORT = 0x00000010,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Categories are not initially shown (even if added).
|
2008-09-12 16:57:41 -04:00
|
|
|
IMPORTANT NOTE: If you do not plan to use categories, then this
|
|
|
|
style will waste resources.
|
|
|
|
This flag can also be changed using wxPropertyGrid::EnableCategories method.
|
|
|
|
*/
|
|
|
|
wxPG_HIDE_CATEGORIES = 0x00000020,
|
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
2008-09-29 12:07:00 -04:00
|
|
|
This style combines non-categoric mode and automatic sorting.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_ALPHABETIC_MODE = (wxPG_HIDE_CATEGORIES|wxPG_AUTO_SORT),
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Modified values are shown in bold font. Changing this requires Refresh()
|
2008-09-12 16:57:41 -04:00
|
|
|
to show changes.
|
|
|
|
*/
|
|
|
|
wxPG_BOLD_MODIFIED = 0x00000040,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
When wxPropertyGrid is resized, splitter moves to the center. This
|
2008-09-12 16:57:41 -04:00
|
|
|
behavior stops once the user manually moves the splitter.
|
|
|
|
*/
|
|
|
|
wxPG_SPLITTER_AUTO_CENTER = 0x00000080,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Display tool tips for cell text that cannot be shown completely. If
|
2008-09-12 16:57:41 -04:00
|
|
|
wxUSE_TOOLTIPS is 0, then this doesn't have any effect.
|
|
|
|
*/
|
|
|
|
wxPG_TOOLTIPS = 0x00000100,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Disables margin and hides all expand/collapse buttons that would appear
|
2008-09-12 16:57:41 -04:00
|
|
|
outside the margin (for sub-properties). Toggling this style automatically
|
|
|
|
expands all collapsed items.
|
|
|
|
*/
|
|
|
|
wxPG_HIDE_MARGIN = 0x00000200,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
This style prevents user from moving the splitter.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_STATIC_SPLITTER = 0x00000400,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Combination of other styles that make it impossible for user to modify
|
2008-09-12 16:57:41 -04:00
|
|
|
the layout.
|
|
|
|
*/
|
|
|
|
wxPG_STATIC_LAYOUT = (wxPG_HIDE_MARGIN|wxPG_STATIC_SPLITTER),
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Disables wxTextCtrl based editors for properties which
|
|
|
|
can be edited in another way. Equals calling
|
|
|
|
wxPropertyGrid::LimitPropertyEditing() for all added properties.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_LIMITED_EDITING = 0x00000800,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
wxPropertyGridManager only: Show tool bar for mode and page selection.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPG_TOOLBAR = 0x00001000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
wxPropertyGridManager only: Show adjustable text box showing description
|
2008-09-12 16:57:41 -04:00
|
|
|
or help text, if available, for currently selected property.
|
|
|
|
*/
|
|
|
|
wxPG_DESCRIPTION = 0x00002000
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum wxPG_EX_WINDOW_STYLES
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
NOTE: wxPG_EX_xxx are extra window styles and must be set using SetExtraStyle()
|
|
|
|
member function.
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
Speeds up switching to wxPG_HIDE_CATEGORIES mode. Initially, if
|
|
|
|
wxPG_HIDE_CATEGORIES is not defined, the non-categorized data storage is not
|
|
|
|
activated, and switching the mode first time becomes somewhat slower.
|
|
|
|
wxPG_EX_INIT_NOCAT activates the non-categorized data storage right away.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
NOTE: If you do plan not switching to non-categoric mode, or if
|
|
|
|
you don't plan to use categories at all, then using this style will result
|
|
|
|
in waste of resources.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_EX_INIT_NOCAT = 0x00001000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Extended window style that sets wxPropertyGridManager tool bar to not
|
2008-09-12 16:57:41 -04:00
|
|
|
use flat style.
|
|
|
|
*/
|
|
|
|
wxPG_EX_NO_FLAT_TOOLBAR = 0x00002000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Shows alphabetic/categoric mode buttons from tool bar.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_EX_MODE_BUTTONS = 0x00008000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Show property help strings as tool tips instead as text on the status bar.
|
2008-09-12 16:57:41 -04:00
|
|
|
You can set the help strings using SetPropertyHelpString member function.
|
|
|
|
*/
|
|
|
|
wxPG_EX_HELP_AS_TOOLTIPS = 0x00010000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Allows relying on native double-buffering.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_EX_NATIVE_DOUBLE_BUFFERING = 0x00080000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Set this style to let user have ability to set values of properties to
|
2008-09-12 16:57:41 -04:00
|
|
|
unspecified state. Same as setting wxPG_PROP_AUTO_UNSPECIFIED for
|
|
|
|
all properties.
|
|
|
|
*/
|
|
|
|
wxPG_EX_AUTO_UNSPECIFIED_VALUES = 0x00200000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
If this style is used, built-in attributes (such as wxPG_FLOAT_PRECISION and
|
|
|
|
wxPG_STRING_PASSWORD) are not stored into property's attribute storage (thus
|
|
|
|
they are not readable).
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
Note that this option is global, and applies to all wxPG property containers.
|
|
|
|
*/
|
|
|
|
wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES = 0x00400000,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Hides page selection buttons from tool bar.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_EX_HIDE_PAGE_BUTTONS = 0x01000000
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Combines various styles.
|
|
|
|
*/
|
|
|
|
#define wxPG_DEFAULT_STYLE (0)
|
|
|
|
|
|
|
|
/** Combines various styles.
|
|
|
|
*/
|
|
|
|
#define wxPGMAN_DEFAULT_STYLE (0)
|
|
|
|
|
|
|
|
/** @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
@section propgrid_vfbflags wxPropertyGrid Validation Failure Behavior Flags
|
2008-09-12 16:57:41 -04:00
|
|
|
@{
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS
|
|
|
|
{
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Prevents user from leaving property unless value is valid. If this
|
2008-09-12 16:57:41 -04:00
|
|
|
behavior flag is not used, then value change is instead cancelled.
|
|
|
|
*/
|
|
|
|
wxPG_VFB_STAY_IN_PROPERTY = 0x01,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Calls wxBell() on validation failure.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_VFB_BEEP = 0x02,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Cell with invalid value will be marked (with red colour).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_VFB_MARK_CELL = 0x04,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Display customizable text message explaining the situation.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPG_VFB_SHOW_MESSAGE = 0x08,
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Defaults.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPG_VFB_DEFAULT = wxPG_VFB_STAY_IN_PROPERTY|wxPG_VFB_BEEP,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef wxByte wxPGVFBFlags;
|
|
|
|
|
2008-09-29 12:23:38 -04:00
|
|
|
/**
|
|
|
|
wxPGValidationInfo
|
|
|
|
|
|
|
|
Used to convey validation information to and from functions that
|
2008-10-22 16:48:31 -04:00
|
|
|
actually perform validation. Mostly used in custom property classes.
|
2008-09-29 12:23:38 -04:00
|
|
|
*/
|
|
|
|
class wxPGValidationInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
@return Returns failure behavior which is a combination of
|
2008-10-22 16:48:31 -04:00
|
|
|
@ref propgrid_vfbflags.
|
2008-09-29 12:23:38 -04:00
|
|
|
*/
|
|
|
|
wxPGVFBFlags GetFailureBehavior();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns current failure message.
|
|
|
|
*/
|
|
|
|
const wxString& GetFailureMessage() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns reference to pending value.
|
|
|
|
*/
|
|
|
|
const wxVariant& GetValue() const;
|
|
|
|
|
|
|
|
/** Set validation failure behavior
|
|
|
|
|
|
|
|
@param failureBehavior
|
|
|
|
Mixture of @ref propgrid_vfbflags.
|
|
|
|
*/
|
|
|
|
void SetFailureBehavior(wxPGVFBFlags failureBehavior);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set current failure message.
|
|
|
|
*/
|
|
|
|
void SetFailureMessage(const wxString& message);
|
|
|
|
};
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
@section propgrid_keyboard_actions wxPropertyGrid Action Identifiers
|
2008-10-22 16:48:31 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
These are used with wxPropertyGrid::AddActionTrigger() and
|
|
|
|
wxPropertyGrid::ClearActionTriggers().
|
2008-09-12 16:57:41 -04:00
|
|
|
@{
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum wxPG_KEYBOARD_ACTIONS
|
|
|
|
{
|
|
|
|
wxPG_ACTION_INVALID = 0,
|
|
|
|
wxPG_ACTION_NEXT_PROPERTY,
|
|
|
|
wxPG_ACTION_PREV_PROPERTY,
|
|
|
|
wxPG_ACTION_EXPAND_PROPERTY,
|
|
|
|
wxPG_ACTION_COLLAPSE_PROPERTY,
|
|
|
|
wxPG_ACTION_CANCEL_EDIT,
|
|
|
|
wxPG_ACTION_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @}
|
|
|
|
*/
|
|
|
|
|
2009-01-07 13:53:09 -05:00
|
|
|
/** This callback function is used for sorting properties.
|
|
|
|
|
|
|
|
Call wxPropertyGrid::SetSortFunction() to set it.
|
|
|
|
|
|
|
|
Sort function should return a value greater than 0 if position of p1 is
|
|
|
|
after p2. So, for instance, when comparing property names, you can use
|
|
|
|
following implementation:
|
|
|
|
|
|
|
|
@code
|
|
|
|
int MyPropertySortFunction(wxPropertyGrid* propGrid,
|
|
|
|
wxPGProperty* p1,
|
|
|
|
wxPGProperty* p2)
|
|
|
|
{
|
|
|
|
return p1->GetBaseName().compare( p2->GetBaseName() );
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
*/
|
|
|
|
typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid,
|
|
|
|
wxPGProperty* p1,
|
|
|
|
wxPGProperty* p2);
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
|
|
|
@class wxPropertyGrid
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
wxPropertyGrid is a specialized grid for editing properties - in other
|
2008-09-21 10:13:32 -04:00
|
|
|
words name = value pairs. List of ready-to-use property classes include
|
2008-09-29 12:07:00 -04:00
|
|
|
strings, numbers, flag sets, fonts, colours and many others. It is possible,
|
2008-09-21 10:13:32 -04:00
|
|
|
for example, to categorize properties, set up a complete tree-hierarchy,
|
|
|
|
add more than two columns, and set arbitrary per-property attributes.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
Please note that most member functions are inherited and as such not
|
|
|
|
documented on this page. This means you will probably also want to read
|
|
|
|
wxPropertyGridInterface class reference.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
See also @ref overview_propgrid.
|
|
|
|
|
|
|
|
@section propgrid_window_styles_ Window Styles
|
|
|
|
|
|
|
|
See @ref propgrid_window_styles.
|
|
|
|
|
|
|
|
@section propgrid_event_handling Event Handling
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
To process input from a property grid control, use these event handler macros
|
|
|
|
to direct input to member functions that take a wxPropertyGridEvent argument.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxPropertyGridEvent}
|
2008-09-12 16:57:41 -04:00
|
|
|
@event{EVT_PG_SELECTED (id, func)}
|
|
|
|
Respond to wxEVT_PG_SELECTED event, generated when property value
|
|
|
|
has been changed by user.
|
|
|
|
@event{EVT_PG_CHANGING(id, func)}
|
|
|
|
Respond to wxEVT_PG_CHANGING event, generated when property value
|
|
|
|
is about to be changed by user. Use wxPropertyGridEvent::GetValue()
|
|
|
|
to take a peek at the pending value, and wxPropertyGridEvent::Veto()
|
|
|
|
to prevent change from taking place, if necessary.
|
|
|
|
@event{EVT_PG_HIGHLIGHTED(id, func)}
|
|
|
|
Respond to wxEVT_PG_HIGHLIGHTED event, which occurs when mouse
|
|
|
|
moves over a property. Event's property is NULL if hovered area does
|
|
|
|
not belong to any property.
|
|
|
|
@event{EVT_PG_RIGHT_CLICK(id, func)}
|
|
|
|
Respond to wxEVT_PG_RIGHT_CLICK event, which occurs when property is
|
|
|
|
clicked on with right mouse button.
|
|
|
|
@event{EVT_PG_DOUBLE_CLICK(id, func)}
|
|
|
|
Respond to wxEVT_PG_DOUBLE_CLICK event, which occurs when property is
|
2008-09-29 12:07:00 -04:00
|
|
|
double-clicked on with left mouse button.
|
2008-09-12 16:57:41 -04:00
|
|
|
@event{EVT_PG_ITEM_COLLAPSED(id, func)}
|
|
|
|
Respond to wxEVT_PG_ITEM_COLLAPSED event, generated when user collapses
|
2008-09-29 12:07:00 -04:00
|
|
|
a property or category.
|
2008-09-12 16:57:41 -04:00
|
|
|
@event{EVT_PG_ITEM_EXPANDED(id, func)}
|
|
|
|
Respond to wxEVT_PG_ITEM_EXPANDED event, generated when user expands
|
2008-09-29 12:07:00 -04:00
|
|
|
a property or category.
|
2008-09-12 16:57:41 -04:00
|
|
|
@endEventTable
|
|
|
|
|
|
|
|
@remarks
|
2008-10-22 16:48:31 -04:00
|
|
|
Use Freeze() and Thaw() respectively to disable and enable drawing.
|
|
|
|
This will also delay sorting etc. miscellaneous calculations to the last
|
|
|
|
possible moment.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
@library{wxpropgrid}
|
|
|
|
@category{propgrid}
|
2008-10-15 05:49:58 -04:00
|
|
|
@appearance{propertygrid.png}
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
class wxPropertyGrid : public wxScrolledWindow, public wxPropertyGridInterface
|
|
|
|
{
|
|
|
|
public:
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
|
|
|
Two step constructor.
|
|
|
|
Call Create() when this constructor is called to build up the wxPropertyGrid
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPropertyGrid();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
2008-10-22 16:48:31 -04:00
|
|
|
Constructor.
|
|
|
|
The styles to be used are styles valid for the wxWindow and wxScrolledWindow.
|
2008-09-29 12:07:00 -04:00
|
|
|
|
|
|
|
@see @ref propgrid_window_styles.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY,
|
2008-10-22 16:48:31 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxPG_DEFAULT_STYLE,
|
|
|
|
const wxChar* name = wxPropertyGridNameStr );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
/** Destructor */
|
|
|
|
virtual ~wxPropertyGrid();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Adds given key combination to trigger given action.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param action
|
2008-09-29 12:07:00 -04:00
|
|
|
Which action to trigger. See @ref propgrid_keyboard_actions.
|
|
|
|
@param keycode
|
|
|
|
Which keycode triggers the action.
|
|
|
|
@param modifiers
|
|
|
|
Which key event modifiers, in addition to keycode, are needed to
|
|
|
|
trigger the action.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void AddActionTrigger( int action, int keycode, int modifiers = 0 );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
This static function enables or disables automatic use of
|
|
|
|
wxGetTranslation() for following strings: wxEnumProperty list labels,
|
|
|
|
wxFlagsProperty child property labels.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
Default is false.
|
|
|
|
*/
|
|
|
|
static void AutoGetTranslation( bool enable );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Changes value of a property, as if from an editor. Use this instead of
|
|
|
|
SetPropertyValue() if you need the value to run through validation
|
|
|
|
process, and also send the property change event.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@return Returns true if value was successfully changed.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Centers the splitter. If argument is true, automatic splitter centering
|
|
|
|
is enabled (only applicable if style wxPG_SPLITTER_AUTO_CENTER was
|
|
|
|
defined).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void CenterSplitter( bool enable_auto_centering = false );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Deletes all properties.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual void Clear();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Clears action triggers for given action.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param action
|
2008-09-29 12:07:00 -04:00
|
|
|
Which action to trigger. @ref propgrid_keyboard_actions.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void ClearActionTriggers( int action );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Forces updating the value of property from the editor control.
|
|
|
|
Note that wxEVT_PG_CHANGING and wxEVT_PG_CHANGED are dispatched using
|
|
|
|
ProcessEvent, meaning your event handlers will be called immediately.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@return Returns @true if anything was changed.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual bool CommitChangesFromEditor( wxUint32 flags = 0 );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Two step creation. Whenever the control is created without any
|
|
|
|
parameters, use Create to actually create it. Don't access the control's
|
|
|
|
public methods before this is called
|
|
|
|
|
|
|
|
@see @ref propgrid_window_styles.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
|
2008-10-22 16:48:31 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxPG_DEFAULT_STYLE,
|
|
|
|
const wxChar* name = wxPropertyGridNameStr );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Enables or disables (shows/hides) categories according to parameter
|
|
|
|
enable.
|
2008-11-06 13:05:09 -05:00
|
|
|
|
|
|
|
@remarks This functions deselects selected property, if any. Validation
|
|
|
|
failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie.
|
|
|
|
selection is cleared even if editor had invalid value.
|
2008-09-29 12:07:00 -04:00
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
bool EnableCategories( bool enable );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Scrolls and/or expands items to ensure that the given item is visible.
|
|
|
|
|
|
|
|
@return Returns @true if something was actually done.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool EnsureVisible( wxPGPropArg id );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Reduces column sizes to minimum possible, while still retaining
|
|
|
|
fully visible grid contents (labels, images).
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@return Minimum size for the grid to still display everything.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@remarks Does not work well with wxPG_SPLITTER_AUTO_CENTER window style.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
This function only works properly if grid size prior to call was
|
|
|
|
already fairly large.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
Note that you can also get calculated column widths by calling
|
|
|
|
GetState->GetColumnWidth() immediately after this function
|
|
|
|
returns.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxSize FitColumns();
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns wxWindow that the properties are painted on, and which should be
|
|
|
|
used as the parent for editor controls.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxPanel* GetPanel() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current category caption background colour.
|
|
|
|
*/
|
|
|
|
wxColour GetCaptionBackgroundColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current category caption font.
|
|
|
|
*/
|
|
|
|
wxFont& GetCaptionFont();
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current category caption text colour.
|
|
|
|
*/
|
|
|
|
wxColour GetCaptionForegroundColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current cell background colour.
|
|
|
|
*/
|
|
|
|
wxColour GetCellBackgroundColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current cell text colour when disabled.
|
|
|
|
*/
|
|
|
|
wxColour GetCellDisabledTextColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current cell text colour.
|
|
|
|
*/
|
|
|
|
wxColour GetCellTextColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns number of columns currently on grid.
|
|
|
|
*/
|
2008-10-12 08:23:48 -04:00
|
|
|
unsigned int GetColumnCount() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns colour of empty space below properties.
|
|
|
|
*/
|
|
|
|
wxColour GetEmptySpaceColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns height of highest characters of used font.
|
|
|
|
*/
|
|
|
|
int GetFontHeight() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns pointer to itself. Dummy function that enables same kind
|
2008-09-12 16:57:41 -04:00
|
|
|
of code to use wxPropertyGrid and wxPropertyGridManager.
|
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxPropertyGrid* GetGrid();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns rectangle of custom paint image.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@param property
|
|
|
|
Return image rectangle for this property.
|
|
|
|
|
|
|
|
@param item
|
|
|
|
Which choice of property to use (each choice may have
|
|
|
|
different image).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxRect GetImageRect( wxPGProperty* property, int item ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns size of the custom paint image in front of property.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@param property
|
|
|
|
Return image rectangle for this property.
|
|
|
|
If this argument is NULL, then preferred size is returned.
|
|
|
|
|
|
|
|
@param item
|
|
|
|
Which choice of property to use (each choice may have
|
|
|
|
different image).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxSize GetImageSize( wxPGProperty* property = NULL, int item = -1 ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns last item which could be iterated using given flags.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
@param flags
|
2008-09-29 12:07:00 -04:00
|
|
|
See @ref propgrid_iterator_flags.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns colour of lines between cells.
|
|
|
|
*/
|
|
|
|
wxColour GetLineColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns background colour of margin.
|
|
|
|
*/
|
|
|
|
wxColour GetMarginColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns "root property". It does not have name, etc. and it is not
|
2008-09-12 16:57:41 -04:00
|
|
|
visible. It is only useful for accessing its children.
|
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxPGProperty* GetRoot() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns height of a single grid row (in pixels).
|
|
|
|
*/
|
|
|
|
int GetRowHeight() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns currently selected property.
|
|
|
|
*/
|
|
|
|
wxPGProperty* GetSelectedProperty() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns currently selected property.
|
|
|
|
*/
|
|
|
|
wxPGProperty* GetSelection() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current selection background colour.
|
|
|
|
*/
|
|
|
|
wxColour GetSelectionBackgroundColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current selection text colour.
|
|
|
|
*/
|
|
|
|
wxColour GetSelectionForegroundColour() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2009-01-07 13:53:09 -05:00
|
|
|
/**
|
|
|
|
Returns the property sort function (default is @NULL).
|
|
|
|
|
|
|
|
@see SetSortFunction
|
|
|
|
*/
|
|
|
|
wxPGSortCallback GetSortFunction() const;
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current splitter x position.
|
|
|
|
*/
|
|
|
|
int GetSplitterPosition() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns wxTextCtrl active in currently selected property, if any. Takes
|
|
|
|
wxOwnerDrawnComboBox into account.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxTextCtrl* GetEditorTextCtrl() const;
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current vertical spacing.
|
|
|
|
*/
|
2008-10-22 16:48:31 -04:00
|
|
|
int GetVerticalSpacing() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns information about arbitrary position in the grid.
|
2009-02-13 11:15:12 -05:00
|
|
|
|
|
|
|
@param pt
|
2009-02-14 03:48:46 -05:00
|
|
|
Coordinates in the virtual grid space. You may need to use
|
|
|
|
wxScrolledWindow::CalcScrolledPosition() for translating
|
|
|
|
wxPropertyGrid client coordinates into something this member
|
|
|
|
function can use.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const;
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns true if any property has been modified by the user.
|
|
|
|
*/
|
|
|
|
bool IsAnyModified() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2009-02-26 14:00:46 -05:00
|
|
|
/**
|
|
|
|
Returns @true if a property editor control has focus.
|
|
|
|
*/
|
|
|
|
bool IsEditorFocused() const;
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns true if updating is frozen (ie. Freeze() called but not
|
|
|
|
yet Thaw() ).
|
|
|
|
*/
|
|
|
|
bool IsFrozen() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2009-06-10 16:36:56 -04:00
|
|
|
/**
|
2009-06-22 13:02:53 -04:00
|
|
|
It is recommended that you call this function any time your code causes
|
|
|
|
wxPropertyGrid's top-level parent to change. wxPropertyGrid's OnIdle()
|
|
|
|
handler should be able to detect most changes, but it is not perfect.
|
2009-06-10 16:36:56 -04:00
|
|
|
|
|
|
|
@param newTLP
|
|
|
|
New top-level parent that is about to be set. Old top-level parent
|
|
|
|
window should still exist as the current one.
|
|
|
|
|
|
|
|
@remarks This function is automatically called from wxPropertyGrid::
|
|
|
|
Reparent() and wxPropertyGridManager::Reparent(). You only
|
|
|
|
need to use it if you reparent wxPropertyGrid indirectly.
|
|
|
|
*/
|
|
|
|
void OnTLPChanging( wxWindow* newTLP );
|
|
|
|
|
2008-12-26 13:46:08 -05:00
|
|
|
/**
|
|
|
|
Refreshes any active editor control.
|
|
|
|
*/
|
|
|
|
void RefreshEditor();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Redraws given property.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual void RefreshProperty( wxPGProperty* p );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Registers a new editor class.
|
|
|
|
|
|
|
|
@return Returns pointer to the editor class instance that should be used.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
static wxPGEditor* RegisterEditorClass( wxPGEditor* editor,
|
|
|
|
const wxString& name,
|
2008-09-12 16:57:41 -04:00
|
|
|
bool noDefCheck = false );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Resets all colours to the original system values.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void ResetColours();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Selects a property. Editor widget is automatically created, but
|
|
|
|
not focused unless focus is true. This will generate wxEVT_PG_SELECT
|
|
|
|
event.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param id
|
2008-09-29 12:07:00 -04:00
|
|
|
Property to select (name or pointer).
|
|
|
|
|
|
|
|
@param focus
|
|
|
|
If @true, move keyboard focus to the created editor right away.
|
|
|
|
|
|
|
|
@return returns @true if selection finished successfully. Usually only
|
|
|
|
fails if current value in editor is not valid.
|
|
|
|
|
|
|
|
@see wxPropertyGrid::ClearSelection()
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
bool SelectProperty( wxPGPropArg id, bool focus = false );
|
|
|
|
|
|
|
|
/**
|
|
|
|
Changes keyboard shortcut to push the editor button.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@remarks You can set default with keycode 0. Good value for the platform
|
|
|
|
is guessed, but don't expect it to be very accurate.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetButtonShortcut( int keycode, bool ctrlDown = false, bool altDown = false );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets category caption background colour.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetCaptionBackgroundColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets category caption text colour.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetCaptionTextColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets default cell background colour - applies to property cells.
|
2008-09-12 16:57:41 -04:00
|
|
|
Note that appearance of editor widgets may not be affected.
|
|
|
|
*/
|
|
|
|
void SetCellBackgroundColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets cell text colour for disabled properties.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetCellDisabledTextColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets default cell text colour - applies to property name and value text.
|
2008-09-12 16:57:41 -04:00
|
|
|
Note that appearance of editor widgets may not be affected.
|
|
|
|
*/
|
|
|
|
void SetCellTextColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Set number of columns (2 or more).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
void SetColumnCount( int colCount );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets the 'current' category - Append will add non-category properties
|
|
|
|
under it.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetCurrentCategory( wxPGPropArg id );
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets colour of empty space below properties.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetEmptySpaceColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets colour of lines between cells.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetLineColour(const wxColour& col);
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets background colour of margin.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetMarginColour(const wxColour& col);
|
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
|
|
|
Sets selection background colour - applies to selected property name
|
|
|
|
background.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetSelectionBackgroundColour(const wxColour& col);
|
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
|
|
|
Sets selection foreground colour - applies to selected property name text.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
void SetSelectionTextColour(const wxColour& col);
|
|
|
|
|
2009-01-07 13:53:09 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the property sorting function.
|
|
|
|
|
|
|
|
@param sortFunction
|
|
|
|
The sorting function to be used. It should return a value greater
|
|
|
|
than 0 if position of p1 is after p2. So, for instance, when
|
|
|
|
comparing property names, you can use following implementation:
|
|
|
|
|
|
|
|
@code
|
|
|
|
int MyPropertySortFunction(wxPropertyGrid* propGrid,
|
|
|
|
wxPGProperty* p1,
|
|
|
|
wxPGProperty* p2)
|
|
|
|
{
|
|
|
|
return p1->GetBaseName().compare( p2->GetBaseName() );
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@remarks
|
|
|
|
Default property sort function sorts properties by their labels
|
|
|
|
(case-insensitively).
|
|
|
|
|
|
|
|
@see GetSortFunction, wxPropertyGridInterface::Sort,
|
|
|
|
wxPropertyGridInterface::SortChildren
|
|
|
|
*/
|
|
|
|
void SetSortFunction( wxPGSortCallback sortFunction );
|
|
|
|
|
2008-10-22 16:48:31 -04:00
|
|
|
/**
|
|
|
|
Sets x coordinate of the splitter.
|
2008-09-29 12:07:00 -04:00
|
|
|
|
|
|
|
@remarks Splitter position cannot exceed grid size, and therefore setting
|
|
|
|
it during form creation may fail as initial grid size is often
|
|
|
|
smaller than desired splitter position, especially when sizers
|
|
|
|
are being used.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
void SetSplitterPosition( int newxpos, int col = 0 );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Moves splitter as left as possible, while still allowing all
|
2008-09-12 16:57:41 -04:00
|
|
|
labels to be shown in full.
|
2008-09-29 12:07:00 -04:00
|
|
|
|
|
|
|
@param privateChildrenToo
|
|
|
|
If @false, will still allow private children to be cropped.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-10-22 16:48:31 -04:00
|
|
|
void SetSplitterLeft( bool privateChildrenToo = false );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font
|
2008-09-12 16:57:41 -04:00
|
|
|
height. Value of 2 should be default on most platforms.
|
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
void SetVerticalSpacing( int vspacing );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2009-07-11 04:16:04 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
@name Property development functions
|
|
|
|
|
|
|
|
These member functions are usually only called when creating custom
|
|
|
|
user properties.
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
|
|
|
Call when editor widget's contents is modified. For example, this is
|
|
|
|
called when changes text in wxTextCtrl (used in wxStringProperty and
|
|
|
|
wxIntProperty).
|
|
|
|
|
|
|
|
@remarks This function should only be called by custom properties.
|
|
|
|
|
|
|
|
@see wxPGProperty::OnEvent()
|
|
|
|
*/
|
|
|
|
void EditorsValueWasModified();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Reverse of EditorsValueWasModified().
|
|
|
|
|
|
|
|
@remarks This function should only be called by custom properties.
|
|
|
|
*/
|
|
|
|
void EditorsValueWasNotModified();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns most up-to-date value of selected property. This will return
|
|
|
|
value different from GetSelectedProperty()->GetValue() only when text
|
|
|
|
editor is activate and string edited by user represents valid,
|
|
|
|
uncommitted property value.
|
|
|
|
*/
|
|
|
|
wxVariant GetUncommittedPropertyValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns true if editor's value was marked modified.
|
|
|
|
*/
|
|
|
|
bool IsEditorsValueModified() const;
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Shows an brief error message that is related to a property.
|
|
|
|
*/
|
|
|
|
void ShowPropertyError( wxPGPropArg id, const wxString& msg );
|
2009-07-11 03:59:59 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
You can use this member function, for instance, to detect in
|
|
|
|
wxPGProperty::OnEvent() if wxPGProperty::SetValueInEvent() was
|
|
|
|
already called in wxPGEditor::OnEvent(). It really only detects
|
|
|
|
if was value was changed using wxPGProperty::SetValueInEvent(), which
|
|
|
|
is usually used when a 'picker' dialog is displayed. If value was
|
|
|
|
written by "normal means" in wxPGProperty::StringToValue() or
|
|
|
|
IntToValue(), then this function will return false (on the other hand,
|
|
|
|
wxPGProperty::OnEvent() is not even called in those cases).
|
|
|
|
*/
|
|
|
|
bool WasValueChangedInEvent() const;
|
2009-07-11 04:16:04 -04:00
|
|
|
|
|
|
|
//@}
|
2008-09-12 16:57:41 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
@class wxPropertyGridEvent
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
A property grid event holds information about events associated with
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPropertyGrid objects.
|
|
|
|
|
|
|
|
@library{wxpropgrid}
|
|
|
|
@category{propgrid}
|
|
|
|
*/
|
|
|
|
class wxPropertyGridEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/** Constructor. */
|
|
|
|
wxPropertyGridEvent(wxEventType commandType=0, int id=0);
|
|
|
|
|
|
|
|
/** Copy constructor. */
|
|
|
|
wxPropertyGridEvent(const wxPropertyGridEvent& event);
|
|
|
|
|
|
|
|
/** Destructor. */
|
|
|
|
~wxPropertyGridEvent();
|
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns true if you can veto the action that the event is signaling.
|
|
|
|
*/
|
2008-10-22 16:48:31 -04:00
|
|
|
bool CanVeto() const;
|
2008-09-29 12:07:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns highest level non-category, non-root parent of property for
|
|
|
|
which event occurred. Useful when you have nested properties with
|
|
|
|
children.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@remarks If immediate parent is root or category, this will return the
|
|
|
|
property itself.
|
|
|
|
*/
|
|
|
|
wxPGProperty* GetMainParent() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns property associated with this event.
|
|
|
|
*/
|
|
|
|
wxPGProperty* GetProperty() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns current validation failure flags.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
wxPGVFBFlags GetValidationFailureBehavior() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns value that is about to be set for wxEVT_PG_CHANGING.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
const wxVariant& GetValue() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Set if event can be vetoed.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
void SetCanVeto( bool canVeto );
|
2008-10-22 16:48:31 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/** Changes the property associated with this event. */
|
|
|
|
void SetProperty( wxPGProperty* p );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Set override validation failure behavior. Only effective if Veto() was
|
|
|
|
also called, and only allowed if event type is wxEVT_PG_CHANGING.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-29 12:23:38 -04:00
|
|
|
void SetValidationFailureBehavior( wxPGVFBFlags flags );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Sets custom failure message for this time only. Only applies if
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPG_VFB_SHOW_MESSAGE is set in validation failure flags.
|
|
|
|
*/
|
2008-09-29 12:07:00 -04:00
|
|
|
void SetValidationFailureMessage( const wxString& message );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Call this from your event handler to veto action that the event is
|
|
|
|
signaling. You can only veto a shutdown if wxPropertyGridEvent::CanVeto()
|
|
|
|
returns true.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
@remarks Currently only wxEVT_PG_CHANGING supports vetoing.
|
|
|
|
*/
|
|
|
|
void Veto( bool veto = true );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-29 12:07:00 -04:00
|
|
|
/**
|
|
|
|
Returns @true if event was vetoed.
|
|
|
|
*/
|
|
|
|
bool WasVetoed() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
};
|