wxPropertyGridManager Class Reference

wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, which can optionally have toolbar for mode and page selection, and help text box. Use window flags to select components to include. More...

#include <manager.h>

Inheritance diagram for wxPropertyGridManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

int AddPage (const wxString &label=wxEmptyString, const wxBitmap &bmp=wxPG_NULL_BITMAP, wxPropertyGridPage *pageObj=(wxPropertyGridPage *) NULL)
bool CanClose ()
virtual void Clear ()
void ClearModifiedStatus ()
void ClearModifiedStatus (wxPGPropArg id)
void ClearPage (int page)
bool ClearSelection ()
bool CommitChangesFromEditor (wxUint32 flags=0)
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxPGMAN_DEFAULT_STYLE, const wxChar *name=wxPropertyGridManagerNameStr)
bool EnableCategories (bool enable)
bool EnsureVisible (wxPGPropArg id)
size_t GetChildrenCount (wxPGPropArg id) const
size_t GetChildrenCount (int pageIndex)
size_t GetChildrenCount ()
int GetColumnCount (int page=-1) const
wxPropertyGridPageGetCurrentPage () const
int GetDescBoxHeight () const
const wxPropertyGridGetGrid () const
wxPropertyGridGetGrid ()
wxPropertyGridConstIterator GetIterator (int flags, int startPos) const
wxPropertyGridIterator GetIterator (int flags, int startPos)
wxPropertyGridConstIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL) const
wxPropertyGridIterator GetIterator (int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL)
wxPGPropertyGetLastChild (wxPGPropArg id)
wxPropertyGridPageGetLastPage () const
wxPropertyGridPageGetPage (const wxString &name) const
wxPropertyGridPageGetPage (unsigned int ind) const
int GetPageByName (const wxString &name) const
int GetPageByState (const wxPropertyGridState *pstate) const
size_t GetPageCount () const
const wxString & GetPageName (int index) const
wxPGPropertyGetPageRoot (int index) const
virtual wxPropertyGridStateGetPageState (int page) const
wxPGPropertyGetPropertyByLabel (const wxString &name, wxPropertyGridState **ppState=(wxPropertyGridState **) NULL) const
wxColour GetPropertyColour (wxPGPropArg id) const
wxColour GetPropertyTextColour (wxPGPropArg id) const
int GetSelectedPage () const
wxPGPropertyGetSelectedProperty () const
int GetSelection () const
wxToolBar * GetToolBar () const
virtual wxPGVIterator GetVIterator (int flags) const
virtual int InsertPage (int index, const wxString &label, const wxBitmap &bmp=wxNullBitmap, wxPropertyGridPage *pageObj=(wxPropertyGridPage *) NULL)
bool IsAnyModified () const
bool IsFrozen () const
bool IsPageModified (size_t index) const
virtual bool IsPropertySelected (wxPGPropArg id) const
virtual void Refresh (bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL)
void RegisterAdvancedPropertyClasses ()
virtual bool RemovePage (int page)
void SelectPage (wxPropertyGridPage *ptr)
void SelectPage (const wxString &label)
void SelectPage (int index)
bool SelectProperty (wxPGPropArg id, bool focus=false)
void SetCaptionTextColour (wxPGPropArg id, const wxColour &col)
void SetColumnCount (int colCount, int page=-1)
void SetDescBoxHeight (int ht, bool refresh=true)
void SetDescription (const wxString &label, const wxString &content)
void SetPageSplitterPosition (int page, int pos, int column=0)
void SetPropertyAttributeAll (const wxString &name, wxVariant value)
void SetPropertyBackgroundColour (wxPGPropArg id, const wxColour &col)
void SetPropertyColourToDefault (wxPGPropArg id)
void SetPropertyTextColour (wxPGPropArg id, const wxColour &col)
void SetSplitterLeft (bool subProps=false, bool allPages=true)
void SetSplitterPosition (int pos, int column=0)
void SetStringSelection (const wxChar *name)
 wxDEPRECATED (void SetTargetPage(const wxChar *))
 wxDEPRECATED (void SetTargetPage(int))
 wxDEPRECATED (void SetPropertyColour(wxPGPropArg id, const wxColour &col))
 wxDEPRECATED (int GetTargetPage() const )
 wxPropertyGridManager (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxPGMAN_DEFAULT_STYLE, const wxChar *name=wxPropertyGridManagerNameStr)
 wxPropertyGridManager ()
virtual ~wxPropertyGridManager ()

Protected Member Functions

virtual wxPropertyGridCreatePropertyGrid () const
virtual void RefreshProperty (wxPGProperty *p)

Friends

class wxPropertyGridPage

Detailed Description

wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, which can optionally have toolbar for mode and page selection, and help text box. Use window flags to select components to include.

Derived from

wxPropertyGridInterface
wxWindow
wxEvtHandler
wxObject

Include files

<wx/propgrid/manager.h>

Window styles

Additional Window Styles

Event handling

To process input from a propertygrid control, use these event handler macros to direct input to member functions that take a wxPropertyGridEvent argument.

EVT_PG_SELECTED (id, func)Property is selected.
EVT_PG_CHANGED (id, func)Property value is modified.
EVT_PG_CHANGING (id, func)Property value is about to be changed. Use wxPropertyGridEvent::GetValue() to take a peek at the pending value.
EVT_PG_HIGHLIGHTED (id, func)Mouse moves over property. Event's property is NULL if hovered on area that is not a property.
EVT_PG_PAGE_CHANGED (id, func)User changed page in manager.
EVT_PG_ITEM_COLLAPSED (id, func)User collapses a property or category.
EVT_PG_ITEM_EXPANDED (id, func)User expands a property or category.
EVT_BUTTON (id, func)Button in a property editor was clicked. Only occurs if the property doesn't handle button clicks itself.
EVT_TEXT (id, func)wxTextCtrl based editor was updated (but property value was not yet modified)
See also:
wxPropertyGridEvent

Definition at line 236 of file manager.h.


Constructor & Destructor Documentation

wxPropertyGridManager::wxPropertyGridManager (  ) 

Two step constructor. Call Create when this constructor is called to build up the wxPropertyGridManager.

wxPropertyGridManager::wxPropertyGridManager ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxPGMAN_DEFAULT_STYLE,
const wxChar *  name = wxPropertyGridManagerNameStr 
)

The default constructor. The styles to be used are styles valid for the wxWindow.

See also:
Additional Window Styles
virtual wxPropertyGridManager::~wxPropertyGridManager (  )  [virtual]

Destructor


Member Function Documentation

int wxPropertyGridManager::AddPage ( const wxString &  label = wxEmptyString,
const wxBitmap &  bmp = wxPG_NULL_BITMAP,
wxPropertyGridPage pageObj = (wxPropertyGridPage*) NULL 
) [inline]

Creates new property page. Note that the first page is not created automatically.

Parameters:
label A label for the page. This may be shown as a toolbar tooltip etc.
bmp Bitmap image for toolbar. If wxNullBitmap is used, then a built-in default image is used.
pageObj wxPropertyGridPage instance. Manager will take ownership of this object. NULL indicates that a default page instance should be created.
Return values:
Returns index to the page created.
Remarks:
If toolbar is used, it is highly recommended that the pages are added when the toolbar is not turned off using window style flag switching.

Definition at line 301 of file manager.h.

bool wxPropertyGridManager::CanClose (  )  [inline]

Returns true if all property grid data changes have been committed. Usually only returns false if value in active editor has been invalidated by a wxValidator.

Definition at line 312 of file manager.h.

virtual void wxPropertyGridManager::Clear (  )  [virtual]

Deletes all all properties and all pages.

Implements wxPropertyGridInterface.

void wxPropertyGridManager::ClearModifiedStatus (  )  [inline]

Definition at line 319 of file manager.h.

void wxPropertyGridManager::ClearModifiedStatus ( wxPGPropArg  id  ) 
void wxPropertyGridManager::ClearPage ( int  page  ) 

Deletes all properties on given page.

bool wxPropertyGridManager::ClearSelection (  )  [inline]

Deselect current selection, if any (from current page).

Return values:
false if editor could not be closed.

Definition at line 733 of file manager.h.

bool wxPropertyGridManager::CommitChangesFromEditor ( wxUint32  flags = 0  )  [inline]

Forces updating the value of property from the editor control. Returns true if DoPropertyChanged was actually called.

Definition at line 335 of file manager.h.

bool wxPropertyGridManager::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxPGMAN_DEFAULT_STYLE,
const wxChar *  name = wxPropertyGridManagerNameStr 
)

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 also:
Additional Window Styles
virtual wxPropertyGrid* wxPropertyGridManager::CreatePropertyGrid (  )  const [protected, virtual]

Creates property grid for the manager. Reimplement in derived class to use subclassed wxPropertyGrid. However, if you you do this, then you must also use two-step construction (ie. default constructor and Create() instead of just constructor with arguments) when creating the manager.

bool wxPropertyGridManager::EnableCategories ( bool  enable  )  [inline]

Enables or disables (shows/hides) categories according to parameter enable. WARNING: Not tested properly, use at your own risk.

Definition at line 354 of file manager.h.

bool wxPropertyGridManager::EnsureVisible ( wxPGPropArg  id  ) 

Selects page, scrolls and/or expands items to ensure that the given item is visible. Returns true if something was actually done.

size_t wxPropertyGridManager::GetChildrenCount ( wxPGPropArg  id  )  const [inline]

Returns number of children for the property.

NB: Cannot be in container methods class due to name hiding.

Definition at line 380 of file manager.h.

size_t wxPropertyGridManager::GetChildrenCount ( int  pageIndex  ) 

Returns number of children of the root property of given page.

size_t wxPropertyGridManager::GetChildrenCount (  )  [inline]

Returns number of children of the root property of the selected page.

Definition at line 368 of file manager.h.

int wxPropertyGridManager::GetColumnCount ( int  page = -1  )  const

Returns number of columns on given page. By the default, returns number of columns on current page.

wxPropertyGridPage* wxPropertyGridManager::GetCurrentPage (  )  const [inline]

Returns currently selected page.

Definition at line 468 of file manager.h.

int wxPropertyGridManager::GetDescBoxHeight (  )  const

Returns height of the description text box.

const wxPropertyGrid* wxPropertyGridManager::GetGrid (  )  const [inline]

Definition at line 403 of file manager.h.

wxPropertyGrid* wxPropertyGridManager::GetGrid (  )  [inline]

Returns pointer to the contained wxPropertyGrid. This does not change after wxPropertyGridManager has been created, so you can safely obtain pointer once and use it for the entire lifetime of the instance.

Definition at line 397 of file manager.h.

wxPropertyGridConstIterator wxPropertyGridManager::GetIterator ( int  flags,
int  startPos 
) const [inline]

Reimplemented from wxPropertyGridInterface.

Definition at line 437 of file manager.h.

wxPropertyGridIterator wxPropertyGridManager::GetIterator ( int  flags,
int  startPos 
) [inline]

Returns iterator class instance.

Remarks:
Calling this method in wxPropertyGridManager causes run-time assertion failure. Please only iterate through individual pages or use CreateVIterator().

Reimplemented from wxPropertyGridInterface.

Definition at line 431 of file manager.h.

wxPropertyGridConstIterator wxPropertyGridManager::GetIterator ( int  flags = wxPG_ITERATE_DEFAULT,
wxPGProperty firstProp = NULL 
) const [inline]

Reimplemented from wxPropertyGridInterface.

Definition at line 420 of file manager.h.

wxPropertyGridIterator wxPropertyGridManager::GetIterator ( int  flags = wxPG_ITERATE_DEFAULT,
wxPGProperty firstProp = NULL 
) [inline]

Returns iterator class instance.

Remarks:
Calling this method in wxPropertyGridManager causes run-time assertion failure. Please only iterate through individual pages or use CreateVIterator().

Reimplemented from wxPropertyGridInterface.

Definition at line 414 of file manager.h.

wxPGProperty* wxPropertyGridManager::GetLastChild ( wxPGPropArg  id  )  [inline]

Returns id of last child of given property.

Deprecated:
Since version 1.3. Use GetPage()->GetIterator() instead.
Remarks:
Returns even sub-properties.

Definition at line 457 of file manager.h.

wxPropertyGridPage* wxPropertyGridManager::GetLastPage (  )  const [inline]

Returns last page.

Definition at line 475 of file manager.h.

wxPropertyGridPage* wxPropertyGridManager::GetPage ( const wxString &  name  )  const [inline]

Returns page object for given page name.

Definition at line 489 of file manager.h.

wxPropertyGridPage* wxPropertyGridManager::GetPage ( unsigned int  ind  )  const [inline]

Returns page object for given page index.

Definition at line 482 of file manager.h.

int wxPropertyGridManager::GetPageByName ( const wxString &  name  )  const

Returns index for a page name. If no match is found, wxNOT_FOUND is returned.

int wxPropertyGridManager::GetPageByState ( const wxPropertyGridState pstate  )  const

Returns index for a relevant propertygrid state. If no match is found, wxNOT_FOUND is returned.

size_t wxPropertyGridManager::GetPageCount (  )  const

Returns number of managed pages.

const wxString& wxPropertyGridManager::GetPageName ( int  index  )  const

Returns name of given page.

wxPGProperty* wxPropertyGridManager::GetPageRoot ( int  index  )  const

Returns "root property" of the given page. It does not have name, etc. and it is not visible. It is only useful for accessing its children.

virtual wxPropertyGridState* wxPropertyGridManager::GetPageState ( int  page  )  const [virtual]

Returns wxPropertyGridState of given page, current page's for -1.

Reimplemented from wxPropertyGridInterface.

wxPGProperty* wxPropertyGridManager::GetPropertyByLabel ( const wxString &  name,
wxPropertyGridState **  ppState = (wxPropertyGridState **) NULL 
) const

Returns id of property with given label (case-sensitive). If there is no property with such label, returned property id is invalid ( i.e. it will return false with IsOk method). If there are multiple properties with identical name, most recent added is returned.

wxColour wxPropertyGridManager::GetPropertyColour ( wxPGPropArg  id  )  const [inline]

Returns cell background colour of a property.

Definition at line 526 of file manager.h.

wxColour wxPropertyGridManager::GetPropertyTextColour ( wxPGPropArg  id  )  const [inline]

Returns cell text colour of a property.

Definition at line 532 of file manager.h.

int wxPropertyGridManager::GetSelectedPage (  )  const [inline]

Returns index to currently selected page.

Definition at line 538 of file manager.h.

wxPGProperty* wxPropertyGridManager::GetSelectedProperty (  )  const [inline]

Shortcut for GetGrid()->GetSelection().

Definition at line 541 of file manager.h.

int wxPropertyGridManager::GetSelection (  )  const [inline]

Synonyme for GetSelectedPage.

Reimplemented from wxPropertyGridInterface.

Definition at line 547 of file manager.h.

wxToolBar* wxPropertyGridManager::GetToolBar (  )  const [inline]

Returns a pointer to the toolbar currently associated with the wxPropertyGridManager (if any).

Definition at line 558 of file manager.h.

virtual wxPGVIterator wxPropertyGridManager::GetVIterator ( int  flags  )  const [virtual]

Similar to GetIterator, but instead returns wxPGVIterator instance, which can be useful for forward-iterating through arbitrary property containers.

Reimplemented from wxPropertyGridInterface.

virtual int wxPropertyGridManager::InsertPage ( int  index,
const wxString &  label,
const wxBitmap &  bmp = wxNullBitmap,
wxPropertyGridPage pageObj = (wxPropertyGridPage *) NULL 
) [virtual]

Creates new property page. Note that the first page is not created automatically.

Parameters:
index Add to this position. -1 will add as the last item.
label A label for the page. This may be shown as a toolbar tooltip etc.
bmp Bitmap image for toolbar. If wxNullBitmap is used, then a built-in default image is used.
pageObj wxPropertyGridPage instance. Manager will take ownership of this object. If NULL, default page object is constructed.
Return values:
Returns index to the page created.
bool wxPropertyGridManager::IsAnyModified (  )  const

Returns true if any property on any page has been modified by the user.

bool wxPropertyGridManager::IsFrozen (  )  const [inline]

Returns true if updating is frozen (ie. Freeze() called but not yet Thaw() ).

Definition at line 582 of file manager.h.

bool wxPropertyGridManager::IsPageModified ( size_t  index  )  const

Returns true if any property on given page has been modified by the user.

virtual bool wxPropertyGridManager::IsPropertySelected ( wxPGPropArg  id  )  const [virtual]

Returns true if property is selected. Since selection is page based, this function checks every page in the manager.

Reimplemented from wxPropertyGridInterface.

virtual void wxPropertyGridManager::Refresh ( bool  eraseBackground = true,
const wxRect *  rect = (const wxRect *) NULL 
) [virtual]
virtual void wxPropertyGridManager::RefreshProperty ( wxPGProperty p  )  [protected, virtual]
void wxPropertyGridManager::RegisterAdvancedPropertyClasses (  )  [inline]

Definition at line 597 of file manager.h.

virtual bool wxPropertyGridManager::RemovePage ( int  page  )  [virtual]

Removes a page.

Return values:
Returns false if it was not possible to remove page in question.
void wxPropertyGridManager::SelectPage ( wxPropertyGridPage ptr  )  [inline]

Select and displays a given page.

Definition at line 622 of file manager.h.

void wxPropertyGridManager::SelectPage ( const wxString &  label  )  [inline]

Select and displays a given page (by label).

Definition at line 614 of file manager.h.

void wxPropertyGridManager::SelectPage ( int  index  ) 

Select and displays a given page.

Parameters:
index Index of page being seleced. Can be -1 to select nothing.
bool wxPropertyGridManager::SelectProperty ( wxPGPropArg  id,
bool  focus = false 
) [inline]

Select a property.

Definition at line 628 of file manager.h.

void wxPropertyGridManager::SetCaptionTextColour ( wxPGPropArg  id,
const wxColour &  col 
) [inline]

Sets text colour of a category caption (but not it's children).

Definition at line 644 of file manager.h.

void wxPropertyGridManager::SetColumnCount ( int  colCount,
int  page = -1 
)

Sets number of columns on given page (default is current page).

void wxPropertyGridManager::SetDescBoxHeight ( int  ht,
bool  refresh = true 
)

Sets y coordinate of the description box splitter.

void wxPropertyGridManager::SetDescription ( const wxString &  label,
const wxString &  content 
)

Sets label and text in description box.

void wxPropertyGridManager::SetPageSplitterPosition ( int  page,
int  pos,
int  column = 0 
) [inline]

Sets splitter position on individual page.

Definition at line 702 of file manager.h.

void wxPropertyGridManager::SetPropertyAttributeAll ( const wxString &  name,
wxVariant  value 
)

Sets property attribute for all applicapple properties. Be sure to use this method after all properties have been added to the grid.

void wxPropertyGridManager::SetPropertyBackgroundColour ( wxPGPropArg  id,
const wxColour &  col 
) [inline]

Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last.

Definition at line 673 of file manager.h.

void wxPropertyGridManager::SetPropertyColourToDefault ( wxPGPropArg  id  )  [inline]

Sets background and text colour of property and all its children to the default.

Definition at line 686 of file manager.h.

void wxPropertyGridManager::SetPropertyTextColour ( wxPGPropArg  id,
const wxColour &  col 
) [inline]

Sets text colour of property and all its children.

Definition at line 680 of file manager.h.

void wxPropertyGridManager::SetSplitterLeft ( bool  subProps = false,
bool  allPages = true 
)

Moves splitter as left as possible, while still allowing all labels to be shown in full.

Parameters:
subProps If false, will still allow sub-properties (ie. properties which parent is not root or category) to be cropped.
allPages If true, takes labels on all pages into account.
void wxPropertyGridManager::SetSplitterPosition ( int  pos,
int  column = 0 
)

Sets splitter position for all pages.

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.
void wxPropertyGridManager::SetStringSelection ( const wxChar *  name  )  [inline]

Synonyme for SelectPage(name).

Definition at line 716 of file manager.h.

wxPropertyGridManager::wxDEPRECATED ( void   SetTargetPageconst wxChar *  ) 
wxPropertyGridManager::wxDEPRECATED ( void   SetTargetPageint  ) 
Deprecated:
Since version 1.3. Use GetPage() and wxPropertyGridPage facilities instead.
wxPropertyGridManager::wxDEPRECATED ( void   SetPropertyColourwxPGPropArg id, const wxColour &col  ) 

Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last.

Deprecated:
Since version 1.3. Use SetPropertyBackgroundColour instead.
wxPropertyGridManager::wxDEPRECATED ( int GetTargetPage()  const  ) 
Deprecated:
Since version 1.3. Use GetPage() and wxPropertyGridPage facilities instead.

Friends And Related Function Documentation

friend class wxPropertyGridPage [friend]

Definition at line 241 of file manager.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


wxpropgrid
Author(s): Jaakko Salli
autogenerated on Fri Jan 11 09:34:07 2013