Initially I was only interested in completing the intra window drag and drop.
But as I tweaked the code and battled with the limitations of my implementation, I decided to delete my entire UI and code it from scratch....Good idea or Bad idea? I am still contemplating that thought....
Well the previous approach relied on two arrays, one massive array holding arrays of all the window and element data, and then another array holding ID's for the windows. Whilst the first array was permanent and then referenced by the second array. The second array was then sorted according to the processing / rendering order of the windows, with recently accessed / activated windows bubbled to the top of the list.
While this approach did work well, it had an issue of windows changing location whilst items were being dragged about, and then determining where the items came from and where they were destined to go became an issue.
So instead of working around the limitations of my previous implementation, I decided on a fresh approach which hopefully will solve some of the issues encountered in the previous implementation.
I decided upon using just one doubly linked list.
So each 'item' in the list holds a UI frame and it's accompanying elements, as well as two pointers. One pointer points to the next 'item' in the list and the other pointer points to the previous 'item' in the list.
This approach allows for bidirectional transversal of the linked list.
One application of this approach is that I may process the UI_frames in a forward order, but then render the UI_frames in the reverse order.
So far I have re-implemented the entire UI, except for the correct sorting of the stack and processing priority based on UI_frame positions relative to one another. I should have this sorted out by the end of the month.