AnimationPropertiesTab Class Reference

Allows the user to set various Animation properties. More...

#include <aprps.h>

Inheritance diagram for AnimationPropertiesTab:

GIFAnimationPropertyTabs PropertyTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 AnimationPropertiesTab ()
 AnimationPropertiesTab constructor.
 ~AnimationPropertiesTab ()
 AnimationPropertiesTab destructor.
virtual BOOL Init ()
 AnimationPropertiesTab init routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the messages for this animation property tab.
virtual BOOL InitSection ()
 Sets initial values for this tab on the Animation properties dialog box.
virtual BOOL CommitSection ()
 Takes the values in this tab of the Animation properties dialog box. Called when ok or apply is clicked on the main dialog box.
virtual BOOL UpdateLayerSection ()
 Called when the spread-related section of the tab should be updated.
virtual BOOL GreySection ()
 Called when all documents have been closed.
virtual BOOL UngreySection ()
 Called when a new document has been selected.
virtual BOOL UpdateSection ()
 Called when we have switched to a new document and need to update all the controls on this tab.
virtual CDlgResID GetPageID ()
 Allows the options dialog code to determine the dialog ID of this section.
virtual BOOL IsPropertyRequired ()
 Allows the Animation properties to determine if this tab is required.
BOOL ChangeControlStatus (const BOOL Status)
 Called to grey/ungrey all controls on this tab.
BOOL SetGlobalDelay (Spread *pSpread, DWORD Delay)
 The delay value in the animation properties tab has changed. This is a global value therefore set this value in the frame layer and associated OILbitmap.

Protected Member Functions

BOOL ShowDetails ()
 Shows the details of the associated spread in this tab.
virtual BOOL UpdateApplyState ()
 This changes the 'Apply now' state based on the settings of the active layer and the settings in this tab. If the settings are the same, the 'Apply state' is FALSE, else it is TRUE.
BOOL HavePropertiesChanged (BOOL ValidateDelayValue=FALSE)
 Central place for comparing settings in the dlg against the settings of a Spread.

Protected Attributes

BOOL m_GreyStatus

Detailed Description

Allows the user to set various Animation properties.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97

Definition at line 300 of file aprps.h.


Constructor & Destructor Documentation

AnimationPropertiesTab::AnimationPropertiesTab  ) 
 

AnimationPropertiesTab constructor.

/

/*!

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2383 of file aprps.cpp.

02384 {       
02385 }            

AnimationPropertiesTab::~AnimationPropertiesTab  ) 
 

AnimationPropertiesTab destructor.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2401 of file aprps.cpp.

02402 {       
02403 }        


Member Function Documentation

BOOL AnimationPropertiesTab::ChangeControlStatus const BOOL  Status  ) 
 

Called to grey/ungrey all controls on this tab.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2791 of file aprps.cpp.

02792 {
02793     // Grey the apply/ok/cancel buttons.
02794     AnimationPropertiesTab::GreyApplyNow();
02795         
02796     return TRUE;
02797 }           

BOOL AnimationPropertiesTab::CommitSection  )  [virtual]
 

Takes the values in this tab of the Animation properties dialog box. Called when ok or apply is clicked on the main dialog box.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if values in dialog the box are ok, False otherwise.

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 2478 of file aprps.cpp.

02479 {
02480     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationPropertiesTab::CommitSection called with a NULL dialog pointer");
02481 
02482     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02483     if (!ok)
02484         return TRUE;        
02485 
02486     // Only do the op if we have a layer with a different set of properties.
02487     if (pSpread && HavePropertiesChanged(TRUE))
02488     {
02489         // Retrieve the values from the animation properties tab dialog.
02490         DWORD   Delay = 0;
02491         BOOL    DelayValid = FALSE;
02492         BOOL    LoopValid   = FALSE;
02493         BOOL    PropertiesChanged = FALSE;  // Flag to indicate that the properties have changed and the new entries are valid.
02494 
02495         BOOL    Loop_Continously = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_ANIMOPTS_LOOP));
02496         DWORD   Loop  = pPropertiesDlg->GetLongGadgetValue(_R(IDC_ANIMOPTS_ITERATIONS), 0, 65535, _R(IDS_BMPPREFS_INVALIDLOOP) ,&LoopValid);
02497                 
02498         // If the loop is invalid, return FALSE.
02499         if(!LoopValid)
02500             return FALSE;
02501         
02502         // Only check the delay edit field value if "Many" is not currently displayed.
02503         if(!m_IsManyDisplayed)
02504             Delay = pPropertiesDlg->GetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), 0, 65535, _R(IDS_BMPPREFS_INVALIDDELAY) ,&DelayValid);
02505 
02506         // The GetLongGadgetValue function returns a Zero delay value when nothing is displayed 
02507         // in the 'Display each frame for:' edit field, we should therefore display a zero value.
02508         if(Delay == 0 && !m_IsManyDisplayed)
02509             pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), 0);   
02510 
02511         // If the delay is invalid, return FALSE.
02512         if(!DelayValid && !m_IsManyDisplayed)
02513             return FALSE;
02514 
02515         // If the 'Loop Continously' check box is ticked, then set the loop value to zero.
02516         if(Loop_Continously)
02517             Loop = 0;
02518 
02519 PORTNOTE("other", "Remove FrameSGallery");
02520 #ifndef EXCLUDE_FROM_XARALX
02521         // Check that all visible layers are actually frame layers.
02522         FrameSGallery::EnsureFrameLayerIntegrity(pSpread);
02523 #endif
02524         // Pass the new loop value to the spread.
02525         pSpread->SetAnimationLoop(Loop);
02526 
02527         //If we get this far, then the animation details have changed and the new entries are valid.
02528         PropertiesChanged = TRUE;
02529 
02530         // If 'Many' is not displayed, then pass on our new delay value.
02531         if(!m_IsManyDisplayed)
02532         {
02533             // Pass the new delay value to the spread.
02534             pSpread->SetAnimationDelay(Delay);
02535 
02536             // This is a global delay value, therefore, set this value in the frame layer and associated OILbitmap.
02537             SetGlobalDelay(pSpread, Delay);
02538         }
02539             
02540         //  If the Preview dialog is open, regenerate all the bitmaps in the animation.
02541         if (PreviewDialog::GetPreviewDialog())
02542         {
02543             // Make sure the preview dialog is not in a greyed state.
02544             // Get our static pointer to the Preview Dialog.
02545             PreviewDialog* pPreviewDlg = PreviewDialog::GetPreviewDialog();
02546 
02547             // Check, for a NULL ptr.
02548             if(pPreviewDlg)
02549             {
02550                 // If the dlg is not in a greyed state, invoke the OP.
02551                 if(!pPreviewDlg->GetDlgState()) 
02552                 {
02553                     // Invoke the op.
02554                     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_FRAME_GRABALLFRAMES); 
02555                     if (pOpDesc != NULL)
02556                         pOpDesc->Invoke();
02557                     else
02558                     {
02559                         ERROR3("Couldn't find OPTOKEN_FRAME_GRABALLFRAMES op descriptor");
02560                     }
02561                 }
02562             }
02563         }
02564         
02565         // Update the display information in frame gallery.
02566         Layer* pLayer = pSpread->FindFirstFrameLayer();
02567         while (pLayer != NULL)
02568         {
02569             // This is just as a double check
02570             if (!pLayer->IsBackground() && !pLayer->IsGuide() &&
02571                 !pLayer->IsPageBackground())
02572             {
02573                 // Tell the frame gallery to update its display of the frame
02574                 BROADCAST_TO_ALL(LayerMsg(pLayer, LayerMsg::REDRAW_LAYER));
02575             }
02576 
02577             // Move to the next frame layer in the animation
02578             pLayer = pLayer->FindNextFrameLayer();
02579         }               
02580         // Update the information in the frame properties tab.
02581         // Find the active layer.
02582         pLayer = pSpread->FindActiveLayer();
02583 
02584         // Boradcast the message.
02585         BROADCAST_TO_ALL(LayerMsg(pLayer, LayerMsg::UPDATE_ACTIVE_LAYER));          
02586 
02587         //The new delay entry is valid.
02588         PropertiesChanged = TRUE;
02589         
02590         // If the animation properties have changed and the new entries are valid, mark the doc. as modified.
02591         if(PropertiesChanged)
02592         {
02593             // Get a ptr to the current document.
02594             Document* pDoc = Document::GetCurrent();
02595 
02596             // Set this document as edited.
02597             if(pDoc)
02598                 pDoc->SetModified(TRUE);            
02599         }
02600     }
02601     // If the delay value for any particular frame layer has changed, then we may need to 
02602     // alter the value displayed in the 'Display each frame for' edit field.
02603     if(GetFrameDelayValueChanged())
02604     {
02605         // At this point check to ensure the 'Display each frame for' edit field is displaying the correct value.
02606         if(SameflDelayValues())
02607         {
02608             // All the frame layers have the same delay value.
02609             // Take the delay value from the first layer.
02610             // Get a ptr to the first layer.
02611             Layer* pLayer = pSpread->FindFirstLayer();
02612 
02613             // Ensure we have valid spread and Layer pointers.
02614             if (pSpread && pLayer) 
02615             {
02616                 // Get the delay value for the frame layer.
02617                 DWORD GlobalDelay = pLayer->GetFrameDelay();
02618 
02619                 // Set this frame layer delay value as the new global delay value.
02620                 pSpread->SetAnimationDelay(GlobalDelay);
02621 
02622                 // Display this value in the delay edit field for this tab.
02623                 pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), pLayer->GetFrameDelay()); 
02624             }
02625         }
02626         else
02627         {
02628             // The delay values differ, display "MANY" in the delay edit field.
02629             pPropertiesDlg->SetStringGadgetValue(_R(IDC_ANIMTAB_DELAY), _R(IDS_MANY));
02630         }   
02631 
02632         // We have taken all the neccessary actions, so set this this flag back to false.
02633         SetFrameDelayValueChanged(FALSE);   
02634     }
02635 
02636     // Everything ok!
02637     return TRUE;
02638 }

CDlgResID AnimationPropertiesTab::GetPageID  )  [virtual]
 

Allows the options dialog code to determine the dialog ID of this section.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The dialog ID of this tab section.

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 2437 of file aprps.cpp.

02438 {
02439     return _R(IDD_TAB_ANIMATION_PROPERTIES);
02440 }

BOOL AnimationPropertiesTab::GreySection  )  [virtual]
 

Called when all documents have been closed.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from PropertyTabs.

Definition at line 2712 of file aprps.cpp.

02713 {
02714     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationPropertiesTab::GreySection called with no dialog pointer");
02715 
02716     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02717     if (!ok)
02718         return TRUE;    
02719 
02720     // Only update if we are not already grey 
02721     if (m_GreyStatus == TRUE)
02722         return TRUE;
02723 
02724     // Set the correct control status.
02725     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_ITERATIONS),   FALSE);
02726     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_LOOP),         FALSE);
02727     pPropertiesDlg->EnableGadget(_R(IDC_ANIMTAB_DELAY),         FALSE);
02728 
02729     // Call our central greying/ungreying function
02730     ok = ChangeControlStatus(FALSE);
02731     
02732     m_GreyStatus = TRUE;
02733     SetApplyNowState(FALSE);
02734 
02735     return ok;
02736 } 

BOOL AnimationPropertiesTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the messages for this animation property tab.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 2979 of file aprps.cpp.

02980 {
02981     ERROR2IF(Msg == NULL,FALSE,"AnimationPropertiesTab::Message Null message received");
02982     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationPropertiesTab::HandleMsg called with no dialog pointer");
02983 
02984     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02985     if (!ok)
02986         return TRUE;
02987 
02988     // Get this tab to update itself. Send it an active layer has changed msg.
02989     //Layer* pNewActiveLayer = pSpread->FindActiveLayer();
02990     switch(Msg->DlgMsg)
02991     {
02992         case DIM_CREATE:    
02993         {
02994             m_GreyStatus = FALSE;   
02995             ok = InitSection();
02996             // Grey the apply/ok/cancel buttons.
02997             AnimationPropertiesTab::GreyApplyNow();
02998             if (!ok)
02999                 InformError();
03000         }
03001         break;
03002 
03003         case DIM_LFT_BN_CLICKED:
03004         {
03005             if(Msg->GadgetID == _R(IDC_ANIMOPTS_LOOP))
03006             {
03007                 // If the "Loop continously" control box is ticked, grey the "Loop" ed field.
03008                 BOOL Value = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_ANIMOPTS_LOOP));
03009                 if (Value)
03010                     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_ITERATIONS), FALSE);
03011                 else
03012                     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_ITERATIONS), TRUE);                                
03013             }
03014 
03015             AnimationPropertiesTab::SetApplyNowState(TRUE);
03016 
03017             // Ungrey the apply/ok/cancel buttons.
03018             AnimationPropertiesTab::UngreyApplyNow();
03019         }
03020         break;
03021 
03022         case DIM_SELECTION_CHANGED:
03023         {
03024             if(AnimationPropertiesTab::GetApplyNowState())
03025             {
03026                 // Grey the apply/ok/cancel buttons.
03027                 AnimationPropertiesTab::UngreyApplyNow();
03028             }
03029         }
03030         break;
03031 
03032         case DIM_TEXT_CHANGED:
03033         {
03034             // Do we want to deal with text change msgs?
03035             if(!GetIgnoreTextChangeMsg())
03036             {
03037                 // Have the animation properties changed?
03038                 if(HavePropertiesChanged())
03039                 {
03040                     // Set the correct state of the m_ApplyNow flag.
03041                     AnimationPropertiesTab::SetApplyNowState(TRUE);
03042 
03043                     // Grey the apply/ok/cancel buttons.
03044                     AnimationPropertiesTab::UngreyApplyNow();
03045 
03046                     // Force the m_FrameDelayValueChanged flag to FALSE.
03047                     SetFrameDelayValueChanged(FALSE);
03048                 }
03049             }
03050         }
03051         break;
03052 
03053         case DIM_SET_ACTIVE:
03054         {
03055             if(AnimationPropertiesTab::GetApplyNowState())
03056             {
03057                 // Grey the apply/ok/cancel buttons.
03058                 AnimationPropertiesTab::UngreyApplyNow();
03059             }
03060         }
03061         break;
03062 
03063         default:
03064             break;
03065     }   
03066     return TRUE;
03067 }  

BOOL AnimationPropertiesTab::HavePropertiesChanged BOOL  ValidateDelayValue = FALSE  )  [protected]
 

Central place for comparing settings in the dlg against the settings of a Spread.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
ValidateDelayValue - Flag to determine when we need to validate the delay value. [INPUTS] Defaults to false.
- [OUTPUTS]
Returns:
TRUE if settings in the dlg are different to the given layer's settings, else FALSE.

Definition at line 3130 of file aprps.cpp.

03131 {
03132     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationPropertiessTab::CommitSection called with a NULL dialog pointer");
03133 
03134     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
03135     if (!ok)
03136         return TRUE;
03137 
03138 //  BOOL UseLocalFrameDelayValues = FALSE;  // Flag to determine whether local frame delay values are being used.
03139     UINT32 CurrentDelay = 0;                    //Current delay setting in the animation properties tab. 
03140 
03141     // Retrieve the details stored in the current spread.
03142     AnimPropertiesParam* pParam = &pSpread->GetSpreadAnimPropertiesParam();
03143          
03144     // Get the delay/loop values.
03145     DWORD Loop  = pParam->GetAnimLoop();
03146     DWORD Delay = pParam->GetGlobalAnimDelay();
03147 
03148     // Retreive the current delay/Loop details from the dlg.
03149     BOOL    CurrentLoop_Continously = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_ANIMOPTS_LOOP));
03150     DWORD   CurrentLoop  = pPropertiesDlg->GetLongGadgetValue(_R(IDC_ANIMOPTS_ITERATIONS), 0, 65535, _R(IDS_BMPPREFS_INVALIDLOOP) ,NULL);
03151         
03152     // If "Many" is displayed in the "Delay for" edit field, then we do not want to read the value.
03153     String_256 StrDelay = pPropertiesDlg->GetStringGadgetValue(_R(IDC_ANIMTAB_DELAY), NULL);
03154     INT32 result = camStrnicmp(StrDelay, _T("Many"), 4);
03155             
03156     // Is 'Many' displayed in the delay edit field?
03157     if(result == 0)
03158     {
03159         // Set the flag to TRUE.
03160         m_IsManyDisplayed = TRUE;               
03161 
03162         // Bug fix. 'Many' is displayed in the edit field.
03163         // However, the global delay value is still set to a specific value e.g. 20cs.
03164         // Therefore, if the user sets a new global delay value, and specifies it as say 20cs,
03165         // we then perceive that no change has occurred. Therefore, force the delay value to
03166         // a value greater than 65535.
03167         pSpread->SetAnimationDelay(65536);
03168 
03169         // 'Many' is displayed, therefore set the Current Delay value to the value stored in the spread.
03170         CurrentDelay = Delay;
03171     }
03172     else
03173     {
03174         // 'Many' is not displayed, therefore set the flag to FALSE.
03175         m_IsManyDisplayed = FALSE;
03176 
03177         // Do we want to validate the delay input.
03178         if(ValidateDelayValue)
03179         {
03180             // Get the current delay input.
03181             BOOL DelayValid = FALSE;
03182             CurrentDelay = pPropertiesDlg->GetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), 0, 65535, _R(IDS_BMPPREFS_INVALIDDELAY) ,&DelayValid);
03183 
03184             // If the delay value is invalid, then go no further!
03185             if(!DelayValid)
03186                 return FALSE;
03187         }
03188         else
03189         {
03190             // Get the current delay input.
03191             CurrentDelay = pPropertiesDlg->GetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), 0, 65535, _R(IDS_BMPPREFS_INVALIDDELAY) ,NULL);
03192         }
03193     }
03194 
03195     // If this switch has been ticked, then set the current loop to a zero value.
03196     if(CurrentLoop_Continously)
03197         CurrentLoop = 0;
03198 
03199     // Compare the current values, against those stored in the spread.
03200     return ((CurrentDelay   != Delay)   || 
03201             (CurrentLoop    != Loop));  
03202 }

BOOL AnimationPropertiesTab::Init void   )  [virtual]
 

AnimationPropertiesTab init routine.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if initialised ok, False if failed.

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 2419 of file aprps.cpp.

02420 {   
02421     return TRUE;
02422 }        

BOOL AnimationPropertiesTab::InitSection  )  [virtual]
 

Sets initial values for this tab on the Animation properties dialog box.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 3217 of file aprps.cpp.

03218 {
03219     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationPropertiesTab::InitSection called with no dialog pointer");
03220 
03221     // Get a ptr to the current document.
03222     Document* pDoc = Document::GetCurrent();
03223 
03224     // If there is no document, then grey the tab.
03225     if(!pDoc)
03226     {
03227         GreySection();
03228         return (TRUE);
03229     }
03230 
03231     ShowDetails();
03232 
03233     return TRUE;
03234 }

BOOL AnimationPropertiesTab::IsPropertyRequired  )  [virtual]
 

Allows the Animation properties to determine if this tab is required.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Returns:
Returns True if this tab is a program option.

Reimplemented from PropertyTabs.

Definition at line 2453 of file aprps.cpp.

02454 {
02455     //  If the dialog has been invoked via the options button on the Export dialog box,
02456     //  then hide this tab.
02457     if (GetBrowserPreviewTab())
02458         return FALSE;
02459     else
02460         return TRUE;    // This tab is required         
02461 }

BOOL AnimationPropertiesTab::SetGlobalDelay Spread pSpread,
DWORD  Delay
 

The delay value in the animation properties tab has changed. This is a global value therefore set this value in the frame layer and associated OILbitmap.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
pSpread:- A ptr to the currenT spread. [INPUTS] Delay:- The delay value to store in the layer/OiLBitmap.
- [OUTPUTS]
Returns:
TRUE if successful, else false.

Definition at line 2655 of file aprps.cpp.

02656 {
02657     ERROR2IF(pSpread == NULL,FALSE,"AnimationPropertiesTab::SetGlobalDelay called with NULL Spread pointer");
02658 
02659     // Get a ptr to the first frame layer.
02660     Layer* pLayer = pSpread->FindFirstFrameLayer();
02661     
02662     if(!pLayer)
02663         return FALSE;   // No frame layer.
02664 
02665     // Iterate through the list of layers.
02666     while (pLayer)
02667     {
02668         // Get the kernel bitmap associated with this frame layer. 
02669         // It might be the generated one
02670         KernelBitmap* pKernelBitmap = pLayer->GetGeneratedBitmap();
02671         // or if not present, may be a referenced one, i.e. single node bitmap on the layer
02672         if (pKernelBitmap == NULL)
02673             pKernelBitmap = pLayer->GetReferencedBitmap();
02674 
02675         // Is there a bitmap on this layer?
02676         if(pKernelBitmap != NULL)
02677         {
02678             // Get the OILBitmap assciated with this kernel bitmap.
02679             OILBitmap* pOILBitmap = pKernelBitmap->GetActualBitmap();
02680             if (pOILBitmap == NULL)
02681                 return FALSE;
02682 
02683             // Set the delay value in the OILBitmap.
02684             pOILBitmap->SetBitmapAnimDelay(Delay);
02685         }
02686 
02687         // Set the delay value in the layer.
02688         pLayer->SetFrameDelay(Delay);
02689     
02690         // Get the next frame layer.
02691         pLayer = pLayer->FindNextFrameLayer();
02692     }
02693     
02694     return TRUE;
02695 }

BOOL AnimationPropertiesTab::ShowDetails  )  [protected]
 

Shows the details of the associated spread in this tab.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2839 of file aprps.cpp.

02840 {
02841     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationpropertiseTab::ShowDetails called with no dialog pointer");
02842 
02843     // Ensure we talk to the correct page.
02844     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02845     if (!ok)
02846         return TRUE;        
02847     
02848     // Ensure we have a valid spread ptr.
02849     if (pSpread)
02850     {
02851         // Ignore all DIM_TEXT_CHANGED msgs which are sent from this function.
02852         SetIgnoreTextChangeMsg(TRUE);
02853 
02854         // Retrieve the Animation details for the current spread.
02855         AnimPropertiesParam* pParam = &pSpread->GetSpreadAnimPropertiesParam();
02856         
02857         if(pParam)
02858         {
02859             // Do all the frame layers have the same delay value.
02860             if(SameflDelayValues())
02861             {
02862                 // No frame layers exist.
02863                 if(m_NoFrameLayers) 
02864                 {
02865                     // Take the delay value from the first layer.
02866                     Layer* pLayer = pSpread->FindFirstLayer();
02867                     if (pLayer)
02868                     {
02869                         // Get the delay value for the frame layer.
02870                         DWORD GlobalDelay = pLayer->GetFrameDelay();
02871 
02872                         // Set this frame layer delay value as the new global delay value.
02873                         pSpread->SetAnimationDelay(GlobalDelay);
02874 
02875                         // Display this value in the delay edit field for this tab.
02876                         pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), pLayer->GetFrameDelay()); 
02877                     }
02878 
02879                 }
02880                 else
02881                 {
02882                     // If yes, then Set the numeric value in the "Display each frame for" edit field.
02883                     // Take the delay value from the first frame layer, since all the layers have the same delay value.
02884                     Layer* pLayer = pSpread->FindFirstFrameLayer();
02885                     if (pLayer)
02886                     {
02887 PORTNOTE("other", "Remove FrameSGallery");
02888 #ifndef EXCLUDE_FROM_XARALX
02889                         // Check that all visible layers are actually frame layers
02890                         FrameSGallery::EnsureFrameLayerIntegrity(pSpread);
02891 #endif
02892                         // Get the delay value for the frame layer.
02893                         DWORD GlobalDelay = pLayer->GetFrameDelay();
02894 
02895                         // Set this frame layer delay value as the new global delay value.
02896                         pSpread->SetAnimationDelay(GlobalDelay);
02897 
02898                         // Display this value in the delay edit field for this tab.
02899                         pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMTAB_DELAY), pLayer->GetFrameDelay()); 
02900                     }               
02901                 }
02902             }
02903             else
02904             {
02905                 // The delay values differ, display "MANY" in the delay edit field.
02906                 pPropertiesDlg->SetStringGadgetValue(_R(IDC_ANIMTAB_DELAY), _R(IDS_MANY));                                                  
02907             }
02908 
02909             // Now Set the "Loop for" details.
02910             DWORD Loop = pParam->GetAnimLoop();
02911 
02912             // If the Loop value is zero, grey the loop edit field and check the loop cont. field.
02913             if(Loop == 0)
02914             {
02915                 // Set a value of 1 in the field as zero is a bad value to display
02916                 pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMOPTS_ITERATIONS), 1);
02917                 pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_ITERATIONS), FALSE);
02918                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_ANIMOPTS_LOOP), TRUE);
02919             }
02920             else
02921             {
02922                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_ANIMOPTS_LOOP), FALSE);
02923                 pPropertiesDlg->SetLongGadgetValue(_R(IDC_ANIMOPTS_ITERATIONS), Loop);
02924             }
02925         }
02926     }
02927 
02928     // We once again wish to deal with DIM_TEXT_CHANGED msgs.
02929     SetIgnoreTextChangeMsg(FALSE);
02930 
02931     // Set the controls to the correct state. 
02932     ChangeControlStatus(!m_GreyStatus);
02933 
02934     // Everything ok.
02935     return TRUE;
02936 }

BOOL AnimationPropertiesTab::UngreySection  )  [virtual]
 

Called when a new document has been selected.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from PropertyTabs.

Definition at line 2751 of file aprps.cpp.

02752 {
02753     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationpropertiseTab::UngreySection called with no dialog pointer");
02754 
02755     // Ensure we are talking to the correct page.
02756     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());  
02757     if (!ok)
02758         return TRUE;    
02759 
02760     // Only update if we are not already ungrey 
02761     if (m_GreyStatus == FALSE)
02762         return TRUE;
02763 
02764     // Set the correct control status.
02765     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_ITERATIONS),   TRUE);
02766     pPropertiesDlg->EnableGadget(_R(IDC_ANIMOPTS_LOOP),         TRUE);
02767     pPropertiesDlg->EnableGadget(_R(IDC_ANIMTAB_DELAY),         TRUE);
02768 
02769     // Call our central greying/ungreying function
02770     ok = ChangeControlStatus(TRUE);
02771     
02772     // Set the correct control grey status.
02773     m_GreyStatus = FALSE;
02774 
02775     return ok;
02776 }

BOOL AnimationPropertiesTab::UpdateApplyState  )  [protected, virtual]
 

This changes the 'Apply now' state based on the settings of the active layer and the settings in this tab. If the settings are the same, the 'Apply state' is FALSE, else it is TRUE.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if ok, FALSE otherwise

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 3084 of file aprps.cpp.

03085 {
03086     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationColoursTab::CommitSection called with a NULL dialog pointer");
03087 /*
03088     // Ensure we talk to the correct page.
03089     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
03090     if (!ok)
03091         return TRUE;
03092 
03093     // Have the properties for this tab changed.
03094     if (pSpread != NULL)
03095         AnimationPropertiesTab::SetApplyNowState(HavePropertiesChanged());
03096 
03097     // The new state for the 'Apply/ok/Cancel' buttons.
03098     BOOL NewApplyNowState = AnimationPropertiesTab::GetApplyNowState();
03099 
03100     // If the properties for this tab have changed, then un grey the apply now button.
03101     if (NewApplyNowState  || GetCurrentApplyNow())
03102     {
03103         // Ungrey the apply/ok/cancel buttons.
03104         AnimationPropertiesTab::UngreyApplyNow();
03105     }
03106     else
03107     {
03108         // Grey the apply/ok/cancel buttons.
03109         AnimationPropertiesTab::GreyApplyNow();
03110     }
03111 */
03112     // Everything ok.
03113     return TRUE;
03114 }

BOOL AnimationPropertiesTab::UpdateLayerSection  )  [virtual]
 

Called when the spread-related section of the tab should be updated.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if ok, FALSE otherwise

Reimplemented from PropertyTabs.

Definition at line 2951 of file aprps.cpp.

02952 {
02953     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationPropertiesTab::UpdateLayerSection() called with a NULL dialog pointer");
02954 
02955     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02956     if (!ok)
02957         return TRUE;    
02958 
02959     // Display the details for this tab.
02960     ShowDetails();
02961     
02962     // Everything OK.
02963     return TRUE;
02964 }

BOOL AnimationPropertiesTab::UpdateSection  )  [virtual]
 

Called when we have switched to a new document and need to update all the controls on this tab.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Returns:
-

Reimplemented from PropertyTabs.

Definition at line 2811 of file aprps.cpp.

02812 {
02813     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationPropertiesTab::UpdateSection called with no dialog pointer");
02814 
02815     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02816     if (!ok)
02817         return TRUE;    
02818 
02819     // Display the details for this tab.
02820     ShowDetails();
02821         
02822     // Everythig ok.
02823     return TRUE;
02824 }


Member Data Documentation

BOOL AnimationPropertiesTab::m_GreyStatus [protected]
 

Definition at line 326 of file aprps.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:49:57 2007 for Camelot by  doxygen 1.4.4