diff --git a/checkin_notes b/checkin_notes index 22813c60f4..eb78bcf06a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6008,3 +6008,13 @@ Jeff 23 June 2009 ops/ db_update.php +Rom 23 June 2009 + - MGR: Remove event handlers for wxEVT_SET_FOCUS and wxEVT_KILL_FOCUS, + we are no longer removing the highlight on a project unless + a new project is selected. This continues to show that a certain + project is still selected even when you switch to the ProjectURL + control. Anyways, the Mac doesn't like the focus events. + + clientgui/ + ProjectListCtrl.cpp, .h + \ No newline at end of file diff --git a/clientgui/ProjectListCtrl.cpp b/clientgui/ProjectListCtrl.cpp index 0f74d8eb08..4139123e6c 100644 --- a/clientgui/ProjectListCtrl.cpp +++ b/clientgui/ProjectListCtrl.cpp @@ -125,7 +125,7 @@ void CProjectListCtrl::CreateControls() * event handler for window */ -void CProjectListCtrl::OnItemChange( wxFocusEvent& event ) { +void CProjectListCtrl::OnItemChange( wxMouseEvent& event ) { // Fire an event for the parent window notifing it of the new selection. CProjectListItemCtrl* pSelectedItem = wxDynamicCast(event.GetEventObject(), CProjectListItemCtrl); @@ -178,7 +178,7 @@ void CProjectListCtrl::OnItemDisplay( wxCommandEvent& event ) { * event handler for window */ -void CProjectListCtrl::OnItemFocusChange( wxFocusEvent& event ) { +void CProjectListCtrl::OnItemFocusChange( wxMouseEvent& event ) { if ( wxEVT_SET_FOCUS == event.GetEventType() ) { // Reset the background color back to the default @@ -321,8 +321,6 @@ BEGIN_EVENT_TABLE( CProjectListItemCtrl, wxPanel ) EVT_LEAVE_WINDOW( CProjectListItemCtrl::OnMouseEnterLeave ) EVT_LEFT_DOWN( CProjectListItemCtrl::OnMouseClick ) EVT_LEFT_UP( CProjectListItemCtrl::OnMouseClick ) - EVT_SET_FOCUS( CProjectListItemCtrl::OnFocusChange ) - EVT_KILL_FOCUS( CProjectListItemCtrl::OnFocusChange ) EVT_KEY_DOWN( CProjectListItemCtrl::OnKeyPressed ) EVT_KEY_UP( CProjectListItemCtrl::OnKeyPressed ) EVT_BUTTON( ID_WEBSITEBUTTON, CProjectListItemCtrl::OnWebsiteButtonClick ) @@ -416,7 +414,10 @@ void CProjectListItemCtrl::OnMouseClick( wxMouseEvent& event ) { m_bLeftButtonDownDetected = true; } else { if ( m_bLeftButtonDownDetected ) { - SetFocus(); + CProjectListCtrl* pParent = wxDynamicCast(GetParent(), CProjectListCtrl); + if (pParent) { + pParent->OnItemFocusChange( event ); + } } } event.Skip(); @@ -424,18 +425,6 @@ void CProjectListItemCtrl::OnMouseClick( wxMouseEvent& event ) { } -/*! - * wxEVT_SET_FOCUS, wxEVT_KILL_FOCUS event handler for window - */ - -void CProjectListItemCtrl::OnFocusChange( wxFocusEvent& event ) { - CProjectListCtrl* pParent = wxDynamicCast(GetParent(), CProjectListCtrl); - if (pParent) { - pParent->OnItemFocusChange( event ); - } -} - - /*! * wxEVT_KEY_DOWN, wxEVT_KEY_UP event handler for window */ diff --git a/clientgui/ProjectListCtrl.h b/clientgui/ProjectListCtrl.h index 234030e4b2..6bf8dcbd6f 100644 --- a/clientgui/ProjectListCtrl.h +++ b/clientgui/ProjectListCtrl.h @@ -27,7 +27,6 @@ class CProjectListItemCtrl; class CProjectListItemStaticCtrl; class CProjectListItemBitmapCtrl; class ProjectListCtrlEvent; -class ProjectListItemCtrlEvent; ////@begin control identifiers @@ -59,13 +58,13 @@ public: ////@begin CProjectListCtrl event handler declarations /// event handler for window - void OnItemChange( wxFocusEvent& event ); + void OnItemChange( wxMouseEvent& event ); /// event handler for window void OnItemDisplay( wxCommandEvent& event ); /// event handler for window - void OnItemFocusChange( wxFocusEvent& event ); + void OnItemFocusChange( wxMouseEvent& event ); /// wxEVT_SET_FOCUS, wxEVT_KILL_FOCUS event handler for window void OnFocusChanged( wxFocusEvent& event ); @@ -167,9 +166,6 @@ public: /// wxEVT_LEFT_DOWN, wxEVT_LEFT_UP event handler for window void OnMouseClick( wxMouseEvent& event ); - /// wxEVT_SET_FOCUS, wxEVT_KILL_FOCUS event handler for window - void OnFocusChange( wxFocusEvent& event ); - /// wxEVT_KEY_DOWN, wxEVT_KEY_UP event handler for window void OnKeyPressed( wxKeyEvent& event );