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