Properties: Use a constant variable for PG_UNIT_EDITOR editor name.
This commit is contained in:
parent
0a62c17040
commit
55a3946af8
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
|
||||||
|
const wxString PG_UNIT_EDITOR::EDITOR_NAME = wxS( "KiCadUnitEditor" );
|
||||||
|
|
||||||
|
|
||||||
PG_UNIT_EDITOR::PG_UNIT_EDITOR( EDA_DRAW_FRAME* aFrame ) :
|
PG_UNIT_EDITOR::PG_UNIT_EDITOR( EDA_DRAW_FRAME* aFrame ) :
|
||||||
wxPGTextCtrlEditor(),
|
wxPGTextCtrlEditor(),
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <eda_units.h>
|
#include <eda_units.h>
|
||||||
#include <properties/eda_angle_variant.h>
|
#include <properties/eda_angle_variant.h>
|
||||||
#include <properties/pg_properties.h>
|
#include <properties/pg_properties.h>
|
||||||
|
#include <properties/pg_editors.h>
|
||||||
#include <properties/property_mgr.h>
|
#include <properties/property_mgr.h>
|
||||||
#include <properties/property.h>
|
#include <properties/property.h>
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
|
@ -86,13 +87,13 @@ wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty )
|
||||||
{
|
{
|
||||||
case PROPERTY_DISPLAY::PT_SIZE:
|
case PROPERTY_DISPLAY::PT_SIZE:
|
||||||
ret = new PGPROPERTY_SIZE();
|
ret = new PGPROPERTY_SIZE();
|
||||||
ret->SetEditor( wxT( "UnitEditor" ) );
|
ret->SetEditor( PG_UNIT_EDITOR::EDITOR_NAME );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROPERTY_DISPLAY::PT_COORD:
|
case PROPERTY_DISPLAY::PT_COORD:
|
||||||
ret = new PGPROPERTY_COORD();
|
ret = new PGPROPERTY_COORD();
|
||||||
static_cast<PGPROPERTY_COORD*>( ret )->SetCoordType( aProperty->CoordType() );
|
static_cast<PGPROPERTY_COORD*>( ret )->SetCoordType( aProperty->CoordType() );
|
||||||
ret->SetEditor( wxT( "UnitEditor" ) );
|
ret->SetEditor( PG_UNIT_EDITOR::EDITOR_NAME );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROPERTY_DISPLAY::PT_DECIDEGREE:
|
case PROPERTY_DISPLAY::PT_DECIDEGREE:
|
||||||
|
|
|
@ -31,11 +31,13 @@ class PROPERTY_EDITOR_UNIT_BINDER;
|
||||||
class PG_UNIT_EDITOR : public wxPGTextCtrlEditor
|
class PG_UNIT_EDITOR : public wxPGTextCtrlEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static const wxString EDITOR_NAME;
|
||||||
|
|
||||||
PG_UNIT_EDITOR( EDA_DRAW_FRAME* aFrame );
|
PG_UNIT_EDITOR( EDA_DRAW_FRAME* aFrame );
|
||||||
|
|
||||||
virtual ~PG_UNIT_EDITOR();
|
virtual ~PG_UNIT_EDITOR();
|
||||||
|
|
||||||
wxString GetName() const override { return wxT( "KiCadUnitEditor" ); }
|
wxString GetName() const override { return EDITOR_NAME; }
|
||||||
|
|
||||||
wxPGWindowList CreateControls( wxPropertyGrid* aPropGrid, wxPGProperty* aProperty,
|
wxPGWindowList CreateControls( wxPropertyGrid* aPropGrid, wxPGProperty* aProperty,
|
||||||
const wxPoint& aPos, const wxSize& aSize ) const override;
|
const wxPoint& aPos, const wxSize& aSize ) const override;
|
||||||
|
|
Loading…
Reference in New Issue