]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/stattext.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticText
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "stattext.h"
17 #include "wx/stattext.h"
22 #include <Xm/LabelG.h>
23 #include <Xm/PushBG.h>
25 #if !USE_SHARED_LIBRARY
26 IMPLEMENT_DYNAMIC_CLASS(wxStaticText
, wxControl
)
29 bool wxStaticText::Create(wxWindow
*parent
, wxWindowID id
,
30 const wxString
& label
,
37 if (parent
) parent
->AddChild(this);
39 SetBackgroundColour(parent
->GetDefaultBackgroundColour()) ;
40 SetForegroundColour(parent
->GetDefaultForegroundColour()) ;
43 m_windowId
= (int)NewControlId();
47 m_windowStyle
= style
;
49 char* label1
= (label
.IsNull() ? "" : (char*) (const char*) label
);
51 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
53 XmString text
= XmStringCreateSimple (label1
);
55 m_mainWidget
= (WXWidget
) XtVaCreateManagedWidget ((char*) (const char*) name
,
60 ((style
& wxALIGN_RIGHT
) ? XmALIGNMENT_END
:
61 ((style
& wxALIGN_CENTRE
) ? XmALIGNMENT_CENTER
:
62 XmALIGNMENT_BEGINNING
)),
67 SetCanAddEventHandler(TRUE
);
68 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
70 SetFont(* parent
->GetFont());
72 ChangeColour (m_mainWidget
);
73 // ChangeFont (m_mainWidget);