bevinfo.h

Go to the documentation of this file.
00001 // $Id: bevinfo.h 1751 2006-09-13 11:33:14Z luke $
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 // FreeHand Tool Info bar operations
00099 
00100 
00101 #ifndef FREEINFO_INC
00102 #define FREEINFO_INC
00103 
00104 //#include "bars.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 class BevelTool;
00106 class BevelInfo;
00107 class BevelBlob;
00108 
00109 /********************************************************************************************
00110 
00111 >   class BevelInfoBarOp : public InformationBarOp
00112 
00113     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00114     Created:    15/2/99
00115     Purpose:    Class for handling the Bevel tool's information bar.
00116 
00117 ********************************************************************************************/
00118 
00119 class BevelInfoBarOp : public InformationBarOp
00120 {
00121     CC_DECLARE_DYNCREATE( BevelInfoBarOp )  
00122 public:
00123     // Dummy default constructor for DYNCREATE
00124     BevelInfoBarOp();
00125 
00126     // All messages to the info bar come through here
00127     MsgResult   Message(Msg* Msg);
00128 
00129     // Functions to allow the tool to talk to the info bar
00130     void SetToolActiveState(BOOL IsToolActive);
00131     void SetRetroState(BOOL CanRetroFit);
00132     void SetRetroString();
00133 
00134     virtual void UpdateState(); // Called during idle processing to disable controls
00135 
00136     // this updates the controls depending on the current selection
00137     void UpdateControls();
00138 
00139     // updates the variables depending on the slider if bIntoVariables is TRUE,
00140     // if bIntoVariables is FALSE then updates the slider depending on the variables
00141     void SliderUpdate(BOOL bIntoVariables, BOOL bTestMany = TRUE);
00142 
00143     // Keep a pointer to the Freehand tool in here
00144     BevelTool   *   pTool;
00145     BOOL            CanRetroFit;
00146 
00147     // Since we get Selection Changing message before the controls are made
00148     // we need to keep a flag to indicate if the controls have been built
00149     BOOL            ControlsExist;
00150 
00151     // creates/updates bevel on selected objects
00152     void DoBevel();
00153 
00154     // slider values
00155     // public so external classes can set them
00156     INT32 m_Depth;
00157     INT32 m_LightAngle;
00158     INT32 m_Contrast;
00159     INT32 m_SliderComboIndex;
00160     INT32 m_LightTilt;
00161 
00162     // sets up a bevelinfo class dependent on the settings of the dialog
00163     // public because the tool needs to use this too for the blob dragging code
00164     void SetUpBevelInfo(BevelInfo * pBevelInfo);
00165 
00166     // used by the bevel controller node to determine if the bevel info bar
00167     // is active or not
00168     static BevelInfoBarOp * GetCurrentBevelInfoBar() { return pCurrentBar; }
00169 
00170     // starts the drag on a particular blob
00171     void BeginDrag(BevelBlob * pBlob);
00172 
00173     // deals with pointer movement messages when dragging
00174     void DragPointerMove( DocCoord PointerPos, ClickModifiers ClickMods, 
00175                                    Spread* pSpread, BOOL bSolidDrag);
00176 
00177     // finishes the drag & updates the variables in the particular blobs list
00178     void DragFinished( DocCoord PointerPos, ClickModifiers ClickMods, 
00179                                 Spread* pSpread, BOOL Success, BOOL bSolidDrag);
00180 
00181     // returns TRUE for being in the middle of a drag
00182     BOOL AmDragging() { return m_bAmDragging; }
00183 
00184     // returns TRUE for dragging the slider
00185     BOOL AmDraggingSlider() { return m_bAmDraggingSlider; }
00186 
00187     void UpdateInnerOuterButtons(BOOL bMany, BOOL bOuter, BOOL bNoSelection);
00188 
00189     // when the slider is a depth slider, these set & get its values (the slider
00190     // is logarithmic)
00191     MILLIPOINT GetSliderDepth();
00192     void SetSliderDepth(MILLIPOINT Depth);
00193 
00194     static BevelInfoBarOp * pCurrentBar;
00195 
00196     BOOL m_BetweenViews;
00197 
00198 private:
00199     // conversion functions for the edit box
00200     BOOL ConvertValueToString(String_256 &In, const INT32 value, UnitType type=NOTYPE);
00201     BOOL ConvertStringToValue(CGadgetID ID,INT32 &value);
00202 
00203     void HandleBevelTypeChanged();
00204     void HandleSliderChanged();
00205     void HandleBevelDirectionChanged();
00206 
00207     void HandleBevelDirectionsToInner();
00208     void HandleBevelDirectionsToOuter();
00209 
00211     // Karim 11/09/2000
00212     // New methods to support the new join-type infobar buttons.
00213 
00214     void HandleJoinTypeMitreClicked();
00215     void HandleJoinTypeRoundClicked();
00216     void HandleJoinTypeBevelClicked();
00217     void ChangeJoinType(JointType jt);
00218     void UpdateJoinTypeControls();
00219     void EnableDisableJoinTypeControls();
00220 
00222 
00223     // control enabling stuff
00224     BOOL m_bControlsEnabled;
00225     BOOL m_bComboChanged;
00226 
00227     void RedrawBlobs(BOOL bAngle = TRUE, BOOL bTilt = FALSE);
00228 
00229     BevelBlob * m_pDragBlob;
00230 
00231     // the angle of the blob before dragging
00232     INT32 m_BlobAngle;
00233 
00234     BOOL m_bAmDragging;
00235 
00236     void SetBlobNodesAngle(INT32 Angle);
00237 
00238     // does the AttributeSelected with the given parameters
00239     void DoBevelAttrChange(BevelInfo *pBI);
00240 
00241     // has the user set the inner/outer ?
00242     BOOL m_bUserSet;
00243     INT32 m_UserIndent;
00244 
00245     // functions for loading strings into combos
00246     void LoadBevelTypeComboStrings(BOOL bMany);
00247     void LoadBevelDirectionComboStrings(BOOL bMany);
00248 
00249     BOOL m_bButtonIsInner;
00250     BOOL m_bButtonIsOuter;
00251 
00252     BOOL m_bAmDraggingSlider;
00253 
00254     MILLIPOINT m_LastDragWidth;
00255 };
00256     
00257 
00258 /********************************************************************************************
00259 
00260 >   class BevelInfoBarOpCreate : public BarCreate
00261 
00262     Author:     Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
00263     Created:    28/4/94
00264     Purpose:    Class for creating BevelInfoBarOps.
00265                 Derived classes of BarCreate are used by DialogBarOp::ReadBarsFromFile()
00266 
00267 ********************************************************************************************/
00268 
00269 class BevelInfoBarOpCreate : public BarCreate
00270 {
00271 public:
00272     DialogBarOp*    Create() { return (new BevelInfoBarOp); }
00273 };
00274 
00275 
00276 
00277 #endif  // FREEINFO_INC
00278 
00279 
00280 
00281 
00282 
00283 

Generated on Sat Nov 10 03:47:28 2007 for Camelot by  doxygen 1.4.4