43 m_paramIndex( aParamIndex ),
59 wxBoolProperty( aLabel, aName ),
63 SetValue( value ==
"1" );
75 wxPGProperty::OnSetValue();
88 wxStringProperty( aLabel, aName ),
90 m_valueType( aValueType )
92 SetValueFromString(
GetParam().value );
98 if( event.GetEventType() == wxEVT_SET_FOCUS &&
allowEval() )
100 if( wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( wnd_primary ) )
104 if( oldStr.length() && oldStr != textEntry->GetValue() )
106 SetValueInEvent( oldStr );
107 textEntry->SetValue( oldStr );
114 else if( event.GetEventType() == wxEVT_KILL_FOCUS &&
allowEval() )
116 if( wxTextEntry* textEntry =
dynamic_cast<wxTextEntry*
>( wnd_primary ) )
118 wxString
strValue = textEntry->GetValue();
138 else if( event.GetEventType() == wxEVT_KEY_DOWN )
140 wxKeyEvent& keyEvent =
dynamic_cast<wxKeyEvent&
>( event );
142 if( wxPropertyGrid* propGrid =
dynamic_cast<wxPropertyGrid*
>( wnd_primary->GetParent() ) )
144 if( keyEvent.GetKeyCode() == WXK_TAB )
146 propGrid->CommitChangesFromEditor();
148 keyEvent.m_keyCode = keyEvent.ShiftDown() ? WXK_UP : WXK_DOWN;
149 keyEvent.m_shiftDown =
false;
162 propGrid->EditorsValueWasModified();
163 propGrid->CommitChangesFromEditor();
187 int aArgFlags )
const
192 wxString
text = aText;
196 if( !aText.IsEmpty() )
212 aVariant =
text.ToStdString();
219 const wxArrayString& aValues ) :
220 wxEnumProperty( aLabel, aName, aValues ),
236#if wxCHECK_VERSION( 3, 3, 0 )
238 wxPGPropValFormatFlags aArgFlags )
const
246 m_model.SetParamValue( m_paramIndex, m_choices.GetLabel( aNumber ).ToStdString() );
247 return wxEnumProperty::IntToValue( aVariant, aNumber, aArgFlags );
wxString OriginalText() const
bool Process(const wxString &aString)
SIM_BOOL_PROPERTY(const wxString &aLabel, const wxString &aName, SIM_MODEL &aModel, int aParamIndex)
void OnSetValue() override
wxValidator * DoGetValidator() const override
SIM_ENUM_PROPERTY(const wxString &aLabel, const wxString &aName, SIM_MODEL &aModel, int aParamIndex, const wxArrayString &aValues)
bool IntToValue(wxVariant &aVariant, int aNumber, int aArgFlags=0) const override
virtual const PARAM & GetParam(unsigned aParamIndex) const
void SetParamValue(int aParamIndex, const std::string &aValue, SIM_VALUE::NOTATION aNotation=SIM_VALUE::NOTATION::SI)
const SIM_MODEL::PARAM & GetParam() const
SIM_PROPERTY(SIM_MODEL &aModel, int aParamIndex)
wxPropertyGrid property specializations for simulator.
bool m_disabled
If true, never access the models.
wxValidator * DoGetValidator() const override
SIM_STRING_PROPERTY(const wxString &aLabel, const wxString &aName, SIM_MODEL &aModel, int aParamIndex, SIM_VALUE::TYPE aValueType=SIM_VALUE::TYPE_FLOAT, SIM_VALUE_GRAMMAR::NOTATION aNotation=SIM_VALUE_GRAMMAR::NOTATION::SI)
SIM_VALUE::TYPE m_valueType
bool OnEvent(wxPropertyGrid *propgrid, wxWindow *wnd_primary, wxEvent &event) override
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
wxPropertyGrid property specializations for simulator.
static std::string Normalize(double aValue)
static bool Equal(double aLH, const std::string &aRH)
static double ToDouble(const std::string &aString, double aDefault=NAN)
static std::string strValue(double aValue)
std::vector< std::string > enumValues