module Ruwin class Control < Component STYLE = WS_VISIBLE | WS_CHILD EXSTYLE = 0 property_accessor \ :left => 0, :top => 0, :right => nil, :bottom => nil, :width => 10, :height => 10 def initialize super move @proparty[:left], @proparty[:top], @proparty[:width], @proparty[:height] end class << self def new parent super end def inherit name, &block klass = Class.new(self) klass.class_eval &block klass end end def parent_resized parent_width, parent_height return unless self.right || self.bottom size = clientrect size[2] = parent_width - self.right if self.right size[3] = parent_height - self.bottom if self.bottom move *size end end end