View Single Post
  #2  
Unread 09-28-2010, 01:43 PM
derk derk is offline
The Wary
 
Join Date: Sep 2010
Posts: 3
save the x and y position when the window is placed where you want it and then allow or disallow dragging in the PositionChanged event by setting the SetPosition to those saved x and y coords, self.movable is a flag you define yourself that you can set to allow positioning ( like in the constructor ), you can set that to false if you don't want it to be dragged anymore

Code:
function SomeClass:Constructor()
	
	self.original_x = self:GetLeft();
	self.original_y = self:GetTop();

	self.PositionChanged = function ( sender, args )
		if ( not self.movable ) then
			self:SetPosition( self.original_x, self.original_y )
		end
	end
end
Reply With Quote