UIWidgetFiles class
#include <Runtime/UI/Public/UIWidgetFiles.h>
Widget assets (.tnxwidget), data tables (.tnxtable), and the style sheets assets name (.ggss), loaded from files into a widget library and reloaded when saved.
A path is a file or a folder. A folder's .tnxwidget, .tnxtable, and .ggss files are all read, including those in folders inside it and, while watching, those added later (looked for every two seconds). A file is read at the next pump and, while watching, again whenever it is saved: the documents using its asset build again.
Starters are the widget assets the engine ships (TNX_ENGINE_ASSET_DIR/ui/widgets): a project asset of the same name replaces one (GGWidgetLibrary::LoadStarter).
Problems are logged with the file and line; an asset that can't be read at all keeps its last version. Add from any thread; pump on the thread that updates the documents, while none is updating.
Public functions
- void Add(std::string_view path, bool bStarters = false)
- Read the file or folder at
pathinto the library at the next pump. WithbStartersits widget assets are starters, which a project asset of the same name replaces. -
auto Pump(bool bWatch,
GGUI::
GGWidgetLibrary& library) -> uint32_t - Read files added since the last pump; with
bWatch, also those saved since they were last read, and new files in watched folders. Returns how many assets were loaded. - auto Loaded() const -> uint32_t
- assets loaded, total
- auto Failed() const -> uint32_t
- files with problems, total