void FScriptContextBase::FetchScriptPropertyValues(UScriptBlueprintGeneratedClass* Class, UObject* Obj)
{
	// @todo: optimize this
	for (auto Property : Class->ScriptProperties)
	{
		if (UFloatProperty* FloatProperty = Cast<UFloatProperty>(Property))
		{
			float Value = GetFloatProperty(Property->GetName());
			FloatProperty->SetFloatingPointPropertyValue(Property->ContainerPtrToValuePtr<float>(Obj), Value);
		}
		else if (UIntProperty* IntProperty = Cast<UIntProperty>(Property))
		{
			int32 Value = GetIntProperty(Property->GetName());
			IntProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<int32>(Obj), Value);
		}
		else if (UBoolProperty* BoolProperty = Cast<UBoolProperty>(Property))
		{
			bool Value = GetBoolProperty(Property->GetName());
			BoolProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<float>(Obj), Value);
		}
		else if (UObjectProperty* ObjectProperty = Cast<UObjectProperty>(Property))
		{
			UObject* Value = GetObjectProperty(Property->GetName());
			ObjectProperty->SetObjectPropertyValue(Property->ContainerPtrToValuePtr<UObject*>(Obj), Value);
		}
		else if (UStrProperty* StringProperty = Cast<UStrProperty>(Property))
		{
			FString Value = GetStringProperty(Property->GetName());
			StringProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<FString>(Obj), Value);
		}
	}
}
Пример #2
0
void CGenerateObjectPropertiesSelectDlg::ButtonClick (ControlEvt e)
{
	switch ((uint)e.GetControlID()) {
	case IDC_CONFIG_PROP:
		{
		// ObjProp konfigurieren
		WObjectProperty ObjProp;
		HRESULT hr = S_OK;

			if (S_OK == GetObjectProperty(ObjProp.ppi())) {
			WConfigObjectProperty Cfg;

				if (SUCCEEDED(ObjProp -> QueryInterface (Cfg.ppi())))
					hr = Cfg -> ConfigObjectProperty (::GetParent(Handle(API_WINDOW_HWND)));		// liefert Sheet
			}

			if (S_OK == hr) {	// cancel liefert S_FALSE
			HTREEITEM hItem = m_pObjProps->GetSelectedItem();

				if (NULL != hItem) {
				// nach configure ist Item selektiert
					m_pObjProps->SetCheckState(hItem, TV_CHECK_ON);
				}
			}
		}
		break;

	default:
		break;
	}
}
Пример #3
0
  ConversionPtr ParseConversion(const JSONValue& doc) {
    // Required: dict
    DictPtr dict = ParseDict(GetObjectProperty(doc, "dict"));
    ConversionPtr conversion(new Conversion(dict));

    return conversion;
  }
Пример #4
0
void CGenerateObjectPropertiesSelectDlg::OnSelChanged (NotifyEvt e)
{
// Messagereflection
	_ASSERTE(NULL != m_pObjProps);

NMTREEVIEW *pnmtv = (NMTREEVIEW *)e.GetNotifyInfo();

	if ((TVC_BYMOUSE|TVC_BYKEYBOARD) & pnmtv -> action)		// verhindern, daß erstes Element ggf. gehakt wird
		m_pObjProps -> OnSelChanged(e);

// Beschreibungstext setzen
WObjectProperty ObjProp;

	if (S_OK == GetObjectProperty(ObjProp.ppi())) {
	// derzeit selektierte Objekteigenschaft näher beschreiben
	char cbBuffer[_MAX_PATH];
	
		if (SUCCEEDED(ObjProp -> HelpInfo(cbBuffer, sizeof(cbBuffer), NULL, NULL)))
			m_ftDesc.SetText(cbBuffer);

	DWORD dwFlags = 0;

		if (SUCCEEDED(ObjProp -> GetPropInfo(NULL, 0, &dwFlags)) && PROPCAPS_INTERACTIVE_INIT & dwFlags)
			m_pbConfig.Enable();
		else
			m_pbConfig.Disable();

	} else {
		m_ftDesc.SetText(g_cbNil);
		m_pbConfig.Disable();
	}

// Knöpfchen richten
	AdjustSheetButtons();
}
Пример #5
0
  SegmentationPtr ParseSegmentation(const JSONValue& doc) {
    SegmentationPtr segmentation;

    // Required: type
    string type = GetStringProperty(doc, "type");
    if (type == "mmseg") {
      // Required: dict
      DictPtr dict = ParseDict(GetObjectProperty(doc, "dict"));
      segmentation = SegmentationPtr(new MaxMatchSegmentation(dict));
    } else {
      throw InvalidFormat("Unknown segmentation type: " + type);
    }
    return segmentation;
  }