From 2b030203c5926bd6af8bc310469c911f2143f7e1 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Thu, 22 Jan 2004 06:13:51 +0000 Subject: [PATCH] Applied patch #881258: Add wxT() to debug messages and a few others git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/font.h | 4 ++-- src/cocoa/NSButton.mm | 4 ++-- src/cocoa/NSControl.mm | 4 ++-- src/cocoa/NSMenu.mm | 10 +++++----- src/cocoa/NSTableView.mm | 4 ++-- src/cocoa/NSView.mm | 2 +- src/cocoa/NSWindow.mm | 16 ++++++++-------- src/cocoa/app.mm | 10 +++++----- src/cocoa/bitmap.mm | 14 +++++++------- src/cocoa/bmpbuttn.mm | 6 +++--- src/cocoa/button.mm | 6 +++--- src/cocoa/checkbox.mm | 2 +- src/cocoa/choice.mm | 2 +- src/cocoa/control.mm | 6 +++--- src/cocoa/dc.mm | 14 +++++++------- src/cocoa/dcclient.mm | 16 ++++++++-------- src/cocoa/dcmemory.mm | 2 +- src/cocoa/dialog.mm | 18 +++++++++--------- src/cocoa/evtloop.mm | 2 +- src/cocoa/frame.mm | 2 +- src/cocoa/mbarman.mm | 4 ++-- src/cocoa/mdi.mm | 10 +++++----- src/cocoa/menu.mm | 4 ++-- src/cocoa/menuitem.mm | 14 +++++++------- src/cocoa/radiobut.mm | 4 ++-- src/cocoa/toolbar.mm | 8 ++++---- src/cocoa/toplevel.mm | 12 ++++++------ src/cocoa/window.mm | 34 +++++++++++++++++----------------- 28 files changed, 117 insertions(+), 117 deletions(-) diff --git a/include/wx/cocoa/font.h b/include/wx/cocoa/font.h index 863837c428..f2075fe537 100644 --- a/include/wx/cocoa/font.h +++ b/include/wx/cocoa/font.h @@ -27,11 +27,11 @@ public: , m_style(wxNORMAL) , m_weight(wxNORMAL) , m_underlined(FALSE) - , m_faceName("Geneva") + , m_faceName(wxT("Geneva")) , m_encoding(wxFONTENCODING_DEFAULT) { Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE, - "Geneva", wxFONTENCODING_DEFAULT); + wxT("Geneva"), wxFONTENCODING_DEFAULT); } wxFontRefData(const wxFontRefData& data) diff --git a/src/cocoa/NSButton.mm b/src/cocoa/NSButton.mm index 1728984c53..63cf30df2f 100644 --- a/src/cocoa/NSButton.mm +++ b/src/cocoa/NSButton.mm @@ -47,9 +47,9 @@ WX_IMPLEMENT_POSER(wxPoserNSButton); @implementation wxPoserNSButton : NSButton - (void)wxNSButtonAction: (id)sender { - wxASSERT_MSG((id)self==sender,"Received wxNSButtonAction from another object"); + wxASSERT_MSG((id)self==sender,wxT("Received wxNSButtonAction from another object")); wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self); - wxCHECK_RET(button,"wxNSButtonAction received without associated wx object"); + wxCHECK_RET(button,wxT("wxNSButtonAction received without associated wx object")); button->Cocoa_wxNSButtonAction(); } diff --git a/src/cocoa/NSControl.mm b/src/cocoa/NSControl.mm index 53d42d1697..2f601e3b6b 100644 --- a/src/cocoa/NSControl.mm +++ b/src/cocoa/NSControl.mm @@ -40,9 +40,9 @@ - (void)wxNSControlAction: (id)sender { - wxLogDebug("wxNSControlAction"); + wxLogDebug(wxT("wxNSControlAction")); wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender); - wxCHECK_RET(wxcontrol,"wxNSControlAction received but no wxCocoaNSControl exists!"); + wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!")); wxcontrol->CocoaTarget_action(); } diff --git a/src/cocoa/NSMenu.mm b/src/cocoa/NSMenu.mm index be8e541735..60792740f4 100644 --- a/src/cocoa/NSMenu.mm +++ b/src/cocoa/NSMenu.mm @@ -58,35 +58,35 @@ struct objc_object *wxCocoaNSMenu::sm_cocoaObserver = [[wxNSMenuNotificationObse - (void)menuDidAddItem: (NSNotification *)notification { wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]); - wxCHECK_RET(menu,"menuDidAddItem received but no wxMenu exists"); + wxCHECK_RET(menu,wxT("menuDidAddItem received but no wxMenu exists")); menu->CocoaNotification_menuDidAddItem(notification); } - (void)menuDidChangeItem: (NSNotification *)notification { wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]); - wxCHECK_RET(menu,"menuDidChangeItem received but no wxMenu exists"); + wxCHECK_RET(menu,wxT("menuDidChangeItem received but no wxMenu exists")); menu->CocoaNotification_menuDidChangeItem(notification); } - (void)menuDidRemoveItem: (NSNotification *)notification { wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]); - wxCHECK_RET(menu,"menuDidRemoveItem received but no wxMenu exists"); + wxCHECK_RET(menu,wxT("menuDidRemoveItem received but no wxMenu exists")); menu->CocoaNotification_menuDidRemoveItem(notification); } - (void)menuDidSendAction: (NSNotification *)notification { wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]); - wxCHECK_RET(menu,"menuDidSendAction received but no wxMenu exists"); + wxCHECK_RET(menu,wxT("menuDidSendAction received but no wxMenu exists")); menu->CocoaNotification_menuDidSendAction(notification); } - (void)menuWillSendAction: (NSNotification *)notification { wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]); - wxCHECK_RET(menu,"menuWillSendAction received but no wxMenu exists"); + wxCHECK_RET(menu,wxT("menuWillSendAction received but no wxMenu exists")); menu->CocoaNotification_menuWillSendAction(notification); } diff --git a/src/cocoa/NSTableView.mm b/src/cocoa/NSTableView.mm index ba027f2bb6..8991fb0ebb 100644 --- a/src/cocoa/NSTableView.mm +++ b/src/cocoa/NSTableView.mm @@ -41,7 +41,7 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTableView) - (int)numberOfRowsInTableView: (NSTableView *)tableView { wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView); - wxCHECK_MSG(wxView, 0, "No associated wx object"); + wxCHECK_MSG(wxView, 0, wxT("No associated wx object")); return wxView->CocoaDataSource_numberOfRows(); } @@ -50,7 +50,7 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTableView) row: (int)rowIndex { wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView); - wxCHECK_MSG(wxView, nil, "No associated wx object"); + wxCHECK_MSG(wxView, nil, wxT("No associated wx object")); return wxView->CocoaDataSource_objectForTableColumn(tableColumn,rowIndex); } diff --git a/src/cocoa/NSView.mm b/src/cocoa/NSView.mm index 03d065c195..e5d83af0f2 100644 --- a/src/cocoa/NSView.mm +++ b/src/cocoa/NSView.mm @@ -189,7 +189,7 @@ void *wxCocoaNSView::sm_cocoaObserver = [[wxNSViewNotificationObserver alloc] in - (void)notificationFrameChanged: (NSNotification *)notification; { wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa([notification object]); - wxCHECK_RET(win,"notificationFrameChanged received but no wxWindow exists"); + wxCHECK_RET(win,wxT("notificationFrameChanged received but no wxWindow exists")); win->Cocoa_FrameChanged(); } diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index 55aab6f438..ca5960caf0 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -50,48 +50,48 @@ - (void)windowDidBecomeKey: (NSNotification *)notification { wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); - wxCHECK_RET(win,"notificationDidBecomeKey received but no wxWindow exists"); + wxCHECK_RET(win,wxT("notificationDidBecomeKey received but no wxWindow exists")); win->CocoaDelegate_windowDidBecomeKey(); } - (void)windowDidResignKey: (NSNotification *)notification { wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); - wxCHECK_RET(win,"notificationDidResignKey received but no wxWindow exists"); + wxCHECK_RET(win,wxT("notificationDidResignKey received but no wxWindow exists")); win->CocoaDelegate_windowDidResignKey(); } - (void)windowDidBecomeMain: (NSNotification *)notification { wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); - wxCHECK_RET(win,"notificationDidBecomeMain received but no wxWindow exists"); + wxCHECK_RET(win,wxT("notificationDidBecomeMain received but no wxWindow exists")); win->CocoaDelegate_windowDidBecomeMain(); } - (void)windowDidResignMain: (NSNotification *)notification { wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); - wxCHECK_RET(win,"notificationDidResignMain received but no wxWindow exists"); + wxCHECK_RET(win,wxT("notificationDidResignMain received but no wxWindow exists")); win->CocoaDelegate_windowDidResignMain(); } - (BOOL)windowShouldClose: (id)sender { - wxLogDebug("windowShouldClose"); + wxLogDebug(wxT("windowShouldClose")); wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender); if(tlw && !tlw->CocoaDelegate_windowShouldClose()) { - wxLogDebug("Window will not be closed"); + wxLogDebug(wxT("Window will not be closed")); return NO; } - wxLogDebug("Window will be closed"); + wxLogDebug(wxT("Window will be closed")); return YES; } - (void)windowWillClose: (NSNotification *)notification { wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); - wxCHECK_RET(win,"windowWillClose received but no wxWindow exists"); + wxCHECK_RET(win,wxT("windowWillClose received but no wxWindow exists")); win->CocoaDelegate_windowWillClose(); } diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index 747330ed53..a499a3a0e6 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -88,7 +88,7 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); && ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode])) { sg_needIdle = false; - wxLogDebug("Processing idle events"); + wxLogDebug(wxT("Processing idle events")); while(wxTheApp->ProcessIdle()) { // Get the same events except don't block @@ -97,19 +97,19 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); if(event) return event; // we didn't get one, do some idle work - wxLogDebug("Looping idle events"); + wxLogDebug(wxT("Looping idle events")); } // No more idle work requested, block - wxLogDebug("Finished idle processing"); + wxLogDebug(wxT("Finished idle processing")); } else - wxLogDebug("Avoiding idle processing sg_needIdle=%d",sg_needIdle); + wxLogDebug(wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle); return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag]; } - (void)sendEvent: (NSEvent*)anEvent { - wxLogDebug("SendEvent"); + wxLogDebug(wxT("SendEvent")); sg_needIdle = true; [super sendEvent: anEvent]; } diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 6e5702044d..b9575fc890 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -296,7 +296,7 @@ bool wxBitmap::Create(int w, int h, int d) bytesPerRow: 0 bitsPerPixel: 0]; - wxLogDebug("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p", M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]); + wxLogDebug(wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]); M_BITMAPDATA->m_ok = true; M_BITMAPDATA->m_numColors = 0; M_BITMAPDATA->m_quality = 0; @@ -510,7 +510,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) template static bool wxMask_CreateFromBitmapData(PixelData srcData, const wxColour& colour, unsigned char *dstData) { - wxCHECK_MSG(dstData,false,"Couldn't access mask data"); + wxCHECK_MSG(dstData,false,wxT("Couldn't access mask data")); class PixelData::Iterator p(srcData); const int nRows = srcData.GetHeight(); const int nCols = srcData.GetWidth(); @@ -581,7 +581,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) // We need the source NSBitmapImageRep to detemine its pixel format NSBitmapImageRep *srcBitmapRep = const_cast(bitmap).GetNSBitmapImageRep(); - wxCHECK_MSG(srcBitmapRep,false,"Can't create mask for an uninitialized bitmap"); + wxCHECK_MSG(srcBitmapRep,false,wxT("Can't create mask for an uninitialized bitmap")); // Get a pointer to the destination data unsigned char *dstPlanes[5] = {NULL,NULL,NULL,NULL,NULL}; @@ -592,7 +592,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) { wxPixelData pixelData(const_cast(bitmap)); wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData), - false, "Unable to access raw data"); + false, wxT("Unable to access raw data")); } // 32-bpp RGBx (x=throw away, no alpha) else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==3 && [srcBitmapRep hasAlpha]==NO) @@ -600,17 +600,17 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) typedef wxPixelFormat PixelFormat; wxPixelData pixelData(const_cast(bitmap)); wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData), - false, "Unable to access raw data"); + false, wxT("Unable to access raw data")); } // 32-bpp RGBA else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==4 && [srcBitmapRep hasAlpha]==YES) { wxPixelData pixelData(const_cast(bitmap)); wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData), - false, "Unable to access raw data"); + false, wxT("Unable to access raw data")); } else - { wxCHECK_MSG(false,false,"Unimplemented pixel format"); } + { wxCHECK_MSG(false,false,wxT("Unimplemented pixel format")); } // maskRep was autoreleased in case we had to exit quickly m_cocoaNSBitmapImageRep = [maskRep retain]; diff --git a/src/cocoa/bmpbuttn.mm b/src/cocoa/bmpbuttn.mm index 61a0193676..7933e5dffa 100644 --- a/src/cocoa/bmpbuttn.mm +++ b/src/cocoa/bmpbuttn.mm @@ -32,10 +32,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid, const wxValidator& validator, const wxString& name) { wxAutoNSAutoreleasePool pool; - wxLogDebug("Creating control with id=%d",winid); + wxLogDebug(wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug("Created control with id=%d",GetId()); + wxLogDebug(wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -60,7 +60,7 @@ wxBitmapButton::~wxBitmapButton() void wxBitmapButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug("YAY!"); + wxLogDebug(wxT("YAY!")); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); InitCommandEvent(event); // event.SetEventObject(this); Command(event); diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index 7b93013217..c68e9596ed 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -32,10 +32,10 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid, const wxValidator& validator, const wxString& name) { wxAutoNSAutoreleasePool pool; - wxLogDebug("Creating control with id=%d",winid); + wxLogDebug(wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug("Created control with id=%d",GetId()); + wxLogDebug(wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -60,7 +60,7 @@ wxButton::~wxButton() void wxButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug("YAY!"); + wxLogDebug(wxT("YAY!")); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); InitCommandEvent(event); // event.SetEventObject(this); Command(event); diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index 04204304f1..ff4513b70b 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -74,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()); diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index b4548842be..3127f87a8c 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -107,7 +107,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"]; int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem]; int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem]; - wxLogDebug("menuDidSendAction, index=%d, selectedItem=%d", index, selectedItem); + wxLogDebug(wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem); wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId); event.SetInt(index); event.SetEventObject(this); diff --git a/src/cocoa/control.mm b/src/cocoa/control.mm index c83fa93dab..c8215a75f5 100644 --- a/src/cocoa/control.mm +++ b/src/cocoa/control.mm @@ -45,10 +45,10 @@ bool wxControl::Create(wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { - wxLogDebug("Creating control with id=%d",winid); + wxLogDebug(wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug("Created control with id=%d",GetId()); + wxLogDebug(wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -78,7 +78,7 @@ wxSize wxControl::DoGetBestSize() const NSRect cocoaRect = [m_cocoaNSView frame]; wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height); [m_cocoaNSView setFrame: storedRect]; - wxLogDebug("wxControl=%p::DoGetBestSize()==(%d,%d)",this,size.x,size.y); + wxLogDebug(wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y); return size; } diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index 013c6eaa8c..55be845f80 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -70,7 +70,7 @@ inline void CocoaSetPenForNSBezierPath(wxPen &pen, NSBezierPath *bezpath) void wxDC::CocoaInitializeTextSystem() { - wxASSERT_MSG(!sm_cocoaNSTextStorage && !sm_cocoaNSLayoutManager && !sm_cocoaNSTextContainer,"Text system already initalized! BAD PROGRAMMER!"); + wxASSERT_MSG(!sm_cocoaNSTextStorage && !sm_cocoaNSLayoutManager && !sm_cocoaNSTextContainer,wxT("Text system already initalized! BAD PROGRAMMER!")); sm_cocoaNSTextStorage = [[NSTextStorage alloc] init]; @@ -108,7 +108,7 @@ void wxDC::CocoaUnwindStackAndLoseFocus() wxASSERT(dc!=this); if(!dc->CocoaUnlockFocus()) { - wxFAIL_MSG("Unable to unlock focus on higher-level DC!"); + wxFAIL_MSG(wxT("Unable to unlock focus on higher-level DC!")); } sm_cocoaDCStack.DeleteNode(node); } @@ -205,7 +205,7 @@ void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord { wxAutoNSAutoreleasePool pool; // FIXME: Cache this so it can be used for DoDrawText - wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, "Text system has not been initialized. BAD PROGRAMMER!"); + wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!")); NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithCString:text.c_str()]]; [sm_cocoaNSTextStorage setAttributedString:attributedString]; @@ -226,7 +226,7 @@ void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y) { if(!CocoaTakeFocus()) return; - wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, "Text system has not been initialized. BAD PROGRAMMER!"); + wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!")); NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithCString:text.c_str()]]; [sm_cocoaNSTextStorage setAttributedString:attributedString]; @@ -252,7 +252,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y) // there is no length or we don't start at zero if(!glyphRange.length) return; - wxASSERT_MSG(glyphRange.location==0,"glyphRange must begin at zero"); + wxASSERT_MSG(glyphRange.location==0,wxT("glyphRange must begin at zero")); NSAffineTransform *transform = [NSAffineTransform transform]; [transform translateXBy:x yBy:y]; @@ -274,7 +274,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y) [flipTransform concat]; #if 0 // Draw+fill a rectangle so we can see where the shit is supposed to be. - wxLogDebug("(%f,%f) (%fx%f)",usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height); + wxLogDebug(wxT("(%f,%f) (%fx%f)"),usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height); NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)]; [[NSColor blackColor] set]; [bezpath stroke]; @@ -454,7 +454,7 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) #if 0 // Draw a rect so we can see where it's supposed to be - wxLogDebug("image at (%d,%d) size %dx%d",x,y,bmp.GetWidth(),bmp.GetHeight()); + wxLogDebug(wxT("image at (%d,%d) size %dx%d"),x,y,bmp.GetWidth(),bmp.GetHeight()); NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,bmp.GetWidth(),bmp.GetHeight())]; [[NSColor blackColor] set]; [bezpath stroke]; diff --git a/src/cocoa/dcclient.mm b/src/cocoa/dcclient.mm index 4e36df97c9..56c9b7f7c1 100644 --- a/src/cocoa/dcclient.mm +++ b/src/cocoa/dcclient.mm @@ -38,7 +38,7 @@ wxWindowDC::wxWindowDC( wxWindow *window ) : m_window(window) , m_lockedNSView(NULL) { - wxLogDebug("non-client window DC's are not supported, oh well"); + wxLogDebug(wxT("non-client window DC's are not supported, oh well")); }; wxWindowDC::~wxWindowDC(void) @@ -57,7 +57,7 @@ bool wxWindowDC::CocoaLockFocusOnNSView(WX_NSView nsview) m_lockedNSView = nsview; return true; } - wxLogDebug("focus lock failed!"); + wxLogDebug(wxT("focus lock failed!")); return false; } @@ -71,13 +71,13 @@ bool wxWindowDC::CocoaUnlockFocusOnNSView() bool wxWindowDC::CocoaLockFocus() { - wxLogDebug("Locking focus on wxWindowDC=%p, NSView=%p",this, m_window->GetNonClientNSView()); + wxLogDebug(wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); return CocoaLockFocusOnNSView(m_window->GetNonClientNSView()); } bool wxWindowDC::CocoaUnlockFocus() { - wxLogDebug("Unlocking focus on wxWindowDC=%p, NSView=%p",this, m_window->GetNonClientNSView()); + wxLogDebug(wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); return CocoaUnlockFocusOnNSView(); } @@ -115,13 +115,13 @@ wxClientDC::~wxClientDC(void) bool wxClientDC::CocoaLockFocus() { - wxLogDebug("Locking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView()); + wxLogDebug(wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); return CocoaLockFocusOnNSView(m_window->GetNSView()); } bool wxClientDC::CocoaUnlockFocus() { - wxLogDebug("Unlocking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView()); + wxLogDebug(wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); return CocoaUnlockFocusOnNSView(); } @@ -137,7 +137,7 @@ wxPaintDC::wxPaintDC(void) wxPaintDC::wxPaintDC( wxWindow *window ) { m_window = window; - wxASSERT_MSG([NSView focusView]==window->GetNSView(), "PaintDC's NSView does not have focus. Please use wxPaintDC only as the first DC created in a paint handler"); + wxASSERT_MSG([NSView focusView]==window->GetNSView(), wxT("PaintDC's NSView does not have focus. Please use wxPaintDC only as the first DC created in a paint handler")); sm_cocoaDCStack.Insert(this); m_lockedNSView = window->GetNSView(); m_cocoaFlipped = [window->GetNSView() isFlipped]; @@ -152,7 +152,7 @@ wxPaintDC::~wxPaintDC(void) bool wxPaintDC::CocoaLockFocus() { - wxFAIL_MSG("wxPaintDC cannot be asked to lock focus!"); + wxFAIL_MSG(wxT("wxPaintDC cannot be asked to lock focus!")); return false; } diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 3bdb6dd67e..1596e33184 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -138,7 +138,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, [transform concat]; [flipTransform concat]; - wxLogDebug("[m_cocoaNSImage isFlipped]=%d", [m_cocoaNSImage isFlipped]); + wxLogDebug(wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]); [m_cocoaNSImage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(xsrc, m_selectedBitmap.GetHeight()-height-ysrc, diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index 01df17f2c3..4a13a49a95 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -75,7 +75,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid, // Because we do not release on close, the following release matches the // above alloc and thus the retain count will be 1. [m_cocoaNSWindow release]; - wxLogDebug("wxDialog m_cocoaNSWindow retainCount=%d",[m_cocoaNSWindow retainCount]); + wxLogDebug(wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]); [m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)]; [m_cocoaNSWindow setHidesOnDeactivate:NO]; @@ -84,7 +84,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid, wxDialog::~wxDialog() { - wxLogDebug("Destroying"); + wxLogDebug(wxT("Destroying")); // setReleasedWhenClosed: NO [m_cocoaNSWindow close]; DisassociateNSPanel(GetNSPanel()); @@ -94,7 +94,7 @@ void wxDialog::CocoaDelegate_windowWillClose(void) { m_closed = true; /* Actually, this isn't true anymore */ - wxLogDebug("Woah: Dialogs are not generally closed"); + wxLogDebug(wxT("Woah: Dialogs are not generally closed")); } void wxDialog::SetModal(bool flag) @@ -124,7 +124,7 @@ bool wxDialog::Show(bool show) { wxAutoNSAutoreleasePool pool; wxModalDialogs.Append(this); - wxLogDebug("runModal"); + wxLogDebug(wxT("runModal")); NSApplication *theNSApp = wxTheApp->GetNSApplication(); // If the app hasn't started, flush the event queue // If we don't do this, the Dock doesn't get the message that @@ -141,11 +141,11 @@ bool wxDialog::Show(bool show) } } [wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow]; - wxLogDebug("runModal END"); + wxLogDebug(wxT("runModal END")); } else { - wxLogDebug("abortModal"); + wxLogDebug(wxT("abortModal")); [wxTheApp->GetNSApplication() abortModal]; wxModalDialogs.DeleteObject(this); } @@ -198,13 +198,13 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event) if ( closing.Member(this) ) { - wxLogDebug("WARNING: Attempting to recursively call Close for dialog"); + wxLogDebug(wxT("WARNING: Attempting to recursively call Close for dialog")); return; } closing.Append(this); - wxLogDebug("Sending Cancel Event"); + wxLogDebug(wxT("Sending Cancel Event")); wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); cancelEvent.SetEventObject( this ); GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog @@ -230,7 +230,7 @@ void wxDialog::OnApply(wxCommandEvent& event) void wxDialog::OnCancel(wxCommandEvent& event) { - wxLogDebug("Cancelled!"); + wxLogDebug(wxT("Cancelled!")); EndModal(wxID_CANCEL); } diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index c6ab3ea5c6..00e19abb62 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -88,7 +88,7 @@ void wxEventLoop::Exit(int rc) m_impl->SetExitCode(rc); NSApplication *cocoaApp = [NSApplication sharedApplication]; - wxLogDebug("wxEventLoop::Exit isRunning=%d", (int)[cocoaApp isRunning]); + wxLogDebug(wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]); wxTheApp->WakeUpIdle(); /* Notes: If we're being called from idle time (which occurs while checking the diff --git a/src/cocoa/frame.mm b/src/cocoa/frame.mm index a172504c57..ca12e36e29 100644 --- a/src/cocoa/frame.mm +++ b/src/cocoa/frame.mm @@ -165,7 +165,7 @@ void wxFrame::UpdateFrameNSView() [sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin]; sbarheight = sbarRect.size.height; } - wxLogDebug("frame height=%f, tbar=%f, sbar=%f",frameRect.size.height,tbarheight,sbarheight); + wxLogDebug(wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight); NSRect innerRect = [m_cocoaNSView frame]; innerRect.size.height = frameRect.size.height - tbarheight - sbarheight; innerRect.origin.y = sbarheight; diff --git a/src/cocoa/mbarman.mm b/src/cocoa/mbarman.mm index c6cf916e64..0935ec6e97 100644 --- a/src/cocoa/mbarman.mm +++ b/src/cocoa/mbarman.mm @@ -49,7 +49,7 @@ @implementation wxMenuBarManagerObserver : NSObject - (id)init { - wxFAIL_MSG("[wxMenuBarManagerObserver -init] should never be called!"); + wxFAIL_MSG(wxT("[wxMenuBarManagerObserver -init] should never be called!")); m_mbarman = NULL; return self; } @@ -273,7 +273,7 @@ void wxMenuBarManager::InstallMenuBarForWindow(wxCocoaNSWindow *win) wxASSERT(win); m_windowCurrent = win; wxMenuBar *menubar = win->GetAppMenuBar(win); - wxLogDebug("Found menubar=%p for window=%p.",menubar,win); + wxLogDebug(wxT("Found menubar=%p for window=%p."),menubar,win); SetMenuBar(menubar); } diff --git a/src/cocoa/mdi.mm b/src/cocoa/mdi.mm index 1d069d58b0..7a3f68a8f1 100644 --- a/src/cocoa/mdi.mm +++ b/src/cocoa/mdi.mm @@ -44,7 +44,7 @@ WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntM @implementation wxMDIParentFrameObserver : NSObject - (id)init { - wxFAIL_MSG("[wxMDIParentFrameObserver -init] should never be called!"); + wxFAIL_MSG(wxT("[wxMDIParentFrameObserver -init] should never be called!")); m_mdiParent = NULL; return self; } @@ -158,7 +158,7 @@ wxMenuBar *wxMDIParentFrame::GetAppMenuBar(wxCocoaNSWindow *win) void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void) { - wxLogDebug("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey",this); + wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild) { sm_cocoaDeactivateWindow = NULL; @@ -183,7 +183,7 @@ void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void) void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey",this); + wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this); if(m_closed) wxFrame::CocoaDelegate_windowDidResignKey(); else @@ -280,7 +280,7 @@ void wxMDIChildFrame::Activate() void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void) { - wxLogDebug("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey",this); + wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent) { sm_cocoaDeactivateWindow = NULL; @@ -299,7 +299,7 @@ void wxMDIChildFrame::CocoaDelegate_windowDidBecomeMain(void) void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey",this); + wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this); sm_cocoaDeactivateWindow = this; } diff --git a/src/cocoa/menu.mm b/src/cocoa/menu.mm index 3c69ea7481..666001f5ce 100644 --- a/src/cocoa/menu.mm +++ b/src/cocoa/menu.mm @@ -105,7 +105,7 @@ wxMenuBar::~wxMenuBar() bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) { wxAutoNSAutoreleasePool pool; - wxLogDebug("append menu=%p, title=%s",menu,title.c_str()); + wxLogDebug(wxT("append menu=%p, title=%s"),menu,title.c_str()); if(!wxMenuBarBase::Append(menu,title)) return false; wxASSERT(menu); @@ -125,7 +125,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { wxAutoNSAutoreleasePool pool; - wxLogDebug("insert pos=%lu, menu=%p, title=%s",pos,menu,title.c_str()); + wxLogDebug(wxT("insert pos=%lu, menu=%p, title=%s"),pos,menu,title.c_str()); // Get the current menu at this position wxMenu *nextmenu = GetMenu(pos); if(!wxMenuBarBase::Insert(pos,menu,title)) diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index e5e5e7659d..eb2c412503 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -54,17 +54,17 @@ - (void)wxMenuItemAction: (id)sender { - wxLogDebug("wxMenuItemAction"); + wxLogDebug(wxT("wxMenuItemAction")); wxMenuItem *item = wxMenuItem::GetFromCocoa(sender); - wxCHECK_RET(item,"wxMenuItemAction received but no wxMenuItem exists!"); + wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!")); wxMenu *menu = item->GetMenu(); - wxCHECK_RET(menu,"wxMenuItemAction received but wxMenuItem is not in a wxMenu"); + wxCHECK_RET(menu,wxT("wxMenuItemAction received but wxMenuItem is not in a wxMenu")); wxMenuBar *menubar = menu->GetMenuBar(); if(menubar) { wxFrame *frame = menubar->GetFrame(); - wxCHECK_RET(frame, "wxMenuBar MUST be attached to a wxFrame!"); + wxCHECK_RET(frame, wxT("wxMenuBar MUST be attached to a wxFrame!")); frame->ProcessCommand(item->GetId()); } } @@ -72,9 +72,9 @@ - (BOOL)validateMenuItem: (id)menuItem { // TODO: Do wxWindows validation here and avoid sending during idle time - wxLogDebug("wxMenuItemAction"); + wxLogDebug(wxT("wxMenuItemAction")); wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem); - wxCHECK_MSG(item,NO,"validateMenuItem received but no wxMenuItem exists!"); + wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!")); return item->IsEnabled(); } @@ -167,7 +167,7 @@ void wxMenuItem::Enable(bool bDoEnable) void wxMenuItem::Check(bool bDoCheck) { - wxCHECK_RET( IsCheckable(), "only checkable items may be checked" ); + wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); wxMenuItemBase::Check(bDoCheck); } diff --git a/src/cocoa/radiobut.mm b/src/cocoa/radiobut.mm index d5502f3d38..5ceef75f99 100644 --- a/src/cocoa/radiobut.mm +++ b/src/cocoa/radiobut.mm @@ -60,7 +60,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid, { m_radioMaster = radioButton->m_radioMaster; wxASSERT_MSG(m_radioMaster, - "Previous radio button should be part of a group"); + wxT("Previous radio button should be part of a group")); // Don't crash, assume user meant wxRB_SINGLE if(m_radioMaster) m_radioMaster->m_radioSlaves.Append(this); @@ -140,7 +140,7 @@ bool wxRadioButton::GetValue() const void wxRadioButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug("wxRadioButton"); + wxLogDebug(wxT("wxRadioButton")); if(m_radioMaster && ([GetNSButton() state] == NSOnState)) { for(wxRadioButtonList::compatibility_iterator slaveNode = diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index a72e61cde4..0f7e02c01d 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -71,9 +71,9 @@ protected: - (void)wxNSActionCellAction: (id)sender { - wxLogDebug("wxNSActionCellAction"); + wxLogDebug(wxT("wxNSActionCellAction")); wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender); - wxCHECK_RET(wxcontrol,"wxNSActionCellAction received but no wxCocoaNSActionCell exists!"); + wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!")); wxcontrol->CocoaTarget_wxNSActionCellAction(); } @@ -297,7 +297,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent) untilMouseUp:NO]) { m_mouseDownTool = NULL; - wxLogDebug("Button was clicked after drag!"); + wxLogDebug(wxT("Button was clicked after drag!")); } [buttonCell setHighlighted: NO]; } @@ -320,7 +320,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent) untilMouseUp:NO]) { m_mouseDownTool = NULL; - wxLogDebug("Button was clicked!"); + wxLogDebug(wxT("Button was clicked!")); } [buttonCell setHighlighted: NO]; } diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index a7c3f22380..9bb32c828a 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -168,7 +168,7 @@ wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win) void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow) { bool need_debug = cocoaNSWindow || m_cocoaNSWindow; - if(need_debug) wxLogDebug("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d",this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]); + if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]); DisassociateNSWindow(m_cocoaNSWindow); [cocoaNSWindow retain]; [m_cocoaNSWindow release]; @@ -178,7 +178,7 @@ void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow) else SetNSView(NULL); AssociateNSWindow(m_cocoaNSWindow); - if(need_debug) wxLogDebug("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d",this,cocoaNSWindow,[cocoaNSWindow retainCount]); + if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]); } void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newView) @@ -197,7 +197,7 @@ void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newVie void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void) { DeactivatePendingWindow(); - wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this); + wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -205,7 +205,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey",this); + wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -213,12 +213,12 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void) { - wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain",this); + wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this); } void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void) { - wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain",this); + wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this); } void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void) diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index e6df2b6fa8..8fdd67223a 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -216,7 +216,7 @@ void wxWindowCocoaScroller::DoGetClientSize(int *x, int *y) const void wxWindowCocoaScroller::Cocoa_FrameChanged(void) { - wxLogDebug("Cocoa_FrameChanged"); + wxLogDebug(wxT("Cocoa_FrameChanged")); wxSizeEvent event(m_owner->GetSize(), m_owner->GetId()); event.SetEventObject(m_owner); m_owner->GetEventHandler()->ProcessEvent(event); @@ -302,13 +302,13 @@ void wxWindowCocoa::CocoaRemoveFromParent(void) void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView) { bool need_debug = cocoaNSView || m_cocoaNSView; - if(need_debug) wxLogDebug("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d",this,m_cocoaNSView,[m_cocoaNSView retainCount]); + if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]); DisassociateNSView(m_cocoaNSView); [cocoaNSView retain]; [m_cocoaNSView release]; m_cocoaNSView = cocoaNSView; AssociateNSView(m_cocoaNSView); - if(need_debug) wxLogDebug("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d",this,cocoaNSView,[cocoaNSView retainCount]); + if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]); } WX_NSView wxWindowCocoa::GetNSViewForSuperview() const @@ -329,13 +329,13 @@ WX_NSView wxWindowCocoa::GetNSViewForHiding() const bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect) { - wxLogDebug("Cocoa_drawRect"); + wxLogDebug(wxT("Cocoa_drawRect")); // Recursion can happen if the event loop runs from within the paint // handler. For instance, if an assertion dialog is shown. // FIXME: This seems less than ideal. if(m_isInPaint) { - wxLogDebug("Paint event recursion!"); + wxLogDebug(wxT("Paint event recursion!")); return false; } //FIXME: should probably turn that rect into the update region @@ -349,7 +349,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect) void wxWindowCocoa::InitMouseEvent(wxMouseEvent& event, WX_NSEvent cocoaEvent) { - wxASSERT_MSG([m_cocoaNSView window]==[cocoaEvent window],"Mouse event for different NSWindow"); + wxASSERT_MSG([m_cocoaNSView window]==[cocoaEvent window],wxT("Mouse event for different NSWindow")); NSPoint cocoaPoint = [m_cocoaNSView convertPoint:[(NSEvent*)cocoaEvent locationInWindow] fromView:nil]; NSRect cocoaRect = [m_cocoaNSView frame]; const wxPoint &clientorigin = GetClientAreaOrigin(); @@ -370,7 +370,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent) { wxMouseEvent event(wxEVT_MOTION); InitMouseEvent(event,theEvent); - wxLogDebug("Mouse Drag @%d,%d",event.m_x,event.m_y); + wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -388,7 +388,7 @@ bool wxWindowCocoa::Cocoa_mouseDown(WX_NSEvent theEvent) { wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK); InitMouseEvent(event,theEvent); - wxLogDebug("Mouse Down @%d,%d num clicks=%d",event.m_x,event.m_y,[theEvent clickCount]); + wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); return GetEventHandler()->ProcessEvent(event); } @@ -397,7 +397,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_MOTION); InitMouseEvent(event,theEvent); event.m_leftDown = true; - wxLogDebug("Mouse Drag @%d,%d",event.m_x,event.m_y); + wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -405,7 +405,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent) { wxMouseEvent event(wxEVT_LEFT_UP); InitMouseEvent(event,theEvent); - wxLogDebug("Mouse Up @%d,%d",event.m_x,event.m_y); + wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -441,7 +441,7 @@ bool wxWindowCocoa::Cocoa_otherMouseUp(WX_NSEvent theEvent) void wxWindowCocoa::Cocoa_FrameChanged(void) { - wxLogDebug("Cocoa_FrameChanged"); + wxLogDebug(wxT("Cocoa_FrameChanged")); wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -493,7 +493,7 @@ bool wxWindow::Show(bool show) // If the window is marked as visible, then it shouldn't have a dummy view // If the window is marked hidden, then it should have a dummy view // wxSpinCtrl (generic) abuses m_isShown, don't use it for any logic -// wxASSERT_MSG( (m_isShown && !m_dummyNSView) || (!m_isShown && m_dummyNSView),"wxWindow: m_isShown does not agree with m_dummyNSView"); +// wxASSERT_MSG( (m_isShown && !m_dummyNSView) || (!m_isShown && m_dummyNSView),wxT("wxWindow: m_isShown does not agree with m_dummyNSView")); // Return false if there isn't a window to show or hide NSView *cocoaView = GetNSViewForHiding(); if(!cocoaView) @@ -573,7 +573,7 @@ void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height) NSView *nsview = GetNSViewForSuperview(); NSView *superview = [nsview superview]; - wxCHECK_RET(superview,"NSView does not have a superview"); + wxCHECK_RET(superview,wxT("NSView does not have a superview")); NSRect parentRect = [superview bounds]; NSRect cocoaRect = NSMakeRect(x,parentRect.size.height-(y+height),width,height); @@ -586,7 +586,7 @@ void wxWindowCocoa::SetInitialFrameRect(const wxPoint& pos, const wxSize& size) { NSView *nsview = GetNSViewForSuperview(); NSView *superview = [nsview superview]; - wxCHECK_RET(superview,"NSView does not have a superview"); + wxCHECK_RET(superview,wxT("NSView does not have a superview")); NSRect parentRect = [superview bounds]; NSRect frameRect = [nsview frame]; if(size.x!=-1) @@ -621,7 +621,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const { NSView *nsview = GetNSViewForSuperview(); NSView *superview = [nsview superview]; - wxCHECK_RET(superview,"NSView does not have a superview"); + wxCHECK_RET(superview,wxT("NSView does not have a superview")); NSRect parentRect = [superview bounds]; NSRect cocoaRect = [nsview frame]; @@ -672,7 +672,7 @@ void wxWindow::DoClientToScreen(int *x, int *y) const // Get size *available for subwindows* i.e. excluding menu bar etc. void wxWindow::DoGetClientSize(int *x, int *y) const { - wxLogDebug("DoGetClientSize:"); + wxLogDebug(wxT("DoGetClientSize:")); if(m_cocoaScroller) m_cocoaScroller->DoGetClientSize(x,y); else @@ -681,7 +681,7 @@ void wxWindow::DoGetClientSize(int *x, int *y) const void wxWindow::DoSetClientSize(int width, int height) { - wxLogDebug("DoSetClientSize=(%d,%d)",width,height); + wxLogDebug(wxT("DoSetClientSize=(%d,%d)"),width,height); if(m_cocoaScroller) m_cocoaScroller->ClientSizeToSize(width,height); CocoaSetWxWindowSize(width,height); -- 2.45.2