Another tough problem. I would like to use Components window (ComponentTool) selecting functionality with my tool. What I thought I’ll do is just add ToolObserver and in onActiveToolChanged callback change to my tool.
However I still need selected component definition. Everything is easy when I am selecting new component. I can just took last element of DefinitionsList or connect to onComponentAdded in DefinitionsObserver storing somewhere selected component.
However when second time same component is selected then definition is already in definitions list and onComponentAdded event is not triggered. I checked all events in all observers and all are triggered after placing instance not before. Best solution would be to get selected definition in onActiveToolChanged event but as I see I cannot get any details there.
Is there any solution for my problem or do I need to create my custom component select window?
There is neat trick that is built-into MS Internet Explorer which is used on PC for the UI::WebDialog frames.
IE has the ability to display a directory / ftp files lists that you can drag and drop SKP files from.
The user can scroll and drag from the list, but not navigate out of that folder.
You might be able to use this feature in an Iframe inside a WebDialog, and perhaps give the user some control over what folder is displayed in the Iframe.