当前位置: 首页>>代码示例>>C++>>正文


C++ wxPropertyGridEvent::GetProperty方法代码示例

本文整理汇总了C++中wxPropertyGridEvent::GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ wxPropertyGridEvent::GetProperty方法的具体用法?C++ wxPropertyGridEvent::GetProperty怎么用?C++ wxPropertyGridEvent::GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxPropertyGridEvent的用法示例。


在下文中一共展示了wxPropertyGridEvent::GetProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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

示例3: OnPropertyChanged

bool ObjectsPropgridHelper::OnPropertyChanged(gd::Object * object, gd::Layout * layout, wxPropertyGridEvent& event)
{
    if ( !grid || !object ) return false;

    auto readEnumPropertyString = [&event](std::map<gd::String, gd::PropertyDescriptor> properties) {
        const std::vector<gd::String> & choices = properties[event.GetProperty()->GetLabel()].GetExtraInfo();

        unsigned int id = event.GetPropertyValue().GetLong();
        if (id < choices.size()) {
            return gd::String(choices[id]);
        }

        return gd::String("");
    };

    if ( event.GetPropertyName().substr(0,10) == "AUTO_PROP:" )
    {
        gd::String autoName = event.GetPropertyName().substr(10);
        if ( !object->HasBehaviorNamed(autoName))
        {
            event.Veto();
            return false;
        }

        gd::Behavior & behavior = object->GetBehavior(autoName);
        gd::String value = event.GetPropertyValue().GetString();

        //Special case for enums.
        if (wxEnumProperty * enumProperty = dynamic_cast<wxEnumProperty*>(event.GetProperty()))
            value = readEnumPropertyString(behavior.GetProperties(project));

        if (!behavior.UpdateProperty(event.GetProperty()->GetLabel(), value, project))
        {
            event.Veto();
            return false;
        }
    }
    else if ( event.GetPropertyName().substr(0,8) == "OBJ_PROP" )
    {
        gd::String value = event.GetPropertyValue().GetString();

        //Special case for enums.
        if (wxEnumProperty * enumProperty = dynamic_cast<wxEnumProperty*>(event.GetProperty()))
            value = readEnumPropertyString(object->GetProperties(project));

        if (!object->UpdateProperty(event.GetProperty()->GetLabel(), value, project))
        {
            event.Veto();
            return false;
        }
    }

    return false;
}
开发者ID:yecaokinux,项目名称:GD,代码行数:54,代码来源:ObjectsPropgridHelper.cpp

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: OnChange

//-----------------------------------------------------------------------------
void Property::OnChange (wxPropertyGridEvent &event)
{
	wxPGProperty *id = event.GetProperty();
	PX2_UNUSED(id);

	const wxString &name = event.GetPropertyName();
	std::string stdName = std::string(name);
	wxVariant variant = event.GetPropertyValue();

	if (name != wxString(mName.c_str()))
		return;

	if (variant.IsNull())
		return;

	if (!mData)
		return;

	if (mType == PT_INT)
	{
		*((int*)mData) = wxPGVariantToInt(variant);
	}
	else if (mType == PT_FLOAT)
	{
		double value = 0;
		wxPGVariantToDouble(variant, &value);
		*((float*)mData) = (float)value;
	}
	else if (mType == PT_BOOL)
	{
		bool value = (bool)(event.GetPropertyValueAsBool()!=0);
		*((bool*)mData) = value;
	}
	else if (mType == PT_BOOLCHECK)
	{
		bool value = (bool)(event.GetPropertyValueAsBool()!=0);
		*((bool*)mData) = value;
	}
	else if (PT_COLOR3FLOAT3 == mType)
	{
		wxString strColor = event.GetPropertyValueAsString();
		wxColor color = StringToColor(strColor);

		Float3 float3Color((float)color.Red()/255.0f, (float)color.Green()/255.0f,
			(float)color.Blue()/255.0f);

		*((Float3*)mData) = float3Color;
	}
	else if (PT_FLOAT3 == mType)
	{
		*((Float3*)mData) = Float3FromVariant(variant);
	}
	else if (mType == PT_STRING)
	{
		std::string value;
		wxString wxValue = event.GetPropertyValueAsString();
		value = std::string(wxValue.ToAscii());
		*((std::string*)mData) = value;
	}
}
开发者ID:ascetic85,项目名称:Phoenix3d,代码行数:61,代码来源:PX2Property.cpp

示例9: 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

示例10: OnPropertyGridSelect

//------------------------------------------------------------------------
// 
//------------------------------------------------------------------------
void CPropertyWindow::OnPropertyGridSelect( wxPropertyGridEvent& event )
{
	SetFocus();

	wxPGProperty* pProp = event.GetProperty();
	RET(!pProp);
	wxString name = pProp->GetName();

	SPropItem *pItemData = (SPropItem*)pProp->GetClientData();
	if (pItemData && pItemData->typeData.vt == VT_EMPTY &&
		pProp->GetChildCount() <= 0)
	{
		IDiaSymbol *pSym = dia::FindType(pItemData->symbolTypeName);
		if (!pSym)
			return;

		DWORD ptr = (DWORD)pItemData->typeData.ptr;
		if (SymTagPointerType == pItemData->typeData.symtag)
			ptr = visualizer::Point2PointValue((DWORD)pItemData->typeData.ptr);

		SSymbolInfo symbol( pSym, memmonitor::SMemInfo("*", (void*)ptr, 0) );
		visualizer::MakePropertyChild_DefaultForm( visualizer::SVisDispDesc(this,pProp), symbol, true, 2 );

			
		//if (!FindSymbolUpward( pProp, &symbol ))
		//	return;
		//if (visualizer::MakePropertyChild_DefaultForm( this, pProp, symbol))
		//{
			//pProp->Expand();
			//AdjustLayout();
		//}
	}
}
开发者ID:butilities,项目名称:3D-Lecture-2,代码行数:36,代码来源:PropertyWindow.cpp

示例11: 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

示例12: OnPropertyGridChange

//-----------------------------------------------------------------------------
void UIPicBoxPropGrid::OnPropertyGridChange (wxPropertyGridEvent &event)
{
	ObjectPropertyGrid::OnPropertyGridChange(event);

	wxPGProperty *prop = event.GetProperty();
	if (prop->GetName() == PX2_LM.GetValue("Color"))
	{
		mUIPicBox->SetColor(mColor);
	}
	else if (prop->GetName() == PX2_LM.GetValue("Alpha01"))
	{
		mUIPicBox->SetAlpha(mAlpha);
	}
	else if (prop->GetName() == PX2_LM.GetValue("AnchorX")
		|| prop->GetName() == PX2_LM.GetValue("AnchorZ"))
	{
		mUIPicBox->SetAnchorPoint(mAnchorPoint);
	}
	else if (prop->GetName() == PX2_LM.GetValue("Width"))
	{
		mUIPicBox->SetWidth(mWidth);
	}
	else if (prop->GetName() == PX2_LM.GetValue("Height"))
	{
		mUIPicBox->SetHeight(mHeight);
	}
	else if (prop->GetName() == PX2_LM.GetValue("DoubleSide"))
	{
		mUIPicBox->SetDoubleSide(mIsDoubleSide);
	}
}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:32,代码来源:PX2UIPicBoxPropGrid.cpp

示例13: 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

示例14: propertyChange

void EntityPropertyGridPage::propertyChange(wxPropertyGridEvent& event)
{
	wxPGId id = event.GetProperty();
	if(id == mDisplaySkeleton)
	{
		mEntity->setDisplaySkeleton(event.GetPropertyValueAsBool());
	}
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:8,代码来源:EntityPropertyGridPage.cpp

示例15: OnPropGridChanged

void SDRDevicesDialog::OnPropGridChanged( wxPropertyGridEvent& event ) {
    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());
        }
    } else if (dev && event.GetProperty() == devSettings["offset"]) {
        DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice(dev->getDeviceId());
        
        long offset = event.GetPropertyValue().GetInteger();
        
        devConfig->setOffset(offset);
    } else if (editId && dev) {
        wxPGProperty *prop = event.GetProperty();
        
        for (std::map<std::string, wxPGProperty *>::iterator rtp = runtimeProps.begin(); rtp != runtimeProps.end(); rtp++) {
            if (rtp->second == prop) {
                SoapySDR::Device *soapyDev = dev->getSoapyDevice();
                std::string settingValue = prop->GetValueAsString().ToStdString();
                SoapySDR::ArgInfo arg = runtimeArgs[rtp->first];
                if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size()) {
                    settingValue = arg.options[prop->GetChoiceSelection()];
                } else if (arg.type == SoapySDR::ArgInfo::BOOL) {
                    settingValue = (prop->GetValueAsString()=="True")?"true":"false";
                } else {
                    settingValue = prop->GetValueAsString();
                }

                soapyDev->writeSetting(rtp->first, settingValue);
                if (dev->isActive()) {
                    wxGetApp().getSDRThread()->writeSetting(rtp->first, settingValue);
                }
                refreshDeviceProperties();
                return;
            }
        }
    }
}
开发者ID:ctcat2008,项目名称:CubicSDR,代码行数:45,代码来源:SDRDevices.cpp


注:本文中的wxPropertyGridEvent::GetProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。