| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- TreeView
- - Name editing
- - Detect mouse input in TreeView and if I double click over a GUILabel start rename
- - Or if I select it and hit F2 also start rename
- - Has callbacks with which it notifies TreeView of actual changes
- - Selecting
- - Clicking on a row of TreeView sets a flag that item is selected, and a GUIElement is created.
- - Element is positioned in updateLayoutInternal and it shows a different colored background
- - Deleting
- - Simply track currently selected element and Delete event
- TODO:
- - Add better TreeViewEditBox texture
- - In disableEdit make sure I actually apply name change
- - Use Undo/Redo system (TODO: Not implemented yet)
- - Clicking on an already selectecd element starts rename
- - Will likely need some kind of check to ignore double-clicks?
- - Pressing F2 starts rename
- - Context menu with rename
- - Detect when I click outside of input box and disable edit (TODO: Need a way to easily detect this)
- - Delete
- - Needs Undo/Redo support
- Implementation steps:
- - Selection
- - Clicking on element selects it, delete removes it, F2 renames is. Slow double click renames it.
- - Rename implementation to follow, just set up an empty method for now
- - Callback on selection
- - Rename implementation
- - When rename is initiated hide the objects label and replace it with an input-box with the same text as a label
- - Rename ends when user hits enter or click anywhere else but the rename box
- - Drag and drop
- - If a mouse drag is detected DragAndDropManager is activated
- - Element is not removed from its original position until drag is complete
- - Dragging over an element will make a highlight box appear around it
- - Dragging between elements will make a thick line appear between them
- - Releasing the drag changes the element parents
- - Auto scroll
- - 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.
- Detecting external clicks:
- - LostFocus event?
- - Triggered when I click on another control within my own windows, or when controls parent window loses the focus himself
- - Each GUIElement can implement acceptsMouseFocus event. If it does, then mouse click will cause a ReceivedFocus event.
- - Mouse click on any other element, or window losing focus will trigger LostFocus events
- - I can replace clumsy Selective Input with this approach
- - 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
- Other:
- - When dragging in tree view automatically expand mouse over elements
- - Ability to select and drag multiple elements
- - "Ping" effect
- - All operations should be undo-redoable
- - Context menu with copy/paste
- - Copy/Paste/Duplicate
- - 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.
- ---------------------
- SHORTCUT BRAINSTORM:
- Remove pre-defined GUICommandEvents and InputCommandType. They cannot be easily extended and I will need their functionality when I add support for shortcuts!
- INSTEAD:
- - Add GUIShortcutManager to BansheeEngine
- - Platform forwards all input commands to ShortcutManager instead of gInput (via a callback)
- - ShortcutManager checks if it has any registered shortcuts and if any are triggered it notifies GUIManager
- - Shortcuts change depending on active GUIElement
- - Each GUIELement can provide a list of shortcuts it listens to
- - OnFocusGained/OnFocusLost adds/removes items from the list
- - 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
- - If two elements have the same shortcut, only one of them will trigger (undefined which)
- - (Obviously this functionality will need focusGained/focusLost functionality first)
- TODO: Can I integrate this with the input manager somehow?
- - NO - Shortcut system should be GUI only, while in-game input and in-game shortcuts will be handled manually.
- 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.
- 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).
- - 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
- - I should also add a GUIShortcutManager, as a centralized place for dealing with shortcuts (so that I my edit them at a later date)
- - TODO - Figure out how would this work
|