[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : phil
Repository : xara
Revision : 1455
Date : Mon Jul 17 14:31:13 BST 2006
Changed paths:
M /Trunk/XaraLX/wxOil/camview.cpp
M /Trunk/XaraLX/wxOil/camview.h
Overloads of HandleDragEvent and InvokeDragOp that take kernel ClickModifiers params in place of raw click modifier flags
Diff:
Index: Trunk/XaraLX/wxOil/camview.h
===================================================================
--- Trunk/XaraLX/wxOil/camview.h (revision 1454)
+++ Trunk/XaraLX/wxOil/camview.h (revision 1455)
@@ -275,6 +275,7 @@
protected:
void HandleDragEvent(UINT32 Button, UINT32 nFlags, wxPoint point, ClickType t);
+ void HandleDragEvent(UINT32 Button, ClickModifiers clickmods, wxPoint point, ClickType t);
BOOL HandleMouseWheelEvent( wxMouseEvent &event );
void HandleDragScrolling(wxPoint point);
void CalcScrollDeltas(wxPoint point, WinRect wrSize, INT32* dx, INT32* dy);
@@ -296,6 +297,7 @@
// Useful esp. for drag ops that are not connected to a particular tool and/or started
// from clicks outside the view, e.g. Creating guidelines by clicking on a ruler window
BOOL InvokeDragOp(String_256* pOpToken,OpParam* pParam,UINT32 Flags,wxPoint point);
+ BOOL InvokeDragOp(String_256* pOpToken,OpParam* pParam,ClickModifiers clickmods,wxPoint point);
// Function to test if there is another mouse move message in the queue
BOOL IsWaitingMouseMove();
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp (revision 1454)
+++ Trunk/XaraLX/wxOil/camview.cpp (revision 1455)
@@ -4086,11 +4086,13 @@
/********************************************************************************************
> void CCamView::HandleDragEvent(UINT32 Button, UINT32 nFlags, wxPoint point, ClickType t) const
+> void CCamView::HandleDragEvent(UINT32 Button, ClickModifiers clickmods, wxPoint point, ClickType t)
Author: Justin_Flude (Xara Group Ltd) <camelotdev@xxxxxxxx>
Created: ages ago
Inputs: Button - the actual button being pressed for a click/double click event.
nFlags - The mouse button flags
+ clickmods - The kernel abstraction of the modifiers
point - the coordinate of the mouse cursor
t - the kind of mouse event (button up/down, move, drag start/finish etc.)
Outputs: -
@@ -4126,6 +4128,14 @@
void CCamView::HandleDragEvent(UINT32 Button, UINT32 nFlags, wxPoint point, ClickType t)
{
+ // Find out which buttons etc are down.
+ ClickModifiers clickmods = ClickModifiers::GetClickModifiers(nFlags);
+
+ HandleDragEvent(Button, clickmods, point, t);
+}
+
+void CCamView::HandleDragEvent(UINT32 Button, ClickModifiers clickmods, wxPoint point, ClickType t)
+{
if (DocView::GetSelected() != pDocView)
{
// TRACEUSER( "JustinF", _T("Ignored drag-event cos not in the selected view
"));
@@ -4150,7 +4160,7 @@
SetCurrentStates();
// Find out which buttons etc are down.
- LastClickMods = ClickModifiers::GetClickModifiers(nFlags);
+ LastClickMods = clickmods;
// If it's the first single click, then reset the drag delay timer, and ask for a
// Windows timer.
@@ -4609,6 +4619,7 @@
/*********************************************************************************************
> BOOL CCamView::InvokeDragOp(String_256 OpToken,UINT32 Flags,wxPoint point,OpParam* pParam)
+> BOOL CCamView::InvokeDragOp(String_256 OpToken,ClickModifiers clickmods,wxPoint point,OpParam* pParam)
Author: Mark_Neves (Xara Group Ltd) <camelotdev@xxxxxxxx>
Created: 21/9/95
@@ -4617,6 +4628,7 @@
NOTE! Object at *pParam must have a long life time. I.e. do NOT
call this func with ptr to a local OpParam var
Flags = flags that specify which modifiers were down during the click
+ clickmods = Kernel abstraction of modifiers
point = screen coord of the start of the drag
Outputs: -
Returns: Returns TRUE if successful. Returns FALSE if not
@@ -4663,13 +4675,26 @@
return TRUE;
}
+BOOL CCamView::InvokeDragOp(String_256* pOpToken, OpParam* pParam, ClickModifiers clickmods, wxPoint point)
+{
+ DragOpToken = *pOpToken;
+ pDragOpParam = pParam;
+ DragOpInvoke = TRUE;
+ // NOTE: May need to post a pseudo mouse event here if some of the subtleties of click
+ // handling are required, but this works fine for simple drags
+ HandleDragEvent(MK_LBUTTON, clickmods, point, CLICKTYPE_SINGLE);
+ return TRUE;
+}
+
+
+
/********************************************************************************************
> BOOL CCamView::ChangeDragType(DragType Type)
Xara