Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  3. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    576
    New features in v1.10:
    • Widget Generation
    • Styles
    Works with:
    • TextMesh Pro
    • Data Bind for Unity
    Widgets

    Collections:
    • Combobox
    • ListView
    • TileView
    • TreeView
    • DirectoryTreeView *
    • FileListView *
    All collections widgets support virtualization: gameobjects are created for visible items only.

    Containers:
    • Accordion
    • Tabs
    Dialog:
    • DatePicker
    • DateTimePicker
    • Dialog
    • FileDialog *
    • FolderDialog *
    • Notify
    • Picker
    • Popup
    • TimePicker
    Input:
    • Autocomplete
    • Calendar
    • ColorPicker
    • ColorPickerRange
    • RangeSlider
    • Spinner
    • Switch
    • Time
    Other:
    • Paginator
    • Progressbar
    • Sidebar
    • Tooltip
    Interactions:
    • Bring to Front
    • Draggable
    • Drag and Drop support
    • Resizable

    * not available on platforms with restricted access to file system (like WebGL and Windows Store/UWP)

    Asset Store
    Demo
    Documentation



    Changelog
    • v1.10.1
      • ListView: added ScrollTo(item) and ScrollToAnimated(item) functions
      • Paginator: added StopAnimation() function
      • ListViewPaginator: fixed direction problem
      • TreeView: added ScrollTo(node) and ScrollToAnimated(node) functions
      • TreeView: added FindNode() function
      • TreeView: now ScrollTo(..) and ScrollToAnimated(…) correctly work with node indentation
      • Widget Generation: added interface types support
      • Widget Generation: fixed property support
    • v1.10.0
      • Added styles support (Styles folder, new styles can be created from context menu “Create / UIWidget - Style”)
      • Added widget generation (context menu “Create / UIWidget - Widgets” on file with item class definition)
      • Added DateTime, Time24 and Time12 widgets
      • Added DateTimePicker and TimePicker widgets
      • Added ColorPickerRangeHSV widget
      • Added ColorsList widget to display list of the selected colors, should be used with ColorPicker or ColorPickerRange.
      • Added “Data Bind for Unity” support (requires Unity 5.6 or later)
      • Added base ListView Picker class for the custom ListView
      • Added base TreeView Picker class for the custom TreeView
      • Added base drop support class for the custom TreeView
      • Added base drop support class for the custom TreeView node
      • Added assembly definitions
      • Improvement: Drag can be canceled with Cancel button
      • Accordion: added AllItemsCanBeClosed option
      • Autocomplete: added GetInputFieldText() function
      • Calendar: added DateMin and DateMax properties
      • Calendar: added currentDateAsDefault option
      • ColorPicker: added Hex block
      • ColorPicker: added new palette mode HSVCircle
      • ColorPickerRange: DefaultShader replaced with DefaultShaderHorizontal and DefaultShaderVertical
      • Connectors: now works correctly with “Screen Space - Camera”
      • EasyLayout: reduced memory allocations
      • EasyLayout: EasyLayout namespace renamed to EasyLayoutNS to avoid problems with Unity 2018.2 and later
      • Interfaces: IItemWidth, IItemHeight, IListViewItemHeight, IListViewItemWidth not used anymore
      • ListView: added CenterTheItems property
      • ListView: added overridable functions CanBeSelected() and CanBeDeselected()
      • ListView: added LoopedList option
      • ListView: added Interactable option
      • ListView: added IsTable option (required to valid stylization)
      • ListView and TileView: ListViewCustomWidth, ListViewCustomHeight, TileViewCustom and TileViewCustomSize replaced with ListViewCustom with List Type option
      • ListViewCustomWidth: TItem now does not require IItemWidth implementation
      • ListViewCustomHeight: TItem now does not require IItemHeight implementation
      • ListViewDropIndicator: added styles support
      • ResizableHeader: fixed resize on touch devices
      • Sidebar: added OnOpeningStarted and OnClosingStarted, called when appropriated animation started
      • other: prefabs in “Sample Assets” folder replaced with scenes
      • other: “Standart Assets” folder renamed to “Scripts”
      • other: “Sample Assets” folder renamed to “Examples”
      • other: removed ListViewGameObjects prefab
      • other: removed outdated prefabs and sprites
      • other: namespace “UIWidgetsSamples” renamed to “UIWidget.Examples”
    • v.1.9.3:
      • Accordion: now works with content with dynamically change size
      • ListView's, TileView's, TreeView's: added GetItemPositionMiddle()
      • ListView's, TileView's, TreeView's: added ScrollToPosition()
      • ListView's, TileView's, TreeView's: added ScrollToPositionAnimated()
      • ResizableHeader: added ColumnEnable, ColumnDisable and ColumnToggle
      • ResizableHeader: fixed problem with adding columns
      • ResizableHeader: improvements
    • v.1.9.2:
      • Added TreeViewCustomNodeDragSupport
      • Added ScrollButtons
      • Autocomplete: fixed problem with resizing
      • Autocomplete: added SearchDelay and MinLength options
      • ColorPicker: fixed incorrect display in linear colorspace
      • ColorPicker: now click on palette or image will change color
      • Draggable: added Horizontal and Vertical options
      • Draggable: added Restriction option
      • ListViewCustomDragSupport: added DeleteAfterDrop parameter
      • ListView's, TileView's, TreeView's: added SetContentSizeFitter parameter
      • ListView's, TileView's, TreeView's: added Navigation parameter
      • ListView's, TileView's, TreeView's: added IsVisible() function to check if item is visible
      • ListView's, TileView's, TreeView's: added animated scrolling to items - ScrollToTime() and ScrollToSpeed()
      • ListView's, TileView's, TreeView's: Multiple renamed to MultipleSelect
      • RangeSlider: added RangeSliderType; it's allow or disable handles overlay
      • Resizable: fixed error with allowed directions
      • Sidebar: added new animation type ScaleDownAndPush
      • Spinner: fixed input parsing problem
      • Splitter: added Mode option, so you specify left and right targers, instead using previous and next siblings in hierarchy
      • TreeView: added serialization support with TreeNode<T>.Serialize() and TreeNode<T>.Deserialize()
      • TreeView: fixed error when deleting selected node with disabled DeselectCollapsedNodes
      • TreeView: added ExpandParentNodes() and CollapseParentNodes() functions
      • TreeView's DefaultItem: Filler renamed to Indentation
      • Dialog, Notify, Picker, Popup: Template() renamed to Clone()
    • v.1.9.1:
      • Fixed CenteredSlider
      • Fixed missing links in prefabs
      • Fixed demo
    • v.1.9.0:
      • Added AudioPlayer
      • Added Calendar
      • Added DatePicker
      • Added DirectoryTreeView
      • Added FileDialog
      • Added FileListView
      • Added FolderDialog
      • Added PickerBool (can be used as Confirmation dialog with Yes/No/Cancel options)
      • Accordion: added ResizeMethod property
      • Accordion: protected Items property replaced with public DataSource property with type ObservableList<T>
      • Accordion: added DisableClosed option
      • ColorPicker: added Image palette, you can use it to get colors from custom Texture2D. The texture must have the Read/Write Enabled flag set in the import settings, otherwise this function will fail.
      • ColorPicker: fixed bug with wrong axes with Hue palette
      • Drag&Drop: added generic classes ListViewCustomDragSupport and ListViewCustomDropSupport, using them to add Drap&Drop functionality for own ListView's become more easily. Check ListViewIconsDragSupport and ListViewIconsDropSuppport as reference (ignore TreeNode region).
      • EasyLayout: fixed "dirty" scene bug when using FitContainer or ShrinkOnOverflow
      • ListView's: DataSource can be safely used from other threads
      • ListView's: added GroupedListView sample
      • ListView's: added .Select(int index, bool raiseEvents) function, you can use it to select items without raising events
      • ListView's: added Owner field to ListViewItem (base class for any DefaultItem), it contains link to parent ListView
      • ListView's: you can implement IViewData<T> to DefaultItem component class to avoid overriding ListView.SetData() function
      • ListView's: added virtual properties Graphic[] GraphicsForeground and Graphic[] GraphicsBackground to ListViewItem, you can them to specify grapgics for coloring, instead overriding coloring functions
      • Resizable: mark events as used
      • SlideBlock renamed to Sidebar
      • Sidebar: added new animation types Overlay (default), Push, Uncover, ScaleDown, SlideAlong, SlideOut, Resize
      • Sidebar: added AnimateWithLayout option for Resize animation, use it if you need more than one Sidebar with Resize on same Content object
      • Spinner: added AllowHold option, so you can disable increasing/decreasing value during pointer hold
      • Switch: added .SetStatus(bool value), you can change state without raising corresponding events
      • TileView's: added TileViewCustomSize
      • Tooltip: added UnscaledTime option
      • TreeNode: added RootNode property, used to check if nodes belong to same tree
      • TreeView's and TreeNode: Nodes type change from IObservableList<TreeNode<TItem>> to ObservableList<TreeNode<TItem>>
      • TreeView: added SelectedNodes property
      • TreeView: added DeselectCollapsedNodes property, enabled by default
      • TreeView: added .Node2Index(TreeNode<TItem> node) function
      • TreeView: added .SelectNode(TreeNode<TItem> node) and .SelectNodeWithSubnodes(TreeNode<TItem> node) functions
      • TreeViewDataSource: fixed incorrect branch bug (thanks to Heiko Berres)
      • ProgressBar: added SpeedType option
     
    Last edited: Nov 13, 2018
    john05, 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:
    576
    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:
    576
    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:
    576
  8. ddfire

    ddfire

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

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    820
    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:
    576
    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:
    576
    No.
     
  13. ilih

    ilih

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

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    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:
    576
    No.

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

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    113
    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:
    576
    It takes some time to research, so I'll give answer at Tuesday or Wednesday.
     
  18. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    44
    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:
    576
    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:
    44
    Thank you very much for the quick response.

    Jason
     
  21. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    44
    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:
    576
    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:
    44
    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:
    576
    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:
    576
    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:
    576
    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:
    576
    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:
    44
    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:
    576
    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:
    576
    No. It will not be added in near future.
     
  36. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    201
    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:
    576
    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:
    201
    Excellent! Bought it.
     
  39. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    576
    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:
    394
    I get this but the GUI does not update only see the result in the inspector. ???

     
  41. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    576
    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:
    964
    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:
    576
    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:
    964
    @ 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:
    964
    @ ilih - but header rows for listviews/boxes would be the absolute number one priority I suspect...
     
  46. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    44
    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:
    576
    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:
    44
    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:
    576
    Is it displayed only one item with tempText or two?