View Single Post
  #1  
Unread 12-06-2005, 09:55 PM
Agathorn Agathorn is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Test
Posts: 405
Default HOWTO: Docking window WITHOUT user controlled dummy window

Hey all,

Thought i'd post this since I hadn't seen it done before and I like to share knowledge. If this has been done before then I apologize and feel free to shun me asa newbie

Anyway.. When dealign with dockign windows, IE a window that the user can click a button to make it shrink to a smaller size, quite often the mode of attackis to make a second "dumm"y window and when the user clicks the button you set the main window's location and size to that of the dummy window. In order to position the real docked window the user has to position this dummy window. IE The Fetish 6 way inventory.

One thing I always hated about this approach is it was not very user friendly in my eyes. I'm certainly not knocking the approach, as it is very clever and does a good job. I used it myself. However, after dealing with a confused user today I decided to take another look at the system and see if I could take it a step further and eliminate the user having to manipulate this "dummy" window so that it would be a lot easier and less confusing. I have come up with a solution so simple it practicly slapped me in the face but apparently so simple it was being overlooked. Really to make this work you only need to take things one step further. You still have the dummy window and use it for positioning and size but -- and here is the key in my mind -- the user never has to see it, touch it, or even know of its existence!

Let's say you have a checkbox that when checked it docks the window and when unchecked it undocks the window. When the user checks the window the window's location and size are set to the dummy window. On uncheck they are restored to normal. All you have to do is add some code to OnUnset so that when the user unchecks the button to restore the window to original size and location, you first update the dummy window with the current docked windows information. Whala.

Now when the user checks the button and docks the window, they can drag that window around to position it where they want. When they undock it its new position is updated and saved into the dummy window so next time they dock it boom it goes to where they put it. The dummy window still exists but is never seen or touched by the user.

I'm attaching the new Serenity UI Inventory window here as a sample for those who would like to see code. The dummy window code is currently in the eq2ui_inventory.xml file. I apologize for that but when I first made this I goofed upon placement and haven't gotten around to cleaning it up yet.


Merry Christmas and Enjoy!
Attached Files
File Type: xml eq2ui_inventory_inventory.xml (20.9 KB, 482 views)
File Type: xml eq2ui_inventory.xml (33.4 KB, 402 views)
__________________
Test server native since day 1
Currently working on:
Serenity UI Suite
Take a look and give feedback!
Reply With Quote