GIFAnimationPropertyTabsDlg Class Reference

#include <aprps.h>

Inheritance diagram for GIFAnimationPropertyTabsDlg:

DialogTabOp DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject AnimExOptns List of all members.

Public Member Functions

 GIFAnimationPropertyTabsDlg (CDlgResID DummyDialogResID, CDlgMode Mode)
 GIFAnimationPropertyTabsDlg constructor. This allows us to specify a new dialog resource id and a different mode. This constructor is overloaded since if the dialog is invoked through the options button on the GIF Export options dialog, then we need to specify a different resouce ID and make the dialog MODAL.
 GIFAnimationPropertyTabsDlg ()
 GIFAnimationPropertyTabsDlg default constructor.
 ~GIFAnimationPropertyTabsDlg ()
 GIFAnimationPropertyTabsDlg destructor.
void Do (OpDescriptor *)
 Creates then opens the dialog in response to a request from the user.
virtual MsgResult Message (Msg *Message)
virtual BOOL RegisterYourPagesInOrderPlease ()
 This function will get called to give us a chance to add our pages to the DialogTabOp.
BOOL CommitDialogValues ()
 Takes the values in the dialog box and sets the return values accordingly Called when ok is pressed on the dialog box.

Static Public Member Functions

static BOOL Init ()
static void Deinit ()
static OpState GetState (String_256 *, OpDescriptor *)
 GIFAnimationPropertyTabsDlg GetState method.
static GIFAnimationPropertyTabsGetGIFAnimationPropertiesTabs ()
static GIFAnimationPropertyTabsDlgGetGIFAnimationPropertyTabsDlg ()
static void SetPageToOpen (INT32 val)
static BOOL GetPageToOpen ()

Static Public Attributes

static const CDlgResID IDD = _R(IDD_PROPERTIES)
static CDlgMode Mode = MODELESS

Protected Attributes

String_256 TitleString

Static Protected Attributes

static GIFAnimationPropertyTabsm_pGIFAnimationProperties = NULL
static INT32 m_PageToOpen = -1
static GIFAnimationPropertyTabsDlgm_pGIFAnimationPropertyTabsDlg = NULL

Detailed Description

Definition at line 133 of file aprps.h.


Constructor & Destructor Documentation

GIFAnimationPropertyTabsDlg::GIFAnimationPropertyTabsDlg CDlgResID  DialogResID,
CDlgMode  Mode
 

GIFAnimationPropertyTabsDlg constructor. This allows us to specify a new dialog resource id and a different mode. This constructor is overloaded since if the dialog is invoked through the options button on the GIF Export options dialog, then we need to specify a different resouce ID and make the dialog MODAL.

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

Definition at line 230 of file aprps.cpp.

00230                                                                                             : DialogTabOp(DialogResID, Mode,
00231                                                                         CC_RUNTIME_CLASS(DialogOp), GIFAnimationPropertyTabsDlg::GetPageToOpen())
00232 {
00233     if (m_pGIFAnimationProperties)
00234     {
00235         m_pGIFAnimationProperties->SetApplyNowState(FALSE);     // grey the apply now button
00236         m_pGIFAnimationProperties->SetInitMessageState(FALSE);  // not sending an init message
00237 
00238         // The Document and spread we are supposed to be working on. 
00239         m_pGIFAnimationProperties->pScopeDocument = NULL;           
00240         m_pGIFAnimationProperties->SetCurrentDocAndSpread(NULL);        
00241 
00242         //Increment the count, as another instance of the dialog has been created.
00243         UINT32 Val=1;
00244         m_pGIFAnimationProperties->IncCount(Val);
00245 
00246         // Create a static link to this dialog class.
00247         m_pGIFAnimationPropertyTabsDlg = this;
00248     }
00249 }

GIFAnimationPropertyTabsDlg::GIFAnimationPropertyTabsDlg  ) 
 

GIFAnimationPropertyTabsDlg default constructor.

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

Definition at line 192 of file aprps.cpp.

00192                                                         : DialogTabOp(GIFAnimationPropertyTabsDlg::IDD, GIFAnimationPropertyTabsDlg::Mode,
00193                                                                         CC_RUNTIME_CLASS(DialogOp), GIFAnimationPropertyTabsDlg::GetPageToOpen())
00194 {
00195     if (m_pGIFAnimationProperties)
00196     {
00197         m_pGIFAnimationProperties->SetApplyNowState(FALSE);     // grey the apply now button
00198         m_pGIFAnimationProperties->SetInitMessageState(FALSE);  // not sending an init message
00199 
00200         // The Document and spread we are supposed to be working on. 
00201         m_pGIFAnimationProperties->pScopeDocument = NULL;           
00202         m_pGIFAnimationProperties->SetCurrentDocAndSpread(NULL);        
00203 
00204         //Increment the count, as another instance of the dialog has been created.
00205         UINT32 Val=1;
00206         m_pGIFAnimationProperties->IncCount(Val);
00207 
00208         // Create a static link to this dialog class.
00209         m_pGIFAnimationPropertyTabsDlg = this;
00210     }
00211 }

GIFAnimationPropertyTabsDlg::~GIFAnimationPropertyTabsDlg  ) 
 

GIFAnimationPropertyTabsDlg destructor.

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

Definition at line 264 of file aprps.cpp.

00265 {
00266     // Ensure we have a valid ptr.
00267     if (m_pGIFAnimationProperties)
00268     {
00269         // Remove the link to the options tabs if all the dialogs have been closed. 
00270         if(m_pGIFAnimationProperties->GetCount() < 1)
00271         {
00272             // Remove the options tabs link to the dialog box class.
00273             m_pGIFAnimationProperties->SetTabbedDlg(NULL);
00274         }
00275 
00276         // A dialog has been destroyed, therefore decrement m_count.
00277         UINT32 Count =1;
00278         m_pGIFAnimationProperties->DecCount(Count);
00279 
00280         // Kill the static link to this dialog class.
00281         m_pGIFAnimationPropertyTabsDlg = NULL;
00282 
00283         // Set this flag to FALSE.
00284         m_pGIFAnimationProperties->SetCurrentApplyNow(FALSE);
00285     }
00286 }


Member Function Documentation

BOOL GIFAnimationPropertyTabsDlg::CommitDialogValues  ) 
 

Takes the values in the dialog box and sets the return values accordingly Called when ok is pressed on the 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.

Definition at line 302 of file aprps.cpp.

00303 {
00304     // Ok has been pressed so take the values from the dialog box.
00305     BOOL ok = TRUE;
00306     BOOL ValuesOk = TRUE;
00307 
00308     // Make sure we work on the correct document and spread.
00309     Document *pDocument = Document::GetSelected();
00310     m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00311 
00312     // Tell all the tabs to commit their values.
00313     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00314 
00315     // Continue while we have a valid tab ptr.
00316     while (pGIFAnimationPropertyTabs != NULL)
00317     {
00318         // Only get the tab to commit if it is in use.
00319         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00320         {
00321             // Get the found page to commit its values.
00322             ok = pGIFAnimationPropertyTabs->CommitSection();
00323             if ( ok != TRUE)
00324             {
00325                 if (ok == 2)
00326                     InformError();      
00327 
00328                 // Carry on with other pages.
00329                 ValuesOk = FALSE;   
00330             }
00331             // Set the apply now flag to FALSE.
00332             pGIFAnimationPropertyTabs->SetApplyNowState(FALSE);
00333 
00334             // Grey yhe apply now/ok/Cancel buttons.
00335             pGIFAnimationPropertyTabs->GreyApplyNow();  
00336         }
00337         // Get the next option's tab.
00338         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00339     }
00340 
00341     // Return whether we found bad values or not.
00342     return ValuesOk;
00343 }

void GIFAnimationPropertyTabsDlg::Deinit  )  [static]
 

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

Definition at line 897 of file aprps.cpp.

00898 {
00899     // Remove all options tabs which have been declared to the system.
00900     GIFAnimationPropertyTabs::DeinitGIFAnimationPropertyTabs(); 
00901     m_pGIFAnimationProperties = NULL;
00902 }

void GIFAnimationPropertyTabsDlg::Do OpDescriptor  )  [virtual]
 

Creates then opens the dialog in response to a request from the user.

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

Reimplemented from Operation.

Reimplemented in AnimExOptns.

Definition at line 918 of file aprps.cpp.

00919 {
00920     BOOL ok = FALSE;
00921 
00922     if (m_pGIFAnimationProperties == NULL)
00923     {
00924         // Could not create the dialog box.
00925         ERROR3("GIFAnimationPropertyTabsDlg::Do no AnimationProperties present");
00926         End();
00927     }
00928 
00929     //Set up the name that the main dialog page will use.
00930     String_256 Temp(_R(IDS_ANIMATION_TAB_DLG)); 
00931     TitleString = Temp;
00932     SetName(&TitleString);
00933     
00934     // Make sure that our options tabs have a link to the dialog box class
00935     GIFAnimationPropertyTabs::SetTabbedDlg(this);
00936 //  m_pGIFAnimationProperties->SetApplyNowState(TRUE);
00937 
00938     // Force the dialog box to be created, as it is non-modal it must be opened if the create works ok.
00939     ok = Create();      
00940 
00941     // Make sure we know the current document and spread to work on.
00942     Document *pDocument = Document::GetSelected();
00943     m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00944 
00945     if ( ok )
00946     {
00947         Open(); 
00948 
00949         // Grey out the apply now button. 
00950         m_pGIFAnimationProperties->SetInitMessageState(FALSE);
00951         m_pGIFAnimationProperties->SetApplyNowState(FALSE);
00952         m_pGIFAnimationProperties->GreyApplyNow();      
00953     }
00954     else
00955     {
00956         // Something went wrong!
00957         InformError();              
00958         End();                      
00959     }                   
00960 }

GIFAnimationPropertyTabs * GIFAnimationPropertyTabsDlg::GetGIFAnimationPropertiesTabs  )  [static]
 

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the animation property tabs handling class.

Definition at line 1010 of file aprps.cpp.

01011 {
01012     return m_pGIFAnimationProperties;
01013 }

static GIFAnimationPropertyTabsDlg* GIFAnimationPropertyTabsDlg::GetGIFAnimationPropertyTabsDlg  )  [inline, static]
 

Definition at line 158 of file aprps.h.

static BOOL GIFAnimationPropertyTabsDlg::GetPageToOpen  )  [inline, static]
 

Definition at line 161 of file aprps.h.

00161 { return m_PageToOpen; }

OpState GIFAnimationPropertyTabsDlg::GetState String_256 ,
OpDescriptor
[static]
 

GIFAnimationPropertyTabsDlg GetState method.

> OpState GIFAnimationPropertyTabsDlg::GetState(String_256*, OpDescriptor*)

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

Reimplemented in AnimExOptns.

Definition at line 830 of file aprps.cpp.

00831 {    
00832     OpState OpSt;
00833 
00834     // If the pointer is non-null grey the menu option. 
00835     if (m_pGIFAnimationProperties && m_pGIFAnimationProperties->GetTabbedDlg() != NULL)
00836         OpSt.Greyed = TRUE;
00837     
00838     return(OpSt);
00839 }

BOOL GIFAnimationPropertyTabsDlg::Init void   )  [static]
 

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

Reimplemented from SimpleCCObject.

Reimplemented in AnimExOptns.

Definition at line 853 of file aprps.cpp.

00854 {
00855     BOOL InitOK;
00856 
00857     // Register ourselves with the dialog system.
00858     InitOK = RegisterOpDescriptor(
00859                                 0,                                                          // Tool ID                                                              
00860                                 _R(IDS_ANIMATION_TAB_DLG),                                      // String resource ID
00861                                 CC_RUNTIME_CLASS(GIFAnimationPropertyTabsDlg),              // Runtime class
00862                                 OPTOKEN_GIFANIMPROPERTYTABS,                                // Token string
00863                                 GetState,                                                   // GetState function
00864                                 0,                                                          // help ID
00865                                 0,                                                          // bubble help
00866                                 0, //_R(IDD_BARCONTROLSTORE),                                   // resource ID
00867                                 0, //_R(IDC_BTN_OPTIONSDLG),                                    // control ID
00868                                 SYSTEMBAR_ILLEGAL,                                          // Bar ID
00869                                 TRUE,                                                       // Recieve system messages
00870                                 FALSE,                                                      // Smart duplicate operation
00871                                 TRUE,                                                       // Clean operation
00872                                 0,                                                          // No vertical counterpart
00873                                 _R(IDS_ANIMATION_TAB_DLG_ONE),                                  // String for one copy only error
00874                                 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC)   // Auto state flags
00875                                 );
00876 
00877     // Set up any animation property tabs that are required and get a link to them.
00878     InitOK = InitOK && GIFAnimationPropertyTabs::InitGIFAnimationPropertyTabs();    
00879     m_pGIFAnimationProperties = GIFAnimationPropertyTabs::GetFirst();
00880 
00881     return (InitOK);
00882 }

MsgResult GIFAnimationPropertyTabsDlg::Message Msg Message  )  [virtual]
 

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/06/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
OK Message handled ok. FAIL Something terrible happened whilst processing the message. EAT_MSG The Message was handled ok but don't send it to any more MessageHandlers.

Reimplemented from DialogTabOp.

Reimplemented in AnimExOptns.

Definition at line 359 of file aprps.cpp.

00360 {
00361     ERROR3IF(Message == NULL,"GIFAnimationPropertyTabsDlg::Message NULL message received");
00362     ERROR3IF(m_pGIFAnimationProperties == NULL,"GIFAnimationPropertyTabsDlg::Message no m_pGIFAnimationProperties ptr");
00363     
00364     // Cope with document changing messages. 
00365     if (MESSAGE_IS_A(Message, DocChangingMsg))
00366     {
00367         DocChangingMsg *TheMsg = (DocChangingMsg *) Message;
00368 
00369         switch ( TheMsg->State )
00370         {
00371             case DocChangingMsg::SELCHANGED:
00372             {
00373                 // In different cases we use different document pointers.
00374                 Document *pDocument = NULL;
00375                 if (TheMsg->State == DocChangingMsg::TITLECHANGED)
00376                 {
00377                     // Document title has changed message.
00378                     pDocument = TheMsg->pChangingDoc;
00379                 }
00380                 else
00381                 {
00382                     // Document selection changed.
00383                     pDocument = TheMsg->pNewDoc;
00384                 }
00385                             
00386                 // Make sure that the tabs know what is the current document and spread to work on.
00387                 m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00388 
00389                 // Ensure correct current document units.
00390                 m_pGIFAnimationProperties->SetUpDocUnits();
00391 
00392                 // Is there a new document.
00393                 if (pDocument == NULL)
00394                 {
00395                     // Make sure all the tabs update themselves.
00396                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00397 
00398                     while (pGIFAnimationPropertyTabs != NULL)
00399                     {
00400                         // Only get the tab to update if it is in use.
00401                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00402                         {
00403                             // Get that tab to update itself.
00404                             pGIFAnimationPropertyTabs->GreySection();
00405                         }
00406 
00407                         // Get the next option's tab.
00408                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00409                     }
00410                 }
00411                 else
00412                 {
00413                     // Make sure all the tabs update themselves.
00414                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00415 
00416                     while (pGIFAnimationPropertyTabs != NULL)
00417                     {
00418                         // Only get the tab to update if it is currently in use.
00419                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00420                         {
00421                             // Get this tab to update itself.
00422                             pGIFAnimationPropertyTabs->UngreySection();
00423                         }
00424                         // Get the next option's tab.
00425                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00426                     }
00427                 }
00428             }
00429             break;
00430             
00431             // This message is sent when a new or just opened document is stable.
00432             case DocChangingMsg::BORNANDSTABLE:
00433             {
00434                 // Get the changing document pointer.
00435                 Document *pDocument = NULL;
00436                 pDocument = TheMsg->pChangingDoc;
00437                 if (pDocument != NULL)
00438                 {
00439                     // Ensure all the tabs update themsleves.
00440                     m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00441 
00442                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00443 
00444                     while (pGIFAnimationPropertyTabs != NULL)
00445                     {
00446                         // Only get the tab to update if it is in use
00447                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00448                         {
00449                             // Get that tab to update itself.
00450                             pGIFAnimationPropertyTabs->UpdateSection();
00451                         }
00452 
00453                         // Get the next options tab.
00454                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00455                     }
00456                 }
00457             }
00458             break;
00459 
00460             default:
00461                 break;
00462         }
00463     }
00464 
00465     // Cope with document view changing messages so that we allow all the tabs to update themselves when switching to a new view.
00466     if (MESSAGE_IS_A(Message, DocViewMsg))
00467     {
00468         DocViewMsg *TheMsg = (DocViewMsg *) Message;
00469 
00470         switch ( TheMsg->State )
00471         {
00472             case DocViewMsg::SELCHANGED:
00473             {
00474                 if (TheMsg->pNewDocView != NULL)
00475                 {
00476                     // Ensure all the tabs update themsleves.
00477                     Document *pDocument = TheMsg->pNewDocView->GetDoc();
00478                     m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00479 
00480                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00481 
00482                     while (pGIFAnimationPropertyTabs != NULL)
00483                     {
00484                         // Only get the tab to update if it is in use.
00485                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00486                         {
00487                             // Get that tab to update itself.
00488                             pGIFAnimationPropertyTabs->UpdateSection();
00489                         }
00490 
00491                         // Get the next option's tab.
00492                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00493                     }
00494                 }
00495             }
00496             break;
00497 
00498             default:
00499                 break;
00500         }
00501     }
00502 
00503     // Cope with document view changing messages so that we allow all the tabs to update themselves when switching to a new view.
00504     if (MESSAGE_IS_A(Message, SpreadMsg))
00505     {
00506         SpreadMsg *TheMsg = (SpreadMsg *) Message;
00507 
00508         switch ( TheMsg->Reason )
00509         {
00510             // The selected spread has changed
00511             case SpreadMsg::SELCHANGED:
00512             {
00513                 if (TheMsg->pNewSpread != NULL)
00514                 {
00515                     // Ensure all the tabs update themselves.
00516                     Document *pDocument = (Document *)TheMsg->pNewSpread->FindOwnerDoc();
00517                     m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00518 
00519                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00520 
00521                     while (pGIFAnimationPropertyTabs != NULL)
00522                     {
00523                         // Only get the tab to update if it is in use.
00524                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00525                         {
00526                             // Get that tab to update itself.
00527                             pGIFAnimationPropertyTabs->UpdateLayerSection();
00528                         }
00529 
00530                         // Get the next option's tab.
00531                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00532                     }
00533                 }
00534             }
00535             break;
00536 
00537             case SpreadMsg::ANIMATIONPROPERTIESCHANGED:
00538             {
00539                 GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00540 
00541                     while (pGIFAnimationPropertyTabs != NULL)
00542                     {
00543                         // Only get the tab to update if it is in use.
00544                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00545                         {
00546                             // Get that tab to update itself.
00547                             pGIFAnimationPropertyTabs->UpdateLayerSection();
00548                         }
00549                         // Get the next option's tab.
00550                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00551                     }
00552             }
00553             break;
00554 
00555             default:
00556                 break;
00557         }
00558     }
00559 
00560     // Handle a layer changing message.
00561     if (MESSAGE_IS_A(Message, LayerMsg))
00562     {
00563         LayerMsg *TheMsg = (LayerMsg *) Message;
00564 
00565         switch ( TheMsg->Reason )
00566         {
00567             // The active layer has changed.
00568             case LayerMsg::ACTIVE_LAYER_CHANGED:
00569             {
00570                 if (TheMsg->pNewLayer != NULL)
00571                 {
00572                     // Ensure all the tabs update themsleves.
00573                     m_pGIFAnimationProperties->SetActiveLayer(TheMsg->pNewLayer);
00574 
00575                     // While Loop flag.
00576 //                  BOOL FoundPage = FALSE;
00577 
00578                     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00579 
00580                     while (pGIFAnimationPropertyTabs != NULL)
00581                     {
00582                         //  Get the page Id.
00583                         CDlgResID PageId = pGIFAnimationPropertyTabs->GetPageID();
00584 
00585                         // For Layer messages we only update the frame properties tab.
00586                         if (PageId == _R(IDD_TAB_FRAME_PROPERTIES) || PageId == _R(IDD_TAB_ANIMATION_PROPERTIES))
00587                         {
00588                             // Only get the tab to update if it is in use.
00589                             if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00590                             {
00591                                 // Get that tab to update itself.
00592                                 pGIFAnimationPropertyTabs->UpdateLayerSection();
00593 
00594                                 // Exit the while loop 
00595                             //  FoundPage = TRUE;
00596                             }
00597                         }
00598                         // Get the next option's tab.
00599                         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00600                     }
00601                 }
00602             }
00603             break;
00604 
00605             // The active layer has been updated.
00606             case LayerMsg::UPDATE_ACTIVE_LAYER:
00607             {
00608                 // While Loop flag.
00609                 BOOL FoundPage = FALSE;
00610 
00611                 // Ensure all the tabs update themsleves.
00612                 m_pGIFAnimationProperties->SetActiveLayer(TheMsg->pNewLayer);
00613 
00614                 GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00615 
00616                 while (pGIFAnimationPropertyTabs != NULL && !FoundPage)
00617                 {
00618                     //  Get the page Id.
00619                     CDlgResID PageId = pGIFAnimationPropertyTabs->GetPageID();
00620 
00621                     // For Layer messages we only update the frame properties tab.
00622                     if (PageId == _R(IDD_TAB_FRAME_PROPERTIES))
00623                     {
00624                         // Only get the tab to update if it is in use.
00625                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00626                         {
00627                             // Get that tab to update itself.
00628                             pGIFAnimationPropertyTabs->UpdateLayerSection();
00629 
00630                             // Exit the loop.
00631                             FoundPage = TRUE;
00632                         }
00633                     }
00634                     // Get the next option's tab.
00635                     pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00636                 }
00637                 break;
00638             }
00639             default:
00640                 break;
00641         }
00642     }
00643 
00644     // The Browser Preview options have changed.
00645     if (MESSAGE_IS_A(Message, BrowserPrvwChgdMsg))
00646     {
00647         BrowserPrvwChgdMsg *TheMsg = (BrowserPrvwChgdMsg *) Message;
00648 
00649         switch ( TheMsg->State )
00650         {
00651             case BrowserPrvwChgdMsg::PROPERTIES_CHANGED:
00652             {
00653                 // The properties have changed, so update the Browser preview tab.
00654 
00655                 // While Loop flag.
00656                 BOOL FoundPage = FALSE;
00657 
00658                 // Get a ptr to the first tab.
00659                 GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00660 
00661                 // Loop untill we get aptr to the Preview in browser tab.
00662                 while (pGIFAnimationPropertyTabs != NULL && !FoundPage)
00663                 {
00664                     //  Get the page Id.
00665                     CDlgResID PageId = pGIFAnimationPropertyTabs->GetPageID();
00666 
00667                     // For bitmap preview properties changed messages we only update the Browser preview tab.
00668                     if (PageId == _R(IDD_TAB_PREVIEW_IN_BROWSER))
00669                     {
00670                         // Only get the tab to update if it is in use.
00671                         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00672                         {
00673                             // Get that tab to update itself.
00674                             pGIFAnimationPropertyTabs->UpdateLayerSection();
00675 
00676                             // Exit the while loop 
00677                             FoundPage = TRUE;
00678                         }
00679                     }
00680                     // Get the next option's tab.
00681                     pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00682                 }
00683                 break;
00684             }
00685             default:
00686                 break;
00687         }
00688     }
00689 
00690     // Handle messages for the dialog box.
00691     if (IS_OUR_DIALOG_MSG(Message))
00692     {
00693         DialogMsg* Msg = (DialogMsg*)Message;
00694 
00695         MsgResult Result;
00696 
00697         // Main handler for dialog type messages
00698         BOOL EndDialog = FALSE;                                         // TRUE if we should quit the dialog
00699         BOOL CommitValues = FALSE;                                      // TRUE if we should commit the dialog values
00700         /*BOOL OldApplyNow =*/ m_pGIFAnimationProperties->GetApplyNowState();   // Old ApplyNow button state  
00701 
00702         // Make sure that the tabs know what is the current document and spread to work on.
00703         Document *pDocument = Document::GetSelected();
00704         m_pGIFAnimationProperties->SetCurrentDocAndSpread(pDocument);
00705 
00706         // Make sure that the current document units are correct.
00707         m_pGIFAnimationProperties->SetUpDocUnits();
00708             
00709         // Check if sending init/create message and if so set flag True.
00710         // If True then do not ungrey the ApplyNow button on changing messages
00711         if (Msg->DlgMsg == DIM_CREATE)
00712             m_pGIFAnimationProperties->SetInitMessageState(TRUE);               
00713 
00714         // If the message is not for the main winndow then try the tab pages.
00715         BOOL FoundPage = FALSE;
00716 
00717         if (Msg->PageID != 0)
00718         {
00719             //Go through all the tabs declared to the system and see if the message is for that page.
00720             GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00721 
00722             while (pGIFAnimationPropertyTabs != NULL&& !FoundPage)
00723             {
00724                 CDlgResID PageId = pGIFAnimationPropertyTabs->GetPageID();
00725                 if (PageId == Msg->PageID)
00726                 {
00727                     // Found the correct page so stop the search and send the message to that page
00728                     pGIFAnimationPropertyTabs->HandleMsg(Msg);
00729                     FoundPage = TRUE;
00730                 }
00731                 // Get the next tab.
00732                 pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);                           
00733             }
00734         }   
00735         else
00736         {
00737             // Main page window
00738             switch (Msg->DlgMsg)
00739             {
00740                 case DIM_CREATE:
00741                     if (Msg->DlgMsg == DIM_CREATE)                  
00742                     {
00743                         //  When the dialog first starts up, only the first tab is initialised. When you change a value
00744                         //  on this tab and press ok/apply, this causes problems.
00745                         //  So, make sure that all the tabs are created
00746                         GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00747 
00748                         while (pGIFAnimationPropertyTabs != NULL)
00749                         {
00750                             //  Send the message to the page
00751                             pGIFAnimationPropertyTabs->HandleMsg(Msg);
00752                         
00753                             //  Get the next tab.
00754                             pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00755                         }
00756                     }
00757                     break;
00758 
00759                 case DIM_COMMIT:        
00760                     EndDialog = TRUE;
00761                     CommitValues = TRUE;
00762                 break;
00763 
00764                 case DIM_SOFT_COMMIT:   
00765                 {
00766                     CommitValues = TRUE;
00767                     m_pGIFAnimationProperties->SetApplyNowState(TRUE);
00768                 }
00769                 break;
00770 
00771                 case DIM_CANCEL:        
00772                 {
00773                     EndDialog = TRUE;
00774                 }
00775                 break;
00776 
00777                 default:
00778                     break;
00779                 }
00780             }
00781 
00782         // Commit values here.
00783         if (CommitValues)
00784         {
00785             BOOL ok = CommitDialogValues();
00786             if (!ok)
00787             {
00788                 EndDialog = FALSE;  
00789             }
00790         }
00791 
00792         // Pass the message back to the Base class.
00793         Result = DialogTabOp::Message(Message);
00794 
00795         // End dialog here
00796         if (EndDialog) 
00797         {
00798             // We can only look at static variables here
00799             // Remove the link to the options tabs if all dialogs have been cloosed. 
00800             if(m_pGIFAnimationProperties->GetCount() < 1)
00801             {
00802                 // Make sure that we remove our options tabs link to the dialog box class as the dialog will now be destroyed.
00803                 m_pGIFAnimationProperties->SetTabbedDlg(NULL);
00804             }
00805             return OK;
00806         }
00807         
00808         // Check if we have been sending an init/create message, if so then set the flag False.
00809         if (Msg->DlgMsg == DIM_CREATE)
00810             m_pGIFAnimationProperties->SetInitMessageState(FALSE);              
00811                     
00812         return Result;
00813     }
00814     return DialogTabOp::Message(Message);
00815 }

BOOL GIFAnimationPropertyTabsDlg::RegisterYourPagesInOrderPlease  )  [virtual]
 

This function will get called to give us a chance to add our pages to the DialogTabOp.

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

Reimplemented from DialogTabOp.

Definition at line 976 of file aprps.cpp.

00977 {
00978     BOOL ok = TRUE;
00979 
00980     // Get the first tab.
00981     GIFAnimationPropertyTabs *pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetFirst();
00982 
00983     while (pGIFAnimationPropertyTabs != NULL)
00984     {
00985         if ( pGIFAnimationPropertyTabs->IsPropertyRequired() )
00986         {
00987             CDlgResID PageId = pGIFAnimationPropertyTabs->GetPageID();
00988             ok = ok && AddAPage(PageId);
00989         }
00990 
00991         // Get next.
00992         pGIFAnimationPropertyTabs = GIFAnimationPropertyTabs::GetNext(pGIFAnimationPropertyTabs);
00993     }
00994 
00995     return (ok); 
00996 }

static void GIFAnimationPropertyTabsDlg::SetPageToOpen INT32  val  )  [inline, static]
 

Definition at line 160 of file aprps.h.

00160 { m_PageToOpen = val;  }            // The page which the dialog should open with.


Member Data Documentation

const CDlgResID GIFAnimationPropertyTabsDlg::IDD = _R(IDD_PROPERTIES) [static]
 

Reimplemented in AnimExOptns.

Definition at line 152 of file aprps.h.

INT32 GIFAnimationPropertyTabsDlg::m_PageToOpen = -1 [static, protected]
 

Definition at line 166 of file aprps.h.

GIFAnimationPropertyTabs * GIFAnimationPropertyTabsDlg::m_pGIFAnimationProperties = NULL [static, protected]
 

Definition at line 165 of file aprps.h.

GIFAnimationPropertyTabsDlg * GIFAnimationPropertyTabsDlg::m_pGIFAnimationPropertyTabsDlg = NULL [static, protected]
 

Definition at line 167 of file aprps.h.

CDlgMode GIFAnimationPropertyTabsDlg::Mode = MODELESS [static]
 

Reimplemented in AnimExOptns.

Definition at line 153 of file aprps.h.

String_256 GIFAnimationPropertyTabsDlg::TitleString [protected]
 

Definition at line 164 of file aprps.h.


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