AAssetPicker
- Module
- Arc
- Header
#include "Arc/Widgets/AAssetPicker.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
ArcDelegate<void(const std::string&)> | OnAssetSelected | |
ArcDelegate<void()> | OnReset | Fired by the clear (reset) button — distinct from selecting the None row so callers can reset to a component default rather than empty. |
ArcDelegate<void(const std::string&)> | OnBrowseTo | Fired by the magnifier button with the current asset path — the host reveals it in the content browser. |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | SetEntries | |
void | SetCurrentAsset | |
void | SetPlaceholderText | |
const std::string& | GetCurrentAssetPath | |
bool | IsOpen | |
void | SetShowThumbnails | |
void | SetShowPathSubtitles | Two-line rows: asset name over its project path in secondary text. |
void | SetShowClearButton | |
void | SetUnresolved | The field holds a reference that names nothing that exists. |
bool | IsUnresolved | |
void | SetThumbnailResolver | Resolves an asset path/key to an Arc texture. |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseMove | |
CReply | OnMouseButtonUp | |
CReply | OnMouseWheel | |
CReply | OnKeyDown | |
CReply | OnKeyChar | |
void | OnMouseEnter | |
void | OnMouseLeave | |
void | OnFocusLost | |
bool | OnDragEnter | Asset drops from a browser. |
bool | OnDragOver | |
void | OnDragLeave | |
bool | OnDrop | |
bool | CanCacheDesiredSize | A fixed dropdown frame; the asset name inside it is elided to fit rather than widening the picker. |
const char* | GetTypeName | |
bool | IsFocusable | Enter and Space on a tabbed-to picker open its list; the arrows and typing inside the open list were already keyboard-driven. |
bool | OnActivate |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(AAssetPicker) ARC_ATTR(int32_t, MaxVisibleRows) ARC_ATTR(bool, ShowThumbnails) ARC_ATTR(bool, ShowClearButton) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)SetEntries
void SetEntries(std::vector<FAssetEntry> entries)SetCurrentAsset
void SetCurrentAsset(const std::string& path, const std::string& name)SetPlaceholderText
void SetPlaceholderText(const std::string& text)GetCurrentAssetPath
const std::string& GetCurrentAssetPath() constIsOpen
bool IsOpen() constSetShowThumbnails
void SetShowThumbnails(bool show)SetShowPathSubtitles
void SetShowPathSubtitles(bool show)Two-line rows: asset name over its project path in secondary text. Off by default — compact pickers (node menus) keep single-line rows.
SetShowClearButton
void SetShowClearButton(bool show)SetUnresolved
void SetUnresolved(bool unresolved)The field holds a reference that names nothing that exists. Drawn in the error colour rather than silently as ordinary text: a path that was renamed away otherwise reads exactly like one that resolves, and the author only finds out when the thing fails to appear at runtime.
IsUnresolved
bool IsUnresolved() constSetThumbnailResolver
void SetThumbnailResolver(std::function<IArcRHITexture*(const std::string&)> resolver)Resolves an asset path/key to an Arc texture. Called every paint (never cached) so a thumbnail that finishes decoding late fills in on the next frame with no extra plumbing. Null result = nothing drawn yet.
ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseWheel
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideOnKeyChar
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) overrideOnMouseEnter
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseLeave
void OnMouseLeave(const CPointerEvent& event) overrideOnFocusLost
void OnFocusLost(const CFocusEvent& event) overrideOnDragEnter
bool OnDragEnter(const CGeometry& geo, const CDragDropEvent& event) overrideAsset drops from a browser. The entry list is already narrowed to the types this field accepts, so membership in it IS the type check — a texture dragged onto a mesh field is simply not offered.
OnDragOver
bool OnDragOver(const CGeometry& geo, const CDragDropEvent& event) overrideOnDragLeave
void OnDragLeave(const CDragDropEvent& event) overrideOnDrop
bool OnDrop(const CGeometry& geo, const CDragDropEvent& event) overrideCanCacheDesiredSize
bool CanCacheDesiredSize() const overrideA fixed dropdown frame; the asset name inside it is elided to fit rather than widening the picker.
GetTypeName
const char* GetTypeName() const overrideIsFocusable
bool IsFocusable() const overrideEnter and Space on a tabbed-to picker open its list; the arrows and typing inside the open list were already keyboard-driven.
OnActivate
bool OnActivate() override