Automated: create new component page |
userspace |
||
| (7 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{UserspaceComponent}} | |||
{{Infobox Component | {{Infobox Component | ||
|Image=FileBrowserComponent.png | |Image=FileBrowserComponent.png | ||
|Name=File Browser | |Name=File Browser | ||
}} | }} | ||
== | The '''FileBrowser''' component is used to show file lists of files on the user's PC in the [[userspace]] [[dash menu]]. | ||
== Fields == | |||
{{Table ComponentFields | {{Table ComponentFields | ||
|SelectedItem| | |SelectedItem|BrowserItem| The currently selected item being highlighted. | ||
|_previousSelectedItem | |_previousSelectedItem|BrowserItem| The item previously highlighted. | ||
|AllowSelect|Bool| | |AllowSelect|Bool| Whether this file browser allows selecting item elements. | ||
|ItemSize|Float| | |ItemSize|Float| How big the items are on the view. | ||
|_selectedText|'''[[Component:Text|Text]]'''|TypeAdv4=true| | |_selectedText|'''[[Component:Text|Text]]'''|TypeAdv4=true| The text to fill with the name of the selected item. | ||
|_pathRoot|Slot| | |_pathRoot|Slot| The root of the area being used to display the current path. | ||
|_buttonsRoot|Slot| | |_buttonsRoot|Slot| The root of the area being used to show the different button actions. | ||
|_folderGrid|'''[[Component:GridLayout|GridLayout]]'''|TypeAdv7=true| | |_folderGrid|'''[[Component:GridLayout|GridLayout]]'''|TypeAdv7=true| The grid layout Component being used to align the folders in the directory. | ||
|_itemGrid|'''[[Component:GridLayout|GridLayout]]'''|TypeAdv8=true| | |_itemGrid|'''[[Component:GridLayout|GridLayout]]'''|TypeAdv8=true| The grid layout Component being used to align the files in the directory. | ||
|_tabSprite|'''[[Component:SpriteProvider|SpriteProvider]]'''|TypeAdv9=true| | |_tabSprite|'''[[Component:SpriteProvider|SpriteProvider]]'''|TypeAdv9=true| The sprite being used to show the tab sprite. | ||
|_loadingIndicator|Slot| | |_loadingIndicator|Slot| The slot that stores the loading indicator for a newly opened directory. | ||
|_swapper|'''[[Component:SlideSwapRegion|SlideSwapRegion]]'''|TypeAdv11=true| | |_swapper|'''[[Component:SlideSwapRegion|SlideSwapRegion]]'''|TypeAdv11=true| The component to handle the slide animation when opening a different directory. | ||
|CurrentPath|String| | |CurrentPath|String| The current folder path. | ||
|_lastPath|String| | |_lastPath|String| The last folder path. | ||
|_user|{{RootFieldType|MachineUserRef}}|TypeAdv14=true| | |_user|{{RootFieldType|MachineUserRef}}|TypeAdv14=true| The user using this file browser. | ||
|_importButton|'''[[Component:Button|Button]]'''|TypeAdv15=true| | |_importButton|'''[[Component:Button|Button]]'''|TypeAdv15=true| The button to import a selected folder or file. | ||
|_rawImportButton|'''[[Component:Button|Button]]'''|TypeAdv16=true| | |_rawImportButton|'''[[Component:Button|Button]]'''|TypeAdv16=true| The button to import a selected file as a raw file object. | ||
|_createNewButton|'''[[Component:Button|Button]]'''|TypeAdv17=true| | |_createNewButton|'''[[Component:Button|Button]]'''|TypeAdv17=true| The button to create a new file directory. | ||
|_reloadButton|'''[[Component:Button|Button]]'''|TypeAdv18=true| | |_reloadButton|'''[[Component:Button|Button]]'''|TypeAdv18=true| The button used to refresh the folder and file list. | ||
}} | |||
== Sync Delegates == | |||
{{Table ComponentTriggers | |||
|CreateDirectory:[[Component:BrowserCreateDirectoryDialog#CreateHandler|CreateHandler]]|[[Component:BrowserCreateDirectoryDialog#CreateHandler|CreateHandler]]|true| Called when a directory is created. | |||
|RunImport:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when an import needs to be made of a file. | |||
|RunRawImport:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when a raw file import needs to be made of a file. | |||
|CreateNew:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when a new item needs to be made. | |||
|Reload:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when a reload needs to be done. | |||
|OnGoUp:[[Type:ButtonEventHandler|ButtonEventHandler]]<[[Type:Int|int]]>|[[Type:ButtonEventHandler|ButtonEventHandler]]<[[Type:Int|int]]>|true| Called when the user wants to go up in directories. | |||
}} | }} | ||
== | == CreateHandler == | ||
Handles creation of directories. Is a sync delegate type. | |||
== Usage == | |||
Not used directly by the user. | |||
== Examples == | == Examples == | ||
Used in the dash menu on the file browser tab. | |||
== See Also == | == See Also == | ||
| Line 36: | Line 53: | ||
[[Category:Components:Uncategorized{{#translation:}}|File Browser]] | [[Category:Components:Uncategorized{{#translation:}}|File Browser]] | ||
[[Category:Components{{#translation:}}|File Browser]] | [[Category:Components{{#translation:}}|File Browser]] | ||
Latest revision as of 18:37, 14 April 2025
Component image File:FileBrowserComponent.pngFile Browser component as seen in the Scene Inspector
The FileBrowser component is used to show file lists of files on the user's PC in the userspace dash menu.
Fields
| Name | Type | Description |
|---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't. |
SelectedItem
|
BrowserItem | The currently selected item being highlighted. |
_previousSelectedItem
|
BrowserItem | The item previously highlighted. |
AllowSelect
|
Bool | Whether this file browser allows selecting item elements. |
ItemSize
|
Float | How big the items are on the view. |
_selectedText
|
Text | The text to fill with the name of the selected item. |
_pathRoot
|
Slot | The root of the area being used to display the current path. |
_buttonsRoot
|
Slot | The root of the area being used to show the different button actions. |
_folderGrid
|
GridLayout | The grid layout Component being used to align the folders in the directory. |
_itemGrid
|
GridLayout | The grid layout Component being used to align the files in the directory. |
_tabSprite
|
SpriteProvider | The sprite being used to show the tab sprite. |
_loadingIndicator
|
Slot | The slot that stores the loading indicator for a newly opened directory. |
_swapper
|
SlideSwapRegion | The component to handle the slide animation when opening a different directory. |
CurrentPath
|
String | The current folder path. |
_lastPath
|
String | The last folder path. |
_user
|
direct MachineUserRef | The user using this file browser. |
_importButton
|
Button | The button to import a selected folder or file. |
_rawImportButton
|
Button | The button to import a selected file as a raw file object. |
_createNewButton
|
Button | The button to create a new file directory. |
_reloadButton
|
Button | The button used to refresh the folder and file list. |
Sync Delegates
| Method Name | Method type and Arguments. | Is the method hidden? | Description |
|---|---|---|---|
CreateDirectory:CreateHandler
|
CreateHandler | ✓ | Called when a directory is created. |
RunImport:ButtonEventHandler
|
ButtonEventHandler | ✓ | Called when an import needs to be made of a file. |
RunRawImport:ButtonEventHandler
|
ButtonEventHandler | ✓ | Called when a raw file import needs to be made of a file. |
CreateNew:ButtonEventHandler
|
ButtonEventHandler | ✓ | Called when a new item needs to be made. |
Reload:ButtonEventHandler
|
ButtonEventHandler | ✓ | Called when a reload needs to be done. |
OnGoUp:ButtonEventHandler<int>
|
ButtonEventHandler<int> | ✓ | Called when the user wants to go up in directories. |
CreateHandler
Handles creation of directories. Is a sync delegate type.
Usage
Not used directly by the user.
Examples
Used in the dash menu on the file browser tab.