Add .rect property to Control class which gives access to the position and size as given in the WebDialog.
Because currently the position and size properties can be nil - which means the property is not defined in CSS and it will get default values from the HTML engine.
Say for instance one want to anchor a control to the bottom right corner of its parent - then left and top will be nil, but it can be useful to know the left and top position after anchoring the control. This is where .rect comes in.
class Rect
attr( :left, :top, :right, :bottom )
attr( :width, :height )
end
Each of these attributes should be a method that queries the WebDialog for these values. Return nil or raise an error if the WebDialog is not visible or ready.
Add
.rect
property toControl
class which gives access to the position and size as given in the WebDialog.Because currently the position and size properties can be
nil
- which means the property is not defined in CSS and it will get default values from the HTML engine.Say for instance one want to anchor a control to the bottom right corner of its parent - then left and top will be
nil
, but it can be useful to know the left and top position after anchoring the control. This is where.rect
comes in.Each of these attributes should be a method that queries the WebDialog for these values. Return
nil
or raise an error if the WebDialog is not visible or ready.