X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9576ca53db96b462ed4c0b4bdf47d64c40203e4..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/mac/carbon/stattext.cpp diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 3b19c7184d..54f6eb4e58 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -22,6 +22,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) #endif +#include + bool wxStaticText::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, @@ -29,32 +31,31 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, long style, const wxString& name) { - SetName(name); - if (parent) parent->AddChild(this); - - SetBackgroundColour(parent->GetBackgroundColour()) ; - SetForegroundColour(parent->GetForegroundColour()) ; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - SetFont(parent->GetFont()); - - // TODO - return FALSE; -} - -void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO + Rect bounds ; + Str255 title ; + + MacPreControlCreate( parent , id , label , pos , size ,style, *((wxValidator*)NULL) , name , &bounds , title ) ; + + m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , "\p" , true , 0 , 0 , 1, + kControlStaticTextProc , (long) this ) ; + ::UMASetControlData( m_macControl, kControlLabelPart, kControlStaticTextTextTag , (long) title[0] , (char*) &title[1] ) ; + + MacPostControlCreate() ; + + return TRUE; } -void wxStaticText::SetLabel(const wxString& label) +void wxStaticText::SetLabel(const wxString& st , bool resize ) { - // TODO + SetTitle( st ) ; + wxString label ; + + if( wxApp::s_macDefaultEncodingIsPC ) + label = wxMacMakeMacStringFromPC( st ) ; + else + label = st ; + + ::UMASetControlData( m_macControl, kControlLabelPart, kControlStaticTextTextTag , (long) label.Length() , (char*)(const char*) label ) ; + Refresh() ; }