[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 969
Date : Sun May 7 16:20:58 BST 2006
Changed paths:
M /Trunk/XaraLX/wxOil/camview.cpp
M /Trunk/XaraLX/wxOil/camview.h
M /Trunk/XaraLX/wxOil/keypress.cpp
M /Trunk/XaraLX/wxOil/rendwnd.cpp
Place keyhandler in renderwindow which is engineered to have focus most of the time, seems to fix the key problem reported by Charles
Diff:
Index: Trunk/XaraLX/wxOil/rendwnd.cpp
===================================================================
--- Trunk/XaraLX/wxOil/rendwnd.cpp (revision 968)
+++ Trunk/XaraLX/wxOil/rendwnd.cpp (revision 969)
@@ -107,8 +107,10 @@
//#include "palman.h"
#include "ccdc.h"
//#include "prncamvw.h"
+#include "docview.h"
#include "camview.h"
#include "camframe.h"
+#include "keypress.h"
DECLARE_SOURCE("$Revision$");
@@ -373,13 +375,13 @@
/*********************************************************************************************
> void CRenderWnd::OnKey( wxKeyEvent & event )
- Author: Alex Bligh <alex@xxxxxxxxxxx>
- Created: 4 May 2006
- Inputs: pointer to the event
+ Author: Luke_Hart <lukeh@xxxxxxxx>
+ Created: 7 May 2006
+ Inputs: reference to the event
Outputs: -
Returns: -
- Purpose: THIS DOES NOT PROCESS KEYS. It merely notes a key has been pressed and
- stops the mouse motion mangler eating the next mouse move
+ Purpose: This now the main keypress handling function. It also notes a key has been
+ pressed and stops the mouse motion mangler eating the next mouse move.
Errors: -
Scope: Protected
SeeAlso: -
@@ -388,9 +390,20 @@
void CRenderWnd::OnKey( wxKeyEvent & event )
{
+ // This is Alex Blighs (alex@xxxxxxxxxxx) mouse skip inhibition code
if (m_pView)
m_pView->DontSkipNextMouse();
+
+ // Make sure the kernel knows which view/doc the event applies to, if any.
+ if( NULL != Document::GetSelected() )
+ Document::GetSelected()->SetCurrent();
+ if( NULL != DocView::GetSelected() )
+ DocView::GetSelected()->SetCurrent();
+ // Process keyboard messages
+ if( !CCamFrame::GetMainFrame()->IsIconized() && KeyPress::TranslateMessage( &event ) )
+ return;
+
event.Skip(); // Pass the key event on to someone who really wants it.
}
Index: Trunk/XaraLX/wxOil/camview.h
===================================================================
--- Trunk/XaraLX/wxOil/camview.h (revision 968)
+++ Trunk/XaraLX/wxOil/camview.h (revision 969)
@@ -249,7 +249,6 @@
void OnMouseWheel( wxMouseEvent &event );
void OnScroll( wxScrollEvent &event);
void OnDragIdle( wxTimerEvent &event); // OnTimer(DragIdleID)
- void OnKeyEvent( wxKeyEvent& event );
void OnSetCursor( wxSetCursorEvent& event );
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp (revision 968)
+++ Trunk/XaraLX/wxOil/camview.cpp (revision 969)
@@ -107,7 +107,6 @@
#include "csrstack.h"
#include "rendwnd.h"
-#include "keypress.h"
#include "docview.h"
#include "prntview.h"
#include "osrndrgn.h"
@@ -148,9 +147,6 @@
EVT_SIZE(CCamView::OnSize)
EVT_SCROLL(CCamView::OnScroll)
EVT_TIMER(DragIdleID, CCamView::OnDragIdle)
-
- EVT_KEY_UP( CCamView::OnKeyEvent )
- EVT_KEY_DOWN( CCamView::OnKeyEvent )
END_EVENT_TABLE()
/*********************************************************************************************
@@ -2995,37 +2991,7 @@
}
}
-
/*********************************************************************************************
-> void CCamView::OnKeyEvent(wxKeyEvent& event)
-
- Author: Luke_Hart (Xara Group Ltd) <lukeh@xxxxxxxx>
- Created: 05/05/06
- Inputs: wxKeyEvent& event - The event object
- Outputs: -
- Returns: -
- Purpose: Forward the keypress event to the central key handler
- Errors: -
- Scope: Protected
- SeeAlso:
-**********************************************************************************************/
-
-void CCamView::OnKeyEvent( wxKeyEvent &event )
-{
- // Make sure the kernel knows which view/doc the event applies to, if any.
- if( NULL != Document::GetSelected() )
- Document::GetSelected()->SetCurrent();
- if( NULL != DocView::GetSelected() )
- DocView::GetSelected()->SetCurrent();
-
- // Process keyboard messages
- if( !CCamFrame::GetMainFrame()->IsIconized() && KeyPress::TranslateMessage( &event ) )
- return;
-
- event.Skip();
-}
-
-/*********************************************************************************************
> void CCamView::ScrollTo(const WorkCoord& offset)
Author: Justin_Flude (Xara Group Ltd) <camelotdev@xxxxxxxx>
Index: Trunk/XaraLX/wxOil/keypress.cpp
===================================================================
--- Trunk/XaraLX/wxOil/keypress.cpp (revision 968)
+++ Trunk/XaraLX/wxOil/keypress.cpp (revision 969)
@@ -1618,6 +1618,9 @@
if (KeyDown || KeyUp)
ControlHelper::BubbleHelpDisable();
#endif
+
+ TRACEUSER( "jlh92", _T("TM - %s
"), wxEVT_KEY_DOWN == pMsg->GetEventType() ? _T("KDN") :
+ wxEVT_KEY_UP == pMsg->GetEventType() ? _T("KUP") : _T("K??") );
// Normal key processing.
KeyPress* pKeyPress;
Xara