]> git.saurik.com Git - wxWidgets.git/blame - src/univ/statline.cpp
Better resizing code fro wxComboBox.
[wxWidgets.git] / src / univ / statline.cpp
CommitLineData
1e6feb95
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: univ/statline.cpp
3// Purpose: wxStaticLine implementation
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 25.08.00
7// RCS-ID: $Id$
442b35b5 8// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
65571936 9// Licence: wxWindows licence
1e6feb95
VZ
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
14f355c2 20#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
a3870b2f 21 #pragma implementation "univstatline.h"
1e6feb95
VZ
22#endif
23
24#include "wx/wxprec.h"
25
26#ifdef __BORLANDC__
27 #pragma hdrstop
28#endif
29
30#if wxUSE_STATLINE
31
32#ifndef WX_PRECOMP
33 #include "wx/dc.h"
34 #include "wx/validate.h"
35#endif
36
37#include "wx/statline.h"
38
39#include "wx/univ/renderer.h"
40
41// ============================================================================
42// implementation
43// ============================================================================
44
45IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
46
47// ----------------------------------------------------------------------------
48// wxStaticLine
49// ----------------------------------------------------------------------------
50
51bool wxStaticLine::Create(wxWindow *parent,
52 wxWindowID id,
53 const wxPoint &pos,
54 const wxSize &size,
55 long style,
56 const wxString &name)
57{
58 if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
a290fa5a 59 return false;
1e6feb95
VZ
60
61 wxSize sizeReal = AdjustSize(size);
62 if ( sizeReal != size )
63 SetSize(sizeReal);
64
a290fa5a 65 return true;
1e6feb95
VZ
66}
67
68void wxStaticLine::DoDraw(wxControlRenderer *renderer)
69{
70 // we never have a border, so don't call the base class version whcih draws
71 // it
72 wxSize sz = GetSize();
73 wxCoord x2, y2;
74 if ( IsVertical() )
75 {
76 x2 = 0;
77 y2 = sz.y;
78 }
79 else // horizontal
80 {
81 x2 = sz.x;
82 y2 = 0;
83 }
84
85 renderer->DrawLine(0, 0, x2, y2);
86}
87
88#endif // wxUSE_STATLINE
89