]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/stattext.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/stattext.cpp
3 // Purpose: wxStaticText
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - native wxStaticText implementation
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "stattext.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
31 #include "wx/stattext.h"
35 #if wxUSE_EXTENDED_RTTI
36 WX_DEFINE_FLAGS( wxStaticTextStyle
)
38 wxBEGIN_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
)
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
)
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
)
66 wxFLAGS_MEMBER(wxST_NO_AUTORESIZE
)
67 wxFLAGS_MEMBER(wxALIGN_LEFT
)
68 wxFLAGS_MEMBER(wxALIGN_RIGHT
)
69 wxFLAGS_MEMBER(wxALIGN_CENTRE
)
71 wxEND_FLAGS( wxStaticTextStyle
)
73 IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText
, wxControl
,"wx/stattext.h")
75 wxBEGIN_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
78 wxEND_PROPERTIES_TABLE()
80 wxBEGIN_HANDLERS_TABLE(wxStaticText
)
81 wxEND_HANDLERS_TABLE()
83 wxCONSTRUCTOR_6( wxStaticText
, wxWindow
* , Parent
, wxWindowID
, Id
, wxString
, Label
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
85 IMPLEMENT_DYNAMIC_CLASS(wxStaticText
, wxControl
)
88 bool wxStaticText::Create(wxWindow
*parent
,
90 const wxString
& label
,
96 if(!wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
99 // note that wxALIGN_LEFT is equal to 0 so we shouldn't
100 // test for it using & operator
102 JustificationType align
= leftAlign
;
104 if ( style
& wxALIGN_CENTRE
)
105 align
= centerAlign
;
106 else if ( style
& wxALIGN_RIGHT
)
109 return wxControl::PalmCreateField(label
, pos
, size
, false, false, align
);
112 wxBorder
wxStaticText::GetDefaultBorder() const
114 return wxBORDER_NONE
;
117 wxSize
wxStaticText::DoGetBestSize() const
122 bool wxStaticText::SetFont(const wxFont
& font
)
127 #endif // wxUSE_STATTEXT