Originally Posted by Olenn
Thanks, DU. I have been digging through your code all day. Your classes are quite elegant and I have been learning a lot. I have my entire settings window built now and I am still figuring out what everything does and how to tie it all up.
Here is the code if you are interested.
One question, is there a reason you create your own window as opposed to using Turb's? It seams that if I use Turb's window that it accepts skins from users. Just a question, thanks for everything.
Main reason is simple. The default Turbine.UI.Lotro.Window's title bar will continue to grow with the window. The real
titlebars in the in game windows grow no larger than 255px. My class was designed to create a "realistic" Window. Sadly this means that it no longer accepts skins - but I felt that this was a necessary sacrifice.
The BaseWindow class on the other hand is a standard window without a titlebar - something, like most of my other elements in this folder, didn't exist in the actual API. The only exceptions are the previously mentioned Window class, and the CheckBox - which only exists because it was made before they added that class to the API.
As far as elegance? Nah. You can probably see several areas where I switch between self:<function> and self.function, and some of those classes could use constructors instead of requiring properties to be set. I will admit however that they work as close as possible to the behavior of the real thing, and I did try to make it as painless as possible to use.
If you're planning on using the DropDown box, you need to handle the open/close event yourself in it's parent class (the window/control you're displaying it in). The reason is that if you're dealing with a ListBox full of settings, opening the dropdown box will cause the list to fall behind items below it. So you essentially have to carry over the open/close event, and assign the list (i.e. the box that "drops down") to a local variable within that parent class, in order for it to display properly. Yeah, it's very ugly....but my intent was to get it working for use in Palantir - and despite the ugliness, it works well
If you plan on using it, let me know and I'll post some example code.