Game Develop Core: gd::InitialInstancesPropgridHelper Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | List of all members
gd::InitialInstancesPropgridHelper Class Reference

Helper class used to easily use a wxPropertyGrid so as to view and edit the properties of the gd::InitialInstance selected in a gd::LayoutEditorCanvas. More...

`#include <InitialInstancesPropgridHelper.h>`

## Public Member Functions

| InitialInstancesPropgridHelper (gd::Project &project_, gd::Layout &layout_)
| Default constructor. More...
void | RefreshFrom (const std::vector< gd::InitialInstance * > &selectedInitialInstances)
| Refresh the property grid from a list of initial instances ( For example, the selection of a gd::LayoutEditorCanvas ) More...
void | OnPropertySelected (const std::vector< gd::InitialInstance * > &selectedInitialInstances, wxPropertyGridEvent &event)
| Call this when the event wxEVT_PG_SELECTED of wxPropertyGrid is triggered. More...
void | OnPropertyChanged (const std::vector< gd::InitialInstance * > &selectedInitialInstances, wxPropertyGridEvent &event)
| Call this when the event wxEVT_PG_CHANGED of wxPropertyGrid is triggered. More...
void | SetGrid (wxPropertyGrid *grid_)
| Set the grid being used.

## Detailed Description

Helper class used to easily use a wxPropertyGrid so as to view and edit the properties of the gd::InitialInstance selected in a gd::LayoutEditorCanvas.

Usage example :

class MyEditor
{
MyEditor(gd::Project & project_, gd::Layout & layout_) :
instanceHelper(project_, layout_),
project(project_),
layout(layout_)
{
grid = new wxPropertyGrid(this,ID_PROPGRID,wxDefaultPosition,wxSize(359,438),0,_T("ID_PROPGRID"));
instanceHelper.SetGrid(grid);
Connect(ID_PROPGRID, wxEVT_PG_SELECTED, (wxObjectEventFunction)&MyEditor::OnPropertySelected);
Connect(ID_PROPGRID, wxEVT_PG_CHANGED, (wxObjectEventFunction)&MyEditor::OnPropertyChanged);
}
OnPropertySelected(wxPropertyGridEvent & event)
{
instanceHelper.OnPropertySelected(selection, event);
}
OnPropertyChanged(wxPropertyGridEvent & event)
{
instanceHelper.OnPropertyChanged(selection, event);
}
Refresh()
{
instanceHelper.RefreshFrom(selection);
}
private:
wxPropertyGrid * grid;
gd::Project & project;
gd::Layout & layout;
InitialInstancesPropgridHelper instanceHelper;
};

See Also
  gd::InitialInstance
  gd::LayoutEditorCanvas

## Constructor & Destructor Documentation

gd::InitialInstancesPropgridHelper::InitialInstancesPropgridHelper | ( | gd::Project & | project_,
|  | gd::Layout & | layout_
| ) |  |

inline

Default constructor.

Parameters

  grid | A pointer to the wxPropertyGrid to be used.
  project | The project edited
  layout | The layout being edited

## Member Function Documentation

void gd::InitialInstancesPropgridHelper::OnPropertyChanged | ( | const std::vector< gd::InitialInstance * > & | selectedInitialInstances,
|  | wxPropertyGridEvent & | event
| ) |  |

Call this when the event wxEVT_PG_CHANGED of wxPropertyGrid is triggered.

Parameters

  selectedInitialInstances | The initial instances which are displayed ( For example, the selection of a gd::LayoutEditorCanvas ).
  event | The event generated by wxWidgets.

void gd::InitialInstancesPropgridHelper::OnPropertySelected | ( | const std::vector< gd::InitialInstance * > & | selectedInitialInstances,
|  | wxPropertyGridEvent & | event
| ) |  |

Call this when the event wxEVT_PG_SELECTED of wxPropertyGrid is triggered.

Parameters

  selectedInitialInstances | The initial instances which are displayed ( For example, the selection of a gd::LayoutEditorCanvas ).
  event | The event generated by wxWidgets.

void gd::InitialInstancesPropgridHelper::RefreshFrom | ( | const std::vector< gd::InitialInstance * > & | selectedInitialInstances) |  |

Refresh the property grid from a list of initial instances ( For example, the selection of a gd::LayoutEditorCanvas )

Parameters

  selectedInitialInstances | The initial instances which are to be displayed ( For example, the selection of a gd::LayoutEditorCanvas ).

The documentation for this class was generated from the following files:

- InitialInstancesPropgridHelper.h
- InitialInstancesPropgridHelper.cpp