- (void)wxNSControlAction: (id)sender
{
- wxLogDebug(wxT("wxNSControlAction"));
+ wxLogTrace(wxTRACE_COCOA,wxT("wxNSControlAction"));
wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!"));
wxcontrol->CocoaTarget_action();
- (BOOL)windowShouldClose: (id)sender
{
- wxLogDebug(wxT("windowShouldClose"));
+ wxLogTrace(wxTRACE_COCOA,wxT("windowShouldClose"));
wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender);
if(tlw && !tlw->CocoaDelegate_windowShouldClose())
{
- wxLogDebug(wxT("Window will not be closed"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Window will not be closed"));
return NO;
}
- wxLogDebug(wxT("Window will be closed"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Window will be closed"));
return YES;
}
&& ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode]))
{
sg_needIdle = false;
- wxLogDebug(wxT("Processing idle events"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Processing idle events"));
while(wxTheApp->ProcessIdle())
{
// Get the same events except don't block
if(event)
return event;
// we didn't get one, do some idle work
- wxLogDebug(wxT("Looping idle events"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Looping idle events"));
}
// No more idle work requested, block
- wxLogDebug(wxT("Finished idle processing"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Finished idle processing"));
}
else
- wxLogDebug(wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle);
+ wxLogTrace(wxTRACE_COCOA,wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle);
return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag];
}
- (void)sendEvent: (NSEvent*)anEvent
{
- wxLogDebug(wxT("SendEvent"));
+ wxLogTrace(wxTRACE_COCOA,wxT("SendEvent"));
sg_needIdle = true;
[super sendEvent: anEvent];
}
bytesPerRow: 0
bitsPerPixel: 0];
- wxLogDebug(wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]);
+ wxLogTrace(wxTRACE_COCOA,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;
const wxValidator& validator, const wxString& name)
{
wxAutoNSAutoreleasePool pool;
- wxLogDebug(wxT("Creating control with id=%d"),winid);
+ wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid);
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- wxLogDebug(wxT("Created control with id=%d"),GetId());
+ wxLogTrace(wxTRACE_COCOA,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).
void wxBitmapButton::Cocoa_wxNSButtonAction(void)
{
- wxLogDebug(wxT("YAY!"));
+ wxLogTrace(wxTRACE_COCOA,wxT("YAY!"));
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
InitCommandEvent(event); // event.SetEventObject(this);
Command(event);
const wxValidator& validator, const wxString& name)
{
wxAutoNSAutoreleasePool pool;
- wxLogDebug(wxT("Creating control with id=%d"),winid);
+ wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid);
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- wxLogDebug(wxT("Created control with id=%d"),GetId());
+ wxLogTrace(wxTRACE_COCOA,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).
void wxButton::Cocoa_wxNSButtonAction(void)
{
- wxLogDebug(wxT("YAY!"));
+ wxLogTrace(wxTRACE_COCOA,wxT("YAY!"));
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
InitCommandEvent(event); // event.SetEventObject(this);
Command(event);
void wxCheckBox::Cocoa_wxNSButtonAction(void)
{
- wxLogDebug(wxT("Checkbox"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Checkbox"));
// What we really want to do is override [NSCell -nextState] to return
// NSOnState in lieu of NSMixedState but this works (aside from the
// very slightly noticeable drawing of - and then a check) -DE
NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"];
int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem];
int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem];
- wxLogDebug(wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem);
+ wxLogTrace(wxTRACE_COCOA,wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem);
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
event.SetInt(index);
event.SetEventObject(this);
const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator, const wxString& name)
{
- wxLogDebug(wxT("Creating control with id=%d"),winid);
+ wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid);
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- wxLogDebug(wxT("Created control with id=%d"),GetId());
+ wxLogTrace(wxTRACE_COCOA,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).
NSRect cocoaRect = [m_cocoaNSView frame];
wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height);
[m_cocoaNSView setFrame: storedRect];
- wxLogDebug(wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
+ wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
return size;
}
[flipTransform concat];
#if 0
// Draw+fill a rectangle so we can see where the shit is supposed to be.
- wxLogDebug(wxT("(%f,%f) (%fx%f)"),usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height);
+ wxLogTrace(wxTRACE_COCOA,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];
#if 0
// Draw a rect so we can see where it's supposed to be
- wxLogDebug(wxT("image at (%d,%d) size %dx%d"),x,y,bmp.GetWidth(),bmp.GetHeight());
+ wxLogTrace(wxTRACE_COCOA,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];
bool wxWindowDC::CocoaLockFocus()
{
- wxLogDebug(wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
+ wxLogTrace(wxTRACE_COCOA,wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
return CocoaLockFocusOnNSView(m_window->GetNonClientNSView());
}
bool wxWindowDC::CocoaUnlockFocus()
{
- wxLogDebug(wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
+ wxLogTrace(wxTRACE_COCOA,wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
return CocoaUnlockFocusOnNSView();
}
bool wxClientDC::CocoaLockFocus()
{
- wxLogDebug(wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
+ wxLogTrace(wxTRACE_COCOA,wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
return CocoaLockFocusOnNSView(m_window->GetNSView());
}
bool wxClientDC::CocoaUnlockFocus()
{
- wxLogDebug(wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
+ wxLogTrace(wxTRACE_COCOA,wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
return CocoaUnlockFocusOnNSView();
}
[transform concat];
[flipTransform concat];
- wxLogDebug(wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]);
+ wxLogTrace(wxTRACE_COCOA,wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]);
[m_cocoaNSImage drawAtPoint: NSMakePoint(0,0)
fromRect: NSMakeRect(xsrc,
m_selectedBitmap.GetHeight()-height-ysrc,
// 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(wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]);
+ wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]);
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
[m_cocoaNSWindow setHidesOnDeactivate:NO];
wxDialog::~wxDialog()
{
- wxLogDebug(wxT("Destroying"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Destroying"));
// setReleasedWhenClosed: NO
[m_cocoaNSWindow close];
DisassociateNSPanel(GetNSPanel());
{
m_closed = true;
/* Actually, this isn't true anymore */
- wxLogDebug(wxT("Woah: Dialogs are not generally closed"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Woah: Dialogs are not generally closed"));
}
void wxDialog::SetModal(bool flag)
{
wxAutoNSAutoreleasePool pool;
wxModalDialogs.Append(this);
- wxLogDebug(wxT("runModal"));
+ wxLogTrace(wxTRACE_COCOA,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
}
}
[wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow];
- wxLogDebug(wxT("runModal END"));
+ wxLogTrace(wxTRACE_COCOA,wxT("runModal END"));
}
else
{
- wxLogDebug(wxT("abortModal"));
+ wxLogTrace(wxTRACE_COCOA,wxT("abortModal"));
[wxTheApp->GetNSApplication() abortModal];
wxModalDialogs.DeleteObject(this);
}
closing.Append(this);
- wxLogDebug(wxT("Sending Cancel Event"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Sending Cancel Event"));
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
cancelEvent.SetEventObject( this );
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
void wxDialog::OnCancel(wxCommandEvent& event)
{
- wxLogDebug(wxT("Cancelled!"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Cancelled!"));
EndModal(wxID_CANCEL);
}
m_impl->SetExitCode(rc);
NSApplication *cocoaApp = [NSApplication sharedApplication];
- wxLogDebug(wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]);
wxTheApp->WakeUpIdle();
/* Notes:
If we're being called from idle time (which occurs while checking the
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
sbarheight = sbarRect.size.height;
}
- wxLogDebug(wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight);
+ wxLogTrace(wxTRACE_COCOA,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;
wxASSERT(win);
m_windowCurrent = win;
wxMenuBar *menubar = win->GetAppMenuBar(win);
- wxLogDebug(wxT("Found menubar=%p for window=%p."),menubar,win);
+ wxLogTrace(wxTRACE_COCOA,wxT("Found menubar=%p for window=%p."),menubar,win);
SetMenuBar(menubar);
}
void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
{
- wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild)
{
sm_cocoaDeactivateWindow = NULL;
void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void)
{
- wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this);
if(m_closed)
wxFrame::CocoaDelegate_windowDidResignKey();
else
void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void)
{
- wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent)
{
sm_cocoaDeactivateWindow = NULL;
void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void)
{
- wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this);
sm_cocoaDeactivateWindow = this;
}
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
wxAutoNSAutoreleasePool pool;
- wxLogDebug(wxT("append menu=%p, title=%s"),menu,title.c_str());
+ wxLogTrace(wxTRACE_COCOA,wxT("append menu=%p, title=%s"),menu,title.c_str());
if(!wxMenuBarBase::Append(menu,title))
return false;
wxASSERT(menu);
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
wxAutoNSAutoreleasePool pool;
- wxLogDebug(wxT("insert pos=%lu, menu=%p, title=%s"),pos,menu,title.c_str());
+ wxLogTrace(wxTRACE_COCOA,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))
- (void)wxMenuItemAction: (id)sender
{
- wxLogDebug(wxT("wxMenuItemAction"));
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction"));
wxMenuItem *item = wxMenuItem::GetFromCocoa(sender);
wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!"));
- (BOOL)validateMenuItem: (id)menuItem
{
// TODO: Do wxWindows validation here and avoid sending during idle time
- wxLogDebug(wxT("wxMenuItemAction"));
+ wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction"));
wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!"));
return item->IsEnabled();
void wxRadioButton::Cocoa_wxNSButtonAction(void)
{
- wxLogDebug(wxT("wxRadioButton"));
+ wxLogTrace(wxTRACE_COCOA,wxT("wxRadioButton"));
if(m_radioMaster && ([GetNSButton() state] == NSOnState))
{
for(wxRadioButtonList::compatibility_iterator slaveNode =
- (void)wxNSActionCellAction: (id)sender
{
- wxLogDebug(wxT("wxNSActionCellAction"));
+ wxLogTrace(wxTRACE_COCOA,wxT("wxNSActionCellAction"));
wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!"));
wxcontrol->CocoaTarget_wxNSActionCellAction();
untilMouseUp:NO])
{
m_mouseDownTool = NULL;
- wxLogDebug(wxT("Button was clicked after drag!"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!"));
}
[buttonCell setHighlighted: NO];
}
untilMouseUp:NO])
{
m_mouseDownTool = NULL;
- wxLogDebug(wxT("Button was clicked!"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!"));
}
[buttonCell setHighlighted: NO];
}
void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
{
bool need_debug = cocoaNSWindow || m_cocoaNSWindow;
- if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]);
+ if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]);
DisassociateNSWindow(m_cocoaNSWindow);
[cocoaNSWindow retain];
[m_cocoaNSWindow release];
else
SetNSView(NULL);
AssociateNSWindow(m_cocoaNSWindow);
- if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]);
+ if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]);
}
void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newView)
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
{
DeactivatePendingWindow();
- wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
{
- wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
{
- wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this);
}
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void)
{
- wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this);
+ wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this);
}
void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void)
void wxTopLevelWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
{
-// wxLogDebug("wxTopLevelWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height);
+ wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height);
NSRect cocoaRect = NSMakeRect(x,y,width,height);
[m_cocoaNSWindow setFrame: cocoaRect display:NO];
*w=(int)cocoaRect.size.width;
if(h)
*h=(int)cocoaRect.size.height;
-// wxLogDebug("wxTopLevelWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height);
+ wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height);
}
void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const
*x=(int)cocoaRect.origin.x;
if(y)
*y=(int)cocoaRect.origin.y;
-// wxLogDebug("wxTopLevelWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
+ wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
}
void wxWindowCocoaScroller::Cocoa_FrameChanged(void)
{
- wxLogDebug(wxT("Cocoa_FrameChanged"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged"));
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
event.SetEventObject(m_owner);
m_owner->GetEventHandler()->ProcessEvent(event);
void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
{
bool need_debug = cocoaNSView || m_cocoaNSView;
- if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]);
+ if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,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(wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]);
+ if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]);
}
WX_NSView wxWindowCocoa::GetNSViewForSuperview() const
bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
{
- wxLogDebug(wxT("Cocoa_drawRect"));
+ wxLogTrace(wxTRACE_COCOA,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.
{
wxMouseEvent event(wxEVT_MOTION);
InitMouseEvent(event,theEvent);
- wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
+ wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
return GetEventHandler()->ProcessEvent(event);
}
{
wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK);
InitMouseEvent(event,theEvent);
- wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]);
+ wxLogTrace(wxTRACE_COCOA,wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]);
return GetEventHandler()->ProcessEvent(event);
}
wxMouseEvent event(wxEVT_MOTION);
InitMouseEvent(event,theEvent);
event.m_leftDown = true;
- wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
+ wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
return GetEventHandler()->ProcessEvent(event);
}
{
wxMouseEvent event(wxEVT_LEFT_UP);
InitMouseEvent(event,theEvent);
- wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y);
+ wxLogTrace(wxTRACE_COCOA,wxT("Mouse Up @%d,%d"),event.m_x,event.m_y);
return GetEventHandler()->ProcessEvent(event);
}
void wxWindowCocoa::Cocoa_FrameChanged(void)
{
- wxLogDebug(wxT("Cocoa_FrameChanged"));
+ wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged"));
wxSizeEvent event(GetSize(), m_windowId);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
-// wxLogDebug("wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":".");
+ wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":".");
int currentX, currentY;
int currentW, currentH;
DoGetPosition(¤tX, ¤tY);
void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
{
wxAutoNSAutoreleasePool pool;
-// wxLogDebug("wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height);
+ wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height);
NSView *nsview = GetNSViewForSuperview();
NSView *superview = [nsview superview];
*w=(int)cocoaRect.size.width;
if(h)
*h=(int)cocoaRect.size.height;
-// wxLogDebug("wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height);
+ wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height);
}
void wxWindow::DoGetPosition(int *x, int *y) const
*x=(int)cocoaRect.origin.x;
if(y)
*y=(int)(parentRect.size.height-(cocoaRect.origin.y+cocoaRect.size.height));
-// wxLogDebug("wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
+ wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
}
WXWidget wxWindow::GetHandle() const
// Get size *available for subwindows* i.e. excluding menu bar etc.
void wxWindow::DoGetClientSize(int *x, int *y) const
{
- wxLogDebug(wxT("DoGetClientSize:"));
+ wxLogTrace(wxTRACE_COCOA,wxT("DoGetClientSize:"));
if(m_cocoaScroller)
m_cocoaScroller->DoGetClientSize(x,y);
else
void wxWindow::DoSetClientSize(int width, int height)
{
- wxLogDebug(wxT("DoSetClientSize=(%d,%d)"),width,height);
+ wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("DoSetClientSize=(%d,%d)"),width,height);
if(m_cocoaScroller)
m_cocoaScroller->ClientSizeToSize(width,height);
CocoaSetWxWindowSize(width,height);