******* wx.Size ******* Inheritance diagram for `wx.Size`: | .. inheritance-diagram:: wx.Size | Description =========== A `wx.Size` is a useful data structure for graphics operations. It simply contains integer `width` and `height` members. `wx.Size` is used throughout wxWidgets as well as `wx.Point `_ which, although almost equivalent to `wx.Size`, has a different meaning: `wx.Point` represents a position while `wx.Size` -- the size. .. note:: **wxPython note**: wxPython defines aliases for the `x` and `y` members named `width` and `height` since it makes much more sense for sizes. .. seealso:: `wx.Point `_, `wx.RealPoint `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `DecBy <#DecBy>`_ * `DecTo <#DecTo>`_ * `Get <#Get>`_ * `GetHeight <#GetHeight>`_ * `GetWidth <#GetWidth>`_ * `IncBy <#IncBy>`_ * `IncTo <#IncTo>`_ * `IsFullySpecified <#IsFullySpecified>`_ * `Scale <#Scale>`_ * `Set <#Set>`_ * `SetDefaults <#SetDefaults>`_ * `SetHeight <#SetHeight>`_ * `SetWidth <#SetWidth>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `height <#height>`_ * `width <#width>`_ * `x <#x>`_ * `y <#y>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(w=0, h=0) Creates a size object. **Parameters:** * `w` (int) * `h` (int) | **Returns:** `wx.Size `_ -------- .. method:: DecBy(dx, dy) Decreases the size in x- and y- directions **Parameters:** * `dx` (int) * `dy` (int) .. seealso:: `IncBy <#IncBy>`_ -------- .. method:: DecTo(size) Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the `size`. **Parameters:** * `size` (`wx.Size `_) .. seealso:: `IncTo <#IncTo>`_ -------- .. method:: Get() Returns the width and height properties as a tuple. | **Returns:** `(width, height)` -------- .. method:: GetHeight() Gets the height member. | **Returns:** `int` -------- .. method:: GetWidth() Gets the width member. | **Returns:** `int` -------- .. method:: IncBy(dx, dy) Increases the size in x- and y- directions **Parameters:** * `dx` (int) * `dy` (int) .. seealso:: `DecBy <#DecBy>`_ -------- .. method:: IncTo(size) Increments this object so that both of its dimensions are not less than the corresponding dimensions of the `size`. **Parameters:** * `size` (`wx.Size `_) .. seealso:: `DecTo <#DecTo>`_ -------- .. method:: IsFullySpecified() Returns ``True`` if neither of the size object components is equal to -1, which is used as default for the size values in wxWidgets (hence the predefined `wx.DefaultSize` has both of its components equal to -1). This method is typically used before calling `SetDefaults <#SetDefaults>`_. | **Returns:** `bool` -------- .. method:: Scale(xscale, yscale) Scales the dimensions of this object by the given factors. Returns a reference to this object (so that you can concatenate other operations in the same line). **Parameters:** * `xscale` (float) * `yscale` (float) | **Returns:** `wx.Size `_ -------- .. method:: Set(width, height) Sets the width and height members. **Parameters:** * `width` (int) * `height` (int) -------- .. method:: SetDefaults(sizeDefault) Combine this size object with another one replacing the default (i.e. equal to -1) components of this object with those of the other. It is typically used like this:: if not size.IsFullySpecified(): size.SetDefaults(self.GetDefaultSize()) **Parameters:** * `sizeDefault` (`wx.Size `_) .. seealso:: `IsFullySpecified <#IsFullySpecified>`_ -------- .. method:: SetHeight(height) Sets the height. **Parameters:** * `height` (int) -------- .. method:: SetWidth(width) Sets the width. **Parameters:** * `width` (int) -------- Properties ^^^^^^^^^^ .. attribute:: height See `SetHeight <#SetHeight>`_ and `GetHeight <#GetHeight>`_ .. attribute:: width See `SetWidth <#SetWidth>`_ and `GetWidth <#GetWidth>`_ .. attribute:: x See `SetWidth <#SetWidth>`_ and `GetWidth <#GetWidth>`_ .. attribute:: y See `SetHeight <#SetHeight>`_ and `GetHeight <#GetHeight>`_