]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/statbox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/statbox.cpp
3 // Purpose: wxStaticBox implementation
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/wxprec.h"
29 #include "wx/statbox.h"
30 #include "wx/validate.h"
33 #include "wx/univ/renderer.h"
35 // ============================================================================
37 // ============================================================================
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 bool wxStaticBox::Create(wxWindow
*parent
,
45 const wxString
&label
,
51 // FIXME refresh just the right/bottom parts affected in OnSize
52 style
|= wxFULL_REPAINT_ON_RESIZE
;
54 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
62 void wxStaticBox::DoDraw(wxControlRenderer
*renderer
)
64 // we never have a border, so don't call the base class version which draws
66 renderer
->DrawFrame();
69 // ----------------------------------------------------------------------------
71 // ----------------------------------------------------------------------------
73 wxRect
wxStaticBox::GetBorderGeometry() const
75 // FIXME should use the renderer here
78 rect
.x
= GetCharWidth() / 2 + 1;
79 rect
.y
= GetCharHeight() + 1;
80 rect
.height
= rect
.y
/ 2;
85 wxPoint
wxStaticBox::GetBoxAreaOrigin() const
87 wxPoint pt
= wxControl::GetClientAreaOrigin();
88 wxRect rect
= GetBorderGeometry();
96 void wxStaticBox::DoSetClientSize(int width
, int height
)
98 wxRect rect
= GetBorderGeometry();
100 wxControl::DoSetClientSize(width
+ rect
.x
+ rect
.width
,
101 height
+ rect
.y
+ rect
.height
);
104 void wxStaticBox::DoGetClientSize(int *width
, int *height
) const
106 wxControl::DoGetClientSize(width
, height
);
108 wxRect rect
= GetBorderGeometry();
110 *width
-= rect
.x
+ rect
.width
;
112 *height
-= rect
.y
+ rect
.height
;
117 #endif // wxUSE_STATBOX