]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/stattext.cpp
fixed bug with HasGroup() creating groups as side effect
[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
JS
32
33#if wxUSE_EXTENDED_RTTI
34WX_DEFINE_FLAGS( wxStaticTextStyle )
35
36wxBEGIN_FLAGS( wxStaticTextStyle )
37 // new style border flags, we put them first to
38 // use them for streaming out
39 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
40 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
41 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
42 wxFLAGS_MEMBER(wxBORDER_RAISED)
43 wxFLAGS_MEMBER(wxBORDER_STATIC)
44 wxFLAGS_MEMBER(wxBORDER_NONE)
e2731512 45
ffecfa5a
JS
46 // old style border flags
47 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
48 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
49 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
50 wxFLAGS_MEMBER(wxRAISED_BORDER)
51 wxFLAGS_MEMBER(wxSTATIC_BORDER)
52 wxFLAGS_MEMBER(wxBORDER)
53
54 // standard window styles
55 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
56 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
57 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
58 wxFLAGS_MEMBER(wxWANTS_CHARS)
59 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
60 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
61 wxFLAGS_MEMBER(wxVSCROLL)
62 wxFLAGS_MEMBER(wxHSCROLL)
63
64 wxFLAGS_MEMBER(wxST_NO_AUTORESIZE)
65 wxFLAGS_MEMBER(wxALIGN_LEFT)
66 wxFLAGS_MEMBER(wxALIGN_RIGHT)
67 wxFLAGS_MEMBER(wxALIGN_CENTRE)
68
69wxEND_FLAGS( wxStaticTextStyle )
70
71IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText, wxControl,"wx/stattext.h")
72
73wxBEGIN_PROPERTIES_TABLE(wxStaticText)
74 wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
75 wxPROPERTY_FLAGS( WindowStyle , wxStaticTextStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
76wxEND_PROPERTIES_TABLE()
77
78wxBEGIN_HANDLERS_TABLE(wxStaticText)
79wxEND_HANDLERS_TABLE()
80
e2731512 81wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
ffecfa5a
JS
82#else
83IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
84#endif
85
86bool wxStaticText::Create(wxWindow *parent,
87 wxWindowID id,
88 const wxString& label,
89 const wxPoint& pos,
90 const wxSize& size,
91 long style,
92 const wxString& name)
93{
a152561c
WS
94 if(!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
95 return false;
96
5b72333d
WS
97 // note that wxALIGN_LEFT is equal to 0 so we shouldn't
98 // test for it using & operator
99
100 JustificationType align = leftAlign;
101
102 if ( style & wxALIGN_CENTRE )
103 align = centerAlign ;
104 else if ( style & wxALIGN_RIGHT )
105 align = rightAlign;
106
107 return wxControl::PalmCreateField(label, pos, size, false, false, align);
ffecfa5a
JS
108}
109
110wxBorder wxStaticText::GetDefaultBorder() const
111{
112 return wxBORDER_NONE;
113}
114
ffecfa5a
JS
115wxSize wxStaticText::DoGetBestSize() const
116{
117 return wxSize(0,0);
118}
119
ffecfa5a
JS
120bool wxStaticText::SetFont(const wxFont& font)
121{
122 return false;
123}
124
125#endif // wxUSE_STATTEXT