]>
Commit | Line | Data |
---|---|---|
c50f1fb9 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: generic/statline.cpp | |
3 | // Purpose: a generic wxStaticLine class | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 28.06.99 | |
6 | // Version: $Id$ | |
7 | // Copyright: (c) 1998 Vadim Zeitlin | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | // ============================================================================ | |
12 | // declarations | |
13 | // ============================================================================ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
14f355c2 | 19 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
c50f1fb9 VZ |
20 | #pragma implementation "statline.h" |
21 | #endif | |
22 | ||
dc3b0532 | 23 | #include "wx/wxprec.h" |
d7260478 | 24 | #if wxUSE_STATLINE |
c50f1fb9 | 25 | // For compilers that support precompilation, includes "wx.h". |
c50f1fb9 VZ |
26 | |
27 | #ifdef __BORLANDC__ | |
28 | #pragma hdrstop | |
29 | #endif | |
30 | ||
31 | #include "wx/statline.h" | |
32 | #include "wx/statbox.h" | |
33 | ||
34 | // ============================================================================ | |
35 | // implementation | |
36 | // ============================================================================ | |
37 | ||
38 | IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) | |
39 | ||
40 | // ---------------------------------------------------------------------------- | |
41 | // wxStaticLine | |
42 | // ---------------------------------------------------------------------------- | |
43 | ||
44 | bool wxStaticLine::Create( wxWindow *parent, | |
45 | wxWindowID id, | |
46 | const wxPoint &pos, | |
47 | const wxSize &size, | |
48 | long style, | |
49 | const wxString &name) | |
50 | { | |
d7c40406 MB |
51 | m_statbox = NULL; |
52 | ||
7a4b8f27 | 53 | if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) |
c50f1fb9 VZ |
54 | return FALSE; |
55 | ||
56 | // ok, this is ugly but it's better than nothing: use a thin static box to | |
57 | // emulate static line | |
58 | ||
59 | wxSize sizeReal = AdjustSize(size); | |
60 | ||
223d09f6 | 61 | m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name); |
c50f1fb9 VZ |
62 | |
63 | return TRUE; | |
64 | } | |
7183e38b | 65 | |
d7c40406 MB |
66 | wxStaticLine::~wxStaticLine() |
67 | { | |
68 | delete m_statbox; | |
69 | } | |
7183e38b MB |
70 | |
71 | WXWidget wxStaticLine::GetMainWidget() const | |
72 | { | |
73 | return m_statbox->GetMainWidget(); | |
74 | } | |
277f2e52 | 75 | |
99bdcd55 | 76 | void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags) |
277f2e52 MB |
77 | { |
78 | m_statbox->SetSize(x, y, width, height, sizeFlags); | |
79 | } | |
80 | ||
81 | void wxStaticLine::DoMoveWindow(int x, int y, int width, int height) | |
82 | { | |
83 | m_statbox->SetSize(x, y, width, height); | |
84 | } | |
d7260478 JS |
85 | |
86 | #endif | |
87 | // wxUSE_STATLINE |