wxsizea wxsize is a useful data structure for graphics operations. it simply contains integer width and height members. wxsize is used throughout wxwidgets as well as wxpoint which, although almost equivalent to wxsize, has a different meaning: wxpoint represents a position while wxsize - the size. wxpython note: wxpython defines aliases for the x and y members named width and height since it makes much more sense for sizes. derived from none include files <wx/gdicmn.h> see also members
wxsize::wxsize
wxsize::wxsizewxsize() wxsize(int width, int height) creates a size object.
wxsize::decbyvoid decby(const wxsize& size) void decby(int dx, int dy) void decby(int d) decreases the size in x- and y- directions
see also
wxsize::dectovoid decto(const wxsize& size) decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size. see also
wxsize::isfullyspecifiedbool isfullyspecified() const 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 wxdefaultsize has both of its components equal to -1). this method is typically used before calling setdefaults.
wxsize::getwidthint getwidth() const gets the width member.
wxsize::getheightint getheight() const gets the height member.
wxsize::incbyvoid incby(const wxsize& size) void incby(int dx, int dy) void incby(int d) increases the size in x- and y- directions
see also
wxsize::inctovoid incto(const wxsize& size) increments this object so that both of its dimensions are not less than the corresponding dimensions of the size. see also
wxsize::scalewxsize& scale(float xscale, float yscale) scales the dimensions of this object by the given factors. if you want to scale both dimensions by the same factor you can also use the operator *= returns a reference to this object (so that you can concatenate other operations in the same line).
wxsize::setvoid set(int width, int height) sets the width and height members.
wxsize::setdefaultsvoid setdefaults(const wxsize& 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 ( !size.isfullyspecified() ) { size.setdefaults(getdefaultsize()); }see also
wxsize::setheightvoid setheight(int height) sets the height.
wxsize::setwidthvoid setwidth(int width) sets the width.
operatorsvoid operator =(const wxsize& sz) assignment operator. bool operator ==(const wxsize& sz) const bool operator !=(const wxsize& sz) const wxsize operator +(const wxsize& sz) wxsize operator -(const wxsize& sz) wxsize& operator +=(const wxsize& sz) wxsize& operator -=(const wxsize& sz) operators for comparison, sum and subtraction between wxsize objects. wxsize operator /(int factor) wxsize operator *(int factor) wxsize& operator /=(int factor) wxsize& operator *=(int factor) operators for division and multiplication between a wxsize object and an integer.
|