//----------------------------------------------------------------------- void TextureAnimatorPropertyWindow::_initProperties(void) { // Set the (internationalized) property names PRNL_ANIMATION_TYPE = _("Animation type"); TAT_LOOP = _("Loop"); TAT_UP_DOWN = _("Up - Down"); TAT_RANDOM = _("Random"); PRNL_TEXCOORDS_START = _("Texture coordinate start"); PRNL_TEXCOORDS_END = _("Texture coordinate end"); PRNL_START_RANDOM = _("Start random"); PRNL_TIME_STEP = _("Time step"); mHelpHtml = wxT("AffectorTextureAnimator.html"); // Time Step Animation: ParticleUniverse::Real Append(wxFloatProperty(PRNL_TIME_STEP, PRNL_TIME_STEP, ParticleUniverse::TextureAnimator::DEFAULT_TIME_STEP)); SetPropertyEditor(PRNL_TIME_STEP, wxPG_EDITOR(SpinCtrl)); // Animation Type: List mAnimationTypes.Add(TAT_LOOP); mAnimationTypes.Add(TAT_UP_DOWN); mAnimationTypes.Add(TAT_RANDOM); wxPGId pid = Append(wxEnumProperty(PRNL_ANIMATION_TYPE, PRNL_ANIMATION_TYPE, mAnimationTypes)); // Start Texture Coordinates: ParticleUniverse::uint16 Append(wxUIntProperty(PRNL_TEXCOORDS_START, PRNL_TEXCOORDS_START, ParticleUniverse::TextureAnimator::DEFAULT_TEXCOORDS_START)); SetPropertyEditor(PRNL_TEXCOORDS_START, wxPG_EDITOR(SpinCtrl)); // End Texture Coordinates: ParticleUniverse::uint16 Append(wxUIntProperty(PRNL_TEXCOORDS_END, PRNL_TEXCOORDS_END, ParticleUniverse::TextureAnimator::DEFAULT_TEXCOORDS_END)); SetPropertyEditor(PRNL_TEXCOORDS_END, wxPG_EDITOR(SpinCtrl)); // Random Start: bool Append(wxBoolProperty(PRNL_START_RANDOM, PRNL_START_RANDOM, ParticleUniverse::TextureAnimator::DEFAULT_START_RANDOM)); }
void EditorTerraceModule::fillPropertyGrid (wxPropertyGrid *pg) { mControlPointIDs.clear (); pg->Append( wxPropertyCategory(wxT("Source modules")) ); appendSourceModuleProperty (pg, wxT("Source module"), mSourceModules[0]); pg->Append( wxPropertyCategory(wxT("Parameters")) ); pg->Append( wxIntProperty(wxT("Control points"), wxPG_LABEL, mPointCount) ); pg->Append( wxBoolProperty(wxT("Invert"), wxPG_LABEL, mModule.isInverted()) ); mPointCategoryID = pg->Append( wxPropertyCategory(wxT("Points")) ); changeNumberOfControlPoints(pg); }
//----------------------------------------------------------------------- void DoAffectorEventHandlerPropertyWindow::_initProperties(void) { // Set the (internationalized) property names PRNL_PRE_POST = _("Perform pre/post processing"); mHelpHtml = wxT("EventHandlerDoAffector.html"); // Affector component: Doesn't have a property, because this is established by means of a connection // Pre/Post Processing: bool Append(wxBoolProperty(PRNL_PRE_POST, PRNL_PRE_POST, ParticleUniverse::DoAffectorEventHandler::DEFAULT_PRE_POST)); }
void wxsPositionSizeProperty::PGCreate(wxsPropertyContainer* Object,wxPropertyGridManager* Grid,wxPGId Parent) { wxPGId DefId = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxBoolProperty(GetPGName(),wxPG_LABEL,DEFVALUE)); wxPGId XId = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxIntProperty(PGXName,wxPG_LABEL,XVALUE)); wxPGId YId = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxIntProperty(PGYName,wxPG_LABEL,YVALUE)); wxPGId DUId = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxBoolProperty(PGDUName,wxPG_LABEL,DUVALUE)); Grid->SetPropertyAttribute(DefId,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(DUId,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); PGRegister(Object,Grid,DefId,DEFIND); PGRegister(Object,Grid,XId,XIND); PGRegister(Object,Grid,YId,YIND); PGRegister(Object,Grid,DUId,DUIND); if ( DEFVALUE ) { Grid->DisableProperty(XId); Grid->DisableProperty(YId); Grid->DisableProperty(DUId); } }
//----------------------------------------------------------------------- void TextureRotatorPropertyWindow::_initProperties(void) { // Set the (internationalized) property names PRNL_USE_OWN_SPEED = _("Use own speed"); PRNL_ROTATION = _("Rotation"); PRNL_ROTATION_SPEED = _("Rotation speed"); mHelpHtml = wxT("AffectorTextureRotator.html"); // Use Own Rotation speed Append(wxBoolProperty(PRNL_USE_OWN_SPEED, PRNL_USE_OWN_SPEED, ParticleUniverse::TextureRotator::DEFAULT_USE_OWN_SPEED)); // Rotation: Dynamic Attribute ParticleUniverse::DynamicAttributeFixed dynAttr; dynAttr.setValue(ParticleUniverse::TextureRotator::DEFAULT_ROTATION); appendDynamicAttribute(PRNL_ROTATION, PRNL_ROTATION, dynAttr); // Rotation Speed: Dynamic Attribute dynAttr.setValue(ParticleUniverse::TextureRotator::DEFAULT_ROTATION_SPEED); appendDynamicAttribute(PRNL_ROTATION_SPEED, PRNL_ROTATION_SPEED, dynAttr); }
void MaterialPropertyGridPage::populate() { mPropertyNameId = Append(wxStringProperty(wxT("Name"), wxPG_LABEL, mController->getMaterial()->getName())); mPropertyReceiveShadowsId = Append(wxBoolProperty(wxT("Receive Shadows"), wxPG_LABEL, mController->getMaterial()->getReceiveShadows())); mPropertyTransparencyCastsShadowsId = Append(wxBoolProperty(wxT("Transparency Casts Shadows"), wxPG_LABEL, mController->getMaterial()->getTransparencyCastsShadows())); }
void CPropertiesCanvas::AddProperty(Property* p, wxPGProperty* parent_prop) { switch(p->get_property_type()){ case StringPropertyType: { wxPGProperty *new_prop = wxStringProperty(p->GetShortString(),wxPG_LABEL, ((PropertyString*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; case DoublePropertyType: case LengthPropertyType: { wxString initial_value; initial_value << ((PropertyDouble*)p)->m_initial_value; // wxPGProperty *new_prop = wxFloatProperty(p->GetShortString(),wxPG_LABEL, ((PropertyDouble*)p)->m_initial_value); wxPGProperty *new_prop = wxStringProperty(p->GetShortString(),wxPG_LABEL, initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case IntPropertyType: { wxPGProperty *new_prop = wxIntProperty(p->GetShortString(),wxPG_LABEL, ((PropertyInt*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case ColorPropertyType: { HeeksColor& col = ((PropertyColor*)p)->m_initial_value; wxColour wcol(col.red, col.green, col.blue); wxPGProperty *new_prop = wxColourProperty(p->GetShortString(),wxPG_LABEL, wcol); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); } break; case ChoicePropertyType: { wxArrayString array_string; std::list< wxString >::iterator It; for(It = ((PropertyChoice*)p)->m_choices.begin(); It != ((PropertyChoice*)p)->m_choices.end(); It++){ array_string.Add(wxString(It->c_str())); } wxPGProperty *new_prop = wxEnumProperty(p->GetShortString(),wxPG_LABEL,array_string, ((PropertyChoice*)p)->m_initial_index); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); } break; case VertexPropertyType: { wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); Append( parent_prop, new_prop, p ); double x[3]; unsigned int number_of_axes = 3; if(((PropertyVertex*)p)->xyOnly())number_of_axes = 2; memcpy(x, ((PropertyVertex*)p)->m_x, number_of_axes*sizeof(double)); if(((PropertyVertex*)p)->m_affected_by_view_units) { for(unsigned int i = 0; i<number_of_axes; i++)x[i] /= wxGetApp().m_view_units; } wxPGProperty* x_prop = wxFloatProperty(_("x"),wxPG_LABEL, x[0]); if(!p->property_editable())x_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, x_prop, p ); wxPGProperty* y_prop = wxFloatProperty(_("y"),wxPG_LABEL, x[1]); if(!p->property_editable())y_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, y_prop, p ); if(!((PropertyVertex*)p)->xyOnly()) { wxPGProperty* z_prop = wxFloatProperty(_("z"),wxPG_LABEL, x[2]); if(!p->property_editable())z_prop->SetFlag(wxPG_PROP_READONLY); new_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, z_prop, p ); } } break; case TrsfPropertyType: { double x[3]; extract(((PropertyTrsf*)p)->m_trsf.TranslationPart(), x); gp_Dir xaxis(1, 0, 0); xaxis.Transform(((PropertyTrsf*)p)->m_trsf); gp_Dir yaxis(0, 1, 0); yaxis.Transform(((PropertyTrsf*)p)->m_trsf); double vertical_angle = 0; double horizontal_angle = 0; double twist_angle = 0; CoordinateSystem::AxesToAngles(xaxis, yaxis, vertical_angle, horizontal_angle, twist_angle); wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); Append( parent_prop, new_prop, p ); wxPGProperty* x_prop = wxFloatProperty(_("x"),wxPG_LABEL,x[0]); if(!p->property_editable())x_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, x_prop, p ); wxPGProperty* y_prop = wxFloatProperty(_("y"),wxPG_LABEL,x[1]); if(!p->property_editable())y_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, y_prop, p ); wxPGProperty* z_prop = wxFloatProperty(_("z"),wxPG_LABEL,x[2]); if(!p->property_editable())z_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, z_prop, p ); wxPGProperty* v_prop = wxFloatProperty(_("vertical angle"),wxPG_LABEL,vertical_angle); if(!p->property_editable())v_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, v_prop, p ); wxPGProperty* h_prop = wxFloatProperty(_("horizontal angle"),wxPG_LABEL,horizontal_angle); if(!p->property_editable())h_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, h_prop, p ); wxPGProperty* t_prop = wxFloatProperty(_("twist angle"),wxPG_LABEL,twist_angle); if(!p->property_editable())t_prop->SetFlag(wxPG_PROP_READONLY); new_prop->SetFlag(wxPG_PROP_READONLY); Append( new_prop, t_prop, p ); } break; case CheckPropertyType: { wxPGProperty* new_prop = wxBoolProperty(p->GetShortString(),wxPG_LABEL, ((PropertyCheck*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); m_pg->SetPropertyAttribute(new_prop, wxPG_BOOL_USE_CHECKBOX, true); } break; case ListOfPropertyType: { wxPGProperty* new_prop = wxParentProperty(p->GetShortString(),wxPG_LABEL); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p ); std::list< Property* >::iterator It; for(It = ((PropertyList*)p)->m_list.begin(); It != ((PropertyList*)p)->m_list.end(); It++){ Property* p2 = *It; AddProperty(p2, new_prop); } } break; case FilePropertyType: { wxPGProperty *new_prop = wxFileProperty(p->GetShortString(),wxPG_LABEL, ((PropertyFile*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; case DirectoryPropertyType: { wxPGProperty *new_prop = wxDirProperty(p->GetShortString(),wxPG_LABEL, ((PropertyDir*)p)->m_initial_value); if(!p->property_editable())new_prop->SetFlag(wxPG_PROP_READONLY); Append( parent_prop, new_prop, p); if(p->m_highlighted)m_pg->SetPropertyBackgroundColour(new_prop->GetId(), wxColour(71, 141, 248)); } break; } }
//----------------------------------------------------------------------- void BillboardRendererPropertyWindow::_initProperties(void) { // Set the (internationalized) property names PRNL_RENDERER_TYPE = _("Renderer type"); PRNL_BILLBOARD_TYPE = _("Billboard type"); BBT_POINT = _("Point"); BBT_ORIENTED_COMMON = _("Oriented Common"); BBT_ORIENTED_SELF = _("Oriented Self"); BBT_PERPENDICULAR_COMMON = _("Perpendicular Common"); BBT_PERPENDICULAR_SELF = _("Perpendicular Self"); BBT_ORIENTED_SHAPE = _("Oriented Shape"); PRNL_ORIGIN = _("Origin"); ORG_TOP_LEFT = _("Top-left"); ORG_TOP_CENTER = _("Top-center"); ORG_TOP_RIGHT = _("Top-right"); ORG_CENTER_LEFT = _("Center-left"); ORG_CENTER_RIGHT = _("Center-right"); ORG_CENTER = _("Center"); ORG_BOTTOM_LEFT = _("Bottom-left"); ORG_BOTTOM_RIGHT = _("Bottom-right"); ORG_BOTTOM_CENTER = _("Bottom-center"); PRNL_ROTATION_TYPE = _("Rotation type"); RT_VERTEX = _("Vertex"); RT_TEXTURE_COORDINATES = _("Texture coordinates"); PRNL_COMMON_DIRECTION = _("Common direction"); PRNL_UP_VECTOR = _("Up Vector"); PRNL_POINT_RENDERING = _("Point Rendering"); PRNL_ACCURATE_FACING = _("Accurate Facing"); ACF_ON = _("On"); ACF_OFF = _("Off"); PRNL_RENDERER_USE_SOFT_PARTICLES = _("Use soft particles"); PRNL_RENDERER_SOFT_PARTICLES_CONTRAST_POWER = _("Soft particles contrast power"); PRNL_RENDERER_SOFT_PARTICLES_SCALE = _("Soft particles scale"); PRNL_RENDERER_SOFT_PARTICLES_DELTA = _("Soft particles delta"); PRNL_X = _(".x"); PRNL_Y = _(".y"); PRNL_Z = _(".z"); mHelpHtml = wxT("RendererBillboard.html"); // Billboard Type: List mBillboardTypes.Add(BBT_POINT); mBillboardTypes.Add(BBT_ORIENTED_COMMON); mBillboardTypes.Add(BBT_ORIENTED_SELF); mBillboardTypes.Add(BBT_PERPENDICULAR_COMMON); mBillboardTypes.Add(BBT_PERPENDICULAR_SELF); mBillboardTypes.Add(BBT_ORIENTED_SHAPE); wxPGId pid = Append(wxEnumProperty(PRNL_BILLBOARD_TYPE, PRNL_BILLBOARD_TYPE, mBillboardTypes)); // Origin: List mOrigin.Add(ORG_TOP_LEFT); mOrigin.Add(ORG_TOP_CENTER); mOrigin.Add(ORG_TOP_RIGHT); mOrigin.Add(ORG_CENTER_LEFT); mOrigin.Add(ORG_CENTER_RIGHT); mOrigin.Add(ORG_CENTER); mOrigin.Add(ORG_BOTTOM_LEFT); mOrigin.Add(ORG_BOTTOM_RIGHT); mOrigin.Add(ORG_BOTTOM_CENTER); pid = Append(wxEnumProperty(PRNL_ORIGIN, PRNL_ORIGIN, mOrigin)); // Rotation Type: List mRotationTypes.Add(RT_VERTEX); mRotationTypes.Add(RT_TEXTURE_COORDINATES); pid = Append(wxEnumProperty(PRNL_ROTATION_TYPE, PRNL_ROTATION_TYPE, mRotationTypes)); // Common Direction: Ogre::Vector3 appendVector3(PRNL_COMMON_DIRECTION, PRNL_COMMON_DIRECTION, ParticleUniverse::BillboardRenderer::DEFAULT_COMMON_DIRECTION); // Common Up Vector: Ogre::Vector3 appendVector3(PRNL_UP_VECTOR, PRNL_UP_VECTOR, ParticleUniverse::BillboardRenderer::DEFAULT_COMMON_UP_VECTOR); // Point Rendering: bool Append(wxBoolProperty(PRNL_POINT_RENDERING, PRNL_POINT_RENDERING, ParticleUniverse::BillboardRenderer::DEFAULT_POINT_RENDERING)); // Accurate Facing: List mAccurateFacing.Add(ACF_ON); mAccurateFacing.Add(ACF_OFF); wxPGProperty* prop = wxEnumProperty(PRNL_ACCURATE_FACING, PRNL_ACCURATE_FACING, mAccurateFacing); Append(prop); prop->SetValueFromString(ACF_OFF); // Note: Although soft particles are generic renderer properties, they currently only work in combination with a billboard renderer. // Use soft particles: Bool Append(wxBoolProperty(PRNL_RENDERER_USE_SOFT_PARTICLES, PRNL_RENDERER_USE_SOFT_PARTICLES, ParticleUniverse::ParticleRenderer::DEFAULT_USE_SOFT_PARTICLES)); // Soft particles contrast power: ParticleUniverse::Real Append(wxFloatProperty(PRNL_RENDERER_SOFT_PARTICLES_CONTRAST_POWER, PRNL_RENDERER_SOFT_PARTICLES_CONTRAST_POWER, ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_CONTRAST_POWER)); SetPropertyEditor(PRNL_RENDERER_SOFT_PARTICLES_CONTRAST_POWER, wxPG_EDITOR(SpinCtrl)); // Soft particles scale: ParticleUniverse::Real Append(wxFloatProperty(PRNL_RENDERER_SOFT_PARTICLES_SCALE, PRNL_RENDERER_SOFT_PARTICLES_SCALE, ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_SCALE)); SetPropertyEditor(PRNL_RENDERER_SOFT_PARTICLES_SCALE, wxPG_EDITOR(SpinCtrl)); // Soft particles delta: ParticleUniverse::Real Append(wxFloatProperty(PRNL_RENDERER_SOFT_PARTICLES_DELTA, PRNL_RENDERER_SOFT_PARTICLES_DELTA, ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_DELTA)); SetPropertyEditor(PRNL_RENDERER_SOFT_PARTICLES_DELTA, wxPG_EDITOR(SpinCtrl)); }
bool ConfigOptionsDialog::AddPropGridSelectValue(ConfigSelectValue & selectValue, wxPGId parentHeaderID, const string & parentNamePath) { wxPGId addID = 0; // Calculate the child path string selectNamePath = parentNamePath + string(".") + selectValue.typeName; // Add a selection based on the type switch(selectValue.configType) { case(CT_String): { // Get the default value wxString defaultValue; if(selectValue.defaultValue.size() > 0) { defaultValue = selectValue.defaultValue[0].c_str(); } // Add a string property addID = propGrid->AppendIn(parentHeaderID, wxStringProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_KeyCombination): case(CT_StringList): { // Get the default values wxArrayString defaultValues; for(uint i=0; i<selectValue.defaultValue.size(); i++) { defaultValues.Add(selectValue.defaultValue[i].c_str()); } // Add a string-list property addID = propGrid->AppendIn(parentHeaderID, wxArrayStringProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValues)); } break; case(CT_Boolean): { // Get the default value bool defaultValue = false; if(selectValue.defaultValue.size() > 0) { // If the default value is true if(selectValue.defaultValue[0] == CONFIG_PLUGIN_TOKEN_TRUE) { defaultValue = true; } else if(selectValue.defaultValue[0] == CONFIG_PLUGIN_TOKEN_FALSE) { defaultValue = false; } else { wxLogError("AddPropGridSelectValue - Unknown boolean value \"%s\"", selectValue.defaultValue[0].c_str()); return false; } } // Add a boolean selection addID = propGrid->AppendIn(parentHeaderID, wxBoolProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_Int): { // Get the default value int defaultValue = 0; if(selectValue.defaultValue.size() > 0) { defaultValue = atoi(selectValue.defaultValue[0].c_str()); } // Add a int property addID = propGrid->AppendIn(parentHeaderID, wxIntProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_UInt): { // Get the default value unsigned int defaultValue = 0; if(selectValue.defaultValue.size() > 0) { int testValue = atoi(selectValue.defaultValue[0].c_str()); if(testValue >= 0) { defaultValue = testValue; } } // Add a uint property addID = propGrid->AppendIn(parentHeaderID, wxUIntProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_Float): { // Get the default value float defaultValue = 0.0f; if(selectValue.defaultValue.size() > 0) { defaultValue = atof(selectValue.defaultValue[0].c_str()); } // Add a float property addID = propGrid->AppendIn(parentHeaderID, wxFloatProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_Enum): { // Get the default value wxArrayString enumValues; int defaultValue = 0; for(uint i=0; i<selectValue.enumValueTypes.size(); i++) { enumValues.Add(selectValue.enumValueTypes[i].c_str()); // Check if the value is the default value if(selectValue.defaultValue.size() > 0 && selectValue.defaultValue[0] == selectValue.enumValueTypes[i]) { defaultValue = i; } } // Add a enum property addID = propGrid->AppendIn(parentHeaderID, wxEnumProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), enumValues, defaultValue)); } break; case(CT_EnumMulti): { // Get the default value wxArrayString enumValues; wxArrayInt defaultValues; for(uint i=0; i<selectValue.enumValueTypes.size(); i++) { enumValues.Add(selectValue.enumValueTypes[i].c_str()); // Check if the value is the default value for(uint i2=0; i2<selectValue.defaultValue.size(); i2++) { // Compare the default value to the enum value if(selectValue.defaultValue[i2] == selectValue.enumValueTypes[i]) { defaultValues.Add(i); break; } } } // Add a multiselect enum property addID = propGrid->AppendIn(parentHeaderID, wxMultiChoiceProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), enumValues, defaultValues)); } break; case(CT_DirSelect): { // Get the default value wxString defaultValue; if(selectValue.defaultValue.size() > 0) { defaultValue = selectValue.defaultValue[0].c_str(); } // Add a directory select property addID = propGrid->AppendIn(parentHeaderID, wxDirProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; case(CT_FileSelect): { // Get the default value wxString defaultValue; if(selectValue.defaultValue.size() > 0) { defaultValue = selectValue.defaultValue[0].c_str(); } // Add a file select property addID = propGrid->AppendIn(parentHeaderID, wxFileProperty(selectValue.typeName.c_str(), selectNamePath.c_str(), defaultValue)); } break; default: wxLogError("AddPropGridSelectValue - Unknown type"); return false; } // Assign the comment string wxString commentStr = selectValue.commentString.c_str(); commentStr.Replace("\\n", "\n"); propGrid->SetPropertyHelpString(addID, commentStr); return true; }
//----------------------------------------------------------------------- void PhysXFluidExternPropertyWindow::_initProperties(void) { // Set the (internationalized) property names PRNL_PHYSX_REST_PARTICLE_PER_METER = _("Rest particle per meter"); PRNL_PHYSX_REST_DENSITY = _("Rest density"); PRNL_PHYSX_KERNEL_RADIUS_MULTIPLIER = _("Kernel radius multiplier"); PRNL_PHYSX_MOTION_LIMIT_MULTIPLIER = _("Motion limit multiplier"); PRNL_PHYSX_COLLISION_DISTANCE_MULTIPLIER = _("Collision dist. multiplier"); PRNL_PHYSX_PACKET_SIZE_MULTIPLIER = _("Packet size multiplier"); PRNL_PHYSX_STIFFNESS = _("Stiffness"); PRNL_PHYSX_VISCOSITY = _("Viscosity"); PRNL_PHYSX_SURFACE_TENSION = _("Surface tension"); PRNL_PHYSX_DAMPING = _("Damping"); PRNL_PHYSX_EXTERNAL_ACCELERATION = _("External acceleration"); PRNL_PHYSX_RESTITUTION_FOR_STATIC_SHAPES = _("Restitution static shapes"); PRNL_PHYSX_DYNAMIC_FRICTION_FOR_STATIC_SHAPES = _("Dyn. friction static shapes"); PRNL_PHYSX_STATIC_FRICTION_FOR_STATIC_SHAPES = _("Static friction static shapes"); PRNL_PHYSX_ATTRACTION_FOR_STATIC_SHAPES = _("Attraction static shapes"); PRNL_PHYSX_RESTITUTION_FOR_DYNAMIC_SHAPES = _("Restitution dynamic shapes"); PRNL_PHYSX_DYNAMIC_FRICTION_FOR_DYNAMIC_SHAPES = _("Dyn. friction dyn. shapes"); PRNL_PHYSX_STATIC_FRICTION_FOR_DYNAMIC_SHAPES = _("Static friction dyn. shapes"); PRNL_PHYSX_ATTRACTION_FOR_DYNAMIC_SHAPES = _("Attraction dynamic shapes"); PRNL_PHYSX_COLLISION_RESPONSE_COEFFICIENT = _("Collision response coeff."); PRNL_PHYSX_SIMULATION_METHOD = _("Simulation method"); PRNL_PHYSX_COLLISION_METHOD = _("Collision method"); PRNL_PHYSX_FLAG_VISUALIZATION = _("Visualisation"); PRNL_PHYSX_FLAG_DISABLE_GRAVITY = _("Disable gravity"); PRNL_PHYSX_FLAG_COLLISION_TWOWAY = _("Collision twoway"); PRNL_PHYSX_FLAG_FLUID_ENABLED = _("Fluid enabled"); PRNL_PHYSX_FLAG_HARDWARE = _("Hardware"); PRNL_PHYSX_FLAG_PRIORITY_MODE = _("Priority mode"); PRNL_PHYSX_FLAG_PROJECT_TO_PLANE = _("Project to plane"); PRNL_PHYSX_FLAG_STRICT_COOKING_FORMAT = _("Strict cooking format"); PHYSX_INTERCOLLISION = _("Intercollision"); PHYSX_NOINTERCOLLISION = _("Non-intercollision"); PHYSX_MIX_INTERCOLLISION = _("Mixed intercollision"); PHYSX_STATIC = _("Static"); PHYSX_DYNAMIC = _("Dynamic"); mHelpHtml = wxT("ExternPhysXFluid.html"); NxFluidDesc fluidDesc; fluidDesc.setToDefault(); // Rest particle per meter: NxReal Append(wxFloatProperty(PRNL_PHYSX_REST_PARTICLE_PER_METER, PRNL_PHYSX_REST_PARTICLE_PER_METER, fluidDesc.restParticlesPerMeter)); SetPropertyEditor(PRNL_PHYSX_REST_PARTICLE_PER_METER, wxPG_EDITOR(SpinCtrl)); // Rest density: NxReal Append(wxFloatProperty(PRNL_PHYSX_REST_DENSITY, PRNL_PHYSX_REST_DENSITY, fluidDesc.restDensity)); SetPropertyEditor(PRNL_PHYSX_REST_DENSITY, wxPG_EDITOR(SpinCtrl)); // Kernel radius multiplier: NxReal Append(wxFloatProperty(PRNL_PHYSX_KERNEL_RADIUS_MULTIPLIER, PRNL_PHYSX_KERNEL_RADIUS_MULTIPLIER, fluidDesc.kernelRadiusMultiplier)); SetPropertyEditor(PRNL_PHYSX_KERNEL_RADIUS_MULTIPLIER, wxPG_EDITOR(SpinCtrl)); // Motion limit multiplier: NxReal Append(wxFloatProperty(PRNL_PHYSX_MOTION_LIMIT_MULTIPLIER, PRNL_PHYSX_MOTION_LIMIT_MULTIPLIER, fluidDesc.motionLimitMultiplier)); SetPropertyEditor(PRNL_PHYSX_MOTION_LIMIT_MULTIPLIER, wxPG_EDITOR(SpinCtrl)); // Collision distance multiplier: NxReal Append(wxFloatProperty(PRNL_PHYSX_COLLISION_DISTANCE_MULTIPLIER, PRNL_PHYSX_COLLISION_DISTANCE_MULTIPLIER, fluidDesc.collisionDistanceMultiplier)); SetPropertyEditor(PRNL_PHYSX_COLLISION_DISTANCE_MULTIPLIER, wxPG_EDITOR(SpinCtrl)); // Packet size multiplier: NxU32 Append(wxUIntProperty(PRNL_PHYSX_PACKET_SIZE_MULTIPLIER, PRNL_PHYSX_PACKET_SIZE_MULTIPLIER, fluidDesc.packetSizeMultiplier)); SetPropertyEditor(PRNL_PHYSX_PACKET_SIZE_MULTIPLIER, wxPG_EDITOR(SpinCtrl)); // Stiffness: NxReal Append(wxFloatProperty(PRNL_PHYSX_STIFFNESS, PRNL_PHYSX_STIFFNESS, fluidDesc.stiffness)); SetPropertyEditor(PRNL_PHYSX_STIFFNESS, wxPG_EDITOR(SpinCtrl)); // Viscosity: NxReal Append(wxFloatProperty(PRNL_PHYSX_VISCOSITY, PRNL_PHYSX_VISCOSITY, fluidDesc.viscosity)); SetPropertyEditor(PRNL_PHYSX_VISCOSITY, wxPG_EDITOR(SpinCtrl)); // Surface tension: NxReal Append(wxFloatProperty(PRNL_PHYSX_SURFACE_TENSION, PRNL_PHYSX_SURFACE_TENSION, fluidDesc.surfaceTension)); SetPropertyEditor(PRNL_PHYSX_SURFACE_TENSION, wxPG_EDITOR(SpinCtrl)); // Damping: NxReal Append(wxFloatProperty(PRNL_PHYSX_DAMPING, PRNL_PHYSX_DAMPING, fluidDesc.damping)); SetPropertyEditor(PRNL_PHYSX_DAMPING, wxPG_EDITOR(SpinCtrl)); // External acceleration: NxVec3 appendVector3(PRNL_PHYSX_EXTERNAL_ACCELERATION, PRNL_PHYSX_EXTERNAL_ACCELERATION, ParticleUniverse::PhysXMath::convert(fluidDesc.externalAcceleration)); // Restitution for static shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_RESTITUTION_FOR_STATIC_SHAPES, PRNL_PHYSX_RESTITUTION_FOR_STATIC_SHAPES, fluidDesc.restitutionForStaticShapes)); SetPropertyEditor(PRNL_PHYSX_RESTITUTION_FOR_STATIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Dynamic friction for static shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_STATIC_SHAPES, PRNL_PHYSX_DYNAMIC_FRICTION_FOR_STATIC_SHAPES, fluidDesc.dynamicFrictionForStaticShapes)); SetPropertyEditor(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_STATIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Static friction for static shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_STATIC_FRICTION_FOR_STATIC_SHAPES, PRNL_PHYSX_STATIC_FRICTION_FOR_STATIC_SHAPES, fluidDesc.staticFrictionForStaticShapes)); SetPropertyEditor(PRNL_PHYSX_STATIC_FRICTION_FOR_STATIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Attraction for static shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_ATTRACTION_FOR_STATIC_SHAPES, PRNL_PHYSX_ATTRACTION_FOR_STATIC_SHAPES, fluidDesc.attractionForStaticShapes)); SetPropertyEditor(PRNL_PHYSX_ATTRACTION_FOR_STATIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Restitution for dynamic shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_RESTITUTION_FOR_DYNAMIC_SHAPES, PRNL_PHYSX_RESTITUTION_FOR_DYNAMIC_SHAPES, fluidDesc.restitutionForDynamicShapes)); SetPropertyEditor(PRNL_PHYSX_RESTITUTION_FOR_DYNAMIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Dynamic friction for dynamic shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_DYNAMIC_SHAPES, PRNL_PHYSX_DYNAMIC_FRICTION_FOR_DYNAMIC_SHAPES, fluidDesc.dynamicFrictionForDynamicShapes)); SetPropertyEditor(PRNL_PHYSX_DYNAMIC_FRICTION_FOR_DYNAMIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Static friction for dynamic shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_STATIC_FRICTION_FOR_DYNAMIC_SHAPES, PRNL_PHYSX_STATIC_FRICTION_FOR_DYNAMIC_SHAPES, fluidDesc.staticFrictionForDynamicShapes)); SetPropertyEditor(PRNL_PHYSX_STATIC_FRICTION_FOR_DYNAMIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Attraction for dynamic shapes: NxReal Append(wxFloatProperty(PRNL_PHYSX_ATTRACTION_FOR_DYNAMIC_SHAPES, PRNL_PHYSX_ATTRACTION_FOR_DYNAMIC_SHAPES, fluidDesc.attractionForDynamicShapes)); SetPropertyEditor(PRNL_PHYSX_ATTRACTION_FOR_DYNAMIC_SHAPES, wxPG_EDITOR(SpinCtrl)); // Collision response coefficient: NxReal Append(wxFloatProperty(PRNL_PHYSX_COLLISION_RESPONSE_COEFFICIENT, PRNL_PHYSX_COLLISION_RESPONSE_COEFFICIENT, fluidDesc.collisionResponseCoefficient)); SetPropertyEditor(PRNL_PHYSX_COLLISION_RESPONSE_COEFFICIENT, wxPG_EDITOR(SpinCtrl)); // Collision group: NxCollisionGroup Append(wxUIntProperty(PRNL_PHYSX_COLLISION_GROUP, PRNL_PHYSX_COLLISION_GROUP, fluidDesc.collisionGroup)); SetPropertyEditor(PRNL_PHYSX_COLLISION_GROUP, wxPG_EDITOR(SpinCtrl)); // Simulation method: List wxArrayString simulationMethod; simulationMethod.Add(PHYSX_INTERCOLLISION); simulationMethod.Add(PHYSX_NOINTERCOLLISION); simulationMethod.Add(PHYSX_MIX_INTERCOLLISION); wxPGId pid = Append(wxEnumProperty(PRNL_PHYSX_SIMULATION_METHOD, PRNL_PHYSX_SIMULATION_METHOD, simulationMethod)); // Collision method: List wxArrayString collisionMethod; collisionMethod.Add(PHYSX_STATIC); collisionMethod.Add(PHYSX_DYNAMIC); wxPGId pid2 = Append(wxEnumProperty(PRNL_PHYSX_COLLISION_METHOD, PRNL_PHYSX_COLLISION_METHOD, collisionMethod)); // Visualisation: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_VISUALIZATION, PRNL_PHYSX_FLAG_VISUALIZATION, fluidDesc.flags & NX_FF_VISUALIZATION)); // Disable gravity: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_DISABLE_GRAVITY, PRNL_PHYSX_FLAG_DISABLE_GRAVITY, fluidDesc.flags & NX_FF_DISABLE_GRAVITY)); // Collision twoway: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_COLLISION_TWOWAY, PRNL_PHYSX_FLAG_COLLISION_TWOWAY, fluidDesc.flags & NX_FF_COLLISION_TWOWAY)); // Fluid enabled: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_FLUID_ENABLED, PRNL_PHYSX_FLAG_FLUID_ENABLED, fluidDesc.flags & NX_FF_ENABLED)); // Hardware: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_HARDWARE, PRNL_PHYSX_FLAG_HARDWARE, fluidDesc.flags & NX_FF_HARDWARE)); // Priority mode: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_PRIORITY_MODE, PRNL_PHYSX_FLAG_PRIORITY_MODE, fluidDesc.flags & NX_FF_PRIORITY_MODE)); // Project to plane: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_PROJECT_TO_PLANE, PRNL_PHYSX_FLAG_PROJECT_TO_PLANE, fluidDesc.flags & NX_FF_PROJECT_TO_PLANE)); // Strict cooking format: bool Append(wxBoolProperty(PRNL_PHYSX_FLAG_STRICT_COOKING_FORMAT, PRNL_PHYSX_FLAG_STRICT_COOKING_FORMAT, fluidDesc.flags & NX_FF_FORCE_STRICT_COOKING_FORMAT)); }
void wxsBoolProperty::PGCreate(wxsPropertyContainer* Object,wxPropertyGridManager* Grid,wxPGId Parent) { wxPGId ID = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxBoolProperty(GetPGName(),wxPG_LABEL,VALUE)); Grid->SetPropertyAttribute(ID,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); PGRegister(Object,Grid,ID); }
void wxsSizerFlagsProperty::PGCreate(wxsPropertyContainer* Object,wxPropertyGridManager* Grid,wxPGId Parent) { #if !(wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0)) wxPGId ID1, ID2, ID3, ID4, ID5, ID6; #endif // Creating border flags if ( (FLAGS & BorderMask) == BorderMask ) { FLAGS |= BorderAll | BorderPrevAll; } else { FLAGS &= ~BorderAll & ~BorderPrevAll; } wxPGChoices PGC; PGC.Add(_("Top"),BorderTop); PGC.Add(_("Bottom"),BorderBottom); PGC.Add(_("Left"),BorderLeft); PGC.Add(_("Right"),BorderRight); PGC.Add(_("All"),BorderAll); #if wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0) wxPGId ID1 = Grid->AppendIn(Parent,new wxFlagsProperty(_("Border"),wxPG_LABEL,PGC,FLAGS&(BorderMask|BorderAll))); PGRegister(Object,Grid,ID1,BORDERIND); #else PGRegister(Object,Grid,ID1 = Grid->AppendIn(Parent, wxFlagsProperty(_("Border"),wxPG_LABEL,PGC,FLAGS&(BorderMask|BorderAll))),BORDERIND); #endif wxPGChoices PGC2; PGC2.Add(_("Left"),AlignLeft); PGC2.Add(_("Center"),AlignCenterHorizontal); PGC2.Add(_("Right"),AlignRight); #if wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0) wxPGId ID2 = Grid->AppendIn(Parent,new wxEnumProperty(_("Horizontal align"),wxPG_LABEL,PGC2,FLAGS&AlignHMask)); PGRegister(Object,Grid,ID2,ALIGNHIND); #else PGRegister(Object,Grid,ID2 = Grid->AppendIn(Parent,NEW_IN_WXPG14X wxEnumProperty(_("Horizontal align"),wxPG_LABEL,PGC2,FLAGS&AlignHMask)),ALIGNHIND); #endif wxPGChoices PGC3; PGC3.Add(_("Top"),AlignTop); PGC3.Add(_("Center"),AlignCenterVertical); PGC3.Add(_("Bottom"),AlignBottom); #if wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0) wxPGId ID3 = Grid->AppendIn(Parent,new wxEnumProperty(_("Vertical align"),wxPG_LABEL,PGC3,FLAGS&AlignVMask)); PGRegister(Object,Grid,ID3,ALIGNVIND); #else PGRegister(Object,Grid,ID3 = Grid->AppendIn(Parent, wxEnumProperty(_("Vertical align"),wxPG_LABEL,PGC3,FLAGS&AlignVMask)),ALIGNVIND); #endif #if wxCHECK_VERSION(2, 9, 0) || wxCHECK_PROPGRID_VERSION(1, 4, 0) wxPGId ID4 = Grid->AppendIn(Parent,new wxBoolProperty(_("Expand"),wxPG_LABEL,(FLAGS&Expand)!=0)); wxPGId ID5 = Grid->AppendIn(Parent,new wxBoolProperty(_("Shaped"),wxPG_LABEL,(FLAGS&Shaped)!=0)); wxPGId ID6 = Grid->AppendIn(Parent,new wxBoolProperty(_("Fixed min size"),wxPG_LABEL,(FLAGS&FixedMinSize)!=0)); PGRegister(Object,Grid,ID4,EXPANDIND); PGRegister(Object,Grid,ID5,SHAPEDIND); PGRegister(Object,Grid,ID6,FIXEDIND); #else PGRegister(Object,Grid,ID4 = Grid->AppendIn(Parent, wxBoolProperty(_("Expand"),wxPG_LABEL,(FLAGS&Expand)!=0)),EXPANDIND); PGRegister(Object,Grid,ID5 = Grid->AppendIn(Parent, wxBoolProperty(_("Shaped"),wxPG_LABEL,(FLAGS&Shaped)!=0)),SHAPEDIND); PGRegister(Object,Grid,ID6 = Grid->AppendIn(Parent, wxBoolProperty(_("Fixed min size"),wxPG_LABEL,(FLAGS&FixedMinSize)!=0)),FIXEDIND); #endif Grid->SetPropertyAttribute(ID1,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(ID2,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(ID3,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(ID4,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(ID5,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); Grid->SetPropertyAttribute(ID6,wxPG_BOOL_USE_CHECKBOX,1L,wxPG_RECURSE); }