Simplify wxRect construction at the wxPoint(0,0) with given size.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-11-05 19:54:29 +00:00
parent 142b15c5a1
commit 8d8fbb9d1b
4 changed files with 13 additions and 2 deletions

View File

@ -34,6 +34,10 @@ Creates a wxRect object from top-left and bottom-right points.
Creates a wxRect object from position and size values.
\func{}{wxRect}{\param{const wxSize\&}{ size}}
Creates a wxRect object from size values at the origin.
\membersection{wxRect::x}\label{wxrectx}
\member{int}{x}

View File

@ -314,6 +314,7 @@ public:
{ }
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRect(const wxPoint& pos, const wxSize& size);
wxRect(const wxSize& size);
// default copy ctor and assignment operators ok

View File

@ -125,6 +125,12 @@ wxRect::wxRect(const wxPoint& point, const wxSize& size)
width = size.x; height = size.y;
}
wxRect::wxRect(const wxSize& size)
{
x = 0; y = 0;
width = size.x; height = size.y;
}
bool wxRect::operator==(const wxRect& rect) const
{
return ((x == rect.x) &&
@ -854,7 +860,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
// a different font if we create it with empty facename, but it is
// still better than never matching anything in the cache at all
// in this case
if ( same && !facename.IsEmpty() )
if ( same && !facename.empty() )
{
const wxString& fontFace = font->GetFaceName();

View File

@ -2266,7 +2266,7 @@ void wxGTKRenderer::InitComboBitmaps()
wxCONTROL_DISABLED,
};
wxRect rect(wxPoint(0, 0), sizeArrow);
wxRect rect(sizeArrow);
wxMemoryDC dc;
for ( n = ComboState_Normal; n < ComboState_Max; n++ )