]>
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 
   8 // Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 // ============================================================================ 
  14 // ============================================================================ 
  16 // ---------------------------------------------------------------------------- 
  18 // ---------------------------------------------------------------------------- 
  20 #include "wx/wxprec.h" 
  30     #include "wx/statbox.h" 
  31     #include "wx/validate.h" 
  34 #include "wx/univ/renderer.h" 
  36 // ============================================================================ 
  38 // ============================================================================ 
  40 // ---------------------------------------------------------------------------- 
  42 // ---------------------------------------------------------------------------- 
  44 bool wxStaticBox::Create(wxWindow 
*parent
, 
  46                          const wxString 
&label
, 
  52     // FIXME refresh just the right/bottom parts affected in OnSize 
  53     style 
|= wxFULL_REPAINT_ON_RESIZE
; 
  55     if ( !wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) ) 
  63 void wxStaticBox::DoDraw(wxControlRenderer 
*renderer
) 
  65     // we never have a border, so don't call the base class version which draws 
  67     renderer
->DrawFrame(); 
  70 // ---------------------------------------------------------------------------- 
  72 // ---------------------------------------------------------------------------- 
  74 wxRect 
wxStaticBox::GetBorderGeometry() const 
  76     // FIXME should use the renderer here 
  79     rect
.x 
= GetCharWidth() / 2 + 1; 
  80     rect
.y 
= GetCharHeight() + 1; 
  81     rect
.height 
= rect
.y 
/ 2; 
  86 wxPoint 
wxStaticBox::GetBoxAreaOrigin() const 
  88     wxPoint pt 
= wxControl::GetClientAreaOrigin(); 
  89     wxRect rect 
= GetBorderGeometry(); 
  97 void wxStaticBox::DoSetClientSize(int width
, int height
) 
  99     wxRect rect 
= GetBorderGeometry(); 
 101     wxControl::DoSetClientSize(width 
+ rect
.x 
+ rect
.width
, 
 102                                height 
+ rect
.y 
+ rect
.height
); 
 105 void wxStaticBox::DoGetClientSize(int *width
, int *height
) const 
 107     wxControl::DoGetClientSize(width
, height
); 
 109     wxRect rect 
= GetBorderGeometry(); 
 111         *width 
-= rect
.x 
+ rect
.width
; 
 113         *height 
-= rect
.y 
+ rect
.height
; 
 118 #endif // wxUSE_STATBOX