guiInspectorTypes.cpp
Engine/source/gui/editor/guiInspectorTypes.cpp
Public Functions
ConsoleDocClass(GuiInspectorTypeBitMask32 , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeBitMask32.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeBitMask32Helper , "@brief Inspector field type support <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeBitMask32.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCheckBox , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">CheckBox\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColor , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeColor\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColorF , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">LinearColorF\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColorI , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ColorI\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCommand , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Command\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCubemapName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Cubemap\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeEaseF , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeEaseF.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeEnum , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Enum\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeFileName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FileName\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeGuiProfile , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiProfile\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeImageFileName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FileName\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeMaterialName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Material\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeMenuBase , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MenuBase\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Name\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypePrefabFilename , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">PrefabFilename\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeRectUV , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeRectUV.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeS32 , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">S32\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXParameterName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXParameter\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXSourceName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXSource\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXStateName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXState\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeShapeFilename , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Shapes\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeTerrainMaterialIndex , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TerrainMaterialIndex\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeTerrainMaterialName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TerrainMaterial\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
DefineEngineMethod(GuiInspectorTypeBitMask32 , applyBit , void , () , "" )
DefineEngineMethod(GuiInspectorTypeFileName , apply , void , (String path) , "" )
Detailed Description
Public Functions
ConsoleDocClass(GuiInspectorTypeBitMask32 , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeBitMask32.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeBitMask32Helper , "@brief Inspector field type support <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeBitMask32.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCheckBox , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">CheckBox\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColor , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeColor\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColorF , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">LinearColorF\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeColorI , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ColorI\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCommand , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Command\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeCubemapName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Cubemap\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeEaseF , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeEaseF.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeEnum , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Enum\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeFileName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FileName\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeGuiProfile , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiProfile\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeImageFileName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">FileName\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeMaterialName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Material\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeMenuBase , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MenuBase\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Name\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypePrefabFilename , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">PrefabFilename\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeRectUV , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TypeRectUV.\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeS32 , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">S32\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXParameterName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXParameter\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXSourceName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXSource\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeSFXStateName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SFXState\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeShapeFilename , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Shapes\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeTerrainMaterialIndex , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TerrainMaterialIndex\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
ConsoleDocClass(GuiInspectorTypeTerrainMaterialName , "@brief Inspector field type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TerrainMaterial\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )
DefineEngineMethod(GuiInspectorTypeBitMask32 , applyBit , void , () , "" )
DefineEngineMethod(GuiInspectorTypeFileName , apply , void , (String path) , "" )
IMPLEMENT_CONOBJECT(GuiInspectorTypeBitMask32 )
IMPLEMENT_CONOBJECT(GuiInspectorTypeBitMask32Helper )
IMPLEMENT_CONOBJECT(GuiInspectorTypeCheckBox )
IMPLEMENT_CONOBJECT(GuiInspectorTypeColor )
IMPLEMENT_CONOBJECT(GuiInspectorTypeColorF )
IMPLEMENT_CONOBJECT(GuiInspectorTypeColorI )
IMPLEMENT_CONOBJECT(GuiInspectorTypeCommand )
IMPLEMENT_CONOBJECT(GuiInspectorTypeCubemapName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeEaseF )
IMPLEMENT_CONOBJECT(GuiInspectorTypeEnum )
IMPLEMENT_CONOBJECT(GuiInspectorTypeFileName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeGuiProfile )
IMPLEMENT_CONOBJECT(GuiInspectorTypeImageFileName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeMaterialName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeMenuBase )
IMPLEMENT_CONOBJECT(GuiInspectorTypeName )
IMPLEMENT_CONOBJECT(GuiInspectorTypePrefabFilename )
IMPLEMENT_CONOBJECT(GuiInspectorTypeRectUV )
IMPLEMENT_CONOBJECT(GuiInspectorTypeS32 )
IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXParameterName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXSourceName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXStateName )
IMPLEMENT_CONOBJECT(GuiInspectorTypeShapeFilename )
IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialIndex )
IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialName )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "platform/platform.h" 25#include "gui/editor/guiInspectorTypes.h" 26 27#include "gui/editor/inspector/group.h" 28#include "gui/controls/guiTextEditSliderCtrl.h" 29#include "gui/controls/guiTextEditSliderBitmapCtrl.h" 30#include "gui/buttons/guiSwatchButtonCtrl.h" 31#include "gui/containers/guiDynamicCtrlArrayCtrl.h" 32#include "core/strings/stringUnit.h" 33#include "materials/materialDefinition.h" 34#include "materials/materialManager.h" 35#include "materials/customMaterialDefinition.h" 36#include "gfx/gfxDrawUtil.h" 37#include "sfx/sfxTypes.h" 38#include "sfx/sfxParameter.h" 39#include "sfx/sfxState.h" 40#include "sfx/sfxSource.h" 41#include "gui/editor/editorFunctions.h" 42#include "math/mEase.h" 43#include "math/mathTypes.h" 44 45 46//----------------------------------------------------------------------------- 47// GuiInspectorTypeMenuBase 48//----------------------------------------------------------------------------- 49IMPLEMENT_CONOBJECT(GuiInspectorTypeMenuBase); 50 51ConsoleDocClass( GuiInspectorTypeMenuBase, 52 "@brief Inspector field type for MenuBase\n\n" 53 "Editor use only.\n\n" 54 "@internal" 55); 56 57GuiControl* GuiInspectorTypeMenuBase::constructEditControl() 58{ 59 GuiControl* retCtrl = new GuiPopUpMenuCtrl(); 60 61 GuiPopUpMenuCtrl *menu = dynamic_cast<GuiPopUpMenuCtrl*>(retCtrl); 62 63 // Let's make it look pretty. 64 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiPopUpMenuProfile" ); 65 _registerEditControl( retCtrl ); 66 67 // Configure it to update our value when the popup is closed 68 char szBuffer[512]; 69 dSprintf( szBuffer, 512, "%d.apply( %d.getText() );", getId(), menu->getId() ); 70 menu->setField("Command", szBuffer ); 71 72 //now add the entries, allow derived classes to override this 73 _populateMenu( menu ); 74 75 // Select the active item, or just set the text field if that fails 76 S32 id = menu->findText(getData()); 77 if (id != -1) 78 menu->setSelected(id, false); 79 else 80 menu->setField("text", getData()); 81 82 return retCtrl; 83} 84 85void GuiInspectorTypeMenuBase::setValue( StringTableEntry newValue ) 86{ 87 GuiPopUpMenuCtrl *ctrl = dynamic_cast<GuiPopUpMenuCtrl*>( mEdit ); 88 if ( ctrl != NULL ) 89 ctrl->setText( newValue ); 90} 91 92void GuiInspectorTypeMenuBase::_populateMenu( GuiPopUpMenuCtrl *menu ) 93{ 94 // do nothing, child classes override this. 95} 96 97//----------------------------------------------------------------------------- 98// GuiInspectorTypeEnum 99//----------------------------------------------------------------------------- 100IMPLEMENT_CONOBJECT(GuiInspectorTypeEnum); 101 102ConsoleDocClass( GuiInspectorTypeEnum, 103 "@brief Inspector field type for Enum\n\n" 104 "Editor use only.\n\n" 105 "@internal" 106); 107 108void GuiInspectorTypeEnum::_populateMenu( GuiPopUpMenuCtrl *menu ) 109{ 110 const EngineEnumTable* table = mField->table; 111 if( !table ) 112 { 113 ConsoleBaseType* type = ConsoleBaseType::getType( mField->type ); 114 if( type && type->getEnumTable() ) 115 table = type->getEnumTable(); 116 else 117 return; 118 } 119 120 const EngineEnumTable& t = *table; 121 const U32 numEntries = t.getNumValues(); 122 123 for( U32 i = 0; i < numEntries; ++ i ) 124 menu->addEntry( t[ i ].getName(), t[ i ] ); 125 126 menu->sort(); 127} 128 129void GuiInspectorTypeEnum::consoleInit() 130{ 131 Parent::consoleInit(); 132 133 // Set this to be the inspector type for all enumeration console types. 134 135 for( ConsoleBaseType* type = ConsoleBaseType::getListHead(); type != NULL; type = type->getListNext() ) 136 if( type->getTypeInfo() && type->getTypeInfo()->isEnum() ) 137 type->setInspectorFieldType( "GuiInspectorTypeEnum" ); 138} 139 140//----------------------------------------------------------------------------- 141// GuiInspectorTypeCubemapName 142//----------------------------------------------------------------------------- 143IMPLEMENT_CONOBJECT(GuiInspectorTypeCubemapName); 144 145ConsoleDocClass( GuiInspectorTypeCubemapName, 146 "@brief Inspector field type for Cubemap\n\n" 147 "Editor use only.\n\n" 148 "@internal" 149); 150 151void GuiInspectorTypeCubemapName::_populateMenu( GuiPopUpMenuCtrl *menu ) 152{ 153 PROFILE_SCOPE( GuiInspectorTypeCubemapName_populateMenu ); 154 155 // This could be expensive looping through the whole RootGroup 156 // and performing string comparisons... Put a profile here 157 // to keep an eye on it. 158 159 SimGroup *root = Sim::getRootGroup(); 160 161 SimGroupIterator iter( root ); 162 for ( ; *iter; ++iter ) 163 { 164 if ( dStricmp( (*iter)->getClassName(), "CubemapData" ) == 0 ) 165 menu->addEntry( (*iter)->getName(), 0 ); 166 } 167 168 menu->sort(); 169} 170 171void GuiInspectorTypeCubemapName::consoleInit() 172{ 173 Parent::consoleInit(); 174 175 ConsoleBaseType::getType(TypeCubemapName)->setInspectorFieldType("GuiInspectorTypeCubemapName"); 176} 177 178//----------------------------------------------------------------------------- 179// GuiInspectorTypeMaterialName 180//----------------------------------------------------------------------------- 181 182IMPLEMENT_CONOBJECT(GuiInspectorTypeMaterialName); 183 184ConsoleDocClass( GuiInspectorTypeMaterialName, 185 "@brief Inspector field type for Material\n\n" 186 "Editor use only.\n\n" 187 "@internal" 188); 189 190GuiInspectorTypeMaterialName::GuiInspectorTypeMaterialName() 191 : mBrowseButton( NULL ) 192{ 193} 194 195void GuiInspectorTypeMaterialName::consoleInit() 196{ 197 Parent::consoleInit(); 198 199 ConsoleBaseType::getType(TypeMaterialName)->setInspectorFieldType("GuiInspectorTypeMaterialName"); 200} 201 202GuiControl* GuiInspectorTypeMaterialName::construct(const char* command) 203{ 204 GuiControl* retCtrl = new GuiTextEditCtrl(); 205 206 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 207 208 _registerEditControl( retCtrl ); 209 210 char szBuffer[512]; 211 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() ); 212 retCtrl->setField("AltCommand", szBuffer ); 213 retCtrl->setField("Validate", szBuffer ); 214 215 //return retCtrl; 216 mBrowseButton = new GuiBitmapButtonCtrl(); 217 218 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 219 220 dSprintf( szBuffer, 512, command, getId()); 221 mBrowseButton->setField( "Command", szBuffer ); 222 223 //temporary static button name 224 char bitmapName[512] = "tools/materialEditor/gui/change-material-btn"; 225 mBrowseButton->setBitmap( bitmapName ); 226 227 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiButtonProfile" ); 228 mBrowseButton->registerObject(); 229 addObject( mBrowseButton ); 230 231 // Position 232 mBrowseButton->resize( browseRect.point, browseRect.extent ); 233 234 return retCtrl; 235} 236 237GuiControl* GuiInspectorTypeMaterialName::constructEditControl() 238{ 239 return construct("materialSelector.showDialog(\"%d.apply\", \"name\");"); 240} 241 242bool GuiInspectorTypeMaterialName::updateRects() 243{ 244 Point2I fieldPos = getPosition(); 245 Point2I fieldExtent = getExtent(); 246 S32 dividerPos, dividerMargin; 247 mInspector->getDivider( dividerPos, dividerMargin ); 248 249 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 250 // Icon extent 17 x 17 251 mBrowseRect.set( fieldExtent.x - 20, 2, 17, fieldExtent.y - 1 ); 252 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 29, fieldExtent.y ); 253 254 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 255 bool browseResize = false; 256 257 if ( mBrowseButton != NULL ) 258 { 259 browseResize = mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 260 } 261 262 return ( editResize || browseResize ); 263} 264 265//----------------------------------------------------------------------------- 266// GuiInspectorTypeTerrainMaterialIndex 267//----------------------------------------------------------------------------- 268 269IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialIndex); 270 271ConsoleDocClass( GuiInspectorTypeTerrainMaterialIndex, 272 "@brief Inspector field type for TerrainMaterialIndex\n\n" 273 "Editor use only.\n\n" 274 "@internal" 275); 276 277void GuiInspectorTypeTerrainMaterialIndex::consoleInit() 278{ 279 Parent::consoleInit(); 280 281 ConsoleBaseType::getType(TypeTerrainMaterialIndex)->setInspectorFieldType("GuiInspectorTypeTerrainMaterialIndex"); 282} 283 284GuiControl* GuiInspectorTypeTerrainMaterialIndex::constructEditControl() 285{ 286 return construct("materialSelector.showTerrainDialog(\"%d.apply\", \"index\");"); 287} 288 289//----------------------------------------------------------------------------- 290// GuiInspectorTypeTerrainMaterialName 291//----------------------------------------------------------------------------- 292 293IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialName); 294 295ConsoleDocClass( GuiInspectorTypeTerrainMaterialName, 296 "@brief Inspector field type for TerrainMaterial\n\n" 297 "Editor use only.\n\n" 298 "@internal" 299); 300 301void GuiInspectorTypeTerrainMaterialName::consoleInit() 302{ 303 Parent::consoleInit(); 304 305 ConsoleBaseType::getType(TypeTerrainMaterialName)->setInspectorFieldType("GuiInspectorTypeTerrainMaterialName"); 306} 307 308GuiControl* GuiInspectorTypeTerrainMaterialName::construct(const char* command) 309{ 310 GuiControl* retCtrl = new GuiTextEditCtrl(); 311 312 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 313 314 _registerEditControl( retCtrl ); 315 316 char szBuffer[512]; 317 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() ); 318 retCtrl->setField("AltCommand", szBuffer ); 319 retCtrl->setField("Validate", szBuffer ); 320 321 //return retCtrl; 322 mBrowseButton = new GuiBitmapButtonCtrl(); 323 324 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 325 326 dSprintf( szBuffer, 512, command, getId()); 327 mBrowseButton->setField( "Command", szBuffer ); 328 329 //temporary static button name 330 char bitmapName[512] = "tools/gui/images/layers-btn"; 331 mBrowseButton->setBitmap( bitmapName ); 332 333 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiButtonProfile" ); 334 mBrowseButton->registerObject(); 335 addObject( mBrowseButton ); 336 337 // Position 338 mBrowseButton->resize( browseRect.point, browseRect.extent ); 339 340 return retCtrl; 341} 342 343GuiControl* GuiInspectorTypeTerrainMaterialName::constructEditControl() 344{ 345 return construct("materialSelector.showTerrainDialog(\"%d.apply\", \"name\");"); 346} 347 348//----------------------------------------------------------------------------- 349// GuiInspectorTypeGuiProfile 350//----------------------------------------------------------------------------- 351IMPLEMENT_CONOBJECT(GuiInspectorTypeGuiProfile); 352 353ConsoleDocClass( GuiInspectorTypeGuiProfile, 354 "@brief Inspector field type for GuiProfile\n\n" 355 "Editor use only.\n\n" 356 "@internal" 357); 358 359void GuiInspectorTypeGuiProfile::_populateMenu( GuiPopUpMenuCtrl *menu ) 360{ 361 // Check whether we should show profiles from the editor category. 362 363 const bool showEditorProfiles = Con::getBoolVariable( "$pref::GuiEditor::showEditorProfiles", false ); 364 365 // Add the control profiles to the menu. 366 367 SimGroup *grp = Sim::getGuiDataGroup(); 368 SimSetIterator iter( grp ); 369 for ( ; *iter; ++iter ) 370 { 371 GuiControlProfile *profile = dynamic_cast<GuiControlProfile*>(*iter); 372 if( !profile ) 373 continue; 374 375 if( !showEditorProfiles && profile->mCategory.compare( "Editor", 0, String::NoCase ) == 0 ) 376 continue; 377 378 menu->addEntry( profile->getName(), profile->getId() ); 379 } 380 381 menu->sort(); 382} 383 384void GuiInspectorTypeGuiProfile::consoleInit() 385{ 386 Parent::consoleInit(); 387 388 ConsoleBaseType::getType( TYPEID< GuiControlProfile >() )->setInspectorFieldType("GuiInspectorTypeGuiProfile"); 389} 390 391//----------------------------------------------------------------------------- 392// GuiInspectorTypeCheckBox 393//----------------------------------------------------------------------------- 394IMPLEMENT_CONOBJECT(GuiInspectorTypeCheckBox); 395 396ConsoleDocClass( GuiInspectorTypeCheckBox, 397 "@brief Inspector field type for CheckBox\n\n" 398 "Editor use only.\n\n" 399 "@internal" 400); 401 402GuiControl* GuiInspectorTypeCheckBox::constructEditControl() 403{ 404 if (mField && mField->flag.test(AbstractClassRep::FIELD_CustomInspectors)) 405 { 406 // This checkbox (bool field) is meant to be treated as a button. 407 GuiControl* retCtrl = new GuiButtonCtrl(); 408 409 // If we couldn't construct the control, bail! 410 if( retCtrl == NULL ) 411 return retCtrl; 412 413 GuiButtonCtrl *button = dynamic_cast<GuiButtonCtrl*>(retCtrl); 414 415 // Let's make it look pretty. 416 retCtrl->setDataField( StringTable->insert("profile"), NULL, "InspectorTypeButtonProfile" ); 417 retCtrl->setField( "text", "Click Here" ); 418 419 retCtrl->setScriptValue( getData() ); 420 421 _registerEditControl( retCtrl ); 422 423 // Configure it to update our value when the popup is closed 424 char szBuffer[512]; 425 dSprintf( szBuffer, 512, "%d.apply(%d.getValue());",getId(), button->getId() ); 426 button->setField("Command", szBuffer ); 427 428 return retCtrl; 429 } 430 else if (mField && mField->flag.test(AbstractClassRep::FieldFlags::FIELD_ComponentInspectors)) 431 { 432 // This checkbox (bool field) is meant to be treated as a button. 433 GuiControl* retCtrl = new GuiButtonCtrl(); 434 435 // If we couldn't construct the control, bail! 436 if (retCtrl == NULL) 437 return retCtrl; 438 439 GuiButtonCtrl *button = dynamic_cast<GuiButtonCtrl*>(retCtrl); 440 441 // Let's make it look pretty. 442 retCtrl->setDataField(StringTable->insert("profile"), NULL, "InspectorTypeButtonProfile"); 443 retCtrl->setField("text", "Click Here"); 444 445 retCtrl->setScriptValue(getData()); 446 447 _registerEditControl(retCtrl); 448 449 // Configure it to update our value when the popup is closed 450 char szBuffer[512]; 451 dSprintf(szBuffer, 512, "%d.apply(%d.getValue());", getId(), button->getId()); 452 button->setField("Command", szBuffer); 453 454 return retCtrl; 455 } 456 else 457 { 458 GuiControl* retCtrl = new GuiCheckBoxCtrl(); 459 460 GuiCheckBoxCtrl *check = dynamic_cast<GuiCheckBoxCtrl*>(retCtrl); 461 462 // Let's make it look pretty. 463 retCtrl->setDataField(StringTable->insert("profile"), NULL, "InspectorTypeCheckboxProfile"); 464 retCtrl->setField("text", ""); 465 466 check->setIndent(4); 467 468 retCtrl->setScriptValue(getData()); 469 470 _registerEditControl(retCtrl); 471 472 // Configure it to update our value when the popup is closed 473 char szBuffer[512]; 474 dSprintf(szBuffer, 512, "%d.apply(%d.getValue());", getId(), check->getId()); 475 check->setField("Command", szBuffer); 476 477 return retCtrl; 478 } 479} 480 481 482void GuiInspectorTypeCheckBox::consoleInit() 483{ 484 Parent::consoleInit(); 485 486 ConsoleBaseType::getType(TypeBool)->setInspectorFieldType("GuiInspectorTypeCheckBox"); 487} 488 489void GuiInspectorTypeCheckBox::setValue( StringTableEntry newValue ) 490{ 491 GuiButtonBaseCtrl *ctrl = dynamic_cast<GuiButtonBaseCtrl*>( mEdit ); 492 if ( ctrl != NULL ) 493 ctrl->setStateOn( dAtob(newValue) ); 494} 495 496const char* GuiInspectorTypeCheckBox::getValue() 497{ 498 GuiButtonBaseCtrl *ctrl = dynamic_cast<GuiButtonBaseCtrl*>( mEdit ); 499 if ( ctrl != NULL ) 500 return ctrl->getScriptValue(); 501 502 return NULL; 503} 504 505//----------------------------------------------------------------------------- 506// GuiInspectorTypeFileName 507//----------------------------------------------------------------------------- 508IMPLEMENT_CONOBJECT(GuiInspectorTypeFileName); 509 510ConsoleDocClass( GuiInspectorTypeFileName, 511 "@brief Inspector field type for FileName\n\n" 512 "Editor use only.\n\n" 513 "@internal" 514); 515 516void GuiInspectorTypeFileName::consoleInit() 517{ 518 Parent::consoleInit(); 519 520 ConsoleBaseType::getType(TypeFilename)->setInspectorFieldType("GuiInspectorTypeFileName"); 521 ConsoleBaseType::getType(TypeStringFilename)->setInspectorFieldType("GuiInspectorTypeFileName"); 522} 523 524GuiControl* GuiInspectorTypeFileName::constructEditControl() 525{ 526 GuiControl* retCtrl = new GuiTextEditCtrl(); 527 528 // Let's make it look pretty. 529 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditRightProfile" ); 530 retCtrl->setDataField( StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile" ); 531 retCtrl->setDataField( StringTable->insert("hovertime"), NULL, "1000" ); 532 533 // Don't forget to register ourselves 534 _registerEditControl( retCtrl ); 535 536 char szBuffer[512]; 537 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),retCtrl->getId() ); 538 retCtrl->setField("AltCommand", szBuffer ); 539 retCtrl->setField("Validate", szBuffer ); 540 541 mBrowseButton = new GuiButtonCtrl(); 542 543 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 544 545 dSprintf( szBuffer, 512, "getLoadFilename(\"*.*|*.*\", \"%d.apply\", %d.getData());", getId(), getId() ); 546 mBrowseButton->setField( "Command", szBuffer ); 547 mBrowseButton->setField( "text", "..." ); 548 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" ); 549 mBrowseButton->registerObject(); 550 addObject( mBrowseButton ); 551 552 // Position 553 mBrowseButton->resize( browseRect.point, browseRect.extent ); 554 555 return retCtrl; 556} 557 558bool GuiInspectorTypeFileName::resize( const Point2I &newPosition, const Point2I &newExtent ) 559{ 560 if ( !Parent::resize( newPosition, newExtent ) ) 561 return false; 562 563 if ( mEdit != NULL ) 564 { 565 return updateRects(); 566 } 567 568 return false; 569} 570 571bool GuiInspectorTypeFileName::updateRects() 572{ 573 S32 dividerPos, dividerMargin; 574 mInspector->getDivider( dividerPos, dividerMargin ); 575 Point2I fieldExtent = getExtent(); 576 Point2I fieldPos = getPosition(); 577 578 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 579 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 32, fieldExtent.y ); 580 581 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 582 bool browseResize = false; 583 584 if ( mBrowseButton != NULL ) 585 { 586 mBrowseRect.set( fieldExtent.x - 20, 2, 14, fieldExtent.y - 4 ); 587 browseResize = mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 588 } 589 590 return ( editResize || browseResize ); 591} 592 593void GuiInspectorTypeFileName::updateValue() 594{ 595 if ( mField ) 596 { 597 Parent::updateValue(); 598 const char* data = getData(); 599 if(!data) 600 data = ""; 601 mEdit->setDataField( StringTable->insert("tooltip"), NULL, data ); 602 } 603} 604 605DefineEngineMethod(GuiInspectorTypeFileName, apply, void, (String path), , "") 606{ 607 if (path.isNotEmpty()) 608 path = Platform::makeRelativePathName(path, Platform::getMainDotCsDir()); 609 610 object->setData(path.c_str()); 611} 612 613 614//----------------------------------------------------------------------------- 615// GuiInspectorTypeImageFileName 616//----------------------------------------------------------------------------- 617IMPLEMENT_CONOBJECT(GuiInspectorTypeImageFileName); 618 619ConsoleDocClass( GuiInspectorTypeImageFileName, 620 "@brief Inspector field type for FileName\n\n" 621 "Editor use only.\n\n" 622 "@internal" 623); 624 625void GuiInspectorTypeImageFileName::consoleInit() 626{ 627 Parent::consoleInit(); 628 629 ConsoleBaseType::getType(TypeImageFilename)->setInspectorFieldType("GuiInspectorTypeImageFileName"); 630} 631 632GuiControl* GuiInspectorTypeImageFileName::constructEditControl() 633{ 634 GuiControl *retCtrl = Parent::constructEditControl(); 635 636 if ( retCtrl == NULL ) 637 return retCtrl; 638 639 retCtrl->getRenderTooltipDelegate().bind( this, &GuiInspectorTypeImageFileName::renderTooltip ); 640 char szBuffer[512]; 641 642 String extList = GBitmap::sGetExtensionList(); 643 extList += "dds"; 644 U32 extCount = StringUnit::getUnitCount( extList, " " ); 645 646 String fileSpec; 647 648 // building the fileSpec string 649 650 fileSpec += "All Image Files|"; 651 652 for ( U32 i = 0; i < extCount; i++ ) 653 { 654 fileSpec += "*."; 655 fileSpec += StringUnit::getUnit( extList, i, " " ); 656 657 if ( i < extCount - 1 ) 658 fileSpec += ";"; 659 } 660 661 fileSpec += "|"; 662 663 for ( U32 i = 0; i < extCount; i++ ) 664 { 665 String ext = StringUnit::getUnit( extList, i, " " ); 666 fileSpec += ext; 667 fileSpec += "|*."; 668 fileSpec += ext; 669 670 if ( i != extCount - 1 ) 671 fileSpec += "|"; 672 } 673 674 dSprintf( szBuffer, 512, "getLoadFilename(\"%s\", \"%d.apply\", %d.getData());", fileSpec.c_str(), getId(), getId() ); 675 mBrowseButton->setField( "Command", szBuffer ); 676 677 return retCtrl; 678} 679 680bool GuiInspectorTypeImageFileName::renderTooltip( const Point2I &hoverPos, const Point2I &cursorPos, const char *tipText ) 681{ 682 if ( !mAwake ) 683 return false; 684 685 GuiCanvas *root = getRoot(); 686 if ( !root ) 687 return false; 688 689 StringTableEntry filename = getData(); 690 if ( !filename || !filename[0] ) 691 return false; 692 693 GFXTexHandle texture( filename, &GFXStaticTextureSRGBProfile, avar("%s() - tooltip texture (line %d)", __FUNCTION__, __LINE__) ); 694 if ( texture.isNull() ) 695 return false; 696 697 // Render image at a reasonable screen size while 698 // keeping its aspect ratio... 699 Point2I screensize = getRoot()->getWindowSize(); 700 Point2I offset = hoverPos; 701 Point2I tipBounds; 702 703 U32 texWidth = texture.getWidth(); 704 U32 texHeight = texture.getHeight(); 705 F32 aspect = (F32)texHeight / (F32)texWidth; 706 707 const F32 newWidth = 150.0f; 708 F32 newHeight = aspect * newWidth; 709 710 // Offset below cursor image 711 offset.y += 20; // TODO: Attempt to fix?: root->getCursorExtent().y; 712 tipBounds.x = newWidth; 713 tipBounds.y = newHeight; 714 715 // Make sure all of the tooltip will be rendered width the app window, 716 // 5 is given as a buffer against the edge 717 if ( screensize.x < offset.x + tipBounds.x + 5 ) 718 offset.x = screensize.x - tipBounds.x - 5; 719 if ( screensize.y < offset.y + tipBounds.y + 5 ) 720 offset.y = hoverPos.y - tipBounds.y - 5; 721 722 RectI oldClip = GFX->getClipRect(); 723 RectI rect( offset, tipBounds ); 724 GFX->setClipRect( rect ); 725 726 GFXDrawUtil *drawer = GFX->getDrawUtil(); 727 drawer->clearBitmapModulation(); 728 GFX->getDrawUtil()->drawBitmapStretch( texture, rect ); 729 730 GFX->setClipRect( oldClip ); 731 732 return true; 733} 734 735 736//----------------------------------------------------------------------------- 737// GuiInspectorTypePrefabFilename 738//----------------------------------------------------------------------------- 739IMPLEMENT_CONOBJECT(GuiInspectorTypePrefabFilename); 740 741ConsoleDocClass( GuiInspectorTypePrefabFilename, 742 "@brief Inspector field type for PrefabFilename\n\n" 743 "Editor use only.\n\n" 744 "@internal" 745); 746 747void GuiInspectorTypePrefabFilename::consoleInit() 748{ 749 Parent::consoleInit(); 750 751 ConsoleBaseType::getType(TypePrefabFilename)->setInspectorFieldType("GuiInspectorTypePrefabFilename"); 752} 753 754GuiControl* GuiInspectorTypePrefabFilename::constructEditControl() 755{ 756 GuiControl *retCtrl = Parent::constructEditControl(); 757 758 if ( retCtrl == NULL ) 759 return retCtrl; 760 761 const char *fileSpec = "Prefab Files (*.prefab)|*.prefab|All Files (*.*)|*.*|"; 762 763 char szBuffer[512]; 764 dSprintf( szBuffer, 512, "getLoadFilename(\"%s\", \"%d.apply\", %d.getData());", fileSpec, getId(), getId() ); 765 766 mBrowseButton->setField( "Command", szBuffer ); 767 768 return retCtrl; 769} 770 771//----------------------------------------------------------------------------- 772// GuiInspectorTypeShapeFileName 773//----------------------------------------------------------------------------- 774 775IMPLEMENT_CONOBJECT(GuiInspectorTypeShapeFilename); 776 777ConsoleDocClass( GuiInspectorTypeShapeFilename, 778 "@brief Inspector field type for Shapes\n\n" 779 "Editor use only.\n\n" 780 "@internal" 781); 782 783void GuiInspectorTypeShapeFilename::consoleInit() 784{ 785 Parent::consoleInit(); 786 787 ConsoleBaseType::getType(TypeShapeFilename)->setInspectorFieldType("GuiInspectorTypeShapeFilename"); 788} 789 790GuiControl* GuiInspectorTypeShapeFilename::constructEditControl() 791{ 792 // Create base filename edit controls 793 GuiControl *retCtrl = Parent::constructEditControl(); 794 if ( retCtrl == NULL ) 795 return retCtrl; 796 797 // Change filespec 798 char szBuffer[512]; 799 dSprintf( szBuffer, sizeof(szBuffer), "getLoadFormatFilename(\"%d.apply\", %d.getData());", getId(), getId() ); 800 mBrowseButton->setField( "Command", szBuffer ); 801 802 // Create "Open in ShapeEditor" button 803 mShapeEdButton = new GuiBitmapButtonCtrl(); 804 805 dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.open(%d.getText());", retCtrl->getId()); 806 mShapeEdButton->setField("Command", szBuffer); 807 808 char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor"; 809 mShapeEdButton->setBitmap(bitmapName); 810 811 mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile"); 812 mShapeEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile"); 813 mShapeEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000"); 814 mShapeEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor"); 815 816 mShapeEdButton->registerObject(); 817 addObject(mShapeEdButton); 818 819 return retCtrl; 820} 821 822bool GuiInspectorTypeShapeFilename::updateRects() 823{ 824 S32 dividerPos, dividerMargin; 825 mInspector->getDivider( dividerPos, dividerMargin ); 826 Point2I fieldExtent = getExtent(); 827 Point2I fieldPos = getPosition(); 828 829 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 830 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y ); 831 832 bool resized = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 833 if ( mBrowseButton != NULL ) 834 { 835 mBrowseRect.set( fieldExtent.x - 32, 2, 14, fieldExtent.y - 4 ); 836 resized |= mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 837 } 838 if ( mShapeEdButton != NULL ) 839 { 840 RectI shapeEdRect( fieldExtent.x - 16, 2, 14, fieldExtent.y - 4 ); 841 resized |= mShapeEdButton->resize( shapeEdRect.point, shapeEdRect.extent ); 842 } 843 844 return resized; 845} 846 847//----------------------------------------------------------------------------- 848// GuiInspectorTypeCommand 849//----------------------------------------------------------------------------- 850IMPLEMENT_CONOBJECT(GuiInspectorTypeCommand); 851 852ConsoleDocClass( GuiInspectorTypeCommand, 853 "@brief Inspector field type for Command\n\n" 854 "Editor use only.\n\n" 855 "@internal" 856); 857 858void GuiInspectorTypeCommand::consoleInit() 859{ 860 Parent::consoleInit(); 861 862 ConsoleBaseType::getType(TypeCommand)->setInspectorFieldType("GuiInspectorTypeCommand"); 863} 864 865GuiInspectorTypeCommand::GuiInspectorTypeCommand() 866{ 867 mTextEditorCommand = StringTable->insert("TextPad"); 868} 869 870GuiControl* GuiInspectorTypeCommand::constructEditControl() 871{ 872 GuiButtonCtrl* retCtrl = new GuiButtonCtrl(); 873 874 // Let's make it look pretty. 875 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 876 877 // Don't forget to register ourselves 878 _registerEditControl( retCtrl ); 879 880 _setCommand( retCtrl, getData() ); 881 882 return retCtrl; 883} 884 885void GuiInspectorTypeCommand::setValue( StringTableEntry newValue ) 886{ 887 GuiButtonCtrl *ctrl = dynamic_cast<GuiButtonCtrl*>( mEdit ); 888 _setCommand( ctrl, newValue ); 889} 890 891void GuiInspectorTypeCommand::_setCommand( GuiButtonCtrl *ctrl, StringTableEntry command ) 892{ 893 if( ctrl != NULL ) 894 { 895 ctrl->setField( "text", command ); 896 897 // expandEscape isn't length-limited, so while this _should_ work 898 // in most circumstances, it may still fail if getData() has lots of 899 // non-printable characters 900 S32 len = 2 * dStrlen(command) + 512; 901 902 FrameTemp<char> szBuffer(len); 903 904 S32 written = dSprintf( szBuffer, len, "%s(\"", mTextEditorCommand ); 905 expandEscape(szBuffer.address() + written, command); 906 written = strlen(szBuffer); 907 dSprintf( szBuffer.address() + written, len - written, "\", \"%d.apply\", %d.getRoot());", getId(), getId() ); 908 909 ctrl->setField( "Command", szBuffer ); 910 } 911} 912 913//----------------------------------------------------------------------------- 914// GuiInspectorTypeRectUV 915//----------------------------------------------------------------------------- 916 917IMPLEMENT_CONOBJECT( GuiInspectorTypeRectUV ); 918 919ConsoleDocClass( GuiInspectorTypeRectUV, 920 "@brief Inspector field type for TypeRectUV.\n\n" 921 "Editor use only.\n\n" 922 "@internal" 923); 924 925GuiInspectorTypeRectUV::GuiInspectorTypeRectUV() 926 : mBrowseButton( NULL ) 927{ 928} 929 930 931void GuiInspectorTypeRectUV::consoleInit() 932{ 933 Parent::consoleInit(); 934 935 ConsoleBaseType::getType( TypeRectUV )->setInspectorFieldType( "GuiInspectorTypeRectUV" ); 936} 937 938GuiControl* GuiInspectorTypeRectUV::constructEditControl() 939{ 940 GuiControl* retCtrl = new GuiTextEditCtrl(); 941 942 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 943 944 _registerEditControl( retCtrl ); 945 946 char szBuffer[512]; 947 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() ); 948 retCtrl->setField("AltCommand", szBuffer ); 949 retCtrl->setField("Validate", szBuffer ); 950 951 //return retCtrl; 952 mBrowseButton = new GuiBitmapButtonCtrl(); 953 954 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 955 956 dSprintf( szBuffer, 512, "uvEditor.showDialog(\"%d.apply\", %d, %d.getText());", getId(), mInspector->getInspectObject()->getId(), retCtrl->getId()); 957 mBrowseButton->setField( "Command", szBuffer ); 958 959 //temporary static button name 960 char bitmapName[512] = "tools/gui/images/uv-editor-btn"; 961 mBrowseButton->setBitmap( bitmapName ); 962 963 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiButtonProfile" ); 964 mBrowseButton->registerObject(); 965 addObject( mBrowseButton ); 966 967 // Position 968 mBrowseButton->resize( browseRect.point, browseRect.extent ); 969 970 return retCtrl; 971} 972 973bool GuiInspectorTypeRectUV::updateRects() 974{ 975 Point2I fieldPos = getPosition(); 976 Point2I fieldExtent = getExtent(); 977 S32 dividerPos, dividerMargin; 978 mInspector->getDivider( dividerPos, dividerMargin ); 979 980 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 981 // Icon extent 17 x 17 982 mBrowseRect.set( fieldExtent.x - 20, 2, 17, fieldExtent.y - 1 ); 983 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 29, fieldExtent.y ); 984 985 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 986 bool browseResize = false; 987 988 if ( mBrowseButton != NULL ) 989 { 990 browseResize = mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 991 } 992 993 return ( editResize || browseResize ); 994} 995 996//----------------------------------------------------------------------------- 997// GuiInspectorTypeEaseF 998//----------------------------------------------------------------------------- 999 1000IMPLEMENT_CONOBJECT( GuiInspectorTypeEaseF ); 1001 1002ConsoleDocClass( GuiInspectorTypeEaseF, 1003 "@brief Inspector field type for TypeEaseF.\n\n" 1004 "Editor use only.\n\n" 1005 "@internal" 1006); 1007 1008GuiInspectorTypeEaseF::GuiInspectorTypeEaseF() 1009 : mBrowseButton( NULL ) 1010{ 1011} 1012 1013void GuiInspectorTypeEaseF::consoleInit() 1014{ 1015 Parent::consoleInit(); 1016 1017 ConsoleBaseType::getType( TypeEaseF )->setInspectorFieldType( "GuiInspectorTypeEaseF" ); 1018} 1019 1020GuiControl* GuiInspectorTypeEaseF::constructEditControl() 1021{ 1022 GuiControl* retCtrl = new GuiTextEditCtrl(); 1023 1024 // Let's make it look pretty. 1025 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 1026 1027 // Don't forget to register ourselves 1028 _registerEditControl( retCtrl ); 1029 1030 char szBuffer[512]; 1031 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),retCtrl->getId() ); 1032 retCtrl->setField("AltCommand", szBuffer ); 1033 retCtrl->setField("Validate", szBuffer ); 1034 1035 mBrowseButton = new GuiButtonCtrl(); 1036 { 1037 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 1038 dSprintf( szBuffer, sizeof( szBuffer ), "GetEaseF(%d.getText(), \"%d.apply\", %d.getRoot());", retCtrl->getId(), getId(), getId() ); 1039 mBrowseButton->setField( "Command", szBuffer ); 1040 mBrowseButton->setField( "text", "E" ); 1041 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" ); 1042 mBrowseButton->registerObject(); 1043 addObject( mBrowseButton ); 1044 1045 // Position 1046 mBrowseButton->resize( browseRect.point, browseRect.extent ); 1047 } 1048 1049 return retCtrl; 1050} 1051 1052bool GuiInspectorTypeEaseF::resize( const Point2I &newPosition, const Point2I &newExtent ) 1053{ 1054 if ( !Parent::resize( newPosition, newExtent ) ) 1055 return false; 1056 1057 if ( mEdit != NULL ) 1058 { 1059 return updateRects(); 1060 } 1061 1062 return false; 1063} 1064 1065bool GuiInspectorTypeEaseF::updateRects() 1066{ 1067 S32 dividerPos, dividerMargin; 1068 mInspector->getDivider( dividerPos, dividerMargin ); 1069 Point2I fieldExtent = getExtent(); 1070 Point2I fieldPos = getPosition(); 1071 1072 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 1073 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 32, fieldExtent.y ); 1074 1075 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 1076 bool browseResize = false; 1077 1078 if ( mBrowseButton != NULL ) 1079 { 1080 mBrowseRect.set( fieldExtent.x - 20, 2, 14, fieldExtent.y - 4 ); 1081 browseResize = mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 1082 } 1083 1084 return ( editResize || browseResize ); 1085} 1086 1087//----------------------------------------------------------------------------- 1088// GuiInspectorTypeColor (Base for ColorI/LinearColorF) 1089//----------------------------------------------------------------------------- 1090GuiInspectorTypeColor::GuiInspectorTypeColor() 1091 : mColorFunction(NULL), mBrowseButton( NULL ) 1092{ 1093} 1094 1095IMPLEMENT_CONOBJECT(GuiInspectorTypeColor); 1096 1097ConsoleDocClass( GuiInspectorTypeColor, 1098 "@brief Inspector field type for TypeColor\n\n" 1099 "Editor use only.\n\n" 1100 "@internal" 1101); 1102 1103GuiControl* GuiInspectorTypeColor::constructEditControl() 1104{ 1105 GuiControl* retCtrl = new GuiTextEditCtrl(); 1106 1107 // Let's make it look pretty. 1108 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 1109 1110 // Don't forget to register ourselves 1111 _registerEditControl( retCtrl ); 1112 1113 char szBuffer[512]; 1114 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() ); 1115 retCtrl->setField("AltCommand", szBuffer ); 1116 retCtrl->setField("Validate", szBuffer ); 1117 1118 mBrowseButton = new GuiSwatchButtonCtrl(); 1119 1120 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 1121 mBrowseButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorSwatchButtonProfile" ); 1122 mBrowseButton->registerObject(); 1123 addObject( mBrowseButton ); 1124 1125 char szColor[2048]; 1126 if( _getColorConversionFunction() ) 1127 dSprintf( szColor, 512, "%s( %d.color )", _getColorConversionFunction(), mBrowseButton->getId() ); 1128 else 1129 dSprintf( szColor, 512, "%d.color", mBrowseButton->getId() ); 1130 1131 // If the inspector supports the alternate undo recording path, 1132 // use this here. 1133 1134 GuiInspector* inspector = getInspector(); 1135 if( inspector->isMethod( "onInspectorPreFieldModification" ) ) 1136 { 1137 dSprintf( szBuffer, sizeof( szBuffer ), 1138 "%d.onInspectorPreFieldModification(\"%s\",\"%s\"); %s(%s, \"%d.onInspectorPostFieldModification(); %d.applyWithoutUndo\", %d.getRoot(), \"%d.applyWithoutUndo\", \"%d.onInspectorDiscardFieldModification(); %%unused=\");", 1139 inspector->getId(), getRawFieldName(), getArrayIndex(), 1140 mColorFunction, szColor, inspector->getId(), getId(), 1141 getId(), 1142 getId(), 1143 inspector->getId() 1144 ); 1145 } 1146 else 1147 dSprintf( szBuffer, sizeof( szBuffer ), 1148 "%s(%s, \"%d.apply\", %d.getRoot());", 1149 mColorFunction, szColor, getId(), getId() ); 1150 1151 mBrowseButton->setConsoleCommand( szBuffer ); 1152 mBrowseButton->setUseMouseEvents( true ); // Allow drag&drop. 1153 1154 // Position 1155 mBrowseButton->resize( browseRect.point, browseRect.extent ); 1156 1157 return retCtrl; 1158} 1159 1160bool GuiInspectorTypeColor::resize( const Point2I &newPosition, const Point2I &newExtent ) 1161{ 1162 if( !Parent::resize( newPosition, newExtent ) ) 1163 return false; 1164 1165 return false; 1166} 1167 1168bool GuiInspectorTypeColor::updateRects() 1169{ 1170 Point2I fieldPos = getPosition(); 1171 Point2I fieldExtent = getExtent(); 1172 S32 dividerPos, dividerMargin; 1173 mInspector->getDivider( dividerPos, dividerMargin ); 1174 1175 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 1176 mBrowseRect.set( fieldExtent.x - 20, 2, 14, fieldExtent.y - 4 ); 1177 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 29, fieldExtent.y ); 1178 1179 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 1180 bool browseResize = false; 1181 1182 if ( mBrowseButton != NULL ) 1183 { 1184 browseResize = mBrowseButton->resize( mBrowseRect.point, mBrowseRect.extent ); 1185 } 1186 1187 return ( editResize || browseResize ); 1188} 1189 1190 1191//----------------------------------------------------------------------------- 1192// GuiInspectorTypeColorI 1193//----------------------------------------------------------------------------- 1194IMPLEMENT_CONOBJECT(GuiInspectorTypeColorI); 1195 1196ConsoleDocClass( GuiInspectorTypeColorI, 1197 "@brief Inspector field type for ColorI\n\n" 1198 "Editor use only.\n\n" 1199 "@internal" 1200); 1201 1202void GuiInspectorTypeColorI::consoleInit() 1203{ 1204 Parent::consoleInit(); 1205 1206 ConsoleBaseType::getType(TypeColorI)->setInspectorFieldType("GuiInspectorTypeColorI"); 1207} 1208 1209GuiInspectorTypeColorI::GuiInspectorTypeColorI() 1210{ 1211 mColorFunction = StringTable->insert("getColorI"); 1212} 1213 1214void GuiInspectorTypeColorI::setValue( StringTableEntry newValue ) 1215{ 1216 // Allow parent to set the edit-ctrl text to the new value. 1217 Parent::setValue( newValue ); 1218 1219 // Now we also set our color swatch button to the new color value. 1220 if ( mBrowseButton ) 1221 { 1222 ColorI color(255,0,255,255); 1223 S32 r,g,b,a; 1224 dSscanf( newValue, "%d %d %d %d", &r, &g, &b, &a ); 1225 color.red = r; 1226 color.green = g; 1227 color.blue = b; 1228 color.alpha = a; 1229 mBrowseButton->setColor( color ); 1230 } 1231} 1232 1233//----------------------------------------------------------------------------- 1234// GuiInspectorTypeColorF 1235//----------------------------------------------------------------------------- 1236IMPLEMENT_CONOBJECT(GuiInspectorTypeColorF); 1237 1238ConsoleDocClass( GuiInspectorTypeColorF, 1239 "@brief Inspector field type for LinearColorF\n\n" 1240 "Editor use only.\n\n" 1241 "@internal" 1242); 1243 1244void GuiInspectorTypeColorF::consoleInit() 1245{ 1246 Parent::consoleInit(); 1247 1248 ConsoleBaseType::getType(TypeColorF)->setInspectorFieldType("GuiInspectorTypeColorF"); 1249} 1250 1251GuiInspectorTypeColorF::GuiInspectorTypeColorF() 1252{ 1253 mColorFunction = StringTable->insert("getColorF"); 1254} 1255 1256void GuiInspectorTypeColorF::setValue( StringTableEntry newValue ) 1257{ 1258 // Allow parent to set the edit-ctrl text to the new value. 1259 Parent::setValue( newValue ); 1260 1261 // Now we also set our color swatch button to the new color value. 1262 if ( mBrowseButton ) 1263 { 1264 LinearColorF color(1,0,1,1); 1265 dSscanf( newValue, "%f %f %f %f", &color.red, &color.green, &color.blue, &color.alpha ); 1266 mBrowseButton->setColor( color ); 1267 } 1268} 1269 1270//----------------------------------------------------------------------------- 1271// GuiInspectorTypeS32 1272//----------------------------------------------------------------------------- 1273IMPLEMENT_CONOBJECT(GuiInspectorTypeS32); 1274 1275ConsoleDocClass( GuiInspectorTypeS32, 1276 "@brief Inspector field type for S32\n\n" 1277 "Editor use only.\n\n" 1278 "@internal" 1279); 1280 1281void GuiInspectorTypeS32::consoleInit() 1282{ 1283 Parent::consoleInit(); 1284 1285 ConsoleBaseType::getType(TypeS32)->setInspectorFieldType("GuiInspectorTypeS32"); 1286} 1287 1288GuiControl* GuiInspectorTypeS32::constructEditControl() 1289{ 1290 GuiControl* retCtrl = new GuiTextEditSliderCtrl(); 1291 1292 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 1293 1294 // Don't forget to register ourselves 1295 _registerEditControl( retCtrl ); 1296 1297 char szBuffer[512]; 1298 dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() ); 1299 retCtrl->setField("AltCommand", szBuffer ); 1300 retCtrl->setField("Validate", szBuffer ); 1301 retCtrl->setField("increment","1"); 1302 retCtrl->setField("format","%d"); 1303 retCtrl->setField("range","-2147483648 2147483647"); 1304 1305 return retCtrl; 1306} 1307 1308void GuiInspectorTypeS32::setValue( StringTableEntry newValue ) 1309{ 1310 GuiTextEditSliderCtrl *ctrl = dynamic_cast<GuiTextEditSliderCtrl*>( mEdit ); 1311 if( ctrl != NULL ) 1312 ctrl->setText( newValue ); 1313} 1314 1315//----------------------------------------------------------------------------- 1316// GuiInspectorTypeS32Mask 1317//----------------------------------------------------------------------------- 1318 1319GuiInspectorTypeBitMask32::GuiInspectorTypeBitMask32() 1320 : mHelper( NULL ), 1321 mRollout( NULL ), 1322 mArrayCtrl( NULL ) 1323{ 1324} 1325 1326IMPLEMENT_CONOBJECT( GuiInspectorTypeBitMask32 ); 1327 1328ConsoleDocClass( GuiInspectorTypeBitMask32, 1329 "@brief Inspector field type for TypeBitMask32.\n\n" 1330 "Editor use only.\n\n" 1331 "@internal" 1332); 1333 1334bool GuiInspectorTypeBitMask32::onAdd() 1335{ 1336 // Skip our parent because we aren't using mEditCtrl 1337 // and according to our parent that would be cause to fail onAdd. 1338 if ( !Parent::Parent::onAdd() ) 1339 return false; 1340 1341 if ( !mInspector ) 1342 return false; 1343 1344 const EnumTable* table = mField->table; 1345 if( !table ) 1346 { 1347 ConsoleBaseType* type = ConsoleBaseType::getType( mField->type ); 1348 if( type && type->getEnumTable() ) 1349 table = type->getEnumTable(); 1350 else 1351 return false; 1352 } 1353 1354 static StringTableEntry sProfile = StringTable->insert( "profile" ); 1355 setDataField( sProfile, NULL, "GuiInspectorFieldProfile" ); 1356 setBounds(0,0,100,18); 1357 1358 // Allocate our children controls... 1359 1360 mRollout = new GuiRolloutCtrl(); 1361 mRollout->setMargin( 14, 0, 0, 0 ); 1362 mRollout->setCanCollapse( false ); 1363 mRollout->registerObject(); 1364 addObject( mRollout ); 1365 1366 mArrayCtrl = new GuiDynamicCtrlArrayControl(); 1367 mArrayCtrl->setDataField( sProfile, NULL, "GuiInspectorBitMaskArrayProfile" ); 1368 mArrayCtrl->setField( "autoCellSize", "true" ); 1369 mArrayCtrl->setField( "fillRowFirst", "true" ); 1370 mArrayCtrl->setField( "dynamicSize", "true" ); 1371 mArrayCtrl->setField( "rowSpacing", "4" ); 1372 mArrayCtrl->setField( "colSpacing", "1" ); 1373 mArrayCtrl->setField( "frozen", "true" ); 1374 mArrayCtrl->registerObject(); 1375 1376 mRollout->addObject( mArrayCtrl ); 1377 1378 GuiCheckBoxCtrl *pCheckBox = NULL; 1379 1380 const EngineEnumTable& t = *table; 1381 const U32 numValues = t.getNumValues(); 1382 1383 for ( S32 i = 0; i < numValues; i++ ) 1384 { 1385 pCheckBox = new GuiCheckBoxCtrl(); 1386 pCheckBox->setText( t[ i ].getName() ); 1387 pCheckBox->registerObject(); 1388 mArrayCtrl->addObject( pCheckBox ); 1389 1390 pCheckBox->autoSize(); 1391 1392 // Override the normal script callbacks for GuiInspectorTypeCheckBox 1393 char szBuffer[512]; 1394 dSprintf( szBuffer, 512, "%d.applyBit();", getId() ); 1395 pCheckBox->setField( "Command", szBuffer ); 1396 } 1397 1398 mArrayCtrl->setField( "frozen", "false" ); 1399 mArrayCtrl->refresh(); 1400 1401 mHelper = new GuiInspectorTypeBitMask32Helper(); 1402 mHelper->init( mInspector, mParent ); 1403 mHelper->mParentRollout = mRollout; 1404 mHelper->mParentField = this; 1405 mHelper->setInspectorField( mField, mCaption, mFieldArrayIndex ); 1406 mHelper->registerObject(); 1407 mHelper->setExtent( pCheckBox->getExtent() ); 1408 mHelper->setPosition( 0, 0 ); 1409 mRollout->addObject( mHelper ); 1410 1411 mRollout->sizeToContents(); 1412 mRollout->instantCollapse(); 1413 1414 updateValue(); 1415 1416 return true; 1417} 1418 1419void GuiInspectorTypeBitMask32::consoleInit() 1420{ 1421 Parent::consoleInit(); 1422 1423 // Set this to be the inspector type for all bitfield console types. 1424 1425 for( ConsoleBaseType* type = ConsoleBaseType::getListHead(); type != NULL; type = type->getListNext() ) 1426 if( type->getTypeInfo() && type->getTypeInfo()->isBitfield() ) 1427 type->setInspectorFieldType( "GuiInspectorTypeBitMask32" ); 1428} 1429 1430void GuiInspectorTypeBitMask32::childResized( GuiControl *child ) 1431{ 1432 setExtent( mRollout->getExtent() ); 1433} 1434 1435bool GuiInspectorTypeBitMask32::resize(const Point2I &newPosition, const Point2I &newExtent) 1436{ 1437 if ( !Parent::resize( newPosition, newExtent ) ) 1438 return false; 1439 1440 // Hack... height of 18 is hardcoded 1441 return mHelper->resize( Point2I(0,0), Point2I( newExtent.x, 18 ) ); 1442} 1443 1444bool GuiInspectorTypeBitMask32::updateRects() 1445{ 1446 if ( !mRollout ) 1447 return false; 1448 1449 bool result = mRollout->setExtent( getExtent() ); 1450 1451 for ( U32 i = 0; i < mArrayCtrl->size(); i++ ) 1452 { 1453 GuiInspectorField *pField = dynamic_cast<GuiInspectorField*>( mArrayCtrl->at(i) ); 1454 if ( pField ) 1455 if ( pField->updateRects() ) 1456 result = true; 1457 } 1458 1459 if ( mHelper && mHelper->updateRects() ) 1460 result = true; 1461 1462 return result; 1463} 1464 1465StringTableEntry GuiInspectorTypeBitMask32::getValue() 1466{ 1467 if ( !mRollout ) 1468 return StringTable->insert( "" ); 1469 1470 S32 mask = 0; 1471 1472 for ( U32 i = 0; i < mArrayCtrl->size(); i++ ) 1473 { 1474 GuiCheckBoxCtrl *pCheckBox = dynamic_cast<GuiCheckBoxCtrl*>( mArrayCtrl->at(i) ); 1475 1476 bool bit = pCheckBox->getStateOn(); 1477 mask |= bit << i; 1478 } 1479 1480 return StringTable->insert( String::ToString(mask).c_str() ); 1481} 1482 1483void GuiInspectorTypeBitMask32::setValue( StringTableEntry value ) 1484{ 1485 U32 mask = dAtoui( value, 0 ); 1486 1487 for ( U32 i = 0; i < mArrayCtrl->size(); i++ ) 1488 { 1489 GuiCheckBoxCtrl *pCheckBox = dynamic_cast<GuiCheckBoxCtrl*>( mArrayCtrl->at(i) ); 1490 1491 bool bit = mask & ( 1 << i ); 1492 pCheckBox->setStateOn( bit ); 1493 } 1494 1495 mHelper->setValue( value ); 1496} 1497 1498void GuiInspectorTypeBitMask32::updateData() 1499{ 1500 StringTableEntry data = getValue(); 1501 setData( data ); 1502} 1503 1504DefineEngineMethod( GuiInspectorTypeBitMask32, applyBit, void, (),, "" ) 1505{ 1506 object->updateData(); 1507} 1508 1509//------------------------------------------------------------------------------ 1510// GuiInspectorTypeS32MaskHelper 1511//------------------------------------------------------------------------------ 1512 1513GuiInspectorTypeBitMask32Helper::GuiInspectorTypeBitMask32Helper() 1514: mButton( NULL ), 1515 mParentRollout( NULL ), 1516 mParentField( NULL ) 1517{ 1518} 1519 1520IMPLEMENT_CONOBJECT( GuiInspectorTypeBitMask32Helper ); 1521 1522ConsoleDocClass( GuiInspectorTypeBitMask32Helper, 1523 "@brief Inspector field type support for TypeBitMask32.\n\n" 1524 "Editor use only.\n\n" 1525 "@internal" 1526); 1527 1528GuiControl* GuiInspectorTypeBitMask32Helper::constructEditControl() 1529{ 1530 GuiControl *retCtrl = new GuiTextEditCtrl(); 1531 retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); 1532 retCtrl->setField( "hexDisplay", "true" ); 1533 1534 _registerEditControl( retCtrl ); 1535 1536 char szBuffer[512]; 1537 dSprintf( szBuffer, 512, "%d.apply(%d.getText());", mParentField->getId(), retCtrl->getId() ); 1538 retCtrl->setField( "AltCommand", szBuffer ); 1539 retCtrl->setField( "Validate", szBuffer ); 1540 1541 mButton = new GuiBitmapButtonCtrl(); 1542 1543 RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); 1544 dSprintf( szBuffer, 512, "%d.toggleExpanded(false);", mParentRollout->getId() ); 1545 mButton->setField( "Command", szBuffer ); 1546 mButton->setField( "buttonType", "ToggleButton" ); 1547 mButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" ); 1548 mButton->setBitmap( "tools/gui/images/arrowBtn" ); 1549 mButton->setStateOn( true ); 1550 mButton->setExtent( 16, 16 ); 1551 mButton->registerObject(); 1552 addObject( mButton ); 1553 1554 mButton->resize( browseRect.point, browseRect.extent ); 1555 1556 return retCtrl; 1557} 1558 1559bool GuiInspectorTypeBitMask32Helper::resize(const Point2I &newPosition, const Point2I &newExtent) 1560{ 1561 if ( !Parent::resize( newPosition, newExtent ) ) 1562 return false; 1563 1564 if ( mEdit != NULL ) 1565 { 1566 return updateRects(); 1567 } 1568 1569 return false; 1570} 1571 1572bool GuiInspectorTypeBitMask32Helper::updateRects() 1573{ 1574 S32 dividerPos, dividerMargin; 1575 mInspector->getDivider( dividerPos, dividerMargin ); 1576 Point2I fieldExtent = getExtent(); 1577 Point2I fieldPos = getPosition(); 1578 1579 mCaptionRect.set( 0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y ); 1580 mEditCtrlRect.set( fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 32, fieldExtent.y ); 1581 1582 bool editResize = mEdit->resize( mEditCtrlRect.point, mEditCtrlRect.extent ); 1583 bool buttonResize = false; 1584 1585 if ( mButton != NULL ) 1586 { 1587 mButtonRect.set( fieldExtent.x - 26, 2, 16, 16 ); 1588 buttonResize = mButton->resize( mButtonRect.point, mButtonRect.extent ); 1589 } 1590 1591 return ( editResize || buttonResize ); 1592} 1593 1594void GuiInspectorTypeBitMask32Helper::setValue( StringTableEntry newValue ) 1595{ 1596 GuiTextEditCtrl *edit = dynamic_cast<GuiTextEditCtrl*>(mEdit); 1597 edit->setText( newValue ); 1598} 1599 1600 1601//----------------------------------------------------------------------------- 1602// GuiInspectorTypeName 1603//----------------------------------------------------------------------------- 1604IMPLEMENT_CONOBJECT(GuiInspectorTypeName); 1605 1606ConsoleDocClass( GuiInspectorTypeName, 1607 "@brief Inspector field type for Name\n\n" 1608 "Editor use only.\n\n" 1609 "@internal" 1610); 1611 1612void GuiInspectorTypeName::consoleInit() 1613{ 1614 Parent::consoleInit(); 1615 1616 ConsoleBaseType::getType(TypeName)->setInspectorFieldType("GuiInspectorTypeName"); 1617} 1618 1619bool GuiInspectorTypeName::verifyData( StringTableEntry data ) 1620{ 1621 return validateObjectName( data, mInspector->getInspectObject() ); 1622} 1623 1624 1625//----------------------------------------------------------------------------- 1626// GuiInspectorTypeSFXParameterName 1627//----------------------------------------------------------------------------- 1628IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXParameterName); 1629 1630ConsoleDocClass( GuiInspectorTypeSFXParameterName, 1631 "@brief Inspector field type for SFXParameter\n\n" 1632 "Editor use only.\n\n" 1633 "@internal" 1634); 1635 1636void GuiInspectorTypeSFXParameterName::_populateMenu( GuiPopUpMenuCtrl *menu ) 1637{ 1638 SimSet* set = Sim::getSFXParameterGroup(); 1639 for( SimSet::iterator iter = set->begin(); iter != set->end(); ++ iter ) 1640 { 1641 SFXParameter* parameter = dynamic_cast< SFXParameter* >( *iter ); 1642 if( parameter ) 1643 menu->addEntry( parameter->getInternalName(), parameter->getId() ); 1644 } 1645 1646 menu->sort(); 1647} 1648 1649void GuiInspectorTypeSFXParameterName::consoleInit() 1650{ 1651 Parent::consoleInit(); 1652 1653 ConsoleBaseType::getType( TypeSFXParameterName )->setInspectorFieldType( "GuiInspectorTypeSFXParameterName" ); 1654} 1655 1656 1657//----------------------------------------------------------------------------- 1658// GuiInspectorTypeSFXStateName 1659//----------------------------------------------------------------------------- 1660IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXStateName); 1661 1662ConsoleDocClass( GuiInspectorTypeSFXStateName, 1663 "@brief Inspector field type for SFXState\n\n" 1664 "Editor use only.\n\n" 1665 "@internal" 1666); 1667 1668void GuiInspectorTypeSFXStateName::_populateMenu( GuiPopUpMenuCtrl *menu ) 1669{ 1670 menu->addEntry( "", 0 ); 1671 1672 SimSet* set = Sim::getSFXStateSet(); 1673 for( SimSet::iterator iter = set->begin(); iter != set->end(); ++ iter ) 1674 { 1675 SFXState* state = dynamic_cast< SFXState* >( *iter ); 1676 if( state ) 1677 menu->addEntry( state->getName(), state->getId() ); 1678 } 1679 1680 menu->sort(); 1681} 1682 1683void GuiInspectorTypeSFXStateName::consoleInit() 1684{ 1685 Parent::consoleInit(); 1686 1687 ConsoleBaseType::getType( TypeSFXStateName )->setInspectorFieldType( "GuiInspectorTypeSFXStateName" ); 1688} 1689 1690 1691//----------------------------------------------------------------------------- 1692// GuiInspectorTypeSFXSourceName 1693//----------------------------------------------------------------------------- 1694IMPLEMENT_CONOBJECT(GuiInspectorTypeSFXSourceName); 1695 1696ConsoleDocClass( GuiInspectorTypeSFXSourceName, 1697 "@brief Inspector field type for SFXSource\n\n" 1698 "Editor use only.\n\n" 1699 "@internal" 1700); 1701 1702void GuiInspectorTypeSFXSourceName::_populateMenu( GuiPopUpMenuCtrl *menu ) 1703{ 1704 menu->addEntry( "", 0 ); 1705 1706 SimSet* set = Sim::getSFXSourceSet(); 1707 for( SimSet::iterator iter = set->begin(); iter != set->end(); ++ iter ) 1708 { 1709 SFXSource* source = dynamic_cast< SFXSource* >( *iter ); 1710 if( source && source->getName() ) 1711 menu->addEntry( source->getName(), source->getId() ); 1712 } 1713 1714 menu->sort(); 1715} 1716 1717void GuiInspectorTypeSFXSourceName::consoleInit() 1718{ 1719 Parent::consoleInit(); 1720 1721 ConsoleBaseType::getType( TypeSFXSourceName )->setInspectorFieldType( "GuiInspectorTypeSFXSourceName" ); 1722} 1723