Send activate/deactivate events for become/resign key

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott 2003-08-26 19:30:10 +00:00
parent 720e01c312
commit 5aa417d57c
2 changed files with 21 additions and 3 deletions

View File

@ -62,6 +62,8 @@ public:
virtual void Cocoa_close(void);
virtual bool Cocoa_windowShouldClose(void);
virtual void Cocoa_wxMenuItemAction(wxMenuItem& item);
virtual void CocoaNotification_DidBecomeKey(void);
virtual void CocoaNotification_DidResignKey(void);
protected:
void SetNSWindow(WX_NSWindow cocoaNSWindow);
WX_NSWindow m_cocoaNSWindow;

View File

@ -132,6 +132,22 @@ void wxTopLevelWindowCocoa::Cocoa_wxMenuItemAction(wxMenuItem& item)
{
}
void wxTopLevelWindowCocoa::CocoaNotification_DidBecomeKey(void)
{
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaNotification_DidBecomeKey",this);
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
void wxTopLevelWindowCocoa::CocoaNotification_DidResignKey(void)
{
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaNotification_DidResignKey",this);
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
void wxTopLevelWindowCocoa::Cocoa_close(void)
{
m_closed = true;
@ -248,7 +264,7 @@ void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(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);
// wxLogDebug("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];
@ -261,7 +277,7 @@ void wxTopLevelWindowCocoa::DoGetSize(int *w, int *h) const
*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);
// wxLogDebug("wxTopLevelWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height);
}
void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const
@ -271,6 +287,6 @@ 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);
// wxLogDebug("wxTopLevelWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
}