AnimationColoursTab Class Reference

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

#include <aprps.h>

Inheritance diagram for AnimationColoursTab:

GIFAnimationPropertyTabs PropertyTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 AnimationColoursTab ()
 AnimationColoursTab constructor.
 ~AnimationColoursTab ()
 AnimationColoursTab destructor.
virtual BOOL Init ()
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the messages for this Animation colours tab.
virtual BOOL InitSection ()
 Sets initial values for this tab on the animation properties dialog box.
virtual BOOL CommitSection ()
 Takes the values in the Animation colours tab. Called when ok or apply now is pressed 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 the user has closed all documents.
virtual BOOL UngreySection ()
 Called when the user has selected a new document.
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 ()
virtual BOOL IsPropertyRequired ()
BOOL ChangeControlStatus (const BOOL Status)
 Called to grey/ungrey all controls on this tab.

Private 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 spread and the settings in this tab. If the settings are the same, the 'Apply state' is FALSE, else it is TRUE.
BOOL HavePropertiesChanged ()

Private Attributes

BOOL m_GreyStatus

Detailed Description

Allows the user to set various Animation Colours.

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

Definition at line 341 of file aprps.h.


Constructor & Destructor Documentation

AnimationColoursTab::AnimationColoursTab  ) 
 

AnimationColoursTab constructor.

/

/*!

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

Definition at line 1528 of file aprps.cpp.

01529 {   
01530     // Does nothing at present.
01531 }            

AnimationColoursTab::~AnimationColoursTab  ) 
 

AnimationColoursTab destructor.

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

Definition at line 1547 of file aprps.cpp.

01548 {   
01549     // Does nothing at present.
01550 }        


Member Function Documentation

BOOL AnimationColoursTab::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 1838 of file aprps.cpp.

01839 {
01840     
01841     // Grey the apply now/ok/cancel buttons.
01842     AnimationColoursTab::GreyApplyNow();
01843     
01844     return TRUE;
01845 }           

BOOL AnimationColoursTab::CommitSection  )  [virtual]
 

Takes the values in the Animation colours tab. Called when ok or apply now is pressed 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 box ok, False otherwise.

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 1622 of file aprps.cpp.

01623 {
01624     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationColoursTab::CommitSection called with a NULL dialog pointer");
01625 
01626     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
01627     if (!ok)
01628         return TRUE;            
01629 
01630     // Have any animation colour properties changed?
01631     if (pSpread && HavePropertiesChanged())
01632     {
01633         PALETTE_COLOURS PalCols;            // Browser/Optimized palette.
01634         WEB_PALETTE     WebPal;             // Global/Local palette.    
01635         DITHER          Dither;             // Current dither type.
01636         DWORD           CurNumColsInPal;    // The current number of colours in the palette.
01637         BOOL            Transparency;   // Whether or not we're transparent.
01638 
01639         // Find the specified Palette type.
01640         if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_GLOBALBROWSER)))
01641         {
01642             PalCols =   PALCOL_BROWSER;
01643             WebPal  =   PAL_GLOBAL;     
01644         }
01645         else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_GLOBALOPTIMISED)))
01646         {
01647             WebPal  = PAL_GLOBAL;
01648             PalCols = PALCOL_OPTIMIZED;     
01649         }
01650         else if(pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_LOCALOPT)))
01651         {
01652             WebPal  = PAL_LOCAL;
01653             PalCols = PALCOL_OPTIMIZED;     
01654         }
01655 
01656         // Find the specified Dither type.
01657         if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION)))
01658             Dither = XARADITHER_ERROR_DIFFUSION;
01659 
01660         else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER)))
01661             Dither = XARADITHER_ORDERED_GREY;
01662         
01663         else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_NODITHER)))
01664             Dither = XARADITHER_NONE;
01665 
01666         // Find the specified number of colours in the palette.
01667         BOOL Valid = FALSE;
01668         CurNumColsInPal = pPropertiesDlg->GetLongGadgetValue(_R(IDC_FRAME_NUMCOLOURS), 2, 256, 0,&Valid);
01669 
01670         // If invalid input, display error message.
01671         if (!Valid)
01672         {
01673             String_256 ErrMsg;
01674             ErrMsg.MakeMsg(_R(IDS_BMPPREFS_NUMCOLSWRONG),2,256);
01675             Error::SetError(0,ErrMsg,0);
01676             InformError();
01677 
01678             return FALSE;
01679         }
01680 
01681         // Find out whether we're transparent or not.
01682         Transparency = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_TRANSPARENCY));
01683 
01684 PORTNOTE("other", "Remove FrameSGallery");
01685 #ifndef EXCLUDE_FROM_XARALX
01686         // Check that all visible layers are actually frame layers
01687         FrameSGallery::EnsureFrameLayerIntegrity(pSpread);
01688 #endif
01689         // Set the new animation colour prefterences in the spread.
01690         pSpread->SetAnimationColours( Dither, WebPal, PalCols, CurNumColsInPal, Transparency);
01691 
01692         // Mark all the frame layers as edited.
01693         Layer* pLayer = pSpread->FindFirstFrameLayer();
01694 
01695         while (pLayer != NULL)
01696         {
01697             // Mark this layer as edited.
01698             pLayer->SetEdited(TRUE);
01699 
01700             // Move to the next frame layer in the spread.
01701             pLayer = pLayer->FindNextFrameLayer();
01702         }               
01703 
01704         // Mark the document as edited.
01705         // Get a ptr to the current document.
01706         Document* pDoc = Document::GetCurrent();
01707 
01708         // Set this document as edited.
01709         if(pDoc)
01710             pDoc->SetModified(TRUE);
01711         
01712         // Is the animation playing.
01713         if (PreviewDialog::GetPreviewDialog())
01714         {
01715             // Stop the animation and regenerate our frames.
01716             //PreviewDialog::SetAnimationPropertiesChanged(TRUE);
01717 
01718             // Invoke the op.
01719             OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_FRAME_GRABALLFRAMES); 
01720             if (pOpDesc != NULL)
01721                 pOpDesc->Invoke();
01722             else
01723             {
01724                 ERROR3("Couldn't find OPTOKEN_FRAME_GRABALLFRAMES op descriptor");
01725             }
01726         }
01727     }
01728 
01729     // Everything ok.
01730     return TRUE;
01731 }

CDlgResID AnimationColoursTab::GetPageID  )  [virtual]
 

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 1582 of file aprps.cpp.

01583 {
01584     return _R(IDD_TAB_ANIMATION_COLOURS);
01585 }

BOOL AnimationColoursTab::GreySection  )  [virtual]
 

Called when the user has closed all documents.

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

Reimplemented from PropertyTabs.

Definition at line 1746 of file aprps.cpp.

01747 {
01748     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationcoloursTab::GreySection called with no dialog pointer");
01749 
01750     //Ensure we are talking to the correct page.
01751     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
01752     if (!ok)
01753         return TRUE;
01754 
01755     // Only update if we are not already grey. 
01756     if (m_GreyStatus == TRUE)
01757         return TRUE;
01758 
01759     // Set the correct state of the controls.
01760     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_GLOBALBROWSER),   FALSE);
01761     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_GLOBALOPTIMISED), FALSE);
01762     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_LOCALOPT),        FALSE);
01763     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS),      FALSE);
01764     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NODITHER),        FALSE);
01765     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_ORDDITHER),       FALSE);
01766     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_DIFFUSION),       FALSE);
01767     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_TRANSPARENCY),    FALSE);
01768 
01769     // Call the central greying/ungreying function
01770     ok = ChangeControlStatus(FALSE);    
01771     
01772     // Set the correct grey status
01773     m_GreyStatus = TRUE;
01774     SetApplyNowState(FALSE);
01775     
01776     // Everything ok.
01777     return ok;
01778 } 

BOOL AnimationColoursTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the messages for this Animation colours tab.

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

Reimplemented from GIFAnimationPropertyTabs.

Definition at line 2078 of file aprps.cpp.

02079 {
02080     ERROR2IF(Msg == NULL,FALSE,"AnimationColoursTab::Message null message received");
02081     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::HandleMsg called with a NULL dialog pointer");
02082 
02083     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02084     if (!ok)
02085         return TRUE;    
02086 
02087     switch(Msg->DlgMsg)
02088     {
02089         case DIM_CREATE:        
02090             m_GreyStatus = FALSE;   
02091             ok = InitSection();
02092             if (!ok)
02093                 InformError();
02094             break;
02095 
02096         case DIM_LFT_BN_CLICKED:
02097         {
02098             HavePropertiesChanged();
02099 
02100             // Set the correct state of the applynow flag.
02101             AnimationColoursTab::SetApplyNowState(TRUE);
02102 
02103             // Ungrey the apply/ok/cancel buttons.
02104             AnimationColoursTab::UngreyApplyNow();
02105         }   
02106         break;
02107 
02108         case DIM_SELECTION_CHANGED: 
02109         {
02110             if(AnimationColoursTab::GetApplyNowState())
02111             {
02112                 // Ungrey the apply/ok/cancel buttons.
02113                 AnimationColoursTab::UngreyApplyNow();
02114             }
02115         }
02116         break;
02117 
02118         case DIM_TEXT_CHANGED:
02119         {
02120             // Do we want to deal with text change msgs?
02121             if(!GetIgnoreTextChangeMsg())
02122             {
02123                 // Have the animation properties changed?
02124                 if(HavePropertiesChanged())
02125                 {
02126                     AnimationColoursTab::SetApplyNowState(TRUE);
02127 
02128                     // Ungrey the apply/ok/cancel buttons.
02129                     AnimationColoursTab::UngreyApplyNow();
02130                 }
02131             }
02132         }
02133         break;
02134 
02135         case DIM_SET_ACTIVE:
02136         {
02137             if(AnimationColoursTab::GetApplyNowState())
02138             {
02139                 // Ungrey the apply/ok/cancel buttons.
02140                 AnimationColoursTab::UngreyApplyNow();
02141             }
02142         }
02143         break;
02144 
02145         default:
02146             break;
02147     }
02148     return TRUE;
02149 }  

BOOL AnimationColoursTab::HavePropertiesChanged  )  [private]
 

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if settings in the dlg are different to those in the spread else FALSE.

Definition at line 2205 of file aprps.cpp.

02206 {
02207     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationColoursTab::HavePropertiesChanged called with a NULL dialog pointer");
02208 
02209     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02210     if (!ok)
02211         return TRUE;
02212 
02213     // Get the current details from animation colours tab.
02214 
02215     PALETTE_COLOURS CurPalCols;                         // Browser/Optimized palette.
02216     WEB_PALETTE     CurWebPal;                          // Global/Local palette.    
02217     DWORD           CurNumColsInPal         = 256;      // The current number of colours in the palette.
02218     BOOL            Global_Browser_Palette  = FALSE;    // Has the Global browser palette switch been selected.
02219     BOOL            Optimized               = FALSE;    // Has the optimized palette switch been selected.
02220     UINT32          CurPaletteType          = 0;        // The current palette type.
02221     UINT32          PaletteType             = 0;        // The palette type stored in the current spread.
02222 
02223 
02224     // Find the selected palette type.
02225     // Global Browser
02226     if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_GLOBALBROWSER)))
02227     {
02228         CurPalCols      =   PALCOL_BROWSER;
02229         CurWebPal       =   PAL_GLOBAL;
02230         CurPaletteType  =   1;
02231         Global_Browser_Palette = TRUE;
02232     }
02233     // Global Optimized
02234     else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_GLOBALOPTIMISED)))
02235     {
02236         CurWebPal       = PAL_GLOBAL;
02237         CurPalCols      = PALCOL_OPTIMIZED;
02238         Optimized       = TRUE;     
02239         CurPaletteType  = 2;
02240         Global_Browser_Palette = FALSE;
02241     }
02242     // Local Optimized
02243     else if(pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_LOCALOPT)))
02244     {
02245         CurWebPal       = PAL_LOCAL;
02246         CurPalCols      = PALCOL_OPTIMIZED;
02247         Optimized       = TRUE;
02248         CurPaletteType  = 3;
02249         Global_Browser_Palette = FALSE;
02250     }
02251 
02252     // If the 'Global browser palette' switch is selected, then the 'Number of colours in palette' editable field is greyed.
02253     if(Global_Browser_Palette)
02254         pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS), FALSE);
02255     else
02256         // Ungrey the 'Number of colours in Palette' editable field.
02257         pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS), TRUE);
02258 
02259     //Find the 'Number of colours in palette' setting.
02260     CurNumColsInPal = pPropertiesDlg->GetLongGadgetValue(_R(IDC_FRAME_NUMCOLOURS), 0, 256, _R(IDS_BMPPREFS_INVALIDDELAY) ,NULL);
02261 
02262     // Get the current dither type.
02263     DITHER CurDither = XARADITHER_NONE;
02264     if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION)))
02265         CurDither = XARADITHER_ERROR_DIFFUSION;
02266 
02267     else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER)))
02268         CurDither = XARADITHER_ORDERED_GREY;
02269         
02270     else if (pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_NODITHER)))
02271         CurDither = XARADITHER_NONE;
02272     
02273     // If the palette is optimized grey out the ordered dither option.
02274     if(Optimized)
02275     {
02276         pPropertiesDlg->EnableGadget(_R(IDC_FRAME_ORDDITHER),FALSE);
02277 
02278         // If the ordered dither option was selected, select the error diffusion option.
02279         if(CurDither == XARADITHER_ORDERED_GREY)
02280             pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),TRUE);
02281             pPropertiesDlg->SetLongGadgetValue(_R(IDC_FRAME_ORDDITHER), FALSE);         
02282     }
02283     else
02284         pPropertiesDlg->EnableGadget(_R(IDC_FRAME_ORDDITHER),TRUE);
02285 
02286     // Get the background transparency setting.
02287     BOOL CurTransparency = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_FRAME_TRANSPARENCY));
02288 
02289     // Retrieve the Animation details for the CURRENT spread.
02290     AnimPropertiesParam* pParam = &pSpread->GetSpreadAnimPropertiesParam();
02291 
02292     ERROR2IF(pParam == NULL,FALSE,"AnimationColoursTab::HavePropertiesChanged makes reference to a NULL ptr!");
02293 
02294     // Get the dither type for the current spread.
02295     DITHER Dither = pParam->GetDither();
02296 
02297     // Get the transparency setting for the current spread.
02298     BOOL Transparency = pParam->GetIsBackGroundTransp();
02299 
02300     // Get the palette type for the current spread.
02301     PALETTE_COLOURS PalCols = pParam->GetPaletteCols();
02302     WEB_PALETTE WebPal = pParam->GetPalette();
02303 
02304     // Set the correct palette type.
02305     if(PalCols == PALCOL_BROWSER && WebPal == PAL_GLOBAL)
02306         PaletteType = 1;
02307         
02308     else if(PalCols == PALCOL_OPTIMIZED && WebPal == PAL_GLOBAL)
02309         PaletteType = 2;
02310             
02311     else if(PalCols ==  PALCOL_OPTIMIZED && WebPal == PAL_LOCAL)
02312         PaletteType = 3;
02313     
02314     // Get the number of colours in the palette  for the current spread.
02315     DWORD NumColsInPal = pParam->GetNumColsInPalette();
02316 
02317     // Compare the new preferences to those stored in the spread.
02318     return
02319         ((CurDither      != Dither)         ||
02320         (CurTransparency != Transparency)   ||
02321         (CurPaletteType  != PaletteType)    ||
02322         (CurNumColsInPal != NumColsInPal));         
02323 }

BOOL AnimationColoursTab::Init void   )  [virtual]
 

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 1565 of file aprps.cpp.

01566 {   
01567     return TRUE;
01568 }        

BOOL AnimationColoursTab::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 2338 of file aprps.cpp.

02339 {
02340     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::InitSection called with a NULL dialog pointer");
02341 
02342     // Get a ptr to the current document.
02343     Document* pDoc = Document::GetCurrent();
02344 
02345     // If there is no document, then grey the tab.
02346     if(!pDoc)
02347     {
02348         GreySection();
02349         return (TRUE);
02350     }
02351 
02352     ShowDetails();
02353     return TRUE;
02354 }

BOOL AnimationColoursTab::IsPropertyRequired  )  [virtual]
 

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 1597 of file aprps.cpp.

01598 {
01599     //  If the dialog has been invoked via the options button on the Export dialog box,
01600     //  then hide this tab.
01601     if (GetBrowserPreviewTab())
01602         return FALSE;
01603     else
01604         return TRUE;    // This tab is required     
01605 }

BOOL AnimationColoursTab::ShowDetails  )  [private]
 

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 1888 of file aprps.cpp.

01889 {
01890     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::ShowDetails called with a NULL dialog pointer");
01891 
01892     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
01893     if (!ok)
01894         return TRUE;        
01895 
01896     if (pSpread != NULL)
01897     {
01898         // Ignore all DIM_TEXT_CHANGED msgs which are sent from this function.
01899         SetIgnoreTextChangeMsg(TRUE);
01900 
01901         // Retrieve the Animation details for the current spread.
01902         AnimPropertiesParam* pParam = &pSpread->GetSpreadAnimPropertiesParam();
01903 
01904         if(pParam)
01905         {
01906             // Set the correct dithering.
01907             DITHER Dither = pParam->GetDither();    
01908 
01909             switch(Dither)
01910             {
01911                 case XARADITHER_NONE:
01912                 {
01913                     // Select the no dither radio button.
01914                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_NODITHER),TRUE);
01915     
01916                     // The remaining dither radio buttons should not be selected.
01917                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER),FALSE);
01918                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),FALSE);
01919                 }
01920                 break;
01921 
01922                 case XARADITHER_ORDERED_GREY:
01923                 {
01924                     // Select the ordered dither radio button.
01925                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER),TRUE);
01926 
01927                     // The remaining dither radio buttons should not be selected.
01928                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),FALSE);
01929                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_NODITHER),FALSE);
01930                 }
01931                 break;
01932 
01933                 case XARADITHER_ERROR_DIFFUSION:
01934                 {
01935                     // Select the error diffusion radio button.
01936                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),TRUE);                    
01937 
01938                     // The remaining dither radio buttons should not be selected.
01939                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_NODITHER),FALSE);
01940                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER),FALSE);
01941                 }
01942                 break;
01943                 default:
01944                 {
01945                     // Select the ordered dither radio button.
01946                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_ORDDITHER),TRUE);                        
01947 
01948                     // The remaining dither radio buttons should not be selected.
01949                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),FALSE);
01950                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_NODITHER),FALSE);
01951                 }
01952                 break;
01953             }
01954 
01955             // Set the correct transparency setting.
01956             pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_TRANSPARENCY), pParam->GetIsBackGroundTransp());
01957 
01958             // Set the correct Palette details.
01959             PALETTE_COLOURS PalCols = pParam->GetPaletteCols();     // Palette colours.
01960             WEB_PALETTE WebPal = pParam->GetPalette();              // Palette type.    
01961             BOOL Optimized = FALSE;                                 // Has the optimized palette switch been selected.
01962             BOOL GlobalBrowserPalette = FALSE;                      // Is the gloab browser palette option selected.
01963             
01964             // Global Browser Palette.
01965             if(WebPal == PAL_GLOBAL && PalCols == PALCOL_BROWSER)
01966             {
01967                 // Select the global browser pallette radio button.
01968                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALBROWSER),TRUE);
01969                 GlobalBrowserPalette = TRUE;
01970 
01971                 // The remaining radio buttons should not be selected.
01972                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALOPTIMISED),FALSE);
01973                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_LOCALOPT),FALSE);                
01974             }
01975             
01976             // Global Optimized Palette.
01977             if(WebPal == PAL_GLOBAL && PalCols == PALCOL_OPTIMIZED)
01978             {
01979                 // Select the Global Optimized Palette.
01980                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALOPTIMISED),TRUE);
01981                 Optimized = TRUE;
01982                 
01983                 // The remaining radio buttons should not be selected.
01984                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALBROWSER),FALSE);
01985                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_LOCALOPT),FALSE);                
01986             }
01987             
01988             // Optimized Palette.
01989             if(WebPal == PAL_LOCAL && PalCols == PALCOL_OPTIMIZED)
01990             {
01991                 //Select the Optimized Palette.
01992                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_LOCALOPT),TRUE);
01993                 Optimized = TRUE;
01994 
01995                 // The remaining radio buttons should not be selected.
01996                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALBROWSER),FALSE);
01997                 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_GLOBALOPTIMISED),FALSE);
01998             }
01999 
02000             // If the palette is optimized grey out the ordered dither switch.
02001             if(Optimized)
02002             {
02003                 // Grey the ordered dither switch.
02004                 pPropertiesDlg->EnableGadget(_R(IDC_FRAME_ORDDITHER),FALSE);
02005 
02006                 // Ungrey the 'Number of colours in Palette' editable field.
02007                 pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS), TRUE);
02008 
02009                 // If the ordered dither option was selected, select the error diffusion option.
02010                 if(Dither == XARADITHER_ORDERED_GREY)
02011                     pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_FRAME_DIFFUSION),TRUE);
02012             }
02013 
02014             // Set the correct "Number of colours in Palette" editable field.
02015             // If the 'Global browser palette' switch is selected, then the "Number of colours in palette" editable field is greyed.
02016             if(GlobalBrowserPalette)
02017             {
02018                 DWORD NumColsInPalette = pParam->GetNumColsInPalette();
02019                 pPropertiesDlg->SetLongGadgetValue(_R(IDC_FRAME_NUMCOLOURS), NumColsInPalette);
02020                 pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS), FALSE);
02021             }
02022             else
02023             {
02024                 DWORD NumColsInPalette = pParam->GetNumColsInPalette();
02025                 pPropertiesDlg->SetLongGadgetValue(_R(IDC_FRAME_NUMCOLOURS), NumColsInPalette);
02026             }
02027         }
02028     }
02029 
02030     // We once again wish to deal with DIM_TEXT_CHANGED msgs.
02031     SetIgnoreTextChangeMsg(FALSE);
02032 
02033     // Set the controls to the correct state. 
02034     ChangeControlStatus(!m_GreyStatus);
02035     return TRUE;
02036 }

BOOL AnimationColoursTab::UngreySection  )  [virtual]
 

Called when the user has selected a new document.

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

Reimplemented from PropertyTabs.

Definition at line 1793 of file aprps.cpp.

01794 {
01795     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::UngreySection called with a NULL dialog pointer");
01796 
01797     // Ensure we are talking to the correct page.
01798     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
01799     if (!ok)
01800         return TRUE;
01801 
01802     // Only update if we are not already ungrey. 
01803     if (m_GreyStatus == FALSE)
01804         return TRUE;
01805 
01806     // Set the correct state of the controls.
01807     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_GLOBALBROWSER),   TRUE);
01808     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_GLOBALOPTIMISED), TRUE);
01809     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_LOCALOPT),        TRUE);
01810     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NUMCOLOURS),      TRUE);
01811     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_NODITHER),        TRUE);
01812     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_ORDDITHER),       TRUE);
01813     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_DIFFUSION),       TRUE);
01814     pPropertiesDlg->EnableGadget(_R(IDC_FRAME_TRANSPARENCY),    TRUE);
01815 
01816     // Call the central greying/ungreying function
01817     ok = ChangeControlStatus(TRUE); 
01818     
01819     m_GreyStatus = FALSE;
01820 
01821     return ok;
01822 }

BOOL AnimationColoursTab::UpdateApplyState  )  [private, virtual]
 

This changes the 'Apply now' state based on the settings of the active spread 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 2166 of file aprps.cpp.

02167 {
02168     ERROR2IF(pPropertiesDlg == NULL,FALSE,"animationColoursTab::CommitSection called with a NULL dialog pointer");
02169 /*
02170     // Ensure we talk ot the correct page.
02171     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02172     if (!ok)
02173         return TRUE;
02174 
02175     // Have the properties for this tab changed.
02176     if (pSpread != NULL)
02177         AnimationColoursTab::SetApplyNowState(HavePropertiesChanged());
02178 
02179     // The new state for the 'Apply/ok/Cancel' buttons.
02180     BOOL NewApplyNowState = AnimationColoursTab::GetApplyNowState();
02181 
02182     // If the properties for this tab have changed, then ungrey the apply now button.
02183     if (NewApplyNowState || GetCurrentApplyNow())
02184     {
02185             // Ungrey the apply/ok/cancel buttons.
02186             AnimationColoursTab::UngreyApplyNow();
02187     }
02188 */  
02189     // Everything ok.
02190     return TRUE;
02191 }

BOOL AnimationColoursTab::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 2050 of file aprps.cpp.

02051 {
02052     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::UpdateLayerSection() called with a NULL dialog pointer");
02053 
02054     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
02055     if (!ok)
02056         return TRUE;    
02057 
02058     // Display the details in this tab.
02059     ShowDetails();
02060         
02061     // Everything ok.
02062     return TRUE;
02063 }

BOOL AnimationColoursTab::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 1860 of file aprps.cpp.

01861 {
01862     ERROR2IF(pPropertiesDlg == NULL,FALSE,"AnimationColoursTab::UpdateSection called with a NULL dialog pointer");
01863 
01864     // Ensure we talk to the correct page.
01865     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
01866     if (!ok)
01867         return TRUE;        
01868 
01869     // Show the correct details.
01870     ShowDetails();
01871 
01872     return TRUE;
01873 }


Member Data Documentation

BOOL AnimationColoursTab::m_GreyStatus [private]
 

Definition at line 365 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