Use wxLogTrace instead of wxLogDebug for trace messages
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
- (void)wxNSControlAction: (id)sender
|
- (void)wxNSControlAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxNSControlAction"));
|
wxLogTrace(wxTRACE_COCOA,wxT("wxNSControlAction"));
|
||||||
wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
|
wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!"));
|
wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!"));
|
||||||
wxcontrol->CocoaTarget_action();
|
wxcontrol->CocoaTarget_action();
|
||||||
|
@@ -77,14 +77,14 @@
|
|||||||
|
|
||||||
- (BOOL)windowShouldClose: (id)sender
|
- (BOOL)windowShouldClose: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("windowShouldClose"));
|
wxLogTrace(wxTRACE_COCOA,wxT("windowShouldClose"));
|
||||||
wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender);
|
wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender);
|
||||||
if(tlw && !tlw->CocoaDelegate_windowShouldClose())
|
if(tlw && !tlw->CocoaDelegate_windowShouldClose())
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Window will not be closed"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Window will not be closed"));
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
wxLogDebug(wxT("Window will be closed"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Window will be closed"));
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication);
|
|||||||
&& ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode]))
|
&& ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode]))
|
||||||
{
|
{
|
||||||
sg_needIdle = false;
|
sg_needIdle = false;
|
||||||
wxLogDebug(wxT("Processing idle events"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Processing idle events"));
|
||||||
while(wxTheApp->ProcessIdle())
|
while(wxTheApp->ProcessIdle())
|
||||||
{
|
{
|
||||||
// Get the same events except don't block
|
// Get the same events except don't block
|
||||||
@@ -98,19 +98,19 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication);
|
|||||||
if(event)
|
if(event)
|
||||||
return event;
|
return event;
|
||||||
// we didn't get one, do some idle work
|
// 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
|
// No more idle work requested, block
|
||||||
wxLogDebug(wxT("Finished idle processing"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Finished idle processing"));
|
||||||
}
|
}
|
||||||
else
|
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];
|
return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendEvent: (NSEvent*)anEvent
|
- (void)sendEvent: (NSEvent*)anEvent
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("SendEvent"));
|
wxLogTrace(wxTRACE_COCOA,wxT("SendEvent"));
|
||||||
sg_needIdle = true;
|
sg_needIdle = true;
|
||||||
[super sendEvent: anEvent];
|
[super sendEvent: anEvent];
|
||||||
}
|
}
|
||||||
|
@@ -296,7 +296,7 @@ bool wxBitmap::Create(int w, int h, int d)
|
|||||||
bytesPerRow: 0
|
bytesPerRow: 0
|
||||||
bitsPerPixel: 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_ok = true;
|
||||||
M_BITMAPDATA->m_numColors = 0;
|
M_BITMAPDATA->m_numColors = 0;
|
||||||
M_BITMAPDATA->m_quality = 0;
|
M_BITMAPDATA->m_quality = 0;
|
||||||
|
@@ -32,10 +32,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxValidator& validator, const wxString& name)
|
const wxValidator& validator, const wxString& name)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
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))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -60,7 +60,7 @@ wxBitmapButton::~wxBitmapButton()
|
|||||||
|
|
||||||
void wxBitmapButton::Cocoa_wxNSButtonAction(void)
|
void wxBitmapButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("YAY!"));
|
wxLogTrace(wxTRACE_COCOA,wxT("YAY!"));
|
||||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
||||||
InitCommandEvent(event); // event.SetEventObject(this);
|
InitCommandEvent(event); // event.SetEventObject(this);
|
||||||
Command(event);
|
Command(event);
|
||||||
|
@@ -32,10 +32,10 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxValidator& validator, const wxString& name)
|
const wxValidator& validator, const wxString& name)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
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))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -60,7 +60,7 @@ wxButton::~wxButton()
|
|||||||
|
|
||||||
void wxButton::Cocoa_wxNSButtonAction(void)
|
void wxButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("YAY!"));
|
wxLogTrace(wxTRACE_COCOA,wxT("YAY!"));
|
||||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
||||||
InitCommandEvent(event); // event.SetEventObject(this);
|
InitCommandEvent(event); // event.SetEventObject(this);
|
||||||
Command(event);
|
Command(event);
|
||||||
|
@@ -113,7 +113,7 @@ wxCheckBoxState wxCheckBox::DoGet3StateValue() const
|
|||||||
|
|
||||||
void wxCheckBox::Cocoa_wxNSButtonAction(void)
|
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
|
// What we really want to do is override [NSCell -nextState] to return
|
||||||
// NSOnState in lieu of NSMixedState but this works (aside from the
|
// NSOnState in lieu of NSMixedState but this works (aside from the
|
||||||
// very slightly noticeable drawing of - and then a check) -DE
|
// very slightly noticeable drawing of - and then a check) -DE
|
||||||
|
@@ -122,7 +122,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio
|
|||||||
NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"];
|
NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"];
|
||||||
int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem];
|
int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem];
|
||||||
int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem];
|
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);
|
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
|
||||||
event.SetInt(index);
|
event.SetInt(index);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
@@ -45,10 +45,10 @@ bool wxControl::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxPoint& pos, const wxSize& size, long style,
|
const wxPoint& pos, const wxSize& size, long style,
|
||||||
const wxValidator& validator, const wxString& name)
|
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))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -78,7 +78,7 @@ wxSize wxControl::DoGetBestSize() const
|
|||||||
NSRect cocoaRect = [m_cocoaNSView frame];
|
NSRect cocoaRect = [m_cocoaNSView frame];
|
||||||
wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height);
|
wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height);
|
||||||
[m_cocoaNSView setFrame: storedRect];
|
[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;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -275,7 +275,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
[flipTransform concat];
|
[flipTransform concat];
|
||||||
#if 0
|
#if 0
|
||||||
// Draw+fill a rectangle so we can see where the shit is supposed to be.
|
// 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)];
|
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)];
|
||||||
[[NSColor blackColor] set];
|
[[NSColor blackColor] set];
|
||||||
[bezpath stroke];
|
[bezpath stroke];
|
||||||
@@ -455,7 +455,7 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Draw a rect so we can see where it's supposed to be
|
// 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())];
|
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,bmp.GetWidth(),bmp.GetHeight())];
|
||||||
[[NSColor blackColor] set];
|
[[NSColor blackColor] set];
|
||||||
[bezpath stroke];
|
[bezpath stroke];
|
||||||
|
@@ -71,13 +71,13 @@ bool wxWindowDC::CocoaUnlockFocusOnNSView()
|
|||||||
|
|
||||||
bool wxWindowDC::CocoaLockFocus()
|
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());
|
return CocoaLockFocusOnNSView(m_window->GetNonClientNSView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::CocoaUnlockFocus()
|
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();
|
return CocoaUnlockFocusOnNSView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,13 +115,13 @@ wxClientDC::~wxClientDC(void)
|
|||||||
|
|
||||||
bool wxClientDC::CocoaLockFocus()
|
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());
|
return CocoaLockFocusOnNSView(m_window->GetNSView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxClientDC::CocoaUnlockFocus()
|
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();
|
return CocoaUnlockFocusOnNSView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
|
|||||||
[transform concat];
|
[transform concat];
|
||||||
[flipTransform 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)
|
[m_cocoaNSImage drawAtPoint: NSMakePoint(0,0)
|
||||||
fromRect: NSMakeRect(xsrc,
|
fromRect: NSMakeRect(xsrc,
|
||||||
m_selectedBitmap.GetHeight()-height-ysrc,
|
m_selectedBitmap.GetHeight()-height-ysrc,
|
||||||
|
@@ -75,7 +75,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
// Because we do not release on close, the following release matches the
|
// Because we do not release on close, the following release matches the
|
||||||
// above alloc and thus the retain count will be 1.
|
// above alloc and thus the retain count will be 1.
|
||||||
[m_cocoaNSWindow release];
|
[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 setTitle:wxNSStringWithWxString(title)];
|
||||||
[m_cocoaNSWindow setHidesOnDeactivate:NO];
|
[m_cocoaNSWindow setHidesOnDeactivate:NO];
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
|
|
||||||
wxDialog::~wxDialog()
|
wxDialog::~wxDialog()
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Destroying"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Destroying"));
|
||||||
// setReleasedWhenClosed: NO
|
// setReleasedWhenClosed: NO
|
||||||
[m_cocoaNSWindow close];
|
[m_cocoaNSWindow close];
|
||||||
DisassociateNSPanel(GetNSPanel());
|
DisassociateNSPanel(GetNSPanel());
|
||||||
@@ -94,7 +94,7 @@ void wxDialog::CocoaDelegate_windowWillClose(void)
|
|||||||
{
|
{
|
||||||
m_closed = true;
|
m_closed = true;
|
||||||
/* Actually, this isn't true anymore */
|
/* 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)
|
void wxDialog::SetModal(bool flag)
|
||||||
@@ -124,7 +124,7 @@ bool wxDialog::Show(bool show)
|
|||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxModalDialogs.Append(this);
|
wxModalDialogs.Append(this);
|
||||||
wxLogDebug(wxT("runModal"));
|
wxLogTrace(wxTRACE_COCOA,wxT("runModal"));
|
||||||
NSApplication *theNSApp = wxTheApp->GetNSApplication();
|
NSApplication *theNSApp = wxTheApp->GetNSApplication();
|
||||||
// If the app hasn't started, flush the event queue
|
// If the app hasn't started, flush the event queue
|
||||||
// If we don't do this, the Dock doesn't get the message that
|
// 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];
|
[wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow];
|
||||||
wxLogDebug(wxT("runModal END"));
|
wxLogTrace(wxTRACE_COCOA,wxT("runModal END"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("abortModal"));
|
wxLogTrace(wxTRACE_COCOA,wxT("abortModal"));
|
||||||
[wxTheApp->GetNSApplication() abortModal];
|
[wxTheApp->GetNSApplication() abortModal];
|
||||||
wxModalDialogs.DeleteObject(this);
|
wxModalDialogs.DeleteObject(this);
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
|
|
||||||
closing.Append(this);
|
closing.Append(this);
|
||||||
|
|
||||||
wxLogDebug(wxT("Sending Cancel Event"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Sending Cancel Event"));
|
||||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||||
cancelEvent.SetEventObject( this );
|
cancelEvent.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
|
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
|
||||||
@@ -230,7 +230,7 @@ void wxDialog::OnApply(wxCommandEvent& event)
|
|||||||
|
|
||||||
void wxDialog::OnCancel(wxCommandEvent& event)
|
void wxDialog::OnCancel(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Cancelled!"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Cancelled!"));
|
||||||
EndModal(wxID_CANCEL);
|
EndModal(wxID_CANCEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ void wxEventLoop::Exit(int rc)
|
|||||||
m_impl->SetExitCode(rc);
|
m_impl->SetExitCode(rc);
|
||||||
|
|
||||||
NSApplication *cocoaApp = [NSApplication sharedApplication];
|
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();
|
wxTheApp->WakeUpIdle();
|
||||||
/* Notes:
|
/* Notes:
|
||||||
If we're being called from idle time (which occurs while checking the
|
If we're being called from idle time (which occurs while checking the
|
||||||
|
@@ -165,7 +165,7 @@ void wxFrame::UpdateFrameNSView()
|
|||||||
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
|
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
|
||||||
sbarheight = sbarRect.size.height;
|
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];
|
NSRect innerRect = [m_cocoaNSView frame];
|
||||||
innerRect.size.height = frameRect.size.height - tbarheight - sbarheight;
|
innerRect.size.height = frameRect.size.height - tbarheight - sbarheight;
|
||||||
innerRect.origin.y = sbarheight;
|
innerRect.origin.y = sbarheight;
|
||||||
|
@@ -273,7 +273,7 @@ void wxMenuBarManager::InstallMenuBarForWindow(wxCocoaNSWindow *win)
|
|||||||
wxASSERT(win);
|
wxASSERT(win);
|
||||||
m_windowCurrent = win;
|
m_windowCurrent = win;
|
||||||
wxMenuBar *menubar = win->GetAppMenuBar(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);
|
SetMenuBar(menubar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -158,7 +158,7 @@ wxMenuBar *wxMDIParentFrame::GetAppMenuBar(wxCocoaNSWindow *win)
|
|||||||
|
|
||||||
void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
|
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)
|
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild)
|
||||||
{
|
{
|
||||||
sm_cocoaDeactivateWindow = NULL;
|
sm_cocoaDeactivateWindow = NULL;
|
||||||
@@ -183,7 +183,7 @@ void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
|
|
||||||
void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void)
|
void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
wxLogTrace(wxTRACE_COCOA,wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
if(m_closed)
|
if(m_closed)
|
||||||
wxFrame::CocoaDelegate_windowDidResignKey();
|
wxFrame::CocoaDelegate_windowDidResignKey();
|
||||||
else
|
else
|
||||||
@@ -280,7 +280,7 @@ void wxMDIChildFrame::Activate()
|
|||||||
|
|
||||||
void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void)
|
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)
|
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent)
|
||||||
{
|
{
|
||||||
sm_cocoaDeactivateWindow = NULL;
|
sm_cocoaDeactivateWindow = NULL;
|
||||||
@@ -299,7 +299,7 @@ void wxMDIChildFrame::CocoaDelegate_windowDidBecomeMain(void)
|
|||||||
|
|
||||||
void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void)
|
void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
wxLogTrace(wxTRACE_COCOA,wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
sm_cocoaDeactivateWindow = this;
|
sm_cocoaDeactivateWindow = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -106,7 +106,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
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))
|
if(!wxMenuBarBase::Append(menu,title))
|
||||||
return false;
|
return false;
|
||||||
wxASSERT(menu);
|
wxASSERT(menu);
|
||||||
@@ -126,7 +126,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
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
|
// Get the current menu at this position
|
||||||
wxMenu *nextmenu = GetMenu(pos);
|
wxMenu *nextmenu = GetMenu(pos);
|
||||||
if(!wxMenuBarBase::Insert(pos,menu,title))
|
if(!wxMenuBarBase::Insert(pos,menu,title))
|
||||||
|
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
- (void)wxMenuItemAction: (id)sender
|
- (void)wxMenuItemAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxMenuItemAction"));
|
wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction"));
|
||||||
wxMenuItem *item = wxMenuItem::GetFromCocoa(sender);
|
wxMenuItem *item = wxMenuItem::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!"));
|
wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!"));
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
- (BOOL)validateMenuItem: (id)menuItem
|
- (BOOL)validateMenuItem: (id)menuItem
|
||||||
{
|
{
|
||||||
// TODO: Do wxWindows validation here and avoid sending during idle time
|
// TODO: Do wxWindows validation here and avoid sending during idle time
|
||||||
wxLogDebug(wxT("wxMenuItemAction"));
|
wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction"));
|
||||||
wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
|
wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
|
||||||
wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!"));
|
wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!"));
|
||||||
return item->IsEnabled();
|
return item->IsEnabled();
|
||||||
|
@@ -140,7 +140,7 @@ bool wxRadioButton::GetValue() const
|
|||||||
|
|
||||||
void wxRadioButton::Cocoa_wxNSButtonAction(void)
|
void wxRadioButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxRadioButton"));
|
wxLogTrace(wxTRACE_COCOA,wxT("wxRadioButton"));
|
||||||
if(m_radioMaster && ([GetNSButton() state] == NSOnState))
|
if(m_radioMaster && ([GetNSButton() state] == NSOnState))
|
||||||
{
|
{
|
||||||
for(wxRadioButtonList::compatibility_iterator slaveNode =
|
for(wxRadioButtonList::compatibility_iterator slaveNode =
|
||||||
|
@@ -71,7 +71,7 @@ protected:
|
|||||||
|
|
||||||
- (void)wxNSActionCellAction: (id)sender
|
- (void)wxNSActionCellAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxNSActionCellAction"));
|
wxLogTrace(wxTRACE_COCOA,wxT("wxNSActionCellAction"));
|
||||||
wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
|
wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!"));
|
wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!"));
|
||||||
wxcontrol->CocoaTarget_wxNSActionCellAction();
|
wxcontrol->CocoaTarget_wxNSActionCellAction();
|
||||||
@@ -297,7 +297,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
|
|||||||
untilMouseUp:NO])
|
untilMouseUp:NO])
|
||||||
{
|
{
|
||||||
m_mouseDownTool = NULL;
|
m_mouseDownTool = NULL;
|
||||||
wxLogDebug(wxT("Button was clicked after drag!"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!"));
|
||||||
}
|
}
|
||||||
[buttonCell setHighlighted: NO];
|
[buttonCell setHighlighted: NO];
|
||||||
}
|
}
|
||||||
@@ -320,7 +320,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
|
|||||||
untilMouseUp:NO])
|
untilMouseUp:NO])
|
||||||
{
|
{
|
||||||
m_mouseDownTool = NULL;
|
m_mouseDownTool = NULL;
|
||||||
wxLogDebug(wxT("Button was clicked!"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!"));
|
||||||
}
|
}
|
||||||
[buttonCell setHighlighted: NO];
|
[buttonCell setHighlighted: NO];
|
||||||
}
|
}
|
||||||
|
@@ -168,7 +168,7 @@ wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win)
|
|||||||
void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
||||||
{
|
{
|
||||||
bool need_debug = cocoaNSWindow || m_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);
|
DisassociateNSWindow(m_cocoaNSWindow);
|
||||||
[cocoaNSWindow retain];
|
[cocoaNSWindow retain];
|
||||||
[m_cocoaNSWindow release];
|
[m_cocoaNSWindow release];
|
||||||
@@ -178,7 +178,7 @@ void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
|||||||
else
|
else
|
||||||
SetNSView(NULL);
|
SetNSView(NULL);
|
||||||
AssociateNSWindow(m_cocoaNSWindow);
|
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::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)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
||||||
{
|
{
|
||||||
DeactivatePendingWindow();
|
DeactivatePendingWindow();
|
||||||
wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -205,7 +205,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
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());
|
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -213,12 +213,12 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
|||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
|
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)
|
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::CocoaDelegate_windowWillClose(void)
|
||||||
@@ -336,7 +336,7 @@ void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(int width, int height)
|
|||||||
|
|
||||||
void wxTopLevelWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
|
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);
|
NSRect cocoaRect = NSMakeRect(x,y,width,height);
|
||||||
[m_cocoaNSWindow setFrame: cocoaRect display:NO];
|
[m_cocoaNSWindow setFrame: cocoaRect display:NO];
|
||||||
@@ -349,7 +349,7 @@ void wxTopLevelWindowCocoa::DoGetSize(int *w, int *h) const
|
|||||||
*w=(int)cocoaRect.size.width;
|
*w=(int)cocoaRect.size.width;
|
||||||
if(h)
|
if(h)
|
||||||
*h=(int)cocoaRect.size.height;
|
*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
|
void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const
|
||||||
@@ -359,6 +359,6 @@ void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const
|
|||||||
*x=(int)cocoaRect.origin.x;
|
*x=(int)cocoaRect.origin.x;
|
||||||
if(y)
|
if(y)
|
||||||
*y=(int)cocoaRect.origin.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -216,7 +216,7 @@ void wxWindowCocoaScroller::DoGetClientSize(int *x, int *y) const
|
|||||||
|
|
||||||
void wxWindowCocoaScroller::Cocoa_FrameChanged(void)
|
void wxWindowCocoaScroller::Cocoa_FrameChanged(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Cocoa_FrameChanged"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged"));
|
||||||
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
|
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
|
||||||
event.SetEventObject(m_owner);
|
event.SetEventObject(m_owner);
|
||||||
m_owner->GetEventHandler()->ProcessEvent(event);
|
m_owner->GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -302,13 +302,13 @@ void wxWindowCocoa::CocoaRemoveFromParent(void)
|
|||||||
void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
|
void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
|
||||||
{
|
{
|
||||||
bool need_debug = cocoaNSView || m_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);
|
DisassociateNSView(m_cocoaNSView);
|
||||||
[cocoaNSView retain];
|
[cocoaNSView retain];
|
||||||
[m_cocoaNSView release];
|
[m_cocoaNSView release];
|
||||||
m_cocoaNSView = cocoaNSView;
|
m_cocoaNSView = cocoaNSView;
|
||||||
AssociateNSView(m_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
|
WX_NSView wxWindowCocoa::GetNSViewForSuperview() const
|
||||||
@@ -329,7 +329,7 @@ WX_NSView wxWindowCocoa::GetNSViewForHiding() const
|
|||||||
|
|
||||||
bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
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
|
// Recursion can happen if the event loop runs from within the paint
|
||||||
// handler. For instance, if an assertion dialog is shown.
|
// handler. For instance, if an assertion dialog is shown.
|
||||||
// FIXME: This seems less than ideal.
|
// FIXME: This seems less than ideal.
|
||||||
@@ -370,7 +370,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent)
|
|||||||
{
|
{
|
||||||
wxMouseEvent event(wxEVT_MOTION);
|
wxMouseEvent event(wxEVT_MOTION);
|
||||||
InitMouseEvent(event,theEvent);
|
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);
|
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);
|
wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK);
|
||||||
InitMouseEvent(event,theEvent);
|
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);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent)
|
|||||||
wxMouseEvent event(wxEVT_MOTION);
|
wxMouseEvent event(wxEVT_MOTION);
|
||||||
InitMouseEvent(event,theEvent);
|
InitMouseEvent(event,theEvent);
|
||||||
event.m_leftDown = true;
|
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);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent)
|
|||||||
{
|
{
|
||||||
wxMouseEvent event(wxEVT_LEFT_UP);
|
wxMouseEvent event(wxEVT_LEFT_UP);
|
||||||
InitMouseEvent(event,theEvent);
|
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);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ bool wxWindowCocoa::Cocoa_otherMouseUp(WX_NSEvent theEvent)
|
|||||||
|
|
||||||
void wxWindowCocoa::Cocoa_FrameChanged(void)
|
void wxWindowCocoa::Cocoa_FrameChanged(void)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Cocoa_FrameChanged"));
|
wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged"));
|
||||||
wxSizeEvent event(GetSize(), m_windowId);
|
wxSizeEvent event(GetSize(), m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -528,7 +528,7 @@ bool wxWindow::Show(bool show)
|
|||||||
|
|
||||||
void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
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 currentX, currentY;
|
||||||
int currentW, currentH;
|
int currentW, currentH;
|
||||||
DoGetPosition(¤tX, ¤tY);
|
DoGetPosition(¤tX, ¤tY);
|
||||||
@@ -569,7 +569,7 @@ void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags
|
|||||||
void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
|
void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
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 *nsview = GetNSViewForSuperview();
|
||||||
NSView *superview = [nsview superview];
|
NSView *superview = [nsview superview];
|
||||||
@@ -614,7 +614,7 @@ void wxWindow::DoGetSize(int *w, int *h) const
|
|||||||
*w=(int)cocoaRect.size.width;
|
*w=(int)cocoaRect.size.width;
|
||||||
if(h)
|
if(h)
|
||||||
*h=(int)cocoaRect.size.height;
|
*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
|
void wxWindow::DoGetPosition(int *x, int *y) const
|
||||||
@@ -629,7 +629,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const
|
|||||||
*x=(int)cocoaRect.origin.x;
|
*x=(int)cocoaRect.origin.x;
|
||||||
if(y)
|
if(y)
|
||||||
*y=(int)(parentRect.size.height-(cocoaRect.origin.y+cocoaRect.size.height));
|
*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
|
WXWidget wxWindow::GetHandle() const
|
||||||
@@ -672,7 +672,7 @@ void wxWindow::DoClientToScreen(int *x, int *y) const
|
|||||||
// Get size *available for subwindows* i.e. excluding menu bar etc.
|
// Get size *available for subwindows* i.e. excluding menu bar etc.
|
||||||
void wxWindow::DoGetClientSize(int *x, int *y) const
|
void wxWindow::DoGetClientSize(int *x, int *y) const
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("DoGetClientSize:"));
|
wxLogTrace(wxTRACE_COCOA,wxT("DoGetClientSize:"));
|
||||||
if(m_cocoaScroller)
|
if(m_cocoaScroller)
|
||||||
m_cocoaScroller->DoGetClientSize(x,y);
|
m_cocoaScroller->DoGetClientSize(x,y);
|
||||||
else
|
else
|
||||||
@@ -681,7 +681,7 @@ void wxWindow::DoGetClientSize(int *x, int *y) const
|
|||||||
|
|
||||||
void wxWindow::DoSetClientSize(int width, int height)
|
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)
|
if(m_cocoaScroller)
|
||||||
m_cocoaScroller->ClientSizeToSize(width,height);
|
m_cocoaScroller->ClientSizeToSize(width,height);
|
||||||
CocoaSetWxWindowSize(width,height);
|
CocoaSetWxWindowSize(width,height);
|
||||||
|
Reference in New Issue
Block a user