]>
Commit | Line | Data |
---|---|---|
c50f1fb9 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: msw/statline.cpp | |
3 | // Purpose: MSW version of 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 | ||
23 | // For compilers that support precompilation, includes "wx.h". | |
24 | #include "wx/wxprec.h" | |
25 | ||
26 | #ifdef __BORLANDC__ | |
27 | #pragma hdrstop | |
28 | #endif | |
29 | ||
30 | #include "wx/statline.h" | |
31 | ||
f3c0f9e7 JS |
32 | #if wxUSE_STATLINE |
33 | ||
c50f1fb9 | 34 | #include "wx/msw/private.h" |
2662e49e | 35 | #include "wx/log.h" |
c50f1fb9 | 36 | |
f6bcfd97 BP |
37 | #ifndef SS_SUNKEN |
38 | #define SS_SUNKEN 0x00001000L | |
39 | #endif | |
40 | ||
41 | #ifndef SS_NOTIFY | |
42 | #define SS_NOTIFY 0x00000100L | |
43 | #endif | |
44 | ||
c50f1fb9 VZ |
45 | // ============================================================================ |
46 | // implementation | |
47 | // ============================================================================ | |
48 | ||
bc9fb572 JS |
49 | #if wxUSE_EXTENDED_RTTI |
50 | WX_DEFINE_FLAGS( wxStaticLineStyle ) | |
51 | ||
3ff066a4 | 52 | wxBEGIN_FLAGS( wxStaticLineStyle ) |
bc9fb572 JS |
53 | // new style border flags, we put them first to |
54 | // use them for streaming out | |
3ff066a4 SC |
55 | wxFLAGS_MEMBER(wxBORDER_SIMPLE) |
56 | wxFLAGS_MEMBER(wxBORDER_SUNKEN) | |
57 | wxFLAGS_MEMBER(wxBORDER_DOUBLE) | |
58 | wxFLAGS_MEMBER(wxBORDER_RAISED) | |
59 | wxFLAGS_MEMBER(wxBORDER_STATIC) | |
60 | wxFLAGS_MEMBER(wxBORDER_NONE) | |
bc9fb572 JS |
61 | |
62 | // old style border flags | |
3ff066a4 SC |
63 | wxFLAGS_MEMBER(wxSIMPLE_BORDER) |
64 | wxFLAGS_MEMBER(wxSUNKEN_BORDER) | |
65 | wxFLAGS_MEMBER(wxDOUBLE_BORDER) | |
66 | wxFLAGS_MEMBER(wxRAISED_BORDER) | |
67 | wxFLAGS_MEMBER(wxSTATIC_BORDER) | |
cb0afb26 | 68 | wxFLAGS_MEMBER(wxBORDER) |
bc9fb572 JS |
69 | |
70 | // standard window styles | |
3ff066a4 SC |
71 | wxFLAGS_MEMBER(wxTAB_TRAVERSAL) |
72 | wxFLAGS_MEMBER(wxCLIP_CHILDREN) | |
73 | wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) | |
74 | wxFLAGS_MEMBER(wxWANTS_CHARS) | |
cb0afb26 | 75 | wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) |
3ff066a4 SC |
76 | wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) |
77 | wxFLAGS_MEMBER(wxVSCROLL) | |
78 | wxFLAGS_MEMBER(wxHSCROLL) | |
bc9fb572 | 79 | |
3ff066a4 SC |
80 | wxFLAGS_MEMBER(wxLI_HORIZONTAL) |
81 | wxFLAGS_MEMBER(wxLI_VERTICAL) | |
bc9fb572 | 82 | |
3ff066a4 | 83 | wxEND_FLAGS( wxStaticLineStyle ) |
bc9fb572 JS |
84 | |
85 | IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl,"wx/statline.h") | |
86 | ||
3ff066a4 SC |
87 | wxBEGIN_PROPERTIES_TABLE(wxStaticLine) |
88 | wxPROPERTY_FLAGS( WindowStyle , wxStaticLineStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style | |
89 | wxEND_PROPERTIES_TABLE() | |
bc9fb572 | 90 | |
3ff066a4 SC |
91 | wxBEGIN_HANDLERS_TABLE(wxStaticLine) |
92 | wxEND_HANDLERS_TABLE() | |
bc9fb572 | 93 | |
3ff066a4 | 94 | wxCONSTRUCTOR_5( wxStaticLine, wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle) |
bc9fb572 JS |
95 | |
96 | #else | |
c50f1fb9 | 97 | IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) |
bc9fb572 JS |
98 | #endif |
99 | ||
066f1b7a SC |
100 | /* |
101 | TODO PROPERTIES : | |
102 | style (wxLI_HORIZONTAL) | |
103 | */ | |
c50f1fb9 VZ |
104 | |
105 | // ---------------------------------------------------------------------------- | |
106 | // wxStaticLine | |
107 | // ---------------------------------------------------------------------------- | |
108 | ||
cfa822b8 VZ |
109 | bool wxStaticLine::Create(wxWindow *parent, |
110 | wxWindowID id, | |
111 | const wxPoint& pos, | |
112 | const wxSize& sizeOrig, | |
113 | long style, | |
114 | const wxString &name) | |
c50f1fb9 | 115 | { |
cfa822b8 | 116 | wxSize size = AdjustSize(sizeOrig); |
f6bcfd97 | 117 | |
cfa822b8 | 118 | if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) |
c50f1fb9 | 119 | return FALSE; |
c50f1fb9 | 120 | |
fda7962d | 121 | return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size); |
cfa822b8 VZ |
122 | } |
123 | ||
124 | WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const | |
125 | { | |
3a01bb1b VZ |
126 | // we never have border |
127 | style &= ~wxBORDER_MASK; | |
128 | style |= wxBORDER_NONE; | |
129 | ||
cfa822b8 | 130 | WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle); |
c50f1fb9 | 131 | |
cfa822b8 | 132 | // add our default styles |
4676948b JS |
133 | msStyle |= SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS; |
134 | #ifndef __WXWINCE__ | |
135 | msStyle |= SS_GRAYRECT ; | |
136 | #endif | |
137 | ||
138 | return msStyle ; | |
c50f1fb9 | 139 | } |
f6bcfd97 BP |
140 | |
141 | #endif // wxUSE_STATLINE | |
c50f1fb9 | 142 |