X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0c6a355b7b53866286ec6263b99f787cfdbe731..5c526007a8909e8856a6d1fb656c5150738d2e4a:/src/cocoa/checkbox.mm diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index 90dd25fba1..ff4513b70b 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -9,11 +9,15 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#include "wx/app.h" -#include "wx/checkbox.h" -#include "wx/log.h" +#include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/app.h" + #include "wx/checkbox.h" +#endif //WX_PRECOMP #include "wx/cocoa/autorelease.h" +#include "wx/cocoa/string.h" #import #import @@ -38,7 +42,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid, SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]); [m_cocoaNSView release]; [GetNSButton() setButtonType: NSSwitchButton]; - [GetNSButton() setTitle:[NSString stringWithCString: label.c_str()]]; + [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))]; [GetNSControl() sizeToFit]; if(m_parent) @@ -50,7 +54,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid, wxCheckBox::~wxCheckBox() { - DisassociateNSButton(m_cocoaNSView); + DisassociateNSButton(GetNSButton()); } void wxCheckBox::SetValue(bool value) @@ -70,7 +74,7 @@ bool wxCheckBox::GetValue() const void wxCheckBox::Cocoa_wxNSButtonAction(void) { - wxLogDebug("Checkbox"); + wxLogDebug(wxT("Checkbox")); wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId()); InitCommandEvent(event); // event.SetEventObject(this); event.SetInt(GetValue());