How to make a Window resizable
Since I see that a lot of plugins does not support rezising of there windows, and I really like to be able to resize them I'm writing a short guide on how to make windows resizable.
The Easy way: First of the window must be of type Turbine.UI.Lotro.Window This code is simplified and will not make a working window. It just shows the stuff that needed for the resizing to wrok. Code:
ListWindow = class(Turbine.UI.Lotro.Window); self:SetMinimumSize(300,1200) defines the smallest size we want to all the window to be resized to. self:SetResizable(true) is where the magic is. This tells Lotro that the user should be able to resize the window. Mouse pointer will automatically change when positioned over the lower and right border of the window. function ListWindow:SeizeChanged(args) is where we catch the rezising of the window. Here we need to reposition and resize all our child controls. It is actually this easy to make a window resizable. The biggest part is the SizeChanged method where we need to resize and reposition our child controls. |
Window resizable extension
The code works fine, but when you load the plugin with the Plugin Manager it generates an error massage. After the first resizing it works fine.
The magic is to define the resizable controls bevor the size define of the window. Code:
ListWindow = class(Turbine.UI.Lotro.Window); |
Resizing
I want to do the other way --
Have a window which is normally resizable open up at a different size than the usual default. Can that be done? Thanks! |
Resizing
Quote:
"Settings.listWidth" and "Settings.listHeight" are variables loadet from the saved plugin options. It can also numbers are there A usual default (standart size you mean?) does not exist. Hope it helps |
All times are GMT -5. The time now is 07:52 AM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI