support for simulating focus events since not all controls can be focused
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e5021b23c9
commit
3af58289f5
2 changed files with 20 additions and 0 deletions
|
|
@ -286,6 +286,7 @@ public:
|
|||
|
||||
virtual bool OSXHandleClicked( double timestampsec );
|
||||
virtual bool OSXHandleKeyEvent( wxKeyEvent& event );
|
||||
virtual void OSXSimulateFocusEvents();
|
||||
|
||||
bool IsNativeWindowWrapper() const { return m_isNativeWindowWrapper; }
|
||||
|
||||
|
|
|
|||
|
|
@ -602,6 +602,25 @@ void wxWindowMac::SetFocus()
|
|||
GetPeer()->SetFocus() ;
|
||||
}
|
||||
|
||||
void wxWindowMac::OSXSimulateFocusEvents()
|
||||
{
|
||||
wxWindow* former = FindFocus() ;
|
||||
if ( former != NULL && former != this )
|
||||
{
|
||||
{
|
||||
wxFocusEvent event( wxEVT_KILL_FOCUS, former->GetId());
|
||||
event.SetEventObject(former);
|
||||
former->HandleWindowEvent(event) ;
|
||||
}
|
||||
|
||||
{
|
||||
wxFocusEvent event(wxEVT_SET_FOCUS, former->GetId());
|
||||
event.SetEventObject(former);
|
||||
former->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindowMac::DoCaptureMouse()
|
||||
{
|
||||
wxApp::s_captureWindow = (wxWindow*) this ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue