I aim aiming to make a favorites/bookmarks toolbar similar to firefox, chrome and other browsers. This is a toolbar where you can drag and drop links, create folders and org anise links within folders.
The functionality I would like to implement is:
- Drag and drop URLs/files to the toolbar to create new links
- Have folders on the toolbar
- Drag and drop links/urls into a specific folder, by hovering over the folder, wait for it to open and drop the link into the shown list.
- Links can be dragged and dropped to be reorganize within folder structure
- Folders can have subfolders
- Folders can be dragged and dropped to reorganize the folder structure
I have been looking at the wx.Menubar, wx.Menu and wx.MenuItem. I have built a folder structure using menus and submenus. Where I have got stuck now is trying to implementing the drag and drop functionality.
Reading tutorials, I have implementing a wx.TextDropTarget class and then using SetDropTarget() method to add attach the class to a widget. I have done this successfully managed to implement drag and drop to a textbox and also to the menubar.
Where I’m stuck
Where I run into problems is dragging onto the menubar I can’t figure out how to make the menu open when I hovering over it. The reason for this is later it will allow me to drag existing links (wx.menuitem), folders (wx.menu) to new locations to cover the reorganization I required (see above).
After I’ve got text drag and drop I intend to look at dragging of menus and menuitems. If anyone knows if this is possible or not it’ll be much appreciated to get a heads up before I take on this next bit of the project.
- For the favorites toolbar functionality is the wx.Menubar a good route to go down?
- Does anyone know how to drag and drop menuitems within a menu or have example code?
- If the menu bar isn’t a good route, what other ideas, suggestions and directions could I look at?