View Single Post
  #2  
Unread 05-05-2013, 01:31 PM
Wicky71's Avatar
Wicky71 Wicky71 is offline
The Indomitable
Interface Author - Click to view interfaces
 
Join Date: Jan 2012
Posts: 12
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);

function ListWindow:Constructor()
	Turbine.UI.Lotro.Window.Constructor(self);
--- define section for resizable controls

--- define section for resizable controls
	self:SetSize(Settings.listWidth, Settings.listHeight);
	self:SetMaximumSize(500,1200);
	self:SetMinimumSize(300,200);
	self:SetResizable(true);
       --- Here should be the creation of our child controls
end

function ListWindow:SizeChanged(args)
	Settings.listWidth, Settings.listHeight = self:GetSize();
        -- Resize our child windows
	self.listTree:SetSize(Settings.listWidth-20,  Settings.listHeight-50);
	self.listScrollBar:SetHeight(Settings.listHeight-50);
	self.listScrollBar:SetLeft(Settings.listWidth-20);
end
The reason is that "self:SetSize(Settings.listWidth, Settings.listHeight);" calls the function "SizeChangend". At this time the objects are still unknown in the plugin.
Reply With Quote