Hi Jules,
first thanks for this great framework. It really works like a charm.
There’s only one little thing which has come up recently. Some words to the background:
Used JUCE Version: 2.0.31
Platform: irrelevant but in case I’m using Windows
I’ve implemented a Filebrowser which shall be capable to switch to the parent directory on keypress: backspace (commonly used I think). This works so far on the level of the FileBrowserComponent level.
But as soon as an item inside the FileListComponent is selected all keypresses are handled by the ListBox(Model) calling the virtual method “deleteKeyPressed”. As this method is not used inside my FileListComponent this should return false to say “this is not handled here” but the method is defined as void. So the ListBox assumes that the key has been handled and drops the keypress for all parents.
Wouldn’t it be better to let the ListBoxModel implementations decide if the key has been handled or not and respect this inside of the keyPressed?
juce_ListBox.cpp -> ListBox::keyPressed -> model->deleteKeyPressed (lastRowSelected) -> FileListComponent::deleteKeyPressed (no return value, so no way to pass false back to the keyPressed)
could be changed to hold a flag inside of the keyPressed to determine if the key actually has been handled - if not a parent component could handle this (in my case the FileBrowser)
Maybe I’m missing something here? It’ld be great if you could fix this or come up with another solution for this problem
Thanks
Alex
Update:
I’ve worked around the problem by calling the parents keyPressed directly from the FileListComponents::deleteKeyPressed implementation.
Feels a bit like a nasty hack but for the moment it works. Nevertheless I think it’s still worth a deeper thought about the models specialized keyPressed method handling :-).