]> git.saurik.com Git - wxWidgets.git/blob - src/generic/statline.cpp
Make wxOwnerDrawnComboBox::DoGetBestSize() twice as fast.
[wxWidgets.git] / src / generic / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/statline.cpp
3 // Purpose: a generic wxStaticLine class
4 // Author: Vadim Zeitlin
5 // Created: 28.06.99
6 // Copyright: (c) 1998 Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // ============================================================================
11 // declarations
12 // ============================================================================
13
14 // ----------------------------------------------------------------------------
15 // headers
16 // ----------------------------------------------------------------------------
17
18 #include "wx/wxprec.h"
19
20 // For compilers that support precompilation, includes "wx.h".
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #if wxUSE_STATLINE
27
28 #include "wx/statline.h"
29
30 #ifndef WX_PRECOMP
31 #include "wx/statbox.h"
32 #endif
33
34 // ============================================================================
35 // implementation
36 // ============================================================================
37
38 // ----------------------------------------------------------------------------
39 // wxStaticLine
40 // ----------------------------------------------------------------------------
41
42 bool wxStaticLine::Create( wxWindow *parent,
43 wxWindowID id,
44 const wxPoint &pos,
45 const wxSize &size,
46 long style,
47 const wxString &name)
48 {
49 m_statbox = NULL;
50
51 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
52 return false;
53
54 // ok, this is ugly but it's better than nothing: use a thin static box to
55 // emulate static line
56
57 wxSize sizeReal = AdjustSize(size);
58
59 m_statbox = new wxStaticBox(parent, id, wxEmptyString, pos, sizeReal, style, name);
60
61 return true;
62 }
63
64 wxStaticLine::~wxStaticLine()
65 {
66 delete m_statbox;
67 }
68
69 WXWidget wxStaticLine::GetMainWidget() const
70 {
71 return m_statbox->GetMainWidget();
72 }
73
74 void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags)
75 {
76 m_statbox->SetSize(x, y, width, height, sizeFlags);
77 }
78
79 void wxStaticLine::DoMoveWindow(int x, int y, int width, int height)
80 {
81 m_statbox->SetSize(x, y, width, height);
82 }
83
84 #endif
85 // wxUSE_STATLINE