TreeView.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. Implementation steps:
  12. - Selection
  13. - Clicking on element selects it, delete removes it, F2 renames is. Slow double click renames it.
  14. - Rename implementation to follow, just set up an empty method for now
  15. - Callback on selection
  16. - Rename implementation
  17. - When rename is initiated hide the objects label and replace it with an input-box with the same text as a label
  18. - Rename ends when user hits enter or click anywhere else but the rename box
  19. - Drag and drop
  20. - If a mouse drag is detected DragAndDropManager is activated
  21. - Element is not removed from its original position until drag is complete
  22. - Dragging over an element will make a highlight box appear around it
  23. - Dragging between elements will make a thick line appear between them
  24. - Releasing the drag changes the element parents
  25. - Auto scroll
  26. - 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.
  27. Detecting external clicks:
  28. - LostFocus event?
  29. - Triggered when I click on another control within my own windows, or when controls parent window loses the focus himself
  30. - Each GUIElement can implement acceptsMouseFocus event. If it does, then mouse click will cause a ReceivedFocus event.
  31. - Mouse click on any other element, or window losing focus will trigger LostFocus events
  32. - I can replace clumsy Selective Input with this approach
  33. - 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