clikmods.cpp

Go to the documentation of this file.
00001 // $Id: clikmods.cpp 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 // Implements click modifiers class
00099 
00100 /*
00101 */
00102 
00103 #include "camtypes.h"
00104 //#include "clikmods.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 #include "pen.h"
00106 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 //#include "binds.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 //#include "wxXtra/wxmousestate.h"
00109 //#include "phil.h"
00110 
00111 DECLARE_SOURCE($Revision: 1282 $);
00112 
00113 CC_IMPLEMENT_MEMDUMP(ClickModifiers,CCObject);
00114 
00115 // Declare smart memory handling in Debug builds
00116 #define new CAM_DEBUG_NEW
00117 
00118 UINT32 ClickModifiers::ButtFuncNames[]= {
00119                         _R(IDS_BUTTFUNC_NORMAL),
00120                         _R(IDS_BUTTFUNC_SHIFT),
00121                         _R(IDS_BUTTFUNC_CONSTRAIN),
00122                         _R(IDS_BUTTFUNC_ALTERNATIVE),
00123                         _R(IDS_BUTTFUNC_MENU),
00124 //                      _R(IDS_BUTTFUNC_EDITOBJECT),
00125                         _R(IDS_BUTTFUNC_FULLSCREEN),
00126                         _R(IDS_BUTTFUNC_ZOOMIN),
00127                         _R(IDS_BUTTFUNC_PUSHCENTRE)
00128                         };
00129 
00130 
00131 
00132 /********************************************************************************************
00133 
00134     Preference: LeftButtonFunction
00135     Section:    Mouse
00136     Range:      ButtonFunction enum
00137     Purpose:    Determine the action of the left mouse button.
00138 
00139 ********************************************************************************************/
00140 
00141 ButtonFunction  ClickModifiers::LeftButtonFunction = BUTTFUNC_NORMAL;
00142 
00143 
00144 
00145 
00146 /********************************************************************************************
00147 
00148     Preference: MiddleButtonFunction
00149     Section:    Mouse
00150     Range:      ButtonFunction enum
00151     Purpose:    Determine the action of the middle mouse button.
00152 
00153 ********************************************************************************************/
00154 
00155 ButtonFunction  ClickModifiers::MiddleButtonFunction = BUTTFUNC_PUSHCENTRE;
00156 
00157 
00158 
00159 
00160 /********************************************************************************************
00161 
00162     Preference: RightButtonFunction
00163     Section:    Mouse
00164     Range:      ButtonFunction enum
00165     Purpose:    Determine the action of the right mouse button.
00166 
00167 ********************************************************************************************/
00168 
00169 #ifndef STANDALONE
00170 ButtonFunction  ClickModifiers::RightButtonFunction = BUTTFUNC_MENU;
00171 #else
00172 ButtonFunction  ClickModifiers::RightButtonFunction = BUTTFUNC_SHIFT;
00173 #endif
00174 
00175 
00176 
00177 /********************************************************************************************
00178 
00179 >   static BOOL ClickModifiers::DeclarePrefs()
00180 
00181     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00182     Created:    09/03/95
00183     Returns:    TRUE if it worked, FALSE if it failed
00184     Purpose:    Declares any preferences that the ClickModifiers class needs to declare
00185 
00186 ********************************************************************************************/
00187 
00188 BOOL ClickModifiers::DeclarePrefs()
00189 {
00190     GetApplication()->DeclareSection( wxT("Mouse"), 5);
00191     GetApplication()->DeclarePref( wxT("Mouse"), wxT("Left Button"), (INT32*)&LeftButtonFunction);
00192     GetApplication()->DeclarePref( wxT("Mouse"), wxT("Middle Button"), (INT32*)&MiddleButtonFunction);
00193     GetApplication()->DeclarePref( wxT("Mouse"), wxT("Right Button"), (INT32*)&RightButtonFunction);
00194 
00195     return TRUE;
00196 }
00197 
00198 
00199 
00200 
00201 /********************************************************************************************
00202 
00203 >   static void ClickModifiers::GetButtonFuncName(ButtonFunction bf, String_32* pString)
00204 
00205     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00206     Created:    10/03/95
00207     Inputs:     ButtonFunction enum member
00208     Outputs:    Name of ButtonFunction enum member
00209     Returns:    -
00210     Purpose:    Get the name of a button function to show to the user.
00211 
00212 ********************************************************************************************/
00213 
00214 void ClickModifiers::GetButtonFuncName(ButtonFunction bf, String_32* pString)
00215 {
00216     *pString = String_32( ButtFuncNames[bf] );
00217 }
00218 
00219 
00220 
00221 
00222 /********************************************************************************************
00223 
00224 >   static void ClickModifiers::RestoreDefaults()
00225 
00226     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00227     Created:    10/03/95
00228     Inputs:     -
00229     Outputs:    -
00230     Returns:    -
00231     Purpose:    Set the three button function prefs to their default values...
00232 
00233 ********************************************************************************************/
00234 
00235 void ClickModifiers::RestoreDefaults()
00236 {
00237     LeftButtonFunction = BUTTFUNC_NORMAL;
00238     MiddleButtonFunction = BUTTFUNC_PUSHCENTRE;
00239     RightButtonFunction = BUTTFUNC_MENU;
00240 }
00241 
00242 
00243 
00244 
00245 /********************************************************************************************
00246 
00247 >   static ButtonFunction ClickModifiers::GetButtonFunc(UINT32 ButtonID)
00248 
00249     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00250     Created:    10/03/95
00251     Inputs:     0, 1 or 2 indicating Left MIddle or Right mouse button
00252     Outputs:    -
00253     Returns:    Button function ID currently assigned to that button
00254     Purpose:    Get the function linked to a mouse button.
00255 
00256 ********************************************************************************************/
00257 
00258 ButtonFunction ClickModifiers::GetButtonFunc(UINT32 ButtonID)
00259 {
00260     switch (ButtonID)
00261     {
00262         case 0:
00263             return LeftButtonFunction;
00264         case 1:
00265             return MiddleButtonFunction;
00266         case 2:
00267             return RightButtonFunction;
00268         default:
00269             ERROR3("GetButtonFunc asked for the function assigned to an unknown button!");
00270             return BUTTFUNC_NORMAL;
00271     }
00272 }
00273 
00274 
00275 
00276 
00277 /********************************************************************************************
00278 
00279 >   static void ClickModifiers::SetButtonFunc(UINT32 ButtonID, ButtonFunction bf)
00280 
00281     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00282     Created:    10/03/95
00283     Inputs:     0, 1 or 2 indicating Left Middle or Right mouse button
00284     Outputs:    -
00285     Returns:    -
00286     Purpose:    Set the function linked to a mouse button.
00287 
00288 ********************************************************************************************/
00289 
00290 void ClickModifiers::SetButtonFunc(UINT32 ButtonID, ButtonFunction bf)
00291 {
00292     switch (ButtonID)
00293     {
00294         case 0:
00295             LeftButtonFunction = bf;
00296             return;
00297         case 1:
00298             MiddleButtonFunction = bf;
00299             return;
00300         case 2:
00301             RightButtonFunction = bf;
00302             return;
00303         default:
00304             ERROR3("GetButtonFunc asked for the function assigned to an unknown button!");
00305     }
00306 }
00307 
00308 
00309 
00310 
00311 /********************************************************************************************
00312 >   ClickModifiers::ClickModifiers()
00313 
00314     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00315     Created:    07/03/95
00316     Inputs:     -
00317     Outputs:    -
00318     Returns:    -
00319     Purpose:    Construct a ClickModifiers object and initialise all its member variables.
00320 
00321 ********************************************************************************************/
00322 
00323 ClickModifiers::ClickModifiers()
00324 {
00325     Adjust          = FALSE;    // Shift key (Also configurable to a mouse button)
00326     Menu            = FALSE;    // User wants a context sensitive menu (Configurable)
00327     Constrain       = FALSE;    // Control key (Also configurable to a mouse button)
00328     Alternative1    = FALSE;    // Left-Alt key (Also configurable to a mouse button)
00329     Alternative2    = FALSE;    // Right-Alt key ???
00330 
00331     EditObject      = FALSE;    // User wants the best editor for this object (Configurable)
00332     FullScreen      = FALSE;    // User wants to toggle full-screen mode (Configurable)
00333     ZoomIn          = FALSE;    // User wants to zoom in one stage (Configurable)
00334 
00335     Pressure        = 0;        // Pen Pressure
00336 
00337     ClickWhileDrag = FALSE;     // TRUE if the click was made while a drag was in progress
00338     PushCentreTool = FALSE;     // User wants to drag move the view or auto-centre on current mouse pos
00339 }
00340 
00341 
00342 
00343 
00344 /********************************************************************************************
00345 >   ClickModifiers::ClickModifiers(const ClickModifiers& CopyMods)
00346 
00347     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00348     Created:    07/03/95
00349     Inputs:     -
00350     Outputs:    -
00351     Returns:    -
00352     Purpose:    Construct a ClickModifiers object and initialise all its member variables.
00353 
00354 ********************************************************************************************/
00355 
00356 ClickModifiers::ClickModifiers(const ClickModifiers& CopyMods)
00357 {
00358     Adjust          = CopyMods.Adjust;          // Shift key (Also configurable to a mouse button)
00359     Menu            = CopyMods.Menu;            // User wants a context sensitive menu (Configurable)
00360     Constrain       = CopyMods.Constrain;       // Control key (Also configurable to a mouse button)
00361     Alternative1    = CopyMods.Alternative1;    // Left-Alt key (Also configurable to a mouse button)
00362     Alternative2    = CopyMods.Alternative2;    // Right-Alt key ???
00363 
00364     EditObject      = CopyMods.EditObject;      // User wants the best editor for this object (Configurable)
00365     FullScreen      = CopyMods.FullScreen;      // User wants to toggle full-screen mode (Configurable)
00366     ZoomIn          = CopyMods.ZoomIn;          // User wants to zoom in one stage (Configurable)
00367 
00368     Pressure        = CopyMods.Pressure;        // Pen Pressure
00369 
00370     ClickWhileDrag  = CopyMods.ClickWhileDrag;  // TRUE if the click was made while a drag was in progress
00371     PushCentreTool  = CopyMods.PushCentreTool;  // TRUE if user wants to drag move view or auto-centre to mouse pos
00372 }
00373 
00374 
00375 
00376 
00377 /********************************************************************************************
00378 >   ClickModifiers& ClickModifiers::operator=(const ClickModifiers& CopyMods)
00379 
00380     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00381     Created:    07/03/95
00382     Inputs:     -
00383     Outputs:    -
00384     Returns:    -
00385     Purpose:    Overload the = operator to copy all the member vars of one to another.
00386 
00387 ********************************************************************************************/
00388 
00389 ClickModifiers& ClickModifiers::operator=(const ClickModifiers& CopyMods)
00390 {
00391     Adjust          = CopyMods.Adjust;          // Shift key (Also configurable to a mouse button)
00392     Menu            = CopyMods.Menu;            // User wants a context sensitive menu (Configurable)
00393     Constrain       = CopyMods.Constrain;       // Control key (Also configurable to a mouse button)
00394     Alternative1    = CopyMods.Alternative1;    // Left-Alt key (Also configurable to a mouse button)
00395     Alternative2    = CopyMods.Alternative2;    // Right-Alt key ???
00396 
00397     EditObject      = CopyMods.EditObject;      // User wants the best editor for this object (Configurable)
00398     FullScreen      = CopyMods.FullScreen;      // User wants to toggle full-screen mode (Configurable)
00399     ZoomIn          = CopyMods.ZoomIn;          // User wants to zoom in one stage (Configurable)
00400 
00401     Pressure        = CopyMods.Pressure;        // Pen Pressure
00402 
00403     ClickWhileDrag  = CopyMods.ClickWhileDrag;  // TRUE if the click was made while a drag was in progress
00404     PushCentreTool  = CopyMods.PushCentreTool;  // TRUE if user wants to drag move view or auto-centre to mouse pos
00405 
00406     return *this;
00407 }
00408 
00409 
00410 
00411 
00412 /********************************************************************************************
00413 >   BOOL ClickModifiers::IsHandledByTool()
00414 
00415     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00416     Created:    07/03/95
00417     Inputs:     -
00418     Outputs:    -
00419     Returns:    TRUE if this ClickModifier should be passed on to tools
00420                 FALSE otherwise
00421     Purpose:    Decide whether a tool should get a click modified with this modifier or not.
00422 
00423 ********************************************************************************************/
00424 
00425 BOOL ClickModifiers::IsHandledByTool()
00426 {
00427     //Graham 19/6/96: Altered to handle clicks while dragging.
00428     //If the click took place while dragging, the Drag operation should always handle
00429     //the click (i.e. IF ClickWhileDrag, return TRUE).
00430 
00431     //Otherwise, return TRUE
00432     //UNLESS any of Edit Object, FullScreen or ZoomIn are TRUE, in which case
00433     //return FALSE.
00434 
00435     return ClickWhileDrag || !(EditObject || FullScreen || ZoomIn);
00436 }
00437 
00438 
00439 
00440 
00441 /********************************************************************************************
00442 >   static UINT32 ClickModifiers::SynthesizeMouseEventFlags()
00443 
00444     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00445     Created:    13/03/95
00446     Inputs:     -
00447     Outputs:    -
00448     Returns:    nFlags in the same format as received from MFC during OnClick, OnMouseMove
00449                 events, etc.
00450     Purpose:    Create nFlags bitfield by interrogating the state of keys and mouse buttons
00451 
00452 ********************************************************************************************/
00453 
00454 UINT32 ClickModifiers::SynthesizeMouseEventFlags()
00455 {
00456     UINT32 nFlags = 0;
00457 
00458     // The OS swaps the mouse buttons over before putting them in the nFlags
00459     // bitfield if a user pref is set so we must do the same...
00460 PORTNOTE("other", "Check use of wxSYS_SWAP_BUTTONS")
00461 //  BOOL swapped = wxSystemSettings::GetMetric( wxSYS_SWAP_BUTTONS );
00462     BOOL swapped = FALSE;
00463 
00464     wxMouseState state = ::wxGetMouseState();
00465 
00466     nFlags |= (state.ControlDown()      ? MK_CONTROL : 0);
00467     nFlags |= (state.ShiftDown()        ? MK_SHIFT : 0);
00468     nFlags |= (state.AltDown()          ? MK_ALT : 0);
00469 
00470     // Note: wxMouseState.LeftDown is equivalent to wxMouseEvent.LeftIsDown
00471     nFlags |= (state.LeftDown()         ? (swapped ? MK_RBUTTON : MK_LBUTTON) : 0);
00472     nFlags |= (state.MiddleDown()       ? MK_MBUTTON : 0);
00473     nFlags |= (state.RightDown()        ? (swapped ? MK_LBUTTON : MK_RBUTTON) : 0);
00474 
00475     return nFlags;
00476 }
00477 
00478 
00479 
00480 
00481 /********************************************************************************************
00482 >   static UINT32 ClickModifiers::SynthesizeMouseEventFlags(wxMouseEvent &event)
00483 
00484     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00485     Created:    13/03/95
00486     Inputs:     wxMouseEvent    event   The event that contains button state
00487     Outputs:    -
00488     Returns:    nFlags in the same format as received from MFC during OnClick, OnMouseMove
00489                 events, etc.
00490     Purpose:    Create nFlags bitfield by interrogating the state of keys and mouse buttons
00491 
00492 ********************************************************************************************/
00493 
00494 UINT32 ClickModifiers::SynthesizeMouseEventFlags(wxMouseEvent &event)
00495 {
00496     UINT32 nFlags = 0;
00497 
00498     // The OS swaps the mouse buttons over before putting them in the nFlags
00499     // bitfield if a user pref is set so we must do the same...
00500 PORTNOTE("other", "Check use of wxSYS_SWAP_BUTTONS")
00501 //  BOOL swapped = wxSystemSettings::GetMetric( wxSYS_SWAP_BUTTONS );
00502     BOOL swapped = FALSE;
00503 
00504     nFlags |= (event.ControlDown()      ? MK_CONTROL : 0);
00505     nFlags |= (event.ShiftDown()        ? MK_SHIFT : 0);
00506     nFlags |= (event.AltDown()          ? MK_ALT : 0);
00507 
00508     // Note: wxMouseState.LeftDown is equivalent to wxMouseEvent.LeftIsDown
00509     nFlags |= (event.LeftIsDown()       ? (swapped ? MK_RBUTTON : MK_LBUTTON) : 0);
00510     nFlags |= (event.MiddleIsDown()     ? MK_MBUTTON : 0);
00511     nFlags |= (event.RightIsDown()      ? (swapped ? MK_LBUTTON : MK_RBUTTON) : 0);
00512 
00513     return nFlags;
00514 }
00515 
00516 
00517 
00518 
00519 /*****************************************************************************
00520 >   static ClickModifiers ClickModifiers::GetClickModifiers();
00521 
00522     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00523     Created:    18/Jan/2006
00524     Returns:    struct holding current modifiers for any mouse clicks
00525     Purpose:    Construct ClickModifiers from current system info
00526 *****************************************************************************/
00527 
00528 ClickModifiers ClickModifiers::GetClickModifiers()
00529 {
00530     UINT32 nFlags = SynthesizeMouseEventFlags();
00531     return GetClickModifiers(nFlags);
00532 }
00533 
00534 
00535 
00536 
00537 /*****************************************************************************
00538 >   static ClickModifiers ClickModifiers::GetClickModifiers(wxMouseEvent& event);
00539 
00540     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00541     Created:    18/Jan/2006
00542     Returns:    struct holding current modifiers for any mouse clicks
00543     Purpose:    Construct ClickModifiers from current event
00544 *****************************************************************************/
00545 
00546 ClickModifiers ClickModifiers::GetClickModifiers(wxMouseEvent& event)
00547 {
00548     UINT32 nFlags = SynthesizeMouseEventFlags(event);
00549     return GetClickModifiers(nFlags);
00550 }
00551 
00552 
00553 
00554 
00555 /*****************************************************************************
00556 >   static ClickModifiers ClickModifiers::GetClickModifiers(UINT32 nFlags);
00557 
00558     Author:     Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
00559     Created:    28/11/94
00560     Returns:    struct holding current modifiers for any mouse clicks
00561 *****************************************************************************/
00562 
00563 ClickModifiers ClickModifiers::GetClickModifiers(UINT32 nFlags)
00564 {
00565     ClickModifiers  ClickMods;
00566 
00567     // Read keyboard modifier states and reflect them in ClickModifiers...
00568     ClickMods.Adjust        = ((nFlags & MK_SHIFT)!=0);
00569     ClickMods.Constrain     = ((nFlags & MK_CONTROL)!=0);
00570     ClickMods.Alternative1  = ((nFlags & MK_ALT)!=0);
00571 
00572     // Check mouse button function prefs to see if they supply modifiers...
00573     if ((nFlags & MK_LBUTTON)!=0)
00574         ClickMods.GetModsFromPrefs(LeftButtonFunction);
00575 
00576     if ((nFlags & MK_MBUTTON)!=0)
00577         ClickMods.GetModsFromPrefs(MiddleButtonFunction);
00578 
00579     if ((nFlags & MK_RBUTTON)!=0)
00580         ClickMods.GetModsFromPrefs(RightButtonFunction);
00581 
00582     //Graham 18/6/96: Set ClickWhileDrag if there is a drag in progress
00583     //That means that this click was made while another mouse button was
00584     //being used to drag something
00585     if (Operation::GetCurrentDragOp()!=NULL)
00586         ClickMods.ClickWhileDrag=TRUE;
00587 
00588 // WEBSTER - markn 25/4/97
00589 // No pen stuff required in Webster
00590 // Taken out by vector stroking code Neville 2/10/97
00591 #ifdef VECTOR_STROKING
00592     // Get pressure information...
00593     CCPen* pPressurePen    = Camelot.GetPressurePen();
00594     if (pPressurePen)
00595         ClickMods.Pressure = pPressurePen->GetPenPressure();
00596     else
00597     {
00598 // don't warn in ralph it hasn't got one...
00599 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00600         ERROR3("CCamApp::GetClickModifiers() - pPressurePen==NULL");
00601 #endif
00602         ClickMods.Pressure = 0;
00603     }
00604 #endif // VECTOR_STROKING
00605 
00606     return ClickMods;
00607 }
00608 
00609 
00610 
00611 
00612 /********************************************************************************************
00613 >   void ClickModifiers::GetModsFromPrefs(ButtonFunction buttfunc)
00614 
00615     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00616     Created:    07/03/95
00617     Inputs:     -
00618     Outputs:    -
00619     Returns:    ClickModifier object based on inputs and prefs
00620     Purpose:    Create a click modifier object
00621 
00622 ********************************************************************************************/
00623 
00624 void ClickModifiers::GetModsFromPrefs(ButtonFunction buttfunc)
00625 {
00626     switch (buttfunc)
00627     {
00628         case BUTTFUNC_NORMAL:
00629             break;
00630 
00631         case BUTTFUNC_SHIFT:
00632             Adjust = TRUE;
00633             break;
00634 
00635         case BUTTFUNC_CONSTRAIN:
00636             Constrain = TRUE;
00637             break;
00638 
00639         case BUTTFUNC_ALTERNATIVE:
00640             Alternative1 = TRUE;
00641             break;
00642 
00643         case BUTTFUNC_MENU:
00644             Menu = TRUE;
00645             break;
00646 
00647 //      case BUTTFUNC_EDITOBJECT:
00648 //          EditObject = TRUE;
00649 //          break;
00650 //
00651         case BUTTFUNC_FULLSCREEN:
00652             FullScreen = TRUE;
00653             break;
00654 
00655         case BUTTFUNC_ZOOMIN:
00656             ZoomIn = TRUE;
00657             break;
00658 
00659         case BUTTFUNC_PUSHCENTRE:
00660             PushCentreTool = TRUE;
00661             break;
00662 
00663         default:
00664             ERROR3("Shouldn't ever get here, but there's no harm if it does");
00665     }
00666 }
00667 
00668 
00669 

Generated on Sat Nov 10 03:48:15 2007 for Camelot by  doxygen 1.4.4