TreeView.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. TreeView
  2. - Name editing
  3. - Detect mouse input in TreeView and if I double click over a GUILabel start rename
  4. - Or if I select it and hit F2 also start rename
  5. - Has callbacks with which it notifies TreeView of actual changes
  6. - Selecting
  7. - Clicking on a row of TreeView sets a flag that item is selected, and a GUIElement is created.
  8. - Element is positioned in updateLayoutInternal and it shows a different colored background
  9. - Deleting
  10. - Simply track currently selected element and Delete event
  11. TODO:
  12. - Add better TreeViewEditBox texture
  13. - In disableEdit make sure I actually apply name change
  14. - Use Undo/Redo system (TODO: Not implemented yet)
  15. - Clicking on an already selectecd element starts rename
  16. - Will likely need some kind of check to ignore double-clicks?
  17. - Pressing F2 starts rename
  18. - Context menu with rename
  19. - Detect when I click outside of input box and disable edit (TODO: Need a way to easily detect this)
  20. - Delete
  21. - Needs Undo/Redo support
  22. Implementation steps:
  23. - Selection
  24. - Clicking on element selects it, delete removes it, F2 renames is. Slow double click renames it.
  25. - Rename implementation to follow, just set up an empty method for now
  26. - Callback on selection
  27. - Rename implementation
  28. - When rename is initiated hide the objects label and replace it with an input-box with the same text as a label
  29. - Rename ends when user hits enter or click anywhere else but the rename box
  30. - Drag and drop
  31. - If a mouse drag is detected DragAndDropManager is activated
  32. - Element is not removed from its original position until drag is complete
  33. - Dragging over an element will make a highlight box appear around it
  34. - Dragging between elements will make a thick line appear between them
  35. - Releasing the drag changes the element parents
  36. - Auto scroll
  37. - Sliding over top or bottom of the tree view while dragging an element will search GUIElement parents to find a ScrollArea. If it finds one it will attempt to scroll up or down.
  38. Detecting external clicks:
  39. - LostFocus event?
  40. - Triggered when I click on another control within my own windows, or when controls parent window loses the focus himself
  41. - Each GUIElement can implement acceptsMouseFocus event. If it does, then mouse click will cause a ReceivedFocus event.
  42. - Mouse click on any other element, or window losing focus will trigger LostFocus events
  43. - I can replace clumsy Selective Input with this approach
  44. - DropDownBox can also use the same approach although I will likely need to convert DropDownBox to a GUIElement - DO THIS AFTER TreeView implementation is working
  45. Other:
  46. - When dragging in tree view automatically expand mouse over elements
  47. - Ability to select and drag multiple elements
  48. - "Ping" effect
  49. - All operations should be undo-redoable
  50. - Context menu with copy/paste
  51. - Copy/Paste/Duplicate
  52. - This is more of a problem with actual copying of SceneObjects (It's not implemented). I should be able to serialize, and then de-serialize with a new parent as a form of copy.
  53. ---------------------
  54. SHORTCUT BRAINSTORM:
  55. Remove pre-defined GUICommandEvents and InputCommandType. They cannot be easily extended and I will need their functionality when I add support for shortcuts!
  56. INSTEAD:
  57. - Add GUIShortcutManager to BansheeEngine
  58. - Platform forwards all input commands to ShortcutManager instead of gInput (via a callback)
  59. - ShortcutManager checks if it has any registered shortcuts and if any are triggered it notifies GUIManager
  60. - Shortcuts change depending on active GUIElement
  61. - Each GUIELement can provide a list of shortcuts it listens to
  62. - OnFocusGained/OnFocusLost adds/removes items from the list
  63. - If multiple elements are in focus, all of their shortcuts are registered but the callbacks just don't get triggered on those elements that don't have the triggered shortcut
  64. - If two elements have the same shortcut, only one of them will trigger (undefined which)
  65. - (Obviously this functionality will need focusGained/focusLost functionality first)
  66. TODO: Can I integrate this with the input manager somehow?
  67. - NO - Shortcut system should be GUI only, while in-game input and in-game shortcuts will be handled manually.
  68. When I implement focus gained/lost system, send keyboard input to all elements with focus. Remove "acceptsKeyboardFocus". Elements can choose to ignore keyboard focus by ignoring keyboard events.
  69. Remove Cut/Copy/Paste/Undo/Redo/Rename/SelectAll and similar shortcuts from InputCommands. Instead send generic shortcut commands whenever user presses some key (together with shift/ctrl/alt state).
  70. - Some shift/ctrl combinations might not be general shortcuts, like shift + arrows for selection, in which case we send them as specific shortcuts instead of generic ones
  71. - I should also add a GUIShortcutManager, as a centralized place for dealing with shortcuts (so that I my edit them at a later date)
  72. - TODO - Figure out how would this work