本文整理汇总了C++中wxPropertyGridEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxPropertyGridEvent类的具体用法?C++ wxPropertyGridEvent怎么用?C++ wxPropertyGridEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxPropertyGridEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnPropertyGridChange
int ArchesModel::OnPropertyGridChange(wxPropertyGridInterface *grid, wxPropertyGridEvent& event) {
if ("ArchesCount" == event.GetPropertyName()) {
ModelXml->DeleteAttribute("parm1");
ModelXml->AddAttribute("parm1", wxString::Format("%d", event.GetPropertyValue().GetLong()));
SetFromXml(ModelXml, zeroBased);
AdjustStringProperties(grid, parm1);
return 3;
} else if ("ArchesNodes" == event.GetPropertyName()) {
ModelXml->DeleteAttribute("parm2");
ModelXml->AddAttribute("parm2", wxString::Format("%d", event.GetPropertyValue().GetLong()));
SetFromXml(ModelXml, zeroBased);
return 3;
} else if ("ArchesLights" == event.GetPropertyName()) {
ModelXml->DeleteAttribute("parm3");
ModelXml->AddAttribute("parm3", wxString::Format("%d", event.GetPropertyValue().GetLong()));
SetFromXml(ModelXml, zeroBased);
return 3;
} else if ("ArchesArc" == event.GetPropertyName()) {
ModelXml->DeleteAttribute("arc");
ModelXml->AddAttribute("arc", wxString::Format("%d", event.GetPropertyValue().GetLong()));
SetFromXml(ModelXml, zeroBased);
return 3;
} else if ("ArchesStart" == event.GetPropertyName()) {
ModelXml->DeleteAttribute("Dir");
ModelXml->AddAttribute("Dir", event.GetValue().GetLong() == 0 ? "L" : "R");
SetFromXml(ModelXml, zeroBased);
return 3;
}
return Model::OnPropertyGridChange(grid, event);
}
开发者ID:bagumondigi,项目名称:xLights,代码行数:31,代码来源:ArchesModel.cpp
示例2: OnPropertyChanged
void ProjectWindow::OnPropertyChanged( wxPropertyGridEvent& evt )
{
if (!mSelectedAssetDef || !mSelectedAsset)
return;
wxString name = evt.GetPropertyName();
wxVariant val = evt.GetPropertyValue();
wxString strVal = val.GetString();
if (name.StartsWith("TextureAsset"))
{
long intVal = val.GetInteger();
//strVal = mTextureAssetChoices.GetLabel(intVal);
}
// Set Value.
mSelectedAsset->setDataField(Torque::StringTableLink->insert(name), NULL, strVal);
// Save the asset
mSelectedAsset->saveAsset();
// Refresh textures if it's a MaterialAsset.
if (mSelectedMaterialAsset)
mSelectedMaterialAsset->loadTextures();
// Refresh Scene.
Torque::Scene.refresh();
// Reload object properties.
mAssetsInspector->Inspect(mSelectedAssetDef);
}
开发者ID:andr3wmac,项目名称:Torque6Editor,代码行数:31,代码来源:projectWindow.cpp
示例3: OnColourChanged
void TweaksSettingsDlg::OnColourChanged(wxPropertyGridEvent& event)
{
event.Skip();
wxPGProperty* prop = event.GetProperty();
CHECK_PTR_RET(prop);
if ( prop == m_pgPropGlobalTabBG ) {
// Global tab bg colour was modified
wxColourPropertyValue cpv;
cpv << prop->GetValue();
m_settings.SetGlobalBgColour( cpv.m_colour );
} else if ( prop == m_pgPropGlobalTabFG ) {
// Global tab colour was modified
wxColourPropertyValue cpv;
cpv << prop->GetValue();
m_settings.SetGlobalFgColour( cpv.m_colour );
} else if ( prop->GetParent() ) {
// project specific colour was changed
wxColourPropertyValue cpv;
cpv << prop->GetValue();
if ( prop->GetLabel().Contains("text colour") ) {
m_settings.GetProjectTweaks(prop->GetParent()->GetLabel()).SetTabFgColour( cpv.m_colour );
} else if ( prop->GetLabel().Contains("background colour") ) {
m_settings.GetProjectTweaks(prop->GetParent()->GetLabel()).SetTabBgColour( cpv.m_colour );
}
}
}
开发者ID:05storm26,项目名称:codelite,代码行数:32,代码来源:TweaksSettingsDlg.cpp
示例4: OnPropGridChanged
void SDRDevicesDialog::OnPropGridChanged( wxPropertyGridEvent& event ) {
if (!editId) {
return;
}
SDRDeviceInfo *dev = getSelectedDevice(editId);
if (editId && event.GetProperty() == devSettings["name"]) {
DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice(dev->getDeviceId());
wxString devName = event.GetPropertyValue().GetString();
devConfig->setDeviceName(devName.ToStdString());
if (editId) {
devTree->SetItemText(editId, devConfig->getDeviceName());
}
if (devName == "") {
event.GetProperty()->SetValueFromString(devConfig->getDeviceName());
}
}
if (dev && event.GetProperty() == devSettings["offset"]) {
DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice(dev->getDeviceId());
long offset = event.GetPropertyValue().GetInteger();
devConfig->setOffset(offset);
}
}
开发者ID:viraptor,项目名称:CubicSDR,代码行数:26,代码来源:SDRDevices.cpp
示例5: OnChange
//-----------------------------------------------------------------------------
void EMFloatProperty::OnChange (wxPropertyGridEvent &event)
{
wxPGProperty *prop = event.GetProperty();
const wxString &wxName = event.GetPropertyName();
wxVariant var = prop->GetValue();
if (var.IsNull())
return;
float fValue = (float)(var.GetDouble());
if (mPropertyInVal == prop)
{
mPoint->InVal = fValue;
}
else if (mPropertyOutVal == prop)
{
mPoint->OutVal = fValue;
}
else if (mPropertyArriveTangent == prop)
{
mPoint->ArriveTangent = fValue;
}
else if (mPropertyLeaveTangent == prop)
{
mPoint->LeaveTangent = fValue;
}
else if (mInterpMode == prop)
{
int val = var.GetInteger();
mPoint->InterpMode = (InterpCurveMode)val;
}
}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:34,代码来源:PX2EMFloatProperty.cpp
示例6: onPropertyChanging
void Properties::onPropertyChanging(wxPropertyGridEvent& event, Object* object)
{
if (object)
{
if (event.GetPropertyName() == "Name")
{
object->setName(event.GetValue().GetString().c_str());
}
else if (event.GetPropertyName() == "Description")
{
object->setDescription(event.GetValue().GetString().c_str());
}
switch (object->getType())
{
case OT_BUILDING: onPropertyChanging(event, static_cast<Building*>(object)); break;
case OT_JUNCTION: onPropertyChanging(event, static_cast<Junction*>(object)); break;
case OT_PLANT: onPropertyChanging(event, static_cast<Plant*>(object)); break;
case OT_ROUTE: onPropertyChanging(event, static_cast<Route*>(object)); break;
case OT_WATER_OBJECT: onPropertyChanging(event, static_cast<WaterObject*>(object)); break;
}
City::getSingleton().updateViews(object);
}
}
开发者ID:wojciech-holisz,项目名称:3d-city,代码行数:25,代码来源:Properties.cpp
示例7: assert
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
PropertiesView::onPropertyGridChanging(wxPropertyGridEvent& _event)
{
wxPGProperty* const pWXProperty = _event.GetProperty();
// TODO Don't assume this is a string.
std::string newValue = wx2std(_event.GetValue().GetString());
if (pWXProperty->GetClientData() != NULL)
{
I_Property* pProperty = static_cast<I_Property*>(pWXProperty->GetClientData());
assert(pProperty != NULL);
if (!pProperty->getPublisher().getController().canChangeProperty(*pProperty, newValue))
{
// Veto the event.
_event.Veto();
// Set the validation failure behavior.
_event.SetValidationFailureBehavior(wxPG_VFB_STAY_IN_PROPERTY
//| wxPG_VFB_BEEP
//| wxPG_VFB_SHOW_MESSAGE
);
}
}
}
开发者ID:SgtFlame,项目名称:indiezen,代码行数:28,代码来源:PropertiesView.cpp
示例8: propertyChange
void EntityPropertyGridPage::propertyChange(wxPropertyGridEvent& event)
{
wxPGId id = event.GetProperty();
if(id == mDisplaySkeleton)
{
mEntity->setDisplaySkeleton(event.GetPropertyValueAsBool());
}
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:8,代码来源:EntityPropertyGridPage.cpp
示例9: OnPropertyChanged
///////////////////////////////////////////////////////////////////////////////
///
/// Wird aufgerufen, wenn der Benutzer eine Property geändert hat.
///
/// @param ev PropertyGrid-Event
///
///////////////////////////////////////////////////////////////////////////////
void PropertyGridControllerMotionCapture::OnPropertyChanged(wxPropertyGridEvent& ev)
{
if(ev.GetProperty()->GetName().compare("Name") == 0)
{
wxString newName = ev.GetProperty()->GetValueAsString();
motionCapture->SetName(newName.c_str());
}
}
开发者ID:revilo,项目名称:perspective,代码行数:15,代码来源:propertygridcontrollermotioncapture.cpp
示例10: if
void
ObjectPropertyEditor::OnPropertyChanged(wxPropertyGridEvent& e)
{
// Skip parent properties
if (e.GetPropertyPtr()->GetParentingType() != 0)
return;
// Skip if no current selected object
Fairy::ObjectPtr object = mCurrentObject.lock();
if (!object)
return;
Ogre::String propertyName = AS_STRING(e.GetPropertyName());
Ogre::String propertyValue = AS_STRING(e.GetPropertyValueAsString());
if(propertyName == "position" || propertyName == "scale")
{
Ogre::Vector3 vValue = Ogre::StringConverter::parseVector3(propertyValue);
object->setProperty(propertyName,vValue);
}
else if(propertyName == "orientation")
{
Ogre::Quaternion qValue = Ogre::StringConverter::parseQuaternion(propertyValue);
object->setProperty(propertyName,qValue);
}
else if(propertyName == "actor name")
{
m_Frame->ClearAllSelectorObject();
m_Frame->GetActorSettingEditor()->SetCurrentObject(Ogre::String(propertyValue.c_str()));
return;
}
mPropertiesViewer->Freeze();
const Fairy::PropertyList& properties = object->getProperties();
for (Fairy::PropertyList::const_iterator it = properties.begin(); it != properties.end(); ++it)
{
const Fairy::PropertyDef& propertyDef = *it;
Fairy::uint propertyFlags = object->getPropertyFlags(propertyDef.name);
wxPGId id = mPropertiesViewer->GetPropertyByName(propertyDef.name.c_str());
assert(id.IsOk());
if (!id.IsOk())
continue;
if (propertyFlags & Fairy::PF_READONLY)
{
if (mPropertiesViewer->IsPropertyEnabled(id))
mPropertiesViewer->DisableProperty(id);
}
else
{
if (!mPropertiesViewer->IsPropertyEnabled(id))
mPropertiesViewer->EnableProperty(id);
}
}
mPropertiesViewer->Thaw();
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:57,代码来源:ObjectPropertyEditor.cpp
示例11: OnPropertyGridSelect
void wxPropertyGridManager::OnPropertyGridSelect( wxPropertyGridEvent& event )
{
// Check id.
wxASSERT_MSG( GetId() == m_pPropGrid->GetId(),
wxT("wxPropertyGridManager id must be set with wxPropertyGridManager::SetId (not wxWindow::SetId).") );
SetDescribedProperty(event.GetProperty());
event.Skip();
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:9,代码来源:manager.cpp
示例12: On_PG_Changed
//---------------------------------------------------------
void CParameters_Control::On_PG_Changed(wxPropertyGridEvent &event)
{
_Set_Parameter(event.GetPropertyName());
if( event.GetProperty() )
{
m_pPG->SelectProperty(event.GetProperty());
}
event.Skip();
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:12,代码来源:parameters_control.cpp
示例13: propertyChange
void MaterialPropertyGridPage::propertyChange(wxPropertyGridEvent& event)
{
wxPGId id = event.GetProperty();
if(id == mReceiveShadowsId)
{
mMaterial->setReceiveShadows(event.GetPropertyValueAsBool());
}
else if(id == mTransparencyShadowsId)
{
mMaterial->setTransparencyCastsShadows(event.GetPropertyValueAsBool());
}
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:12,代码来源:MaterialPropertyGridPage.cpp
示例14: OnPropertyChanged
void ProjectPropertiesPnl::OnPropertyChanged(wxPropertyGridEvent& event)
{
if (project) project->OnChangeInPropertyGrid(propertyGrid, event);
if ( event.GetPropertyName() == _("Name of the project") && associatedTree != NULL)
associatedTree->SetItemText(associatedTreeItem, event.GetProperty()->GetValue());
if ( event.GetPropertyName() == _("Activate the use of C++ source files") && associatedProjectManager != NULL)
associatedProjectManager->Refresh();
if (project) project->SetDirty();
}
开发者ID:Slulego,项目名称:GD,代码行数:12,代码来源:ProjectPropertiesPnl.cpp
示例15: if
//-----------------------------------------------------------------------------
void EMFloat3Property::OnChange (wxPropertyGridEvent &event)
{
wxPGProperty *prop = event.GetProperty();
const wxString &wxName = event.GetPropertyName();
wxVariant var = prop->GetValue();
PX2_UNUSED(wxName);
if (var.IsNull())
return;
if (mPropertyInVal == prop)
{
float fValue = (float)(var.GetDouble());
mPoint->InVal = fValue;
if (mPropertyInVal)
mPropertyInVal->SetValue(fValue);
}
else if (mPropertyOutVal == prop)
{
if (mIsColor)
{
wxColor color = wxANY_AS(var.GetAny(), wxColor);
Float3 float3Color((float)color.Red()/255.0f, (float)color.Green()/255.0f,
(float)color.Blue()/255.0f);
mPoint->OutVal = float3Color;
}
else
{
mPoint->OutVal = Float3RefFromVariant(var);
}
}
else if (mPropertyArriveTangent == prop)
{
mPoint->ArriveTangent = Float3RefFromVariant(var);
}
else if (mPropertyLeaveTangent == prop)
{
mPoint->LeaveTangent = Float3RefFromVariant(var);
}
else if (mInterpMode == prop)
{
int val = var.GetInteger();
mPoint->InterpMode = (InterpCurveMode)val;
}
}
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:51,代码来源:PX2EMFloat3Property.cpp
示例16: assert
void
ObjectPropertyEditor::OnPropertyChanged(wxPropertyGridEvent& e)
{
// Skip parent properties
if (e.GetPropertyPtr()->GetParentingType() != 0)
return;
// Skip if no current selected object
WX::ObjectPtr object = mCurrentObject.lock();
if (!object)
return;
WX::String propertyName = AS_STRING(e.GetPropertyName());
WX::String propertyValue = AS_STRING(e.GetPropertyValueAsString());
WX::Variant oldValue = object->getProperty(propertyName);
object->setPropertyAsString(propertyName, propertyValue);
mSceneManipulator->_fireObjectPropertyChanged(object, propertyName, this);
WX::Variant newValue = object->getProperty(propertyName);
WX::ModifyObjectPropertyOperator* op = new WX::ModifyObjectPropertyOperator(mSceneManipulator);
op->add(object->getName(), propertyName, oldValue, newValue);
mSceneManipulator->getOperatorManager()->addOperator(op);
mPropertiesViewer->Freeze();
const WX::PropertyList& properties = object->getProperties();
for (WX::PropertyList::const_iterator it = properties.begin(); it != properties.end(); ++it)
{
const WX::PropertyDef& propertyDef = *it;
WX::uint propertyFlags = object->getPropertyFlags(propertyDef.name);
wxPGId id = mPropertiesViewer->GetPropertyByName(propertyDef.name.c_str());
assert(id.IsOk());
if (!id.IsOk())
continue;
if (propertyFlags & WX::PF_READONLY)
{
if (mPropertiesViewer->IsPropertyEnabled(id))
mPropertiesViewer->DisableProperty(id);
}
else
{
if (!mPropertiesViewer->IsPropertyEnabled(id))
mPropertiesViewer->EnableProperty(id);
}
}
mPropertiesViewer->Thaw();
}
开发者ID:brock7,项目名称:TianLong,代码行数:49,代码来源:ObjectPropertyEditor.cpp
示例17: HandlePGChange
bool EditorChoiceWindowT::HandlePGChange(wxPropertyGridEvent& Event, GuiEditor::ChildFrameT* ChildFrame)
{
if (EditorWindowT::HandlePGChange(Event, ChildFrame)) return true;
const wxPGProperty* Prop =Event.GetProperty();
const wxString PropName=Prop->GetName();
if (PropName=="Choices")
{
ArrayT<std::string> NewStrings;
wxStringTokenizer Tokenizer(Prop->GetValueAsString(), "\r\n");
while (Tokenizer.HasMoreTokens())
NewStrings.PushBack(std::string(Tokenizer.GetNextToken()));
ChildFrame->SubmitCommand(new CommandSetWinPropT< ArrayT<std::string> >(m_GuiDoc, this, PropName, m_Choice->m_Choices, NewStrings));
return true;
}
if (PropName=="DefaultChoice")
{
wxASSERT(m_Choice->GetMemberVar("selectedChoice").Member!=NULL);
ChildFrame->SubmitCommand(new CommandModifyWindowT(m_GuiDoc, m_Choice, PropName, m_Choice->GetMemberVar("selectedChoice"), Prop->GetValue().GetLong()));
return true;
}
return false;
}
开发者ID:mark711,项目名称:Cafu,代码行数:29,代码来源:EditorChoiceWindow.cpp
示例18: OnPropertyValueChanged
void rePropertyInspector::OnPropertyValueChanged(wxPropertyGridEvent& event){
wxPGProperty* property = event.GetProperty();
wxStringClientData* propertyInfo = static_cast<wxStringClientData*>(property->GetClientObject());
wxStringTokenizer tokenizer(propertyInfo->GetData(), ":");
wxString propertyType = tokenizer.GetNextToken();
wxString propertyName = tokenizer.GetNextToken();
wxAny anyVal;
if (propertyType == "vector3"){
wxVariant x = GetProperty(propertyName + ".x")->GetValue();
wxVariant y = GetProperty(propertyName + ".y")->GetValue();
wxVariant z = GetProperty(propertyName + ".z")->GetValue();
rVector3 vec3(x.GetDouble(), y.GetDouble(), z.GetDouble());
anyVal = vec3;
}
else if (propertyType == "color"){
wxAny colorVal = property->GetValue();
wxColor cpv = colorVal.As<wxColor>();
rColor c(cpv.Red(), cpv.Green(), cpv.Blue(), cpv.Alpha());
anyVal = c;
}
else if (propertyType == "int" || propertyType == "float" || propertyType == "string" || propertyType == "bool"){
anyVal = property->GetValueAsString();
}
m_component->SubmitCommand(new reSetPropertyCommand(m_actorName, propertyName, anyVal, m_component));
}
开发者ID:matthewcpp,项目名称:recondite,代码行数:32,代码来源:rePropertyInspector.cpp
示例19: OnPropertyChanged
void LayoutEditorPropertiesPnl::OnPropertyChanged(wxPropertyGridEvent& event)
{
if ( layoutEditorCanvas && displayInstancesProperties )
{
std::vector<InitialInstance*> selectedInitialInstances = layoutEditorCanvas->GetSelection();
//In case "Custom size" property is checked, we do some extra work : Setting the custom width/height
//of instances at their original width/height
if ( event.GetPropertyName() == _("Custom size?") && grid->GetProperty(_("Custom size?"))->GetValue().GetBool() )
{
for (std::size_t i = 0;i<selectedInitialInstances.size();++i)
{
sf::Vector2f size = layoutEditorCanvas->GetInitialInstanceSize(*selectedInitialInstances[i]);
selectedInitialInstances[i]->SetCustomWidth(size.x);
selectedInitialInstances[i]->SetCustomHeight(size.y);
}
}
instancesHelper.OnPropertyChanged(selectedInitialInstances, event);
}
if ( object )
{
if ( objectsHelper.OnPropertyChanged(object, &layout, event) ){
wxCommandEvent refreshEvent(refreshEventType);
wxPostEvent(grid, refreshEvent);
//Refresh(); Can trigger a crash
}
}
}
开发者ID:HaoDrang,项目名称:GD,代码行数:29,代码来源:LayoutEditorPropertiesPnl.cpp
示例20: onPropertySelected
void VisualizationPanel::onPropertySelected( wxPropertyGridEvent& event )
{
wxPGProperty* pg_property = event.GetProperty();
selected_display_ = NULL;
if ( !pg_property )
{
return;
}
void* client_data = pg_property->GetClientData();
if ( client_data )
{
PropertyBase* property = reinterpret_cast<PropertyBase*>(client_data);
void* user_data = property->getUserData();
if ( user_data )
{
Display* display = reinterpret_cast<Display*>(user_data);
if ( manager_->isValidDisplay( display ) )
{
selected_display_ = display;
}
}
}
}
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:28,代码来源:visualization_panel.cpp
注:本文中的wxPropertyGridEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论