Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

New UI Widgets

Discussion in 'Assets and Asset Store' started by ilih, Feb 11, 2015.

  1. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    New UI Widgets is a set of widgets and UI interactions; it also includes a widgets generator for the custom data types and converter from default Text to TextMeshPro.

    Collections:

    Widgets can be generated for your custom type with the context menu "Create / New UI Widgets / Generate Widgets"
    Virtualization (recycling) supported: game objects are created for visible items only.

    Containers:
    Dialog:
    Controls:
    Input:
    Other:
    Interactions:
    Works with:
    * not available on platforms with restricted access to the file system (like WebGL and Windows Store/UWP)

    Asset Store
    Demo
    Documentation



    Changelog
    • v1.15.9
      • ListView: fixed undisplayed properties in the Inspector window
      • Rating: fixed Interactable does not work correctly when disabled
      • TreeView: added ContainerMaxSize option to prevent scrollbar blink caused by virtualization: the container will have the maximum width of all items. By default, the container has the maximum width of only visible items. Require ListType = List View with Variable Size.
    • v1.15.8
      • added Rating widget (Text can be replaced with an Image or any other Graphic component)
      • added async helpers scripts
      • DatePicker, PickerInt, PickerString, and custom PickerListView: added an optional OK button and Mode option to choose between “close on select” and “close on OK click”
      • Dialog, Notification, Picker, Popup: added OnBaseInstanceOpen and OnBaseInstanceClose static events
      • Dialog, Notification, Picker: added OnInstanceOpen and OnInstanceClose static events for the custom types
      • Popup: added ShowAsync() method to use with async/await
      • Styles: fixed missing font in some Unity versions
      • TileView: added LinearGroupedTileView example
      • TracksView: added Timeline
      • menu “New UI Widgets/Dialogs” renamed to “New UI Widgets/Dialogs Templates”
    • v1.15.7
      • added LoadAnimation widget
      • Dialog, Lightbox, Picker, Popup: added HideOnModalClick option
      • added workaround to avoid ReSharper RRSRP-489023 bug
      • Combobox: fixed bug when items were removed but still displayed as selected
      • ListView: added ChangeLayoutType option: if enabled changes EasyLayout.LayoutType to match ListType.
      • ListView, TreeView: now the deselect events invoked for the removed indices/nodes
    • v1.15.6
      • now the oldest supported version is Unity 2018.4
      • added Grayscale effect
      • added LocalizationSupport option to disable translation for widgets with localization support
      • added LimitMaxSize script to limit size when using anchors stretch
      • added ProgressbarCircular prefab and menu option
      • added SafeArea script to resize RectTransform to fit the safe area
      • added Swipe script
      • Dialog, Notification, Picker: added ShowAsync() method to use with async/await
      • Dialog, Notification, Picker: added IsDestroyed property to check if is instance destroyed
      • Dialog, Notification, Picker: now destroying instances will raise cancel or hide events
      • Effects (derived from UVEffect): improved filled image type support
      • Calendar: add OtherMonthWeekend and OutOfRangeDate colors to the Date component
      • ContextMenu: fixed bug occurring with opened “ContextMenu Items Editor” window in play mode
      • ListView, TreeView: fixed incorrect drop indicator position in some cases
      • ListView: added GetInstanceSize(), SetInstanceSize(), ResetInstanceSize() methods to animate items resize without problems with virtualization
      • ListView: fixed wrong drop position and indicator if enabled CenterTheItems
      • Ring Effect: added Fill option
      • TreeView Drop Support: added AutoDropPosition and DropPosition options
      • TreeView: added AllowToggle option
      • TreeView: added TreeViewToggleAnimation script to animate node toggle
      • Widgets Generator: fixed bug with “const” fields
      • Widgets Generator: now you can select the fields that will be used in the widgets, including the field for the autocomplete; it also can be done with [GeneratorIgnore] and [GeneratorAutocomplete] attributes
    • v1.15.5
      • improved Unity 2021.3 LTS support
      • COMPATIBILITY-BREAKING CHANGES: ListView methods ComponentCreated, ComponentDestroyed, ComponentActivated, ComponentCached changed to public
      • ListView: added SetSharedTemplates() method
      • Widgets Generation: fixed bug when data type has a parameterless constructor
    • v1.15.4
      • added ScrollRectDragSensitivity
      • added UtilitiesScrollRect: get time for ScrollRect stop by inertia
      • ListView: added ReversedOrder option (items displayed from end to start)
      • ListView: added OnlyOneHighlighted option
      • ScrollRectHeader, ScrollRectFooter: added Visible option to show and hide header (or footer)
      • ScrollRectHeader, ScrollRectFooter: added layout support if DisplayType is Reveal
      • ScrollRectFooter: added ChangeLayout option
      • ScrollRectPaginator: added RoundingError option to avoid excess last page
      • Switch: added AnimationCurve option
      • Widgets Generation: fixed enum related bug
      • Widgets Generation: improved support of latest Unity versions (2022.1.0+)
      • Style: fixed “Create Style” bug
    • v1.15.3
      • COMPATIBILITY-BREAKING CHANGES: LateUpdateAdd and LateUpdateRemove methods of IUpdaterProxy renamed to AddLateUpdate and RemoveLateUpdate, added RemoveRunOnce and RemoveRunOnceNextFrame methods
      • ContextMenu: added helper script OpenContextMenu to open the menu by clicking on non-UI gameobject, requires PhysicsRaycaster and/or PhysicsRaycaster2D on the main camera
      • DateTimeScroller and DateScroller: fixed AMPM change on hours scroll if IndependentScroll enabled
      • EasyLayout: added optional movement and resize animation support; warning: can decrease performance
      • Effects: RingEffect, RippleEffect, LinesDrawer, SnapGridDrawer no more requires enabled TexCoord1 channel on Canvas
      • ListView: fixed item instance visibility if ListViewItem.DisableRecycling enabled
      • ListView: added OnNavigate event; called after navigating to the other item instance with keyboard or gamepad
      • ListView: added ItemsEvents.MovedToCache event
      • ListView: FixHighlightItemUnderPointer option now obsolete
      • ListView: added KeepHighlight option to keep item highlight on pointer enter until will be selected another gameobject
      • ListView: fixed wrong events processing order in some cases
      • ListViewItem: added StopSelectableAnimations() method to ListViewItem class
      • Notification: added OpenedNotifications, AllNotifications and InactiveNotifications properties
      • Picker: added OpenedPickers, AllPickers, and InactivePickers properties
      • Spinner: fixed bug with Unity Text and OnKeyDown validation
      • Tabs: added EventSystemSelectActiveHeader option
      • Tabs: added ImmediateSelect option
      • Tabs: added NextTab() and PreviousTab() methods
      • TimeScroller: added SingleAMPM property to disable multiple AM PM options in scroll block
      • TreeNode: added HasNodes and HasVisibleNodes properties
      • TreeView: added ToggleOnNavigate option, if enabled expand node on move right event and collapse node on move left event
      • TreeView: added ToggleOnSubmitCancel option, if enabled expand node on submit event and collapse node on cancel event
    • v1.15.2
      • added Updater static class to control scripts updates IUpdatable.RunUpdate() without reflection instead of the default MonoBehaviour.Update()
      • added SnapGrid: allow to stick draggable or resizable UI game objects to the nearest grid lines
      • added LinesDrawer and SnapGridDrawer effects
      • COMPATIBILITY-BREAKING CHANGES: MonoBehaviour.Update() replaced with IUpdatable.RunUpdate()
      • Autocomplete: added AllowCancelOnDeselect to cancel DisplayListView close on deselect event.
      • Autocomplete: added OnSearchCompleted event
      • Autocomplete: added ResetListViewSelection option
      • AutoCombobox: fixed InputField display bug
      • AutoCombobox: fixed coloring bug
      • AutoCombobox: added KeepSelection option (set Autocomplete.DisplayListView selected items)
      • Connectors: fixed incorrect positions when CanvasMode is WorldSpace and its scale is not 1
      • Dialog: added ButtonsContainer option
      • ListView: fixed bug with incorrect item sizes when using variable size type
      • ListView: fixed highlighting bug
      • ListView: fixed wrong background color for the last items in table mode
      • ListView: added RangeMode property to determine which element is the start when selecting a range with the Shift key.
      • ListView: fixed instance recycling if ListViewItem.IsDragged enabled
      • ListViewItem: IsDragged renamed to DisableRecycling
      • ListViewString: now sort can be disabled with EnableSort in Inspector window
      • Notification: added ButtonsContainer option
      • Paginator: added SetPage method to change current page without animation
      • Sidebar: added ModalColor field
      • shaders: now should support stereo instanced rendering and SRP batcher (thanks to David Watt)
      • Tooltip: added generic Tooltip
      • TreeView: added FindNodes method
      • Widgets Generation: added Tooltip generation
    • v1.15.1
      • COMPATIBILITY-BREAKING CHANGES: cursors fields at components (Resizable, Rotatable, Splitter, TableHeader, DragSupport) are no more used and replaced with Cursors asset and CursorsDPISelector component
      • Accordion: added Curve property to use in animations
      • ContextMenu: fixed HotKey null bug
      • ListView: added OnComponentCreated, OnComponentEnabled, OnComponentDisabled, OnComponentDestroyed events
      • ListView: renamed StopScrollAtItemCenter to ScrollInertiaUntilItemCenter and StopScrollInertia to ScrollInertia
      • TreeView: fixed node remove bug when different nodes using the same item
      • TreeView: fixed multiple selection bug when selecting a collapsed node
      • TreeViewNodeDropSupport: added “Expand Node On Hold” option with customizable delay
      • UICursors: static methods changed to fields so now they can be replaced
    • v1.15.0
      • added ListViewEnum with ListViewEnum<T> wrapper to work with any enums
      • reduced memory allocations
      • all classes with INotifyPropertyChanged support now also implements IObservable which works without memory allocations
      • Autocomplete, Combobox: added field ParentCanvas, it used as ListView parent on open
      • Combobox: toggle-button is now full width
      • ContextMenu: now works correctly with all canvas render modes
      • DateScroller/DateTimeScroller/TimeScroller: ScrollBlock replaced with ScrollBlockBase
      • Dialog: added InactiveDialogs and AllDialogs properties to get access to the template instances
      • Dialog: DialogButton now support callback with Func<DialogBase dialog, int buttonIndex, bool closeDialog> type
      • EasyLayout: small improvements
      • EasyLayout: Filter property is obsolete and replaced with ShouldIgnore
      • Input System support: fixed bug on mobile devices
      • ListView: added property TemplateSelector, its allow to use of different templates (not only DefaultItem) depending on the item
      • ListView: added GetDebugInfo and PringDebugInfo methods
      • ListView: added "AnimationCurve animation, bool unscaledTime, Action after = null" parameters to the ScrollTo*Animated methods
      • ListView: StopScrollAtItemCenter and StopScrollInertia properties
      • ListView: fixed problem with not displayed items for ListType with variable sizes
      • ListView: added GetComponentsEnumerator to iterate through DefaultItems instances as allocation free replacement of the ForEachComponent method
      • ListView: added support of Container with custom scale
      • ListView: fixed AutoScroll bug
      • Notification: NotificationButton now support callback with Func<NotificationBase notification, int buttonIndex, bool closeNotification> type
      • Paginators: added OnMovement event
      • Popup: added content and onClose parameters to the Show method, added SetContent() method, added OnClose field, works the same way as dialog
      • Resizable: added UseCanvasScaler option, if enabled ActiveRegion will be changed according to the CanvasScaler settings
      • ScrollBlock: added OnItemChanged event to customize items depending on index and value
      • ScrollBlock: added ScrollBlockBase and ScrollBlockCustom<T> classes
      • TracksViewBase: ScrollBlock replaced with ScrollBlockBase
      • TreeView: fixed drop support bug
      • TreeView prefabs: toggle arrow is now nested
      • UICursor: added Replacement function to replace cursor (can be used to replace cursor on High DPI screens)
      • Utilities: more functions moved to the new UtilitiesUI and UtilitiesRectTransform classes
    • v1.14.2
      • added CircularSlider widget
      • added SliderScale widget
      • added TimeAnalog widget
      • Accordion: added OnStartToggleAnimation and OnDataSourceChanged events
      • Accordion: added AccordionHighlight component
      • AutoComplete: added OnItemNotFound and OnCancelInput events
      • AutoCombobox: added AddItems option (requires overridden Input2Item method)
      • CenteredSlider: event OnValuesChange renamed to OnValueChanged
      • Connectors: fixed bug related to “Scale With Screen Size”
      • Connectors: added rectangular lines support
      • Cursor: fixed flickering
      • DatePicker and DateTimePicker: fixed initial date
      • DirectoryTreeView: nested nodes are automatically loaded on node expand from a script
      • DirectoryTreeView: added ExpandPath(), Path2Node(), Path2NearestNode(), RefreshDirectories() methods
      • ListView: fixed highlight coloring on navigation
      • ListView: fixed unstoppable auto-scroll bug
      • ListView Drop Support: added ReceiveOnlyEmptyNode option
      • RangeSlider: event OnValuesChange renamed to OnValuesChanged
      • Resizable: fixed position change
      • ScrollBlock: added AllowIncrease and AllowDecrease fields
      • Spinner: added SetValue() method to change value without OnChangeEvent invocation
      • Styles: fixed error when creating a new style
      • Styles: added PixelsPerUnitMultiplier property to the Image styles
      • TreeGraph: small performance improvement
      • TreeGraph: added LineThickness, LineType, LineMargin options
      • TreeView: added ScrollWithIndent option
      • Widgets Generation: improved localization support
    • v1.14.1
      • EasyLayout: reduced memory allocations
      • Widgets Generation: fixed type name error
      • Widgets Generation: fixed missing reference
    • v1.14.0
      • added localizations integration support
      • added I2 Localization support
      • added ContextMenu
      • added Input System support
      • added UtilitiesCompare class
      • added ScrollRectFooter
      • added AutoComboboxIcons prefab
      • Dialog, Picker, Popup: added CloseButton property
      • EasyLayout: added SetPreferredAndFitContainer option for the Children Size
      • ListView: added Header property
      • ListViewPaginator: added LoopedList support
      • Notification: added “content” and “onReturn” parameters to the Show() method
      • Style: fixed unchangeable settings after “Apply Fast Settings” use
      • Style: added “Update Default Style” option, which is opposite of the “Apply Default Style”, it gets style settings from widgets and saves them to the current style
      • Tabs: added CanSelectTab field to check if tab can be selected with a button click.
      • TabsCustom: TabButton class changed to the generic class TabButton<T>
      • Widgets Generation: generated classes are partial now
      • Widgets Generation: added AutoCombobox widget
      • Utilities: most functions moved to the new Utilities* classes
    • v1.12.5
      • added UIFlareGlobal shader: flare at global space
      • added Ripple effect
      • UIWidgets extensions methods moved to UIWidgets.Extensions namespace
      • EasyLayout extensions methods moved to EasyLayoutNS.Extensions namespace
      • shaders: replaced properties names with properties IDs
      • Dialog: Show() arguments can later be changed with other methods: SetInfo(), SetButtons(), FocusButton(), SetPosition(), SetContent(), SetCanvas(), SetModal().
      • EasyLayout: added GetElementPosition to get position in group
      • InputFieldExtended: fixed bug with Value property (thanks to RickSaada1)
      • ListView: added ItemsEvents field
      • ListViewItem: now foreground and background graphics are serialized properties
      • Notify: added buttons support with SetButtons(IList<DialogButton> buttons) method
      • ProgressbarIndeterminate: fixed bar jump at the start
      • TableHeader: fixed bug with ColumnToggle (thanks to jbw)
      • UIFlare shaders: added flare delay property
    • v1.12.4
      • Unity 4.6+ and Unity 5.x no more supported, now the oldest supported version is 2017.4
      • fixed SendMessage warnings in Unity 2019.3 and later versions
      • assembly definitions removed because of the all changes in .asmdef files are deleted on package update
      • ListView: DefaultItem no more disabled by default in Editor mode
      • ListViewDragSupport: added auto-scroll when the drag is near the border
      • Notify: now you can create derived classes with NotificationCustom<T>
      • TreeView Drag&Drop: now nodes can be reordered
    • v1.12.3
      • added Pinchable component: drag, rotate, resize multi-touch support
      • added ListViewAutoResize component: auto-resize ListView or TileView according to items counts until specified maximum size reached
      • [Serializable] attribute of TreeNode<TItem> class not available for Unity 2020.1 and later versions
      • ListView: added DisableScrollRect property to disable ScrollRect if ListView is not Interactable
      • ListView and TreeView Drag&Drop: added Interactable support
    • v1.12.2
      • added DistanceLines component
      • added UI Cursor settings component
      • Dialog: fixed buttons order
      • DirectoryTreeView: fixed drives list
      • ListViewPaginator, ScrollRectPaginator: fixed LastPageFullSize option
      • ListView: now resize of disabled ListView processed correctly
    • v1.12.1
      • added converter from Unity Text to TextMeshPro text
      • added IUpgradeable interface to improve compatibility between versions
      • added Groupable component
      • added UIFlareTransparent shader
      • added ResizableHandles component
      • added Rotatable component
      • added RotatableHandle component
      • deleted a lot of lambda functions
      • other lambda functions replaced with local functions
      • renamed classes *Utilites to *Utilities
      • improved performance with Asset Pipeline V2
      • Combobox: fixed navigation support
      • Draggable: added Target property to drag the specified target instead of self
      • DragSupport: added AllowDrag field
      • DropSupport: added ReceiveItems and ReceiveNodes fields for the base classes
      • ListView: not selectable items are no more highlighted and navigated
      • ListViewPaginator, ScrollRectPaginator: added LastPageFullSize option to change the last page size to full-page size
      • Resizable: AllowResize renamed to Interactable
      • Resizable: added resize type to change between size and scale
      • Resizable: added Target property to resize the specified target instead of self
      • ScrollRectEvents: RequiredMovement replaced with Thresholds to support separate thresholds for each pull direction
      • Splitter: AllowResize renamed to Interactable
      • Widgets Generation: added option to manually specify the type name if the type cannot be detected from the MonoScript
    • v1.11.2
      • added TracksView to create custom schedule or time-line widgets
      • added InputFieldAdapter to improve TextMesh Pro support
      • added ListComponentPool
      • added SplitButton
      • Dialog: added RectTransform content and Action onClose parameters to Show(…) method
      • Dialog: added OpenedDialogs property to get list of the opened dialog
      • Dialog: DefaultButton replaced with ButtonsTemplates and DialogActions now has option to specify button index for the button template
      • Dialog: type of the “buttons” parameter in the Show() method changed to IList<DialogButton>
      • Dialog: added “Func<int, bool> onCancel” parameter to the Show() method, called with -1 parameter when dialog closed with top right close button
      • DragListener: OnDragListener renamed to DragListener
      • DragSupport: added optional DragHandle property, you can use it drag ListView items by specified handle instead of the whole item
      • DragSupport: added StartDragEvent and EndDragEvent
      • EasyLayout: added ElementsRotate and ElementsRotationStart for Ellipse layout
      • ListView: improved navigation support
      • ListView: added optional parameter minVisiblePart to IsVisible() method
      • ListView: replaced old ListView with ListViewString
      • ListView: added Virtualization setting to disable Virtualization
      • ListViewDropSupport: added DropPosition parameter
      • ListViewPaginator: now use ListView.ScrollToAnimatedPosition instead of the own animation
      • Notify: fixed incorrect size and rotation of next notification if previous notification was closed during hide animation
      • Resizable: added AllowResize property to enable/disable resize without removing component
      • ScrollBlock: SetText() renamed to UpdateView()
      • ScrollRectPaginator: ForceScrollOnPage replaced with ForcedPosition to support different positions
    • v1.11.1
      • added AutocompleteCombobox
      • ListView: fixed scrolling bug with variable size list types
      • Notify: renamed AnimationRotate to AnimationRotateVertical, AnimationCollapse to AnimationCollapseVertical
      • Notify: added animations AnimationRotateHorizontal, AnimationCollapseHorizontal, AnimationSlideRight, AnimationSlideLeft, AnimationSlideUp, AnimationSlideDown
      • Notify: added configurable animations AnimationRotateBase, AnimationCollapseBase, AnimationSlideBase
      • Resizable: added OnResize event
      • Splitter: added OnResize event
      • Tabs: added SelectedTabIndex property
    • v1.11.0
      • added ScrollRectHeader (example of usage in Examples/ListView/ListViewHeader scene)
      • added EasyLayoutEllipseScroll
      • Combobox: added OnShowListView and OnHideListView events
      • EasyLayout: added new layout type Ellipse
      • EasyLayout: added new option ResetRotation
      • ListView: added DestroyDefaultItemsCache, if enabled instances of the previous DefaultItem will be destroyed when replacing DefaultItem
      • ListView: added new ListViewEllipse list type
      • Scroller: renamed to ScrollBlock
     
    Last edited: Nov 17, 2022
    johanneskopf, QFord and Gozdek like this.
  2. Lennartos

    Lennartos

    Joined:
    Feb 13, 2013
    Posts:
    34
    Hi ilih
    Im trying to use the combobox widget, but i have issues with using a scaling canvas ("Scale With Screen Size") and different aspects.
    The listbox items seem to ignore the resolution scale of the canvas entirely, meaning that the added items are either too small or too large for the listview.
     
  3. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Replace line 245 in ListViewBase.cs
    old line
    Code (csharp):
    1.                 x.transform.SetParent(Container);
    new line
    Code (csharp):
    1.                 x.transform.SetParent(Container, false);
     
  4. Lennartos

    Lennartos

    Joined:
    Feb 13, 2013
    Posts:
    34
    Perfect, Worked like a charm.
     
  5. Lennartos

    Lennartos

    Joined:
    Feb 13, 2013
    Posts:
    34
    Hi ilih
    Still learning from the documentation, but i encountered some minor issues though that you might want to look at:
    1) List View doesnt have clear method, Listview.Items.Clear does nothing.
    2) Listview remove worked as workaround, but that method only works with strings, the remove(listviewitem) is broken
    3) Combobox should also close if you clicked outside the list. ( standard combobox behavior )
    4) in a combobox, when selecting the currently selected, it does not close the combobox but instead deselects the item instead.
     
    Last edited: May 21, 2015
  6. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Clear method will be added with next update.
    Workaround for ListView
    Code (csharp):
    1.         listView.Strings = new List<string>();
    Workaround for ListViewIcons
    Code (csharp):
    1.         listViewIcons.Items = new List<ListViewIconsItemDescription>();
    Misprint with access modifiers.
    ListViewBase.Remove(ListViewItem) should be protected, not public.
    ListViewCustom.Remove(TItem item) should be public, not protected.

    Will be available with next update.

    Quick fix for this
    Replace line 282 in ListViewBase.cs
    old line
    Code (csharp):
    1. if (IsSelected(index))
    new line
    Code (csharp):
    1. if (IsSelected(index) && Multiple)
    Replace line 289 in ListViewBase.cs
    old line
    Code (csharp):
    1. if (selectedIndex!=-1)
    new line
    Code (csharp):
    1. if ((selectedIndex!=-1) && (selectedIndex!=index))
    Replace line 346 in ListViewBase.cs
    old line
    Code (csharp):
    1. if (IsSelected(index))
    new line
    Code (csharp):
    1. if (IsSelected(index) && Multiple)
     
    Last edited: May 21, 2015
  7. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
  8. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    is this mobile (android and ios) ready?
     
  9. KyleStaves

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    821
    Does the list view pool renderers and only use game objects for visible elements? or does it populate the list with game objects for every element?
     
  10. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Works on Android. It don't have platform specific code, so it should works on iOS too.
    You can try Android Demo (This demo may have problem with devices don't supported non-power-of-2 textures)

    For every element. Working on using game objects only for visible elements.
     
  11. ConfirmCrit

    ConfirmCrit

    Joined:
    Nov 26, 2013
    Posts:
    7
    Are the UI widgets controller friendly?
     
  12. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    No.
     
  13. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Fixed in version 1.3.1. It's already released.
     
  14. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    hi
    does this come with (or can you add if not) a working knob (like a volume control knob).

    thanks
     
  15. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    No.

    I'll think about it.
     
  16. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    well that's not much good to me is it! will you add it or not? if so ill buy, if not i wont, please could you give a definitive answer?

    thanks
     
  17. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    It takes some time to research, so I'll give answer at Tuesday or Wednesday.
     
  18. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    How do I pragmatically (using C#) add elements (new icons and text) to the ListViewIcons widget?

    Jason
     
  19. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Create one or more ListViewIconsItemDescription and add them with ListViewIcons.Add or ListViewIcons.Items.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using UIWidgets;
    4.  
    5. public class TestListViewIcons : MonoBehaviour {
    6.     [SerializeField]
    7.     ListViewIcons listViewIcons;
    8.  
    9.     [SerializeField]
    10.     Sprite icon;
    11.  
    12.     [SerializeField]
    13.     List<Sprite> icons = new List<Sprite>();
    14.  
    15.     public void ListViewIconsSamples()
    16.     {
    17.         //Add item
    18.         var new_item = new ListViewIconsItemDescription() {
    19.             Icon = icon,
    20.             Name = "item 1"
    21.         };
    22.         listViewIcons.Add(new_item);
    23.        
    24.         //Add items
    25.         var add_items = new List<ListViewIconsItemDescription>() {
    26.             new ListViewIconsItemDescription() {
    27.                 Icon = icons.Count > 0 ?  icons[0] : null,
    28.                 Name = "item 1"
    29.             },
    30.             new ListViewIconsItemDescription() {
    31.                 Icon = icons.Count > 1 ?  icons[1] : null,
    32.                 Name = "item 2"
    33.             },
    34.             new ListViewIconsItemDescription() {
    35.                 Icon = icons.Count > 2 ?  icons[2] : null,
    36.                 Name = "item 3"
    37.             },
    38.         };
    39.         var new_items = listViewIcons.Items;
    40.         new_items.AddRange(add_items);
    41.         listViewIcons.Items = new_items;
    42.        
    43.         //Replace items
    44.         listViewIcons.Items = add_items;
    45.     }
    46. }
     
  20. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Thank you very much for the quick response.

    Jason
     
  21. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Another question. On the ListView how do I detect a user click on one of the listed items?

    Jason
     
  22. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Add callback to ListViewIcons.OnSelect to detect user select item. ListViewIcons.OnDeselect to detect user deselect item.

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         listViewIcons.OnSelect.AddListener(ItemSelected);
    4.         listViewIcons.OnDeselect.AddListener(ItemDeselected);
    5.     }
    6.  
    7.     void ItemSelected(int index, ListViewItem component)
    8.     {
    9.         Debug.Log("Selected index: " + index);
    10.         var item = listViewIcons.Items[index];
    11.         Debug.Log("Selected item name: " + item.Name);
    12.     }
    13.  
    14.     void ItemDeselected(int index, ListViewItem component)
    15.     {
    16.         Debug.Log("Deselected index: " + index);
    17.         var item = listViewIcons.Items[index];
    18.         Debug.Log("Deselected item name: " + item.Name);
    19.     }
    20.  
    21.     void OnDestroy()
    22.     {
    23.         listViewIcons.OnSelect.RemoveListener(ItemSelected);
    24.         listViewIcons.OnDeselect.RemoveListener(ItemDeselected);
    25.     }
    26.  
     
  23. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    And still another question. How do I have the ListView reload a new list without reloading the level?

    Jason
     
  24. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Save ListView.Strings or ListViewIcons.Items, than restore them when you need.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using UIWidgets;
    4.  
    5. public class TestListViewSaveLoad : MonoBehaviour {
    6.     [SerializeField]
    7.     ListView listView;
    8.  
    9.     List<string> listViewStrings = new List<string>();
    10.     List<int> listViewIndicies = new List<int>();
    11.  
    12.     [SerializeField]
    13.     ListViewIcons listViewIcons;
    14.  
    15.     List<ListViewIconsItemDescription> listViewIconsItems = new List<ListViewIconsItemDescription>();
    16.     List<int> listViewIconsIndicies = new List<int>();
    17.  
    18.     void Start()
    19.     {
    20.         listView.Start();
    21.         listViewIcons.Start();
    22.  
    23.         SaveListView();
    24.         SaveListViewIcons();
    25.     }
    26.     public void TestRestore()
    27.     {
    28.         RestoreListView();
    29.         RestoreListViewIcons();
    30.     }
    31.  
    32.     /// <summary>
    33.     /// Saves the ListView strings.
    34.     /// </summary>
    35.     public void SaveListView()
    36.     {
    37.         listViewStrings = listView.Strings;
    38.         listViewIndicies = listView.SelectedIndicies;
    39.     }
    40.  
    41.     /// <summary>
    42.     /// Restores the ListView strings.
    43.     /// </summary>
    44.     public void RestoreListView()
    45.     {
    46.         listView.Strings = listViewStrings;
    47.         listView.SelectedIndicies.ForEach(i => listView.Deselect(i));
    48.         listViewIndicies.ForEach(i => listView.Select(i));
    49.     }
    50.  
    51.     /// <summary>
    52.     /// Saves the ListViewIcons items.
    53.     /// </summary>
    54.     public void SaveListViewIcons()
    55.     {
    56.         listViewIconsItems = listViewIcons.Items;
    57.         listViewIconsIndicies = listViewIcons.SelectedIndicies;
    58.     }
    59.  
    60.     /// <summary>
    61.     /// Restore the ListViewIcons items.
    62.     /// </summary>
    63.     public void RestoreListViewIcons()
    64.     {
    65.         listViewIcons.Items = listViewIconsItems;
    66.         listViewIcons.SelectedIndicies.ForEach(i => listViewIcons.Deselect(i));
    67.         listViewIconsIndicies.ForEach(i => listViewIcons.Select(i));
    68.     }
    69. }
     
  25. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    When I start my scene I can use the dialog, but then once the scene reloads I get exceptions when trying to use the same dialog (get a similar error with notifications - again works ok the first time but never again after a screen reloads)

    ArgumentException: Not found template with name 'DialogTemplate'
    UIWidgets.Templates`1[UIWidgets.Dialog].Instance (System.String name) (at Assets/UIWidgets/Standart Assets/Templates.cs:143)
    UIWidgets.Dialog.Template (System.String template) (at Assets/UIWidgets/Standart Assets/Dialog.cs:131)
    Voxel.Modify.Update () (at Assets/Voxel/Modify.cs:40)
    "
     
    Last edited: May 26, 2015
  26. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Sorry for the inconvenience.

    Fix for Dialog.
    Add after line 109 in Dialog.cs (Awake method)
    Code (CSharp):
    1.             if (Templates==null)
    2.             {
    3.                 Templates = new Templates<Dialog>();
    4.             }
    Replace line 118-121 in Dialog.cs (OnDestroy method)
    Code (CSharp):
    1.             if (!IsTemplate)
    2.             {
    3.                 Templates = null;
    4.                 return ;
    5.             }
    Fix for Notify.
    Add after line 124 in Notify.cs (Awake method)
    Code (CSharp):
    1.             if (Templates==null)
    2.             {
    3.                 Templates = new Templates<Notify>(AddCloseCallback);
    4.             }
    5.  
    Replace line 138-141 in Notify.cs (OnDestroy method)
    Code (CSharp):
    1.             if (!IsTemplate)
    2.             {
    3.                 Templates = null;
    4.                 return ;
    5.             }
     
  27. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    Error I get now:
    NullReferenceException: Object reference not set to an instance of an object
    UIWidgets.Dialog.Template (System.String template) (at Assets/UIWidgets/Standart Assets/Dialog.cs:136)
    Voxel.Modify.Update () (at Assets/Voxel/Modify.cs:39)
     
  28. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    All dialogs unactive by default?

    This fix should help.
    Replace lines 99-102 in Dialog.cs
    Code (CSharp):
    1.         static Templates<Dialog> templates;
    2.  
    3.         /// <summary>
    4.         /// Dialog templates.
    5.         /// </summary>
    6.         public static Templates<Dialog> Templates {
    7.             get {
    8.                 if (templates==null)
    9.                 {
    10.                     templates = new Templates<Dialog>();
    11.                 }
    12.                 return templates;
    13.             }
    14.             set {
    15.                 templates = value;
    16.             }
    17.         }
    Replace lines 94-97 in Notify.cs
    Code (CSharp):
    1.         static Templates<Notify> templates;
    2.  
    3.         /// <summary>
    4.         /// Notify templates.
    5.         /// </summary>
    6.         public static Templates<Notify> Templates {
    7.             get {
    8.                 if (templates==null)
    9.                 {
    10.                     templates = new Templates<Notify>(AddCloseCallback);
    11.                 }
    12.                 return templates;
    13.             }
    14.             set {
    15.                 templates = value;
    16.             }
    17.         }
     
  29. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    Ah are they supposed to be enabled or disabled on start - when i switched to enabled on start it worked (I did not put in the second bit of code). (Note that I tried having them enabled originally and the null on scene load bug was still there) So it is working now with the first fix you gave me, if the object is enabled on start. Thanks!
     
  30. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    First fix works only with enabled dialogs, with second fix it's works with both disabled and enabled.
     
  31. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    Also not clear on how I get the results of a dialog box?
     
  32. fivearchers

    fivearchers

    Joined:
    Apr 17, 2009
    Posts:
    716
    Ah I got it - I saw where to tell the dialog the method - nice!
     
  33. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    This did not work for me. I am not sure why. I found an easier way to do it by using listView.Remove(string) and listView.add(string) which did work.

    Thanks,

    Jason
     
  34. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Just in case.
    Code (CSharp):
    1.     public void ShowDialogSignIn()
    2.     {
    3.         // create dialog from template
    4.         var dialog = Dialog.Template("DialogSignInTemplateSample");
    5.         // helper component with references to input fields
    6.         var helper = dialog.GetComponent<DialogInputHelper>();
    7.         // reset input fields to default
    8.         helper.Refresh();
    9.  
    10.         // open dialog
    11.         dialog.Show(
    12.             title: "Sign into your Account",
    13.             buttons: new DialogActions(){
    14.                 // on click call SignInNotify
    15.                 {"Sign in", () => SignInNotify(helper)},
    16.                 // on click close dialog
    17.                 {"Cancel", Dialog.Close},
    18.             },
    19.             focusButton: "Sign in",
    20.             modal: true,
    21.             modalColor: new Color(0, 0, 0, 0.8f)
    22.         );
    23.     }
    24.  
    25.     // using dialog
    26.     bool SignInNotify(DialogInputHelper helper)
    27.     {
    28.         // return true if Username.text and Password not empty, otherwise false
    29.         if (!helper.Validate())
    30.         {
    31.             // return false to keep dialog open
    32.             return false;
    33.         }
    34.  
    35.         // using dialog input
    36.         var message = "Sign in.\nUsername: " + helper.Username.text + "\nPassword: <hidden>";
    37.         Notify.Template("NotifyTemplateAutoHide").Show(message, customHideDelay: 3f);
    38.  
    39.         // return true to close dialog
    40.         return true;
    41.     }
     
  35. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    No. It will not be added in near future.
     
  36. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    240
    Hi, I noticed the interface elements do not support the StandaloneInputModule (navigation with keyboard or gamepad). Are you planning to add support for it any time soon?
     
  37. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Yes. Now I am working on optimization, then keyboard and gamepad support.
     
    Last edited: May 29, 2015
  38. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    240
    Excellent! Bought it.
     
  39. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Version 1.3.2 released.
    • Improved performance for ListView, ListViewIcons, ListViewCustom, Combobox, ComboboxIcons, ComboboxCustom (game objects used only for visible elements).
    • Bug fixes.

    Migration guide (without it optimization will not be available):
    • Specify Scroll Rect in ListViews
    • Replace Horizontal Layout Group with Easy Layout

     
    Last edited: Jun 2, 2015
    Orion likes this.
  40. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    467
    I get this but the GUI does not update only see the result in the inspector. ???

     
  41. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    That's strange.
    Which version of Unity are you using?
    Any messages in console?
    Are you using and checking same ListViewIcons? Sample scene have two of them, one from ListViewIcons and one from ComboboxIcons.
     
    Last edited: Jun 4, 2015
  42. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Have just purchased and reviewed...

    Feature request - Can you add treeviews, header rows to listviews, tooltips, guages, and fillers (fills up) to this asset?
     
  43. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Will be added in one of next updates.

    It is already in asset.

    May be. I don't know when I can do it.

    Is this vertical progressbar?
     
  44. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ ilih - thanks for the quick response.

    header rows in listviews, treeviews - yes please... ;)

    tooltips - whoops - somehow missed that...

    guages - agree, low priority

    fillers - thinking more of RPG esque bowls, bulbs that fill?
     
  45. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ ilih - but header rows for listviews/boxes would be the absolute number one priority I suspect...
     
  46. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    I am trying to load an item into a ListViewIcons object using the following code:

    Code (CSharp):
    1. [SerializeField] Sprite sampleIcon;
    2.  
    3. sampleIcon = Sprite.Create(Resources.Load <Texture2D>("PATH TO IMAGE"),new Rect(0,0,170,170),new Vector2(0,0));
    4.  
    5. var new_item = new ListViewIconsItemDescription() {
    6.      Icon = sampleIcon,
    7.      Name = tempText
    8. };
    9. lstView.Add(new_item);
    I am getting the following error message:

    NullReferenceException: Object reference not set to an instance of an object
    UIWidgets.ListViewIconsItemDescription.Equals (System.Object obj) (at Assets/UIWidgets/Standart Assets/ListViewIcons.cs:44)
    UIWidgets.ListViewCustom`2+<Add>c__AnonStoreyF[UIWidgets.ListViewIconsItemComponent,UIWidgets.ListViewIconsItemDescription].<>m__10 (UIWidgets.ListViewIconsItemDescription x) (at Assets/UIWidgets/Standart Assets/ListViewCustom.cs:303)
    System.Collections.Generic.List`1[UIWidgets.ListViewIconsItemDescription].GetIndex (Int32 startIndex, Int32 count, System.Predicate`1 match) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:313)
    System.Collections.Generic.List`1[UIWidgets.ListViewIconsItemDescription].FindIndex (System.Predicate`1 match) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:294)
    UIWidgets.ListViewCustom`2[TComponent,TItem].Add (.TItem item) (at Assets/UIWidgets/Standart Assets/ListViewCustom.cs:303)
    con_item_list.Start () (at Assets/Scripts/con_item_list.cs:41)

    I suspect it has something to do with the way I am creating the sprite with Sprite.Create().

    Jason
     
  47. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Error happens when you have two items with similar Names and one with icon and second without.

    Here is fix
    ListViewIcons.cs, line 44, replace code
    old code
    Code (CSharp):
    1. return Name==descObj.Name && Icon.Equals(descObj.Icon);
    new code
    Code (CSharp):
    1.             if (((descObj.Icon==null) && (Icon!=null)) || ((descObj.Icon!=null) && (Icon==null)))
    2.             {
    3.                 return false;
    4.             }
    5.  
    6.             return Name==descObj.Name && ((Icon==null && descObj.Icon==null) || Icon.Equals(descObj.Icon));
     
  48. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    I replaced the code and the error message disappeared but the image is not displayed in the ListViewIcon. It is displaying the text just not the image.

    Jason
     
  49. OnAndOn

    OnAndOn

    Joined:
    Feb 14, 2015
    Posts:
    11
    @ilih - I was facing the same issue of scene reload giving 'Template XXXXX not found' error on Notify widget. I updated to the new version (1.3.2) and now that error is gone however I'm getting new error:

    MissingReferenceException: The object of type 'RectTransform' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.GetComponent[SlideUp] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineComponent.gen.cs:45)
    UIWidgets.Notify.SlideUp () (at Assets/UIWidgets/Standart Assets/Notify.cs:343)
    UIWidgets.Notify.Hide () (at Assets/UIWidgets/Standart Assets/Notify.cs:305)
    UIWidgets.Notify+<HideCorutine>c__Iterator5F.MoveNext () (at Assets/UIWidgets/Standart Assets/Notify.cs:295)

    The Notify widget is now shown but it doesn't auto-hide anymore after scene is reloaded.
     
  50. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,216
    Is it displayed only one item with tempText or two?