swfbuttn.cpp

Go to the documentation of this file.
00001 // $Id: swfbuttn.cpp 751 2006-03-31 15:43: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 #include "camtypes.h"
00099 #include "swfplace.h"
00100 #include "swfbuttn.h"
00101 
00102 #define new CAM_DEBUG_NEW
00103 
00104 /********************************************************************************************
00105 
00106 >   FlashButtonRecord::FlashButtonRecord ( void )
00107 
00108     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00109     Created:    8/12/99
00110     Inputs:     -
00111     Returns:    -
00112     Purpose:    Creates a FlashButtonRecord list node, and initialises all member variables.
00113 
00114 ********************************************************************************************/
00115 
00116 FlashButtonRecord::FlashButtonRecord ( void )
00117 {
00118     // Create constant variables for initial states.
00119     const DocCoord  Position    ( 0, 0 );       // Default position for all co-ordinates.
00120 
00121     // Pointers should always be initialised to NULL when created.
00122     mpNext          = NULL;                 // No subsequent nodes.
00123     mpLast          = NULL;                 // No previous nodes.
00124 
00125     // Attached objects.
00126     mButtonID       = 0;
00127     mHitID          = 0;
00128     mDownID         = 0;
00129     mOverID         = 0;
00130     mUpID           = 0;
00131 
00132     // Clear the strings.
00133     mURL.Empty ();
00134     mFrame.Empty ();
00135     mName.Empty ();
00136 
00137     // Place object positions.
00138     mHitPosition    = Position;
00139     mDownPosition   = Position;
00140     mOverPosition   = Position;
00141     mUpPosition     = Position;
00142 
00143     // Object states.
00144     mHitType        = FLASH_SHAPE;
00145     mDownType       = FLASH_SHAPE;
00146     mOverType       = FLASH_SHAPE;
00147     mUpType         = FLASH_SHAPE;
00148 
00149     mHasHit         = FALSE;
00150     mHasDown        = FALSE;
00151     mHasOver        = FALSE;
00152     mHasUp          = FALSE;
00153 
00154     mTransformHit   = FALSE;
00155     mTransformDown  = FALSE;
00156     mTransformOver  = FALSE;
00157     mTransformUp    = FALSE;
00158 
00159     mHasURL         = FALSE;
00160     mHasFrame       = FALSE;
00161 }
00162 
00163 /********************************************************************************************
00164 
00165 >   FlashButtonRecord::~FlashButtonRecord ( void )
00166 
00167     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00168     Created:    16/11/99
00169     Inputs:     -
00170     Returns:    -
00171     Purpose:    Destroys this instance of FlashButtonRecord.
00172 
00173 ********************************************************************************************/
00174 
00175 FlashButtonRecord::~FlashButtonRecord ( void )
00176 {
00177     // Clean up any stray values.
00178 }
00179 
00180 /********************************************************************************************
00181 
00182 >   FlashButtonRecord* FlashButtonRecord::AddElement ( void )
00183 
00184     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00185     Created:    16/11/99
00186     Inputs:     -
00187     Returns:    pTail - The pointer to the new node.
00188     Purpose:    Adds an element to the tail of the list.
00189 
00190 ********************************************************************************************/
00191 
00192 FlashButtonRecord* FlashButtonRecord::AddElement ( void )
00193 {
00194     FlashButtonRecord *pTail = new FlashButtonRecord;
00195     ASSERT ( pTail != NULL );
00196 
00197     // Set the appropriate pointers.
00198     pTail->SetLast ( this );        // Ensure that a reference exists to this object...
00199     pTail->SetNext ( NULL );        // Avoids any problems if mpLast isn't NULL.
00200     mpNext = pTail;                 // ... and a reference exists to the new one.
00201 
00202     return pTail;
00203 }
00204 
00205 /********************************************************************************************
00206 
00207 >   void FlashButtonRecord::DeleteLastElement ( void )
00208 
00209     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00210     Created:    16/11/99
00211     Inputs:     -
00212     Returns:    -
00213     Purpose:    Deletes the previous item in the list.
00214 
00215 ********************************************************************************************/
00216 
00217 void FlashButtonRecord::DeleteLastElement ( void )
00218 {
00219     FlashButtonRecord *pToDelete = mpLast;
00220     
00221     // Reset mpLast to be mpLast->GetLast (), so that the list isn't broken.
00222     mpLast = mpLast->GetLast ();
00223 
00224     delete pToDelete;
00225 }
00226 
00227 /********************************************************************************************
00228 
00229 >   void FlashButtonRecord::DeleteNextElement ( void )
00230 
00231     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00232     Created:    16/11/99
00233     Inputs:     -
00234     Returns:    -
00235     Purpose:    Deletes the next item in the list.
00236 
00237 ********************************************************************************************/
00238 
00239 void FlashButtonRecord::DeleteNextElement ( void )
00240 {
00241     FlashButtonRecord *pToDelete = mpNext;
00242     
00243     // Reset mpNext to be mpNext->GetNext (), so that the list isn't broken.
00244     mpNext = mpNext->GetNext ();
00245 
00246     delete pToDelete;
00247 }
00248 
00249 /********************************************************************************************
00250 
00251 >   WORD FlashButtonRecord::GetButtonID ( void )
00252 
00253     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00254     Created:    8/12/99
00255     Inputs:     -
00256     Returns:    mButtonID - The internal ID number used by the Flash file for the button.
00257     Purpose:    Gets the value of mButtonID.
00258 
00259 ********************************************************************************************/
00260 
00261 WORD FlashButtonRecord::GetButtonID ( void )
00262 {
00263     return mButtonID;
00264 }
00265 
00266 /********************************************************************************************
00267 
00268 >   WORD FlashButtonRecord::GetHitID ( void )
00269 
00270     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00271     Created:    8/12/99
00272     Inputs:     -
00273     Returns:    mHitID - Hit state ID.
00274     Purpose:    Gets the value of mHitID.
00275 
00276 ********************************************************************************************/
00277 
00278 WORD FlashButtonRecord::GetHitID ( void )
00279 {
00280     return GetActualID ( mHitID, mHitType );
00281 }
00282 
00283 /********************************************************************************************
00284 
00285 >   WORD FlashButtonRecord::GetDownID ( void )
00286 
00287     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00288     Created:    8/12/99
00289     Inputs:     -
00290     Returns:    mDownID - Down state ID.
00291     Purpose:    Gets the value of mDownID.
00292 
00293 ********************************************************************************************/
00294 
00295 WORD FlashButtonRecord::GetDownID ( void )
00296 {
00297     return GetActualID ( mDownID, mDownType );
00298 }
00299 
00300 /********************************************************************************************
00301 
00302 >   WORD FlashButtonRecord::GetOverID ( void )
00303 
00304     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00305     Created:    8/12/99
00306     Inputs:     -
00307     Returns:    mOverID - Over state ID.
00308     Purpose:    Gets the value of mOverID.
00309 
00310 ********************************************************************************************/
00311 
00312 WORD FlashButtonRecord::GetOverID ( void )
00313 {
00314     return GetActualID ( mOverID, mOverType );
00315 }
00316 
00317 /********************************************************************************************
00318 
00319 >   WORD FlashButtonRecord::GetUpID ( void )
00320 
00321     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00322     Created:    8/12/99
00323     Inputs:     -
00324     Returns:    mUpID - Up state ID.
00325     Purpose:    Gets the value of mUpID.
00326 
00327 ********************************************************************************************/
00328 
00329 WORD FlashButtonRecord::GetUpID ( void )
00330 {
00331     return GetActualID ( mUpID, mUpType );
00332 }
00333 
00334 /********************************************************************************************
00335 
00336 >   WORD FlashButtonRecord::GetRawHitID ( void )
00337 
00338     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00339     Created:    18/1/00
00340     Inputs:     -
00341     Returns:    mHitID - Hit state ID.
00342     Purpose:    Gets the raw value of mHitID.
00343 
00344 ********************************************************************************************/
00345 
00346 WORD FlashButtonRecord::GetRawHitID ( void )
00347 {
00348     return mHitID;
00349 }
00350 
00351 /********************************************************************************************
00352 
00353 >   WORD FlashButtonRecord::GetRawDownID ( void )
00354 
00355     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00356     Created:    18/1/00
00357     Inputs:     -
00358     Returns:    mDownID - Down state ID.
00359     Purpose:    Gets the raw value of mDownID.
00360 
00361 ********************************************************************************************/
00362 
00363 WORD FlashButtonRecord::GetRawDownID ( void )
00364 {
00365     return mDownID;
00366 }
00367 
00368 /********************************************************************************************
00369 
00370 >   WORD FlashButtonRecord::GetRawOverID ( void )
00371 
00372     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00373     Created:    18/1/00
00374     Inputs:     -
00375     Returns:    mOverID - Over state ID.
00376     Purpose:    Gets the raw value of mOverID.
00377 
00378 ********************************************************************************************/
00379 
00380 WORD FlashButtonRecord::GetRawOverID ( void )
00381 {
00382     return mOverID;
00383 }
00384 
00385 /********************************************************************************************
00386 
00387 >   WORD FlashButtonRecord::GetRawUpID ( void )
00388 
00389     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00390     Created:    18/1/00
00391     Inputs:     -
00392     Returns:    mUpID - Up state ID.
00393     Purpose:    Gets the raw value of mUpID.
00394 
00395 ********************************************************************************************/
00396 
00397 WORD FlashButtonRecord::GetRawUpID ( void )
00398 {
00399     return mUpID;
00400 }
00401 
00402 /********************************************************************************************
00403 
00404 >   DocCoord FlashButtonRecord::GetHitPosition ( void )
00405 
00406     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00407     Created:    18/1/00
00408     Inputs:     -
00409     Returns:    mHitPosition - Hit state position.
00410     Purpose:    Gets the position of this button state.
00411 
00412 ********************************************************************************************/
00413 
00414 DocCoord FlashButtonRecord::GetHitPosition ( void )
00415 {
00416     return mHitPosition;
00417 }
00418 
00419 /********************************************************************************************
00420 
00421 >   DocCoord FlashButtonRecord::GetDownPosition ( void )
00422 
00423     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00424     Created:    18/1/00
00425     Inputs:     -
00426     Returns:    mDownPosition - Down state position.
00427     Purpose:    Gets the position of this button state.
00428 
00429 ********************************************************************************************/
00430 
00431 DocCoord FlashButtonRecord::GetDownPosition ( void )
00432 {
00433     return mDownPosition;
00434 }
00435 
00436 /********************************************************************************************
00437 
00438 >   DocCoord FlashButtonRecord::GetOverPosition ( void )
00439 
00440     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00441     Created:    18/1/00
00442     Inputs:     -
00443     Returns:    mOverPosition - Over state position.
00444     Purpose:    Gets the position of this button state.
00445 
00446 ********************************************************************************************/
00447 
00448 DocCoord FlashButtonRecord::GetOverPosition ( void )
00449 {
00450     return mOverPosition;
00451 }
00452 
00453 /********************************************************************************************
00454 
00455 >   DocCoord FlashButtonRecord::GetUpPosition ( void )
00456 
00457     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00458     Created:    18/1/00
00459     Inputs:     -
00460     Returns:    mUpPosition - Up state position.
00461     Purpose:    Gets the position of this button state..
00462 
00463 ********************************************************************************************/
00464 
00465 DocCoord FlashButtonRecord::GetUpPosition ( void )
00466 {
00467     return mUpPosition;
00468 }
00469 
00470 /********************************************************************************************
00471 
00472 >   BOOL FlashButtonRecord::GetTransformHit ( void )
00473 
00474     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00475     Created:    18/1/00
00476     Inputs:     -
00477     Returns:    mTransformHit - Is a transform required for mHitPosition?
00478     Purpose:    Do these co-ordinates need to be transformed into Flash co-ordinates? This is
00479                 included to allow objects to be positioned at (0, 0).
00480 
00481 ********************************************************************************************/
00482 
00483 BOOL FlashButtonRecord::GetTransformHit ( void )
00484 {
00485     return mTransformHit;
00486 }
00487 
00488 /********************************************************************************************
00489 
00490 >   BOOL FlashButtonRecord::GetTransformDown ( void )
00491 
00492     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00493     Created:    18/1/00
00494     Inputs:     -
00495     Returns:    mTransformDown - Is a transform required for mDownPosition?
00496     Purpose:    Do these co-ordinates need to be transformed into Flash co-ordinates? This is
00497                 included to allow objects to be positioned at (0, 0).
00498 
00499 ********************************************************************************************/
00500 
00501 BOOL FlashButtonRecord::GetTransformDown ( void )
00502 {
00503     return mTransformDown;
00504 }
00505 
00506 /********************************************************************************************
00507 
00508 >   BOOL FlashButtonRecord::GetTransformOver ( void )
00509 
00510     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00511     Created:    18/1/00
00512     Inputs:     -
00513     Returns:    mTransformOver - Is a transform required for mOverPosition?
00514     Purpose:    Do these co-ordinates need to be transformed into Flash co-ordinates? This is
00515                 included to allow objects to be positioned at (0, 0).
00516 
00517 ********************************************************************************************/
00518 
00519 BOOL FlashButtonRecord::GetTransformOver ( void )
00520 {
00521     return mTransformOver;
00522 }
00523 
00524 /********************************************************************************************
00525 
00526 >   BOOL FlashButtonRecord::GetTransformUp ( void )
00527 
00528     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00529     Created:    18/1/00
00530     Inputs:     -
00531     Returns:    mTransformUp - Is a transform required for mUpPosition?
00532     Purpose:    Do these co-ordinates need to be transformed into Flash co-ordinates? This is
00533                 included to allow objects to be positioned at (0, 0).
00534 
00535 ********************************************************************************************/
00536 
00537 BOOL FlashButtonRecord::GetTransformUp ( void )
00538 {
00539     return mTransformUp;
00540 }
00541 
00542 /********************************************************************************************
00543 
00544 >   FlashType FlashButtonRecord::GetHitType ( void )
00545 
00546     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00547     Created:    18/1/00
00548     Inputs:     -
00549     Returns:    mHitType - The object type to be rendered.
00550     Purpose:    Gets the class of object that is to be rendered in this button state.
00551 
00552 ********************************************************************************************/
00553 
00554 FlashType FlashButtonRecord::GetHitType ( void )
00555 {
00556     return mHitType;
00557 }
00558 
00559 /********************************************************************************************
00560 
00561 >   FlashType FlashButtonRecord::GetDownType ( void )
00562 
00563     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00564     Created:    18/1/00
00565     Inputs:     -
00566     Returns:    mDownType - The object type to be rendered.
00567     Purpose:    Gets the class of object that is to be rendered in this button state.
00568 
00569 ********************************************************************************************/
00570 
00571 FlashType FlashButtonRecord::GetDownType ( void )
00572 {
00573     return mDownType;
00574 }
00575 
00576 /********************************************************************************************
00577 
00578 >   FlashType FlashButtonRecord::GetOverType ( void )
00579 
00580     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00581     Created:    18/1/00
00582     Inputs:     -
00583     Returns:    mOverType - The object type to be rendered.
00584     Purpose:    Gets the class of object that is to be rendered in this button state.
00585 
00586 ********************************************************************************************/
00587 
00588 FlashType FlashButtonRecord::GetOverType ( void )
00589 {
00590     return mOverType;
00591 }
00592 
00593 /********************************************************************************************
00594 
00595 >   FlashType FlashButtonRecord::GetUpType ( void )
00596 
00597     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00598     Created:    18/1/00
00599     Inputs:     -
00600     Returns:    mUpType - The object type to be rendered.
00601     Purpose:    Gets the class of object that is to be rendered in this button state.
00602 
00603 ********************************************************************************************/
00604 
00605 FlashType FlashButtonRecord::GetUpType ( void )
00606 {
00607     return mUpType;
00608 }
00609 
00610 /********************************************************************************************
00611 
00612 >   TCHAR* FlashButtonRecord::GetURL ( void )
00613 
00614     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00615     Created:    8/12/99
00616     Inputs:     -
00617     Returns:    mURL - A pointer to a string containing a URL.
00618     Purpose:    Gets the contents of mURL.
00619 
00620 ********************************************************************************************/
00621 
00622 TCHAR* FlashButtonRecord::GetURL ( void )
00623 {
00624     return ( TCHAR * ) mURL;
00625 }
00626 
00627 /********************************************************************************************
00628 
00629 >   TCHAR* FlashButtonRecord::GetFrame ( void )
00630 
00631     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00632     Created:    17/1/00
00633     Inputs:     -
00634     Returns:    mFrame - A pointer to a string containing the frame value to use.
00635     Purpose:    Gets the contents of mFrame.
00636 
00637 ********************************************************************************************/
00638 
00639 TCHAR* FlashButtonRecord::GetFrame ( void )
00640 {
00641     return ( TCHAR * ) mFrame;
00642 }
00643 
00644 /********************************************************************************************
00645 
00646 >   TCHAR* FlashButtonRecord::GetName ( void )
00647 
00648     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00649     Created:    14/1/00
00650     Inputs:     -
00651     Returns:    mName - A pointer to a string containing the Camelot name for the button.
00652     Purpose:    Gets the contents of mName.
00653 
00654 ********************************************************************************************/
00655 
00656 TCHAR* FlashButtonRecord::GetName ( void )
00657 {
00658     return ( TCHAR * ) mName;
00659 }
00660 
00661 /********************************************************************************************
00662 
00663 >   BOOL FlashButtonRecord::IsAMatch ( const TCHAR *pName )
00664 
00665     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00666     Created:    14/1/00
00667     Inputs:     -
00668     Returns:    TRUE if the names match, otherwise FALSE.
00669     Purpose:    Compares the names of two buttons (which is how Camelot IDs them), and
00670                 determines whether or not they're identical.
00671 
00672 ********************************************************************************************/
00673 
00674 BOOL FlashButtonRecord::IsAMatch ( const TCHAR *pName )
00675 {
00676     return mName.IsIdentical ( pName );
00677 }
00678 
00679 /********************************************************************************************
00680 
00681 >   FlashButtonRecord* FlashButtonRecord::GetLast ( void )
00682 
00683     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00684     Created:    16/11/99
00685     Inputs:     -
00686     Returns:    *mpLast - A pointer to the previous node in the linked list.
00687     Purpose:    Gets mpLast.
00688 
00689 ********************************************************************************************/
00690 
00691 FlashButtonRecord* FlashButtonRecord::GetLast ( void )
00692 {
00693     return mpLast;
00694 }
00695 
00696 /********************************************************************************************
00697 
00698 >   FlashButtonRecord* FlashButtonRecord::GetNext ( void )
00699 
00700     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00701     Created:    16/11/99
00702     Inputs:     -
00703     Returns:    *mpNext - A pointer to the next node in the linked list.
00704     Purpose:    Gets mpNext.
00705 
00706 ********************************************************************************************/
00707 
00708 FlashButtonRecord* FlashButtonRecord::GetNext ( void )
00709 {
00710     return mpNext;
00711 }
00712 
00713 /********************************************************************************************
00714 
00715 >   void FlashButtonRecord::SetButtonID ( WORD mID )
00716 
00717     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00718     Created:    8/12/99
00719     Inputs:     ID - The ID value for this button.
00720     Returns:    -
00721     Purpose:    Sets the value of mButtonID.
00722 
00723 ********************************************************************************************/
00724 
00725 void FlashButtonRecord::SetButtonID ( WORD ID )
00726 {
00727     mButtonID = ID;
00728 }
00729 
00730 /********************************************************************************************
00731 
00732 >   void FlashButtonRecord::SetHitID ( WORD ID,
00733                                        FlashType Type )
00734 
00735     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00736     Created:    8/12/99
00737     Inputs:     ID - The ID value for this button state.
00738                 Type - Is it a shape record? (Used for returning the ID value.)
00739     Returns:    -
00740     Purpose:    Sets the values of mHitID and mHitType.
00741 
00742 ********************************************************************************************/
00743 
00744 void FlashButtonRecord::SetHitID ( WORD ID,
00745                                    FlashType Type )
00746 {
00747     mHitID      = ID;       // Set the ID value for this state.
00748     mHitType    = Type;     // And whether or not it's a shape.
00749     mHasHit     = TRUE;     // Record that this state has been set.
00750 }
00751 
00752 /********************************************************************************************
00753 
00754 >   void FlashButtonRecord::SetDownID ( WORD ID,
00755                                         FlashType Type )
00756 
00757     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00758     Created:    8/12/99
00759     Inputs:     ID - The ID value for this button state.
00760                 Type - Is it a shape record? (Used for returning the ID value.)
00761     Returns:    -
00762     Purpose:    Sets the values of mDownID and mDownType.
00763 
00764 ********************************************************************************************/
00765 
00766 void FlashButtonRecord::SetDownID ( WORD ID,
00767                                     FlashType Type )
00768 {
00769     mDownID     = ID;       // Set the ID value for this state.
00770     mDownType   = Type;     // And whether or not it's a shape.
00771     mHasDown    = TRUE;     // Record that this state has been set.
00772 }
00773 
00774 /********************************************************************************************
00775 
00776 >   void FlashButtonRecord::SetOverID ( WORD ID,
00777                                         FlashType Type )
00778 
00779     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00780     Created:    8/12/99
00781     Inputs:     ID - The ID value for this button state.
00782                 Type - Is it a shape record? (Used for returning the ID value.)
00783     Returns:    -
00784     Purpose:    Sets the values of mOverID and mOverType.
00785 
00786 ********************************************************************************************/
00787 
00788 void FlashButtonRecord::SetOverID ( WORD ID,
00789                                     FlashType Type )
00790 {
00791     mOverID     = ID;       // Set the ID value for this state.
00792     mOverType   = Type;     // And whether or not it's a shape.
00793     mHasOver    = TRUE;     // Record that this state has been set.
00794 }
00795 
00796 /********************************************************************************************
00797 
00798 >   void FlashButtonRecord::SetUpID ( WORD ID,
00799                                       FlashType Type )
00800 
00801     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00802     Created:    8/12/99
00803     Inputs:     ID - The ID value for this button state.
00804                 Type - Is it a shape record? (Used for returning the ID value.)
00805     Returns:    -
00806     Purpose:    Sets the values of mUpID and mUpType.
00807 
00808 ********************************************************************************************/
00809 
00810 void FlashButtonRecord::SetUpID ( WORD ID,
00811                                   FlashType Type )
00812 {
00813     mUpID       = ID;       // Set the ID value for this state.
00814     mUpType     = Type;     // And whether or not it's a shape.
00815     mHasUp      = TRUE;     // Record that this state has been set.
00816 
00817     // I'm treating up as the default state, so ensure that all other states are set.
00818     if ( !mHasHit )
00819         SetHitID ( ID, Type );
00820 
00821     if ( !mHasOver )
00822         SetOverID ( ID, Type );
00823 
00824     if ( !mHasDown )
00825         SetDownID ( ID, Type );
00826 }
00827 
00828 /********************************************************************************************
00829 
00830 >   void FlashButtonRecord::SetHitPosition ( DocCoord Position,
00831                                              BOOL DoTransform )
00832 
00833     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00834     Created:    18/1/00
00835     Inputs:     Position    - The position to place the object.
00836                 DoTransform - Do the co-ordinates need to be transformed into Flash ones?
00837     Returns:    -
00838     Purpose:    Sets the values of mHitPosition and mTransformHit.
00839 
00840 ********************************************************************************************/
00841 
00842 void FlashButtonRecord::SetHitPosition ( DocCoord Position,
00843                                          BOOL DoTransform )
00844 {
00845     mHitPosition    = Position;
00846     mTransformHit   = DoTransform;
00847 }
00848 
00849 /********************************************************************************************
00850 
00851 >   void FlashButtonRecord::SetDownPosition ( DocCoord Position,
00852                                               BOOL DoTransform )
00853 
00854     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00855     Created:    18/1/00
00856     Inputs:     Position    - The position to place the object.
00857                 DoTransform - Do the co-ordinates need to be transformed into Flash ones?
00858     Returns:    -
00859     Purpose:    Sets the values of mDownPosition and mTransformDown.
00860 
00861 ********************************************************************************************/
00862 
00863 void FlashButtonRecord::SetDownPosition ( DocCoord Position,
00864                                           BOOL DoTransform )
00865 {
00866     mDownPosition   = Position;
00867     mTransformDown  = DoTransform;
00868 }
00869 
00870 /********************************************************************************************
00871 
00872 >   void FlashButtonRecord::SetOverPosition ( DocCoord Position,
00873                                               BOOL DoTransform )
00874 
00875     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00876     Created:    18/1/00
00877     Inputs:     Position    - The position to place the object.
00878                 DoTransform - Do the co-ordinates need to be transformed into Flash ones?
00879     Returns:    -
00880     Purpose:    Sets the values of mOverPosition and mTransformOver.
00881 
00882 ********************************************************************************************/
00883 
00884 void FlashButtonRecord::SetOverPosition ( DocCoord Position,
00885                                           BOOL DoTransform )
00886 {
00887     mOverPosition   = Position;
00888     mTransformOver  = DoTransform;
00889 }
00890 
00891 /********************************************************************************************
00892 
00893 >   void FlashButtonRecord::SetUpPosition ( DocCoord Position,
00894                                             BOOL DoTransform )
00895 
00896     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00897     Created:    18/1/00
00898     Inputs:     Position    - The position to place the object.
00899                 DoTransform - Do the co-ordinates need to be transformed into Flash ones?
00900     Returns:    -
00901     Purpose:    Sets the values of mUpPosition and mTransformUp.
00902 
00903 ********************************************************************************************/
00904 
00905 void FlashButtonRecord::SetUpPosition ( DocCoord Position,
00906                                         BOOL DoTransform )
00907 {
00908     mUpPosition     = Position;
00909     mTransformUp    = DoTransform;
00910 }
00911 
00912 /********************************************************************************************
00913 
00914 >   void FlashButtonRecord::SetURL ( String256 Address )
00915 
00916     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00917     Created:    8/12/99
00918     Inputs:     Address - A reference to a URL.
00919     Returns:    -
00920     Purpose:    Sets the value of mURL. mHasURL is also set, so that only the first URL
00921                 string encountered is used. This is to keep it consistent with the Camelot
00922                 button class.
00923 
00924 ********************************************************************************************/
00925 
00926 void FlashButtonRecord::SetURL ( String_256 Address )
00927 {
00928     if ( !mHasURL )
00929     {
00930         mURL = Address;
00931         mHasURL = TRUE;
00932     }
00933 }
00934 
00935 /********************************************************************************************
00936 
00937 >   void FlashButtonRecord::SetFrame ( TCHAR *pFrame )
00938 
00939     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00940     Created:    17/1/00
00941     Inputs:     pFrame - A reference to a frame..
00942     Returns:    -
00943     Purpose:    Sets the value of mFrame.
00944 
00945 ********************************************************************************************/
00946 
00947 void FlashButtonRecord::SetFrame ( TCHAR *pFrame )
00948 {
00949     if ( !mHasFrame )
00950     {
00951         mFrame = pFrame;
00952         mHasFrame = TRUE;
00953     }
00954 }
00955 
00956 /********************************************************************************************
00957 
00958 >   void FlashButtonRecord::SetName ( String256 Address )
00959 
00960     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00961     Created:    14/1/00
00962     Inputs:     pName - A reference to a button.
00963     Returns:    -
00964     Purpose:    Sets the value of mName.
00965 
00966 ********************************************************************************************/
00967 
00968 void FlashButtonRecord::SetName ( const TCHAR* pName )
00969 {
00970     mName = pName;
00971 }
00972 
00973 /********************************************************************************************
00974 
00975 >   void FlashButtonRecord::SetLast ( FlashButtonRecord *pLast )
00976 
00977     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00978     Created:    16/11/99
00979     Inputs:     pLast - A pointer to the previous FlashButtonRecord in the linked list.
00980     Returns:    -
00981     Purpose:    Sets the value of mpLast.
00982 
00983 ********************************************************************************************/
00984 
00985 void FlashButtonRecord::SetLast ( FlashButtonRecord *pLast )
00986 {
00987     mpLast = pLast;
00988 }
00989 
00990 /********************************************************************************************
00991 
00992 >   void FlashButtonRecord::SetNext ( FlashButtonRecord *pNext )
00993 
00994     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00995     Created:    16/11/99
00996     Inputs:     pNext - A pointer to the next FlashButtonRecord in the linked list.
00997     Returns:    -
00998     Purpose:    Sets the value of mpNext.
00999 
01000 ********************************************************************************************/
01001 
01002 void FlashButtonRecord::SetNext ( FlashButtonRecord *pNext )
01003 {
01004     mpNext = pNext;
01005 }
01006 
01007 /********************************************************************************************
01008 
01009 >   WORD FlashButtonRecord::GetActualID ( WORD ID,
01010                                           FlashType Type )
01011 
01012     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
01013     Created:    9/12/99
01014     Inputs:     ID      - The basic ID value of the object to be used as a button state.
01015                 Type    - The type of object to be rendered.
01016     Returns:    ID      - The actual value of this object's ID within the Flash file.
01017     Purpose:    Gets the value of mHitID.
01018 
01019 ********************************************************************************************/
01020 
01021 WORD FlashButtonRecord::GetActualID ( WORD ID,
01022                                       FlashType Type )
01023 {
01024     // Step 1:  Increment the ID value past the font and bitmap records that are never
01025     //          rendered directly.
01026     ID += FlashPlaceObject::GetBitmapCount () + FlashPlaceObject::GetFontCount () +
01027           FLASH_FIRST_ID;
01028 
01029     // Step 2:  If the record is a shape record, increment it past the text records.
01030     if ( Type == FLASH_SHAPE )
01031     {
01032         ID += FlashPlaceObject::GetTextCount ();
01033     }
01034     else if ( Type == FLASH_SPRITE )
01035     {
01036         ID += FlashPlaceObject::GetShapeCount ();
01037     }
01038 
01039     // Step 3:  Return the ID value.
01040     return ID;
01041 }

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