bmpsdlg.cpp

Go to the documentation of this file.
00001 // $Id: bmpsdlg.cpp 1282 2006-06-09 09:46:49Z alex $
00002 // Implementation of the Bitmap Properties Dialog for XWP.
00003 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00004 ================================XARAHEADERSTART===========================
00005  
00006                Xara LX, a vector drawing and manipulation program.
00007                     Copyright (C) 1993-2006 Xara Group Ltd.
00008        Copyright on certain contributions may be held in joint with their
00009               respective authors. See AUTHORS file for details.
00010 
00011 LICENSE TO USE AND MODIFY SOFTWARE
00012 ----------------------------------
00013 
00014 This file is part of Xara LX.
00015 
00016 Xara LX is free software; you can redistribute it and/or modify it
00017 under the terms of the GNU General Public License version 2 as published
00018 by the Free Software Foundation.
00019 
00020 Xara LX and its component source files are distributed in the hope
00021 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00022 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00023 See the GNU General Public License for more details.
00024 
00025 You should have received a copy of the GNU General Public License along
00026 with Xara LX (see the file GPL in the root directory of the
00027 distribution); if not, write to the Free Software Foundation, Inc., 51
00028 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00029 
00030 
00031 ADDITIONAL RIGHTS
00032 -----------------
00033 
00034 Conditional upon your continuing compliance with the GNU General Public
00035 License described above, Xara Group Ltd grants to you certain additional
00036 rights. 
00037 
00038 The additional rights are to use, modify, and distribute the software
00039 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00040 library and any other such library that any version of Xara LX relased
00041 by Xara Group Ltd requires in order to compile and execute, including
00042 the static linking of that library to XaraLX. In the case of the
00043 "CDraw" library, you may satisfy obligation under the GNU General Public
00044 License to provide source code by providing a binary copy of the library
00045 concerned and a copy of the license accompanying it.
00046 
00047 Nothing in this section restricts any of the rights you have under
00048 the GNU General Public License.
00049 
00050 
00051 SCOPE OF LICENSE
00052 ----------------
00053 
00054 This license applies to this program (XaraLX) and its constituent source
00055 files only, and does not necessarily apply to other Xara products which may
00056 in part share the same code base, and are subject to their own licensing
00057 terms.
00058 
00059 This license does not apply to files in the wxXtra directory, which
00060 are built into a separate library, and are subject to the wxWindows
00061 license contained within that directory in the file "WXXTRA-LICENSE".
00062 
00063 This license does not apply to the binary libraries (if any) within
00064 the "libs" directory, which are subject to a separate license contained
00065 within that directory in the file "LIBS-LICENSE".
00066 
00067 
00068 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00069 ----------------------------------------------
00070 
00071 Subject to the terms of the GNU Public License (see above), you are
00072 free to do whatever you like with your modifications. However, you may
00073 (at your option) wish contribute them to Xara's source tree. You can
00074 find details of how to do this at:
00075   http://www.xaraxtreme.org/developers/
00076 
00077 Prior to contributing your modifications, you will need to complete our
00078 contributor agreement. This can be found at:
00079   http://www.xaraxtreme.org/developers/contribute/
00080 
00081 Please note that Xara will not accept modifications which modify any of
00082 the text between the start and end of this header (marked
00083 XARAHEADERSTART and XARAHEADEREND).
00084 
00085 
00086 MARKS
00087 -----
00088 
00089 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00090 designs are registered or unregistered trademarks, design-marks, and/or
00091 service marks of Xara Group Ltd. All rights in these marks are reserved.
00092 
00093 
00094       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00095                         http://www.xara.com/
00096 
00097 =================================XARAHEADEREND============================
00098  */
00099 
00100 #include "camtypes.h"
00101 #include "camelot.h"
00102 #include "bmpsdlg.h"
00103 //#include "bmpdlgr.h"
00104 //#include "bmpsdlgr.h"
00105 //#include "will3.h"
00106 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 #include "giffiltr.h"
00108 //#include "opdesc.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00109 //#include "simon.h"
00110 #include "bmpprefs.h"       
00111 
00112 
00113 CC_IMPLEMENT_DYNCREATE(BmpDlg, DialogOp)
00114 CC_IMPLEMENT_DYNAMIC(BmpDlgParam, OpParam)
00115 
00116 #define new CAM_DEBUG_NEW
00117 #define MORE_THAN_ONE_BITMAP 1
00118 #define OPTION_ONE  0
00119 #define OPTION_FOUR 4
00120 #define FOUR        4
00121 #define ZERO        0
00122 
00123 // Set up the static pointer to the class which the export dialog box uses to pass parameters to and from itself. 
00124 BmpDlgParam*  BmpDlg::pParam = NULL;
00125 
00126 // set up the dialog box details.
00127 const UINT32 BmpDlg::IDD = _R(IDD_BMP_DLG);
00128 const CDlgMode BmpDlg::Mode = MODAL;        //The dialog is Modal
00129 
00130 
00131 /*********************************************************************************************************************
00132 
00133     BmpDlg::bmpdlg() : DialogOp(BmpDlg::IDD, BmpDlg::Mode)
00134 
00135     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00136     Created:    22/11/96
00137     Inputs:     -
00138     Outputs:    -
00139     Returns     -
00140     Purpose:    bmpdlg Constructor, Sets The dlgs resource ID and Mode.
00141     Errors      -
00142     See Also    -
00143 
00144 ***********************************************************************************************************************/
00145 
00146 BmpDlg::BmpDlg() : DialogOp(BmpDlg::IDD, BmpDlg::Mode)
00147 {
00148     m_HasDelayChanged = FALSE;
00149     m_bInterpolationChanged = FALSE;
00150     m_IsManyDisplayed = FALSE;
00151     m_ListDropped = FALSE;
00152 }
00153 
00154 /***********************************************************************************************************************
00155 
00156     BmpDlg::~BmpDlg()
00157 
00158     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00159     Created:    22/11/96
00160     Inputs:     -
00161     Outputs:    -
00162     Returns     -
00163     Purpose:    Destructor, Does nothing.
00164     Errors      -
00165     See Also    -
00166 
00167 *************************************************************************************************************************/
00168 BmpDlg::~BmpDlg()
00169 {
00170 }
00171 
00172 /**************************************************************************************************************************
00173 
00174     void UpdateInterpolationCheckbox()
00175 
00176     Author:     Andy_Hills (Xara Group Ltd) <camelotdev@xara.com>
00177     Created:    12/10/00
00178     Inputs:     -
00179     Outputs:    -
00180     Returns     -
00181     Purpose:    'smooth when scaled up' has been clicked --> update its state.
00182     Errors      -
00183     See Also    -
00184 
00185 **************************************************************************************************************************/
00186 
00187 void BmpDlg::UpdateInterpolationCheckbox()
00188 {
00189     SetInterpolationChanged(TRUE);
00190     
00191     // get the current state
00192     BOOL bState = GetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE));
00193 
00194     // this code is broken. How can a BOOL return have 3 states? -AMB
00195 
00196     switch(bState)
00197     {
00198     case TRUE:
00199         {
00200             bState = FALSE;
00201             break;
00202         }
00203     default:
00204         {
00205             bState = TRUE;
00206             break;
00207         }
00208     }
00209 
00210     SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), bState);
00211 
00212 }
00213 
00214 
00215 /**************************************************************************************************************************
00216 
00217     MsgResult Message(Msg* Messgse);    
00218 
00219     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00220     Created:    22/11/96
00221     Inputs:     -
00222     Outputs:    -
00223     Returns     -
00224     Purpose:    Handles all the Bitmap Properties dialog's messages.
00225     Errors      -
00226     See Also    -
00227 
00228 **************************************************************************************************************************/
00229 MsgResult BmpDlg::Message(Msg* Message)
00230 {
00231     if (IS_OUR_DIALOG_MSG(Message))
00232     {
00233         DialogMsg* Msg = (DialogMsg*)Message;
00234 
00235         // Now handle the required messages that we respond to.
00236         switch (Msg->DlgMsg)
00237         {
00238             case DIM_CREATE:
00239                     {
00240                         InitDialog();
00241                         SetDelayChanged(FALSE);
00242                         SetListDropped(FALSE);
00243                         SetInterpolationChanged(FALSE);
00244                     }
00245             break;  
00246             case DIM_COMMIT:
00247                     {
00248                         CommitDialogValue();
00249                         Close();    // Hide the dialog box
00250                         End();      // Finish the operation
00251                         return OK;                          
00252                     }
00253             break;
00254             case DIM_CANCEL:    
00255                     {
00256                         Close();    // Hide the dialog box
00257                         End();      // Finish the operation
00258                         return OK; 
00259                     }
00260             break;
00261             case DIM_LISTDROPPED:
00262                 {
00263                     SetListDropped(TRUE);
00264 
00265                     if(GetIsManyDisplayed())
00266                     {
00267                         DeleteAllValues(_R(IDC_SETREMOVAL));    
00268                         // Set up the new list
00269 
00270                         SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_NOTHING));
00271                         SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_LEAVEASIS));
00272                         SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_BACKGROUND));
00273                         SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_PREVIOUS));
00274                         SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_MANY));
00275                         SetSelectedValueIndex(_R(IDC_SETREMOVAL),OPTION_FOUR);
00276                         SetComboListLength  (_R(IDC_SETREMOVAL));           
00277                         SetIsManyDisplayed(FALSE);
00278                     }
00279                 }
00280             break;
00281             case DIM_TEXT_CHANGED:
00282                 {
00283                     // A control on the dialog box has been typed in.
00284                     if (Msg->GadgetID == _R(IDC_SETDELAY))
00285                         SetDelayChanged(TRUE);
00286                 }
00287             break;
00288             case DIM_LFT_BN_CLICKED:
00289                 {
00290                     // Left button clicked.
00291                     if (Msg->GadgetID == _R(IDC_BMP_ALWAYS_INTERPOLATE))
00292                         UpdateInterpolationCheckbox();
00293                 }
00294             break;
00295             default:
00296                 break;
00297         }
00298     }
00299     return DialogOp::Message(Message);
00300 }   
00301 
00302 /**************************************************************************************************************************
00303 
00304     static OpState  GetState(String_256*, OpDescriptor*)
00305 
00306     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00307     Created:    22/11/96
00308     Inputs:     
00309     Outputs:    -
00310     Returns     -
00311     Purpose:    Returns the OpState for the Bitmap properties dialog operation.
00312     Errors      -
00313     See Also    -
00314 
00315 **************************************************************************************************************************/
00316  OpState BmpDlg::GetState(String_256*, OpDescriptor*)
00317 {    
00318     OpState opState;
00319     return opState;
00320 }
00321 
00322 
00323 /***********************************************************************************************************************
00324 
00325   static BOOL Init();
00326 
00327     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00328     Created:    22/11/96
00329     Inputs:     -
00330     Outputs:    -
00331     Returns     False if Initialisation/setup fails.
00332     Purpose:    bmpdlg Init method.
00333     Errors      -
00334     See Also    -
00335 
00336 *************************************************************************************************************************/
00337 
00338 BOOL BmpDlg::Init()                     
00339 {
00340     BOOL Ok = FALSE;
00341     Ok = RegisterOpDescriptor(
00342                                 0,                              /* Tool ID*/
00343                                 _R(IDS_PROPERTIES_DLG),             /* String resouirce ID*/
00344                                 CC_RUNTIME_CLASS(BmpDlg),       /* Runtime class*/
00345                                 OPTOKEN_BMP_DLG,                /* Token string*/
00346                                 BmpDlg::GetState,               /* GetState function*/
00347                                 0,                              /* Help ID*/
00348                                 0,                              /* Bubble ID*/
00349                                 0,                              /* Resource ID*/
00350                                 0,                              /* Control ID*/
00351                                 SYSTEMBAR_ILLEGAL,                              /* Bar ID*/
00352                                 TRUE,                           /* Recieve system messages*/
00353                                 FALSE,                          /* Smart duplicate operation*/
00354                                 TRUE,                           /* Clean operation*/
00355                                 NULL,                           /* No vertical counterpart*/
00356                                 _R(IDS_PROPERTIES_DLG_ONE)              /* String for one copy only*/
00357                                 );
00358     return (Ok);
00359 }
00360 
00361 /************************************************************************************************************************
00362     bmpdlg::Create()
00363 
00364     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00365     Created:    22/11/96
00366     Inputs:     -
00367     Outputs:    -
00368     Returns     TRUE if successful, else FALSE.
00369     Purpose:    
00370     Errors      -
00371     See Also    -
00372 
00373 ****************************************************************************************************************************/
00374 
00375 BOOL BmpDlg::Create()
00376 {
00377     if (DialogOp::Create())
00378     { 
00379         return TRUE; 
00380     }
00381     else
00382     {
00383         //Could not create the dialog box, so call inform error. 
00384         InformError();
00385         // End the operation 
00386         End();                   
00387             return FALSE; 
00388     }
00389 }
00390 
00391 /***********************************************************************************************************************
00392 
00393     bmpdlg::Do()
00394 
00395     Author: Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00396     Created:    22/11/96
00397     Inputs:     -
00398     Outputs:    -
00399     Returns     -
00400     Purpose:    Overrides DialogOp's ::Do function to create and display a Bitmap Properties Dialog.
00401     Errors      -
00402     See Also    -
00403 
00404 *************************************************************************************************************************/
00405 
00406 void BmpDlg::Do(OpDescriptor*)
00407 {
00408 ERROR3("BmpDlg::Do called, when should be using DoWithParam!");
00409 
00410 // End the operation
00411 End();          
00412 
00413 }
00414 
00415 /*********************************************************************************************************
00416 
00417 >   void BmpDlg::DoWithParam(OpDescriptor*)
00418 
00419     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00420     Created:    28/11/96
00421     Inputs:     -
00422     Outputs:    -
00423     Returns:    -
00424     Purpose:    This creates and opens the dialog in response to a request from the user.  
00425                 Allows values to be passed in and returned to the caller through the BmpDlgParam class.
00426     Errors:     -
00427     SeeAlso:    -
00428 
00429 *********************************************************************************************************/
00430 
00431 void BmpDlg::DoWithParam(OpDescriptor*, OpParam* Param)
00432 {
00433     ERROR3IF(Param == NULL, "BmpPrefsDlg::DoWithParam - NULL Param passed in");
00434 
00435     BOOL ok = FALSE;;
00436     // Force the dialog box to be created, as it is modal it will be opened via a message.
00437     ok = Create();
00438 
00439     if (!ok)
00440     {
00441         // Could not create the dialog box, so call inform error.
00442         InformError();
00443         // End the operation. 
00444         End();      
00445     }
00446 }
00447     
00448 /***********************************************************************************************************************
00449 
00450 BmpDlgParam* BmpDlg::CommitDialogValue()    
00451 
00452     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00453     Created:    22/11/96
00454     Inputs:     -
00455     Outputs:    -
00456     Returns     The pParam member of the BmpDlg class.
00457     Purpose:    Called when ok is pressed on the dialog box.
00458     Errors      -
00459     See Also    -
00460 
00461 **************************************************************************************************************************/
00462 BmpDlgParam* BmpDlg::CommitDialogValue()
00463 {
00464     if(GetDelayChanged())
00465     {
00466         BOOL Valid = FALSE;
00467         UINT32 Delay = GetLongGadgetValue(_R(IDC_SETDELAY), 0, 65535, _R(IDS_BMPPREFS_INVALIDDELAY) ,&Valid);
00468         if(Valid)
00469         {
00470             pParam->SetAnimDelay(Delay);
00471 
00472             if(pParam->GetListSize() >= MORE_THAN_ONE_BITMAP)
00473                 pParam->SetAreDelayValuesSame(TRUE);
00474         }
00475     }
00476 
00477     if(GetListDropped())
00478     {
00479         UINT32 RestoreType = GetSelectedValueIndex(_R(IDC_SETREMOVAL));
00480 
00481         if (RestoreType != FOUR)
00482         {
00483             // A new Restore type has been entered.
00484             pParam->SetRestoreType((GIFDisposalMethod)RestoreType);
00485             pParam->SetSameRestoreType(TRUE);
00486         }
00487     }
00488 
00489     if(GetInterpolationChanged())
00490     {
00491         BOOL bInterpolation = GetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE));
00492 
00493         // The 'smooth when scaled up' tick box has been changed.
00494         pParam->SetInterpolation(bInterpolation);
00495 
00496         if(pParam->GetListSize() >= MORE_THAN_ONE_BITMAP)
00497             pParam->SetAreInterpolationValuesSame(TRUE);
00498     }
00499 
00500     return pParam;
00501 }
00502 
00503 /***********************************************************************************************************************
00504 
00505 BOOL BmpDlg::InitDialog()
00506 
00507     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00508     Created:    22/11/96
00509     Inputs:     -
00510     Outputs:    -
00511     Returns     True if successful, else false.
00512     Purpose:    Sets initial dialog values
00513     Errors      -
00514     See Also    -
00515 
00516 **************************************************************************************************************************/
00517 BOOL BmpDlg::InitDialog()
00518 {
00519   ERROR3IF(pParam == NULL, "BmpsDlg::InitDialog called after duff initialisation?!");
00520 
00521     if (pParam->GetMany()==TRUE)
00522     {
00523         SetStringGadgetValue(_R(IDC_NAME), _R(IDS_MANY) );      // Name details
00524     
00525         if(pParam->GetSameFormat())
00526         {
00527             SetStringGadgetValue(_R(IDC_FORMAT), pParam->GetBitmapFormat());    // Format details.  
00528         }
00529         else
00530             SetStringGadgetValue(_R(IDC_FORMAT), _R(IDS_MANY));
00531         
00532         // Change the size field and enter the measurements.
00533         SetStringGadgetValue(_R(IDC_SIZEI), _R(IDS_TOTALSIZE) );
00534         SetStringGadgetValue(_R(IDC_SIZEII), pParam->GetMemoryUsed());
00535 
00536         // Dimensions info
00537         if(pParam->GetSameDimensions())
00538         {
00539             String_256 DimensionsInfo; //  = BitmapWidth+" by "+BitmapHeight+" pixels,  "+BitmapCols;
00540             DimensionsInfo.MakeMsg(_R(IDS_SGBITMAP_FULLINFO), (TCHAR *)pParam->GetBitmapWidth(),
00541                                     (TCHAR *)pParam->GetBitmapHeight());
00542             SetStringGadgetValue(_R(IDC_DIMENSIONS), DimensionsInfo);
00543         }
00544         else
00545             SetStringGadgetValue(_R(IDC_DIMENSIONS), _R(IDS_MANY));
00546         
00547         // Colour Info
00548         if(pParam->GetSameColors())
00549             SetStringGadgetValue(_R(IDC_COLOURS), pParam->GetBitmapCols());
00550         else
00551             SetStringGadgetValue(_R(IDC_COLOURS), _R(IDS_MANY));
00552         
00553         // Transparency Info
00554         if (pParam->GetSameTranspType())
00555             SetStringGadgetValue(_R(IDC_TRANSPARENT), pParam->GetBitmapTranspType());
00556         else
00557             SetStringGadgetValue(_R(IDC_TRANSPARENT), _R(IDS_MANY));    
00558         
00559         // Animation Delay info
00560         if(pParam->GetAreDelayValuesSame())
00561             SetLongGadgetValue(_R(IDC_SETDELAY), pParam->GetAnimDelay());
00562         else
00563             SetStringGadgetValue(_R(IDC_SETDELAY), _R(IDS_MANY) );
00564         
00565         // 'smooth when scaled up' tickbox
00566         if(pParam->GetAreInterpolationValuesSame())
00567             SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), pParam->GetInterpolation());
00568         else
00569         {
00570             // grey-out the box to represent 'many' different interpolation settings
00571             SetLongGadgetValue(_R(IDC_BMP_ALWAYS_INTERPOLATE), 2 );
00572         }
00573 
00574 
00575     /* Animation Restore deatils are no longer dsplyed in the information group. Removed - Ranbir.
00576     
00577         if(pParam->GetSameRestoreTpye())
00578         {
00579             GIFDisposalMethod DisposalMethod = pParam->GetRestoreType();
00580         
00581             switch(DisposalMethod)
00582             {
00583                 case GDM_NONE:
00584                 {
00585                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_NOTHING));
00586                 }
00587                 break;
00588         
00589                 case  GDM_LEAVE:
00590                 {
00591                     SetStringGadgetValue(_R(IDC_RESTORE), _R(IDS_RESTORE_LEAVEASIS));
00592                 }
00593                 break;
00594 
00595                 case GDM_BACKTOBACK:
00596                 {
00597                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_BACKGROUND));
00598                     
00599                 }
00600                 break;
00601 
00602                 case GDM_PREVIOUS:
00603                 {
00604                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_PREVIOUS));
00605                 }
00606                 break;
00607             }
00608     */
00609         if(pParam->GetSameRestoreType())
00610         {
00611             // Set up the list for our Animation Restore types.
00612             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_NOTHING)));
00613             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_LEAVEASIS)));
00614             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_BACKGROUND)));
00615             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_PREVIOUS)));
00616             SetComboListLength  (_R(IDC_SETREMOVAL));           
00617 
00618             // Select the correct restore tpye for the List box.
00619             SetSelectedValueIndex(_R(IDC_SETREMOVAL), pParam->GetRestoreType());
00620         }
00621         else
00622         {
00623             // The animation restore types differ, so display "Many" in the Listbox. 
00624         //  SetStringGadgetValue (_R(IDC_RESTORE), _R(IDS_MANY));
00625             SetStringGadgetValue (_R(IDC_SETREMOVAL), _R(IDS_MANY));
00626             SetSelectedValueIndex(_R(IDC_SETREMOVAL), OPTION_ONE);
00627             SetIsManyDisplayed(TRUE);
00628             pParam->SetSameRestoreType(FALSE);
00629         }
00630     }
00631     else // Only one Bitmap is currently selected.
00632     {
00633         SetStringGadgetValue(_R(IDC_NAME), pParam->GetBitmapName());        // Name details.
00634         
00635         SetStringGadgetValue(_R(IDC_FORMAT), pParam->GetBitmapFormat());    // Format details.  
00636         
00637         SetStringGadgetValue(_R(IDC_SIZEII), pParam->GetMemoryUsed());      // Memeory details. 
00638         
00639         String_256 DimensionsInfo; //  = BitmapWidth+" by "+BitmapHeight+" pixels,  "+BitmapCols;
00640 
00641         DimensionsInfo.MakeMsg(_R(IDS_SGBITMAP_FULLINFO), (TCHAR *)pParam->GetBitmapWidth(),
00642                                 (TCHAR *)pParam->GetBitmapHeight());
00643         SetStringGadgetValue(_R(IDC_DIMENSIONS), DimensionsInfo);           // Dimensions details
00644 
00645         SetStringGadgetValue(_R(IDC_COLOURS), pParam->GetBitmapCols()); // Colour detalis.
00646 
00647         SetStringGadgetValue(_R(IDC_TRANSPARENT), pParam->GetBitmapTranspType());   // Colour detalis.
00648         
00649         SetLongGadgetValue(_R(IDC_SETDELAY), pParam->GetAnimDelay());       // Delay details.
00650 
00651         SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), pParam->GetInterpolation());
00652 
00653     /*  Restore details are no longer dislpayed, in the info. field
00654     
00655         GIFDisposalMethod DisposalMethod = pParam->GetRestoreType();    // Set the restore details.
00656         
00657             switch(DisposalMethod)
00658             {
00659                 case GDM_NONE:
00660                 {
00661                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_NOTHING));
00662                 }
00663                 break;
00664 
00665                 case  GDM_LEAVE:
00666                 {
00667                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_LEAVEASIS));
00668                 }
00669                 break;
00670 
00671                 case GDM_BACKTOBACK:
00672                 {
00673                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_BACKGROUND));
00674                 }
00675                 break;
00676 
00677                 case GDM_PREVIOUS:
00678                 {
00679                     SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_PREVIOUS));
00680                 }
00681                 break;
00682 
00683                 default:
00684                     break;
00685 
00686             }
00687     */
00688             // Set up the list for our Animation Restore types.
00689             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_NOTHING)));
00690             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_LEAVEASIS)));
00691             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_BACKGROUND)));
00692             SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_PREVIOUS)));
00693             SetComboListLength  (_R(IDC_SETREMOVAL));           
00694             SetSelectedValueIndex(_R(IDC_SETREMOVAL), pParam->GetRestoreType());
00695     }
00696     return TRUE;
00697 }
00698 
00699 /***********************************************************************************************************************
00700 
00701   BOOL BmpDlg::InvokeBmpDlg(BmpDlgParam* pBmpDlgParam)
00702 
00703     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
00704     Created:    22/11/96
00705     Inputs:     A pointer to the BmpDlgParam Class.
00706     Outputs:    -
00707     Returns     -
00708     Purpose:    Open a BMP Dialog.
00709     Errors      -
00710     See Also    -
00711 
00712 **************************************************************************************************************************/
00713 
00714 void BmpDlg::InvokeBmpDlg(BmpDlgParam* pBmpDlgParam)
00715 {
00716     ERROR3IF(pBmpDlgParam == NULL, "BmpDlg::BmpDlgParam - NULL Param passed in");
00717 
00718     // Save a refernece for use in the dialog code.
00719     pParam = pBmpDlgParam;  
00720 
00721     OpDescriptor* OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(BmpDlg));
00722     OpDesc->Invoke(pBmpDlgParam, FALSE);
00723 }
00724 

Generated on Sat Nov 10 03:44:30 2007 for Camelot by  doxygen 1.4.4