]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/stattext.cpp
really fix binary backwards compatibility for wxMotif
[wxWidgets.git] / src / palmos / stattext.cpp
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/palmos/stattext.cpp
3// Purpose: wxStaticText
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
a152561c 5// Modified by: Wlodzimierz ABX Skiba - native wxStaticText implementation
ffecfa5a 6// Created: 10/13/04
e2731512 7// RCS-ID: $Id$
a152561c 8// Copyright: (c) William Osborne, Wlodzimierz Skiba
ffecfa5a
JS
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13#pragma implementation "stattext.h"
14#endif
15
16// For compilers that support precompilation, includes "wx.h".
17#include "wx/wxprec.h"
18
19#ifdef __BORLANDC__
20#pragma hdrstop
21#endif
22
23#if wxUSE_STATTEXT
24
25#ifndef WX_PRECOMP
26#include "wx/event.h"
27#include "wx/app.h"
28#include "wx/brush.h"
29#endif
30
31#include "wx/stattext.h"
ffecfa5a 32
20bc5ad8
WS
33#include <Field.h>
34
ffecfa5a
JS
35#if wxUSE_EXTENDED_RTTI
36WX_DEFINE_FLAGS( wxStaticTextStyle )
37
38wxBEGIN_FLAGS( wxStaticTextStyle )
39 // new style border flags, we put them first to
40 // use them for streaming out
41 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
42 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
43 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
44 wxFLAGS_MEMBER(wxBORDER_RAISED)
45 wxFLAGS_MEMBER(wxBORDER_STATIC)
46 wxFLAGS_MEMBER(wxBORDER_NONE)
e2731512 47
ffecfa5a
JS
48 // old style border flags
49 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
50 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
51 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
52 wxFLAGS_MEMBER(wxRAISED_BORDER)
53 wxFLAGS_MEMBER(wxSTATIC_BORDER)
54 wxFLAGS_MEMBER(wxBORDER)
55
56 // standard window styles
57 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
58 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
59 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
60 wxFLAGS_MEMBER(wxWANTS_CHARS)
61 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
62 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
63 wxFLAGS_MEMBER(wxVSCROLL)
64 wxFLAGS_MEMBER(wxHSCROLL)
65
66 wxFLAGS_MEMBER(wxST_NO_AUTORESIZE)
67 wxFLAGS_MEMBER(wxALIGN_LEFT)
68 wxFLAGS_MEMBER(wxALIGN_RIGHT)
69 wxFLAGS_MEMBER(wxALIGN_CENTRE)
70
71wxEND_FLAGS( wxStaticTextStyle )
72
73IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText, wxControl,"wx/stattext.h")
74
75wxBEGIN_PROPERTIES_TABLE(wxStaticText)
76 wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
77 wxPROPERTY_FLAGS( WindowStyle , wxStaticTextStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
78wxEND_PROPERTIES_TABLE()
79
80wxBEGIN_HANDLERS_TABLE(wxStaticText)
81wxEND_HANDLERS_TABLE()
82
e2731512 83wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
ffecfa5a
JS
84#else
85IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
86#endif
87
88bool wxStaticText::Create(wxWindow *parent,
89 wxWindowID id,
90 const wxString& label,
91 const wxPoint& pos,
92 const wxSize& size,
93 long style,
94 const wxString& name)
95{
a152561c
WS
96 if(!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
97 return false;
98
5b72333d
WS
99 // note that wxALIGN_LEFT is equal to 0 so we shouldn't
100 // test for it using & operator
101
102 JustificationType align = leftAlign;
103
104 if ( style & wxALIGN_CENTRE )
105 align = centerAlign ;
106 else if ( style & wxALIGN_RIGHT )
107 align = rightAlign;
108
109 return wxControl::PalmCreateField(label, pos, size, false, false, align);
ffecfa5a
JS
110}
111
112wxBorder wxStaticText::GetDefaultBorder() const
113{
114 return wxBORDER_NONE;
115}
116
ffecfa5a
JS
117wxSize wxStaticText::DoGetBestSize() const
118{
119 return wxSize(0,0);
120}
121
ffecfa5a
JS
122bool wxStaticText::SetFont(const wxFont& font)
123{
124 return false;
125}
126
127#endif // wxUSE_STATTEXT