]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: stattext.cpp | |
3 | // Purpose: wxStaticText | |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifdef __GNUG__ | |
13 | #pragma implementation "stattext.h" | |
14 | #endif | |
15 | ||
16 | #include "wx/app.h" | |
17 | #include "wx/stattext.h" | |
18 | ||
19 | #include <stdio.h> | |
20 | ||
21 | IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) | |
22 | ||
23 | #include <wx/mac/uma.h> | |
24 | ||
25 | bool wxStaticText::Create(wxWindow *parent, wxWindowID id, | |
26 | const wxString& label, | |
27 | const wxPoint& pos, | |
28 | const wxSize& size, | |
29 | long style, | |
30 | const wxString& name) | |
31 | { | |
32 | Rect bounds ; | |
33 | Str255 title ; | |
34 | ||
35 | MacPreControlCreate( parent , id , label , pos , size ,style, *((wxValidator*)NULL) , name , &bounds , title ) ; | |
36 | ||
37 | m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , "\p" , true , 0 , 0 , 1, | |
38 | kControlStaticTextProc , (long) this ) ; | |
39 | ::UMASetControlData( m_macControl, kControlLabelPart, kControlStaticTextTextTag , (long) title[0] , (char*) &title[1] ) ; | |
40 | ||
41 | MacPostControlCreate() ; | |
42 | ||
43 | return TRUE; | |
44 | } | |
45 | ||
46 | void wxStaticText::SetLabel(const wxString& st , bool resize ) | |
47 | { | |
48 | SetTitle( st ) ; | |
49 | wxString label ; | |
50 | ||
51 | if( wxApp::s_macDefaultEncodingIsPC ) | |
52 | label = wxMacMakeMacStringFromPC( st ) ; | |
53 | else | |
54 | label = st ; | |
55 | ||
56 | ::UMASetControlData( m_macControl, kControlLabelPart, kControlStaticTextTextTag , (long) label.Length() , (char*)(const char*) label ) ; | |
57 | Refresh() ; | |
58 | } | |
59 |