GUIGameObjectField* GUIGameObjectField::create(const String& typeNamespace, const String& type, const GUIOptions& options, const String& style) { const String* curStyle = &style; if (*curStyle == StringUtil::BLANK) curStyle = &BuiltinEditorResources::ObjectFieldStyleName; return bs_new<GUIGameObjectField>(PrivatelyConstruct(), typeNamespace, type, GUIContent(), 0, *curStyle, GUIDimensions::create(options), false); }
GUITextField* GUITextField::create(bool multiline, const HString& labelText, const GUIOptions& options, const String& style) { const String* curStyle = &style; if (*curStyle == StringUtil::BLANK) curStyle = &GUITextField::getGUITypeName(); return bs_new<GUITextField>(PrivatelyConstruct(), multiline, GUIContent(labelText), DEFAULT_LABEL_WIDTH, *curStyle, GUIDimensions::create(options), true); }
GUITextField* GUITextField::create(bool multiline, const HString& labelText, UINT32 labelWidth, const String& style) { const String* curStyle = &style; if (*curStyle == StringUtil::BLANK) curStyle = &GUITextField::getGUITypeName(); return bs_new<GUITextField>(PrivatelyConstruct(), multiline, GUIContent(labelText), labelWidth, *curStyle, GUIDimensions::create(), true); }
GUIGameObjectField* GUIGameObjectField::create(const String& typeNamespace, const String& type, const HString& labelText, const String& style) { const String* curStyle = &style; if (*curStyle == StringUtil::BLANK) curStyle = &BuiltinEditorResources::ObjectFieldStyleName; return bs_new<GUIGameObjectField>(PrivatelyConstruct(), typeNamespace, type, GUIContent(labelText), DEFAULT_LABEL_WIDTH, *curStyle, GUIDimensions::create(), true); }
void GUIGameObjectField::setValue(const HGameObject& value, bool triggerEvent) { if (value) { if (mInstanceId == value.getInstanceId()) return; mInstanceId = value->getInstanceId(); mDropButton->setContent(GUIContent(HString(toWString(value->getName()) + L" (" + toWString(mType) + L")"))); } else { if (mInstanceId == 0) return; mInstanceId = 0; mDropButton->setContent(GUIContent(HString(L"None (" + toWString(mType) + L")"))); } if (triggerEvent) onValueChanged(value); }
GUIDropButton::GUIDropButton(UINT32 dragType, const String& styleName, const GUIDimensions& dimensions) :GUIButtonBase(styleName, GUIContent(HString(L"None")), dimensions), mDragType(dragType) { }
GUIButton* GUIButton::create(const HString& text, const GUIOptions& options, const String& styleName) { return create(GUIContent(text), options, styleName); }
GUIToggle* GUIToggle::create(const HString& text, SPtr<GUIToggleGroup> toggleGroup, const GUIOptions& options, const String& styleName) { return create(GUIContent(text), toggleGroup, options, styleName); }
GUIToggle* GUIToggle::create(const HString& text, const String& styleName) { return create(GUIContent(text), styleName); }