LiveEffectsInfoBarOp Class Reference

Class for handling the FreeHand tool's information bar. More...

#include <liveeffectsinfo.h>

Inheritance diagram for LiveEffectsInfoBarOp:

InformationBarOp DialogBarOp DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 LiveEffectsInfoBarOp ()
 Sets the info bars vars to NULL defaults.
 ~LiveEffectsInfoBarOp ()
 destructor
MsgResult Message (Msg *Msg)
 Takes a look at the message and if it is for me it responds to it.
void SetToolActiveState (BOOL IsToolActive)
 Allows the info bar to know if it is valid or not.
virtual void UpdateState ()
 Sets the state of button on the bar to keep them up to date.
virtual void HandleCreate ()
 Called when a DIM_CREATE message is received.

Public Attributes

LiveEffectsToolm_pTool

Protected Member Functions

void SetGadgetWritable (INT32 id, BOOL enable)
 Sets the state of the 'Read Only' flag of an edit field or combo box. NOTE!!! This should be in DialogOp/DialogManager!
void GadgetMessage_Label (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Order (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it. Note: Strings in this gadget are NOT distinct - you cannot use string matching on effect names to identify which is selected!
void GadgetMessage_Edit (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Add (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Insert (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Remove (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_RemoveAll (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Setup (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_Resolution (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_ToggleLock (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void GadgetMessage_ToggleLockAll (DialogMsg *Message)
 Takes a look at the message and if it is for me it responds to it.
void PopulateOrderDropdown (EffectsStack *pPPStack, INT32 iSelectedStackPos=-1)
 

void PopulateResolutionDropdown (EffectsStack *pStack, ListRange *pLevelRange, BOOL bUpdateList=TRUE)
 

void UpdateAddButton (EffectsStack *pStack, ListRange *pLevelRange)
 

void UpdateEditButton (EffectsStack *pStack, ListRange *pLevelRange)
 

void UpdateLockButton (ListRange *pLevelRange)
 

void UpdateRemoveButton (ListRange *pLevelRange)
 

void UpdateLockAllButton ()
 

void UpdateRemoveAllButton ()
 

void UpdateSetupButton ()
 


Protected Attributes

BOOL m_bControlsExist
BOOL m_bDropDownInited
BOOL m_bLockSwitchState
BOOL m_bLockAllSwitchState

Detailed Description

Class for handling the FreeHand tool's information bar.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/94

Definition at line 124 of file liveeffectsinfo.h.


Constructor & Destructor Documentation

LiveEffectsInfoBarOp::LiveEffectsInfoBarOp  ) 
 

Sets the info bars vars to NULL defaults.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/8/94

Definition at line 141 of file liveeffectsinfo.cpp.

00142 {
00143     // Don't know about the tool and can not retro fit to start with
00144     m_pTool = NULL;
00145 
00146     // The Controls hasve not been created yet
00147     m_bControlsExist = FALSE;
00148     m_bLockSwitchState = FALSE;
00149     m_bLockAllSwitchState = FALSE;
00150 }

LiveEffectsInfoBarOp::~LiveEffectsInfoBarOp  ) 
 

destructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/5/2000

Definition at line 165 of file liveeffectsinfo.cpp.

00166 {
00167 }


Member Function Documentation

void LiveEffectsInfoBarOp::GadgetMessage_Add DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 597 of file liveeffectsinfo.cpp.

00598 {
00599     switch (Message->DlgMsg)
00600     {
00601         case DIM_LFT_BN_CLICKED:
00602         {
00603             // Commit changes of any modeless edit session already running
00604             // and close it down ready for this new one...
00605             if (XPEHost::IsEditSessionRunning())
00606             {
00607                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00608                 m_pTool->UpdatePPStack();
00609             }
00610 
00611             LiveEffectsMenu* pLEMenu = new LiveEffectsMenu();
00612             if (pLEMenu)
00613             {
00614                 pLEMenu->SetStackPos(STACKPOS_INSERT_TOP);
00615                 pLEMenu->SetEffectsStack(m_pTool->GetEffectsStack());
00616                 pLEMenu->Show();
00617             }
00618         }
00619     }
00620 }

void LiveEffectsInfoBarOp::GadgetMessage_Edit DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 509 of file liveeffectsinfo.cpp.

00510 {
00511     switch (Message->DlgMsg)
00512     {
00513         case DIM_LFT_BN_CLICKED:
00514         {
00515             String_256 strCurrentEffectID = m_pTool->GetCurrentEffectID();
00516 
00517             // Special case for old legacy effects
00518             if (strCurrentEffectID==String_256(POSTPRO_ID_SHADOW))
00519             {
00520                 // Make sure the Shadow tool is current... (this func can be called from other tools)
00521                 Tool* pShadowTool = Tool::FindTool(TOOLID_SOFTSHADOW);
00522                 if (pShadowTool && !pShadowTool->IsCurrent())
00523                 {
00524                     INT32 iStackPos = m_pTool->GetCurrentStackPos();
00525                     ListRange* pShadowRange = m_pTool->GetEffectsStack()->GetLevelRange(&iStackPos);
00526                     if (pShadowRange)
00527                     {
00528                         ((SoftShadowTool*)pShadowTool)->SelectShadowRange(pShadowRange);
00529                     }
00530 
00531                     pShadowTool->SetCurrent();
00533 //                  INT32 iStackPos = m_pTool->GetCurrentStackPos();
00534 //                  ListRange* pShadowRange = m_pTool->GetEffectsStack()->GetLevelRange(&iStackPos);
00535 //                  ((SoftShadowTool*)pShadowTool)->SetShadowEditRange(pShadowRange, m_pTool->GetCurrentStackPos(), TRUE);  // Must be consistent because it comes from the PPStack
00536                     return;
00537                 }
00538             }
00539 
00540 #ifdef FEATHER_EFFECT
00541             if (strCurrentEffectID==String_256(POSTPRO_ID_FEATHER))
00542             {
00543                 INT32 iStackPos = m_pTool->GetCurrentStackPos();
00544                 ListRange* pFeatherRange = m_pTool->GetEffectsStack()->GetLevelRange(&iStackPos);
00545                 OpChangeFeatherSize::SetEditContext(iStackPos, pFeatherRange);
00546                 return;
00547             }
00548 #endif
00549 
00550             if (strCurrentEffectID!=String(""))
00551             {
00552                 OpDescriptor* pOp = NULL;
00553                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_EDIT_LIVEEFFECT);
00554 
00555                 if (pOp)
00556                 {
00557                     // Commit changes of any modeless edit session already running
00558                     // and close it down ready for this new one...
00559                     if (XPEHost::IsEditSessionRunning())
00560                     {
00561                         XPEHost::EndEditLiveEffect();       // Could change PPStack!
00562                         m_pTool->UpdatePPStack();
00563                     }
00564 
00565                     OpLiveEffectParam Param;
00566                     Param.strOpUnique = strCurrentEffectID;
00567                     Param.StackPosition = m_pTool->GetCurrentStackPos();
00568                     Param.pPPStack = m_pTool->GetEffectsStack();
00569                     BOOL bValid = XPEHost::GetEffectDetails(strCurrentEffectID, &Param.strMenuText, &Param.bIsDestructive);
00570 
00571                     if (bValid)
00572                     {
00573                         pOp->Invoke(&Param);
00574                         return;
00575                     }
00576                 }
00577             }
00578         }
00579     }
00580 }

void LiveEffectsInfoBarOp::GadgetMessage_Insert DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 844 of file liveeffectsinfo.cpp.

00845 {
00846     switch (Message->DlgMsg)
00847     {
00848         case DIM_LFT_BN_CLICKED:
00849         {
00850             // Commit changes of any modeless edit session already running
00851             // and close it down ready for this new one...
00852             if (XPEHost::IsEditSessionRunning())
00853             {
00854                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00855                 m_pTool->UpdatePPStack();
00856             }
00857 
00858             LiveEffectsMenu* pLEMenu = new LiveEffectsMenu();
00859             if (pLEMenu)
00860             {
00861                 pLEMenu->SetStackPos(m_pTool->GetCurrentStackPos());
00862                 pLEMenu->SetEffectsStack(m_pTool->GetEffectsStack());
00863                 pLEMenu->Show();
00864             }
00865         }
00866     }
00867 }

void LiveEffectsInfoBarOp::GadgetMessage_Label DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 637 of file liveeffectsinfo.cpp.

00638 {
00639     switch (Message->DlgMsg)
00640     {
00641         case DIM_RGT_BN_CLICKED:
00642         {
00643             // Commit changes of any modeless edit session already running
00644             // and close it down ready for this new one...
00645             if (XPEHost::IsEditSessionRunning())
00646             {
00647                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00648                 m_pTool->UpdatePPStack();
00649             }
00650 
00651             LiveEffectsMenu* pLEMenu = new LiveEffectsMenu();
00652             if (pLEMenu)
00653             {
00654                 pLEMenu->SetStackPos(STACKPOS_INSERT_TOP);
00655                 pLEMenu->SetEffectsStack(m_pTool->GetEffectsStack());
00656                 pLEMenu->Show();
00657             }
00658         }
00659     }
00660 }

void LiveEffectsInfoBarOp::GadgetMessage_Order DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it. Note: Strings in this gadget are NOT distinct - you cannot use string matching on effect names to identify which is selected!

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 454 of file liveeffectsinfo.cpp.

00455 {
00456     switch (Message->DlgMsg)
00457     {
00458         case DIM_SELECTION_CHANGED:
00459         {
00460             WORD Index;
00461             GetValueIndex(Message->GadgetID, &Index);
00462             EffectsStack* pStack = m_pTool->GetEffectsStack();
00463             PPStackLevel* pStackLevel = (PPStackLevel*)pStack->FindItem(Index);
00464 
00465             if (pStackLevel)
00466             {
00467                 String_256 strEffectID = pStackLevel->strPostProID;
00468                 m_pTool->SetCurrentEffectID(strEffectID);
00469                 m_pTool->SetCurrentStackPos(Index);
00470             }
00471             else
00472             {
00473                 m_pTool->SetCurrentEffectID(String(""));
00474                 m_pTool->SetCurrentStackPos(Index);
00475             }
00476 
00477             UpdateState();
00478 
00479 #ifdef FEATHER_EFFECT
00480             String_256 strCurrentEffectID = m_pTool->GetCurrentEffectID();
00481             if (strCurrentEffectID==String_256(POSTPRO_ID_FEATHER))
00482             {
00483                 INT32 iStackPos = m_pTool->GetCurrentStackPos();
00484                 ListRange* pFeatherRange = m_pTool->GetEffectsStack()->GetLevelRange(&iStackPos);
00485                 OpChangeFeatherSize::SetEditContext(iStackPos, pFeatherRange);
00486                 return;
00487             }
00488 #endif
00489 
00490         }
00491     }
00492 }

void LiveEffectsInfoBarOp::GadgetMessage_Remove DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 884 of file liveeffectsinfo.cpp.

00885 {
00886     switch (Message->DlgMsg)
00887     {
00888         case DIM_LFT_BN_CLICKED:
00889         {
00890             String_256 strCurrentEffectID = m_pTool->GetCurrentEffectID();
00891             if (strCurrentEffectID!=String(""))
00892             {
00893                 // Commit changes of any modeless edit session already running
00894                 // and close it down ready for this new one...
00895                 if (XPEHost::IsEditSessionRunning())
00896                 {
00897                     XPEHost::EndEditLiveEffect();       // Could change PPStack!
00898                     m_pTool->UpdatePPStack();
00899                 }
00900 
00901                 OpDescriptor* pOp = NULL;
00902                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_DELETE_LIVEEFFECT);
00903 
00904                 if (pOp)
00905                 {
00906                     OpLiveEffectParam Param;
00907                     Param.strOpUnique = strCurrentEffectID;
00908                     Param.StackPosition = m_pTool->GetCurrentStackPos();
00909                     Param.pPPStack = m_pTool->GetEffectsStack();
00910                     BOOL bValid = XPEHost::GetEffectDetails(strCurrentEffectID, &Param.strMenuText, &Param.bIsDestructive);
00911 
00912                     // We want to delete the effect whether it was valid or not
00913                     pOp->Invoke(&Param);
00914                     return;
00915                 }
00916             }
00917         }
00918     }
00919 }

void LiveEffectsInfoBarOp::GadgetMessage_RemoveAll DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 936 of file liveeffectsinfo.cpp.

00937 {
00938     switch (Message->DlgMsg)
00939     {
00940         case DIM_LFT_BN_CLICKED:
00941         {
00942             // Commit changes of any modeless edit session already running
00943             // and close it down ready for this new one...
00944             if (XPEHost::IsEditSessionRunning())
00945             {
00946                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00947                 m_pTool->UpdatePPStack();
00948             }
00949 
00950             OpDescriptor* pOp = NULL;
00951             pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_DELETEALL_LIVEEFFECT);
00952 
00953             if (pOp)
00954             {
00955                 OpLiveEffectParam Param;
00956                 pOp->Invoke(&Param);
00957                 return;
00958             }
00959         }
00960     }
00961 }

void LiveEffectsInfoBarOp::GadgetMessage_Resolution DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/06/2005
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 677 of file liveeffectsinfo.cpp.

00678 {
00679     switch (Message->DlgMsg)
00680     {
00681         case DIM_SELECTION_CHANGED:
00682         {
00683             // Commit changes of any modeless edit session already running
00684             // and close it down ready for this new one...
00685             if (XPEHost::IsEditSessionRunning())
00686             {
00687                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00688                 m_pTool->UpdatePPStack();
00689             }
00690 
00691             BOOL Valid = FALSE;
00692             INT32 lValue = 0;
00693 
00694             lValue = GetResDropListValue(_R(IDC_COMBOBOX_LE_RES), TRUE, &Valid);
00695 
00696             if (Valid)
00697             {
00698                 // Update the resolution of the specified effects
00699                 OpDescriptor* pOp = NULL;
00700                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGE_EFFECT_RES);
00701 
00702                 if (pOp)
00703                 {
00704                     OpLiveEffectParam Param;
00705 //                  Param.strOpUnique = strCurrentEffectID;
00706                     Param.StackPosition = m_pTool->GetCurrentStackPos();
00707                     Param.pPPStack = m_pTool->GetEffectsStack();
00708                     Param.dResolution = (double) lValue;
00709 //                  BOOL bValid = XPEHost::GetEffectDetails(strCurrentEffectID, &Param.strMenuText, &Param.bIsDestructive);
00710 
00711                     pOp->Invoke(&Param);
00712                     return;
00713                 }
00714             }
00715 
00716             // Repopulate the dropdown so that if the user missed off the ppi
00717             // it is restored
00718             EffectsStack* pStack = m_pTool->GetEffectsStack();
00719             INT32 iStackPos = m_pTool->GetCurrentStackPos();
00720             ListRange* pLevelRange = NULL;
00721             if (pStack)
00722                 pLevelRange = pStack->GetLevelRange(&iStackPos);
00723 
00724             PopulateResolutionDropdown(pStack, pLevelRange, FALSE);
00725         }
00726     }
00727 }

void LiveEffectsInfoBarOp::GadgetMessage_Setup DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/2004
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 978 of file liveeffectsinfo.cpp.

00979 {
00980     switch (Message->DlgMsg)
00981     {
00982         case DIM_LFT_BN_CLICKED:
00983         {
00984             // Commit changes of any modeless edit session already running
00985             // and close it down ready for this new one...
00986             if (XPEHost::IsEditSessionRunning())
00987             {
00988                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00989                 m_pTool->UpdatePPStack();
00990             }
00991 
00992             if (ClickModifiers::GetClickModifiers().Adjust)
00993                 XPEEditOp::EditPluginSettings();
00994             else
00995             {
00996                 OpDescriptor* pOp = NULL;
00997                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_PLUGSDLG);
00998 
00999                 String_256 strDesc;
01000                 if (pOp && !pOp->GetOpsState(&strDesc).Greyed)
01001                 {
01002                     pOp->Invoke();
01003                     return;
01004                 }
01005             }
01006         }
01007     }
01008 }

void LiveEffectsInfoBarOp::GadgetMessage_ToggleLock DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/06/2005
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 744 of file liveeffectsinfo.cpp.

00745 {
00746     switch (Message->DlgMsg)
00747     {
00748         case DIM_LFT_BN_CLICKED:
00749         {
00750             // Commit changes of any modeless edit session already running
00751             // and close it down ready for this new one...
00752             if (XPEHost::IsEditSessionRunning())
00753             {
00754                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00755                 m_pTool->UpdatePPStack();
00756             }
00757 
00758             // Toggle the state of the button
00759             m_bLockSwitchState = !m_bLockSwitchState;
00760             BOOL bIsSelected = GetBoolGadgetSelected(Message->GadgetID, m_bLockSwitchState);
00761 
00762             OpDescriptor* pOp = NULL;
00763             pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGE_EFFECT_LOCK);
00764 
00765             if (pOp)
00766             {
00767                 OpLiveEffectParam Param;
00768 //              Param.strOpUnique = strCurrentEffectID;
00769                 Param.StackPosition = m_pTool->GetCurrentStackPos();
00770                 Param.pPPStack = m_pTool->GetEffectsStack();
00771 //              BOOL bValid = XPEHost::GetEffectDetails(strCurrentEffectID, &Param.strMenuText, &Param.bIsDestructive);
00772                 Param.bForceLock = m_bLockSwitchState;
00773 
00774                 pOp->Invoke(&Param);
00775                 return;
00776             }
00777         }
00778     }
00779 }

void LiveEffectsInfoBarOp::GadgetMessage_ToggleLockAll DialogMsg Message  )  [protected]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/06/2005
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Definition at line 796 of file liveeffectsinfo.cpp.

00797 {
00798     switch (Message->DlgMsg)
00799     {
00800         case DIM_LFT_BN_CLICKED:
00801         {
00802             // Commit changes of any modeless edit session already running
00803             // and close it down ready for this new one...
00804             if (XPEHost::IsEditSessionRunning())
00805             {
00806                 XPEHost::EndEditLiveEffect();       // Could change PPStack!
00807                 m_pTool->UpdatePPStack();
00808             }
00809 
00810             // Toggle the state of the button
00811             m_bLockAllSwitchState = !m_bLockAllSwitchState;
00812             BOOL bIsSelected = GetBoolGadgetSelected(Message->GadgetID, m_bLockAllSwitchState);
00813 
00814             OpDescriptor* pOp = NULL;
00815             pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGE_EFFECT_LOCKALL);
00816 
00817             if (pOp)
00818             {
00819                 OpLiveEffectParam Param;
00820                 Param.bForceLock = m_bLockAllSwitchState;
00821 
00822                 pOp->Invoke(&Param);
00823                 return;
00824             }
00825         }
00826     }
00827 }

void LiveEffectsInfoBarOp::HandleCreate  )  [virtual]
 

Called when a DIM_CREATE message is received.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/2000
Parameters:
- [INPUTS]
Returns:
-

Definition at line 1025 of file liveeffectsinfo.cpp.

01026 {
01027     // Don't do anything if the Info bar isn't displayed
01028 //  if (!LiveEffectsTool::IsCurrentTool() || !IsVisible()) return;
01029 
01030     if (WindowID!=NULL)
01031     {
01032         // Mark the controls as existing
01033         m_bControlsExist = TRUE;
01034 
01035         // Set the state of the pressure button according to the Op's state.
01036         // Why buttons on infobars can't dynamically auto-connect to their ops is beyond me
01037         UpdateState();
01038     }
01039 }

MsgResult LiveEffectsInfoBarOp::Message Msg Message  )  [virtual]
 

Takes a look at the message and if it is for me it responds to it.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/94
Parameters:
Message - A dialog message [INPUTS]
Returns:
The result of the message

Reimplemented from InformationBarOp.

Definition at line 182 of file liveeffectsinfo.cpp.

00183 {
00184     if (IS_OUR_DIALOG_MSG(Message))
00185     {
00186         DialogMsg* DMsg = (DialogMsg*)Message;
00187 
00188         // Check if the message is a CANCEL
00189         if (DMsg->DlgMsg == DIM_CANCEL)
00190         {
00191             // Mark the controls as no longer existing
00192             m_bControlsExist = FALSE;
00193             
00194             // Close the dialog 
00195             Close();
00196         }
00197 
00198         else if (DMsg->DlgMsg == DIM_CREATE)
00199         {
00200             HandleCreate();
00201         }
00202 
00203         else
00204         {
00205             // Messages to all the controls, handled indivdually
00206             switch (DMsg->GadgetID)
00207             {
00208                 case _R(IDC_LE_LABEL):
00209                 {
00210                     GadgetMessage_Label(DMsg);
00211                     break;
00212                 }
00213                 case _R(IDC_COMBOBOX_LE_ORDER):
00214                 {
00215                     GadgetMessage_Order(DMsg);
00216                     break;
00217                 }
00218                 case _R(IDC_CCBUTTON_LE_EDIT):
00219                 case _R(IDC_BUTTON_LE_EDIT):
00220                 {
00221                     GadgetMessage_Edit(DMsg);
00222                     break;
00223                 }
00224                 case _R(IDC_CCBUTTON_LE_ADD):
00225                 case _R(IDC_BUTTON_LE_ADD):
00226                 {
00227                     GadgetMessage_Add(DMsg);
00228                     break;
00229                 }
00230                 case _R(IDC_CCBUTTON_LE_INSERT):
00231                 {
00232                     GadgetMessage_Insert(DMsg);
00233                     break;
00234                 }
00235                 case _R(IDC_COMBOBOX_LE_RES):
00236                 {
00237                     GadgetMessage_Resolution(DMsg);
00238                     break;
00239                 }
00240                 case _R(IDC_CCBUTTON_LE_TOGGLELOCK):
00241                 {
00242                     GadgetMessage_ToggleLock(DMsg);
00243                     break;
00244                 }
00245                 case _R(IDC_CCBUTTON_LE_REMOVE):
00246                 {
00247                     GadgetMessage_Remove(DMsg);
00248                     break;
00249                 }
00250                 case _R(IDC_CCBUTTON_LE_REMOVEALL):
00251                 {
00252                     GadgetMessage_RemoveAll(DMsg);
00253                     break;
00254                 }
00255                 case _R(IDC_CCBUTTON_LE_TOGGLELOCKALL):
00256                 {
00257                     GadgetMessage_ToggleLockAll(DMsg);
00258                     break;
00259                 }
00260                 case _R(IDC_BUTTON_LE_SETUP):
00261                 {
00262                     GadgetMessage_Setup(DMsg);
00263                     break;
00264                 }
00265             }
00266         }
00267     }
00268     else
00269     {
00270         // Handle non dialog messages in here
00271 
00272         // likewise if it is a screen change message
00273 // Commented out, Phil, 25/10/2004
00274 // This upsets OpLiveEffect::UpdateCurrentEditor because it causes one of these messages to be sent while it's working
00275 // and so the current PPStack that it's working on is deleted from under it by ScreenChanged
00276 //      if (Message->IsKindOf(CC_RUNTIME_CLASS(ScreenChangeMsg)) || Message->IsKindOf(CC_RUNTIME_CLASS(CurrentAttrChangedMsg)))
00277 //      {
00278 //          if (m_pTool != NULL && HasWindow() 
00279 //              && (Document::GetCurrent() != NULL))
00280 //          {
00281 //              m_pTool->ScreenChanged(TRUE); //((ScreenChangeMsg*)Message)->m_bClear);
00282 //              UpdateState();
00283 //          }
00284 //      }
00285 
00286 
00287         if (Message->IsKindOf(CC_RUNTIME_CLASS(DocViewMsg)))
00288         {
00289             DocViewMsg* pDVM = (DocViewMsg*)Message;
00290             if (pDVM->State == pDVM->DocViewState::SELCHANGED)
00291                 m_pTool->ScreenChanged(TRUE);
00292         }
00293     }
00294 
00295     // do we have a selection change message? 
00296     if (MESSAGE_IS_A(Message, SelChangingMsg))
00297     {
00298         Document* pDoc  = Document::GetCurrent();
00299         if (pDoc != NULL)
00300         {
00301             if (m_bControlsExist && IsVisible())
00302             {
00303             }
00304         }
00305         // ask the tool to refresh its cache, as blobs will have changed
00306         // TODO: Could test for and exclude COLOURATTCHANGED and NONCOLOURATTCHANGED here?
00307         if (m_pTool != NULL && HasWindow()) 
00308             m_pTool->ScreenChanged(TRUE); 
00309     }
00310 
00311     if (MESSAGE_IS_A(Message, ColourChangingMsg))
00312     {
00313         ColourChangingMsg *TheMsg = (ColourChangingMsg *) Message;
00314 
00315         // handle the selected View's Colour Context is changing
00316         // e.g. if the show printer colours (plate) has changed
00317         if(TheMsg->State == ColourChangingMsg::ColourState::SELVIEWCONTEXTCHANGE)
00318         {
00319             // ask the tool to refresh its cache
00320             // (so that the cache does not have the old colour in it
00321             //  and the drawing will be agains the correct (current)
00322             //  background!)
00323             if (m_pTool != NULL && HasWindow()) 
00324                 m_pTool->ScreenChanged(TRUE);
00325         }
00326     }
00327 
00328     if (MESSAGE_IS_A(Message, DocChangingMsg))
00329     {
00330         DocChangingMsg* pMsg = (DocChangingMsg*) Message;
00331         if (pMsg->State == DocChangingMsg::DocState::ABOUTTODIE && XPEHost::GetEditSessionDocument()==pMsg->pChangingDoc)
00332         {
00333             XPEHost::EndEditLiveEffect();
00334         }
00335     }
00336 
00337     else if (MESSAGE_IS_A(Message,OpMsg))   // Check for undo/redo
00338     {
00339         // update the gadgets
00340 //      UpdateState();
00341         BlobManager* BlobMgr = GetApplication()->GetBlobManager();
00342         ENSURE(BlobMgr, "Can't get BlobManager");
00343         
00344         if ( (((OpMsg*)Message)->MsgType == OpMsg::BEFORE_UNDO) ||
00345                                         (((OpMsg*)Message)->MsgType == OpMsg::BEFORE_REDO))
00346         {
00347             OpLiveEffect* pCurrentOp = XPEHost::GetCurrentLEOp();
00348 
00349             // If we haven't got a list of editors yet then get one
00350             if (pCurrentOp!=NULL)
00351             {
00352 /*              // Attempt to suspend the modeless XPE edit while we undo
00353                 m_strUndoEffectID = pCurrentOp->GetEffectID();
00354                 m_iUndoStackPos = pCurrentOp->GetStackPos();
00355                 // Stop the current Op and commit all of its changes
00356                 // Disconnect it from the XPE system so that, just for the moment at least, other routines
00357                 // think that there's no running edit session
00358                 pCurrentOp->DoEndEdit(TRUE, TRUE);              // Sends ScreenChangeMsg - and thus releases pPPStack
00359                 XPEHost::SetCurrentLEOp(NULL);                  // Tells UpdateCurrentEditor not to try to update dying editor
00360 */
00361                 // This is the only safe thing to do at the moment...
00362 //              XPEHost::EndEditLiveEffect();
00363                 pCurrentOp->DoEndEdit(TRUE, TRUE, TRUE, TRUE);
00364                 XPEHost::SetCurrentLEOp(NULL);
00365                 XPEHost::EndEditLiveEffect();
00366             }
00367         }
00368         else if ( (((OpMsg*)Message)->MsgType == OpMsg::AFTER_UNDO) ||
00369                                         (((OpMsg*)Message)->MsgType == OpMsg::AFTER_REDO))
00370         {
00371 /*          // Attempt tp restore the modeless XPE edit after undo
00372             // Reset pPPStack in LiveEffectTool to reset the Tool after the ScreenChangeMsg sent above
00373             // (prevent idle handler looping forever calling this function)
00374             EffectsStack* pPPStack = EffectsStack::GetEffectsStackFromSelection();
00375 
00376             // Try to find the same effect in the new stack
00377             // If found then invoke a new Op to use the running editor on that effect
00378             BOOL bOK = pPPStack->FindBestProcessor(&m_strUndoEffectID, &m_iUndoStackPos);
00379 
00380             // Decide which sort of Operation we need to use instead...
00381             OpDescriptor* pOp = NULL;
00382             if (bOK)
00383             {
00384                 // We found the right sort of Effect in the stack so we'll just edit that
00385                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_EDIT_LIVEEFFECT);
00386             }
00387             else
00388             {
00389                 // We didn't find the right sort of effect so we'll apply a brand new one!
00390                 // At the top of the stack
00391                 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLY_LIVEEFFECT);
00392                 m_iUndoStackPos = STACKPOS_INSERT_TOP;
00393             }
00394 
00395             // Start a new Op but tell it to use the existing edit session instead of making a new one
00396             if (pOp)
00397             {
00398                 OpLiveEffectParam Param;
00399                 Param.strOpUnique = m_strUndoEffectID;
00400                 Param.StackPosition = m_iUndoStackPos;
00401                 Param.pPPStack = pPPStack;
00402                 Param.bReUseEditor = TRUE;              // This is the important param!
00403                 BOOL bValid = XPEHost::GetEffectDetails(m_strUndoEffectID, &Param.strMenuText, &Param.bIsDestructive);
00404 
00405                 String_256 strDummy;
00406                 if (bValid && pOp->GetOpsState(&strDummy).Greyed==FALSE)
00407                 {
00408                     pOp->Invoke(&Param);
00409 
00410                     // Reset the Tool's current stack pointer now so that it doesn't need
00411                     // to be updated under idle events with the consequent call to this function
00412                     // and infinite loop...
00413                     Tool* pTool = Tool::GetCurrent();
00414                     if (pTool->GetID()==TOOLID_LIVEEFFECT)
00415                         ((LiveEffectsTool*)pTool)->UpdatePPStack(FALSE);
00416 
00417                     // If that successfully set up a new editor op then we're fine to carry on
00418                     if (XPEHost::GetCurrentLEOp()!=NULL)
00419                     {
00420                         delete pPPStack;
00421                         return (InformationBarOp::Message(Message));
00422                     }
00423                 }
00424             }
00425 
00426             // If we get here then we must have failed in some way so close down the running editor
00427             XPEHost::EndEditLiveEffect();
00428             delete pPPStack;
00429 */
00430         }
00431     }
00432 
00433     // Pass message on
00434     return (InformationBarOp::Message(Message));
00435 }    

void LiveEffectsInfoBarOp::PopulateOrderDropdown EffectsStack pPPStack,
INT32  iSelectedStackPos = -1
[protected]
 

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

Definition at line 1115 of file liveeffectsinfo.cpp.

01116 {
01117     // Don't try to set our controls when they're not there!
01118     if (!m_bControlsExist)
01119         return;
01120 
01121     if (pPPStack==NULL)
01122         return;
01123 
01124     DeleteAllValues(_R(IDC_COMBOBOX_LE_ORDER));
01125     SetComboListLength(_R(IDC_COMBOBOX_LE_ORDER));
01126     SetGadgetWritable(_R(IDC_COMBOBOX_LE_ORDER), FALSE);
01127 
01128     if (!pPPStack->bConsistent)
01129     {
01130         // There is no consistent set of LiveEffects applied to the selection
01131         SetStringGadgetValue(_R(IDC_COMBOBOX_LE_ORDER), _R(IDS_LE_MANY));
01132         SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_ORDER), 0);
01133     }
01134     else
01135     {
01136         if (pPPStack->IsEmpty())
01137         {
01138             // There is no consistent set of LiveEffects applied to the selection
01139             SetStringGadgetValue(_R(IDC_COMBOBOX_LE_ORDER), _R(IDS_LE_NONE));
01140             SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_ORDER), 0);
01141         }
01142         else
01143         {
01144             // This is a consistent set of LiveEffects applied to the selection
01145             INT32 pos = 0;
01146             PPStackLevel* pLevel = (PPStackLevel*)pPPStack->GetHead();
01147             while (pLevel!=NULL)
01148             {
01149                 String_64 strDisplayName;
01150                 if (pLevel->pPPNode!=NULL && pLevel->pPPNode->IsBitmapEffect())
01151                     strDisplayName = ((NodeBitmapEffect*)(pLevel->pPPNode))->GetDisplayName();
01152                 BOOL bDestructive = FALSE;
01153                 BOOL bFound = XPEHost::GetEffectDetails(pLevel->strPostProID, &strDisplayName, &bDestructive);
01154 
01155                 TCHAR Str[64];
01156                 String_64 pjm(_R(IDS_LE_ORDER_FORMAT));
01157                 if (!bFound)
01158                     pjm = String_64(_R(IDS_LE_ORDER_FORMAT_NOTFOUND));
01159                 else if (bDestructive)
01160                     pjm = String_64(_R(IDS_LE_ORDER_FORMAT_DESTRUCTIVE));
01161                 camSprintf(Str, pjm, pos+1, (LPTSTR)strDisplayName);
01162                 String_64 strOrderedName(Str);
01163 
01164                 SetStringGadgetValue(_R(IDC_COMBOBOX_LE_ORDER), &strOrderedName, FALSE, pos);
01165 
01166                 if (pos==iSelectedStackPos)
01167                     SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_ORDER), pos);
01168 
01169                 pos++;
01170                 pLevel = (PPStackLevel*)pPPStack->GetNext(pLevel);
01171             }
01172         }
01173     }
01174     SetComboListLength(_R(IDC_COMBOBOX_LE_ORDER));
01175 }

void LiveEffectsInfoBarOp::PopulateResolutionDropdown EffectsStack pStack,
ListRange pLevelRange,
BOOL  bUpdateList = TRUE
[protected]
 

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

Definition at line 1193 of file liveeffectsinfo.cpp.

01194 {
01195     // Don't try to set our controls when they're not there!
01196     if (!m_bControlsExist)
01197         return;
01198 
01199     if (bUpdateList)
01200     {
01201         BuildResDropList(_R(IDC_COMBOBOX_LE_RES), TRUE, FALSE, -1);
01202         SetGadgetWritable(_R(IDC_COMBOBOX_LE_RES), TRUE);
01203     }
01204 
01205     if (pLevelRange==NULL)
01206         return;
01207 
01208     double dRes = -1;                               // -1 means "None"
01209     Node* pNode = pLevelRange->FindFirst();
01210     BOOL bCanChangeRes = FALSE;
01211     while (pNode)
01212     {
01213         if (pNode->IsBitmapEffect())
01214         {
01215             NodeBitmapEffect* pEffect = (NodeBitmapEffect*)pNode;
01216             bCanChangeRes = bCanChangeRes || pEffect->CanBeUnlocked();
01217             if (dRes==-1)
01218                 dRes = pEffect->GetPixelsPerInchValue();
01219             else
01220             {
01221                 if (dRes != pEffect->GetPixelsPerInchValue())
01222                 {
01223                     dRes = -2;                      // -2 means "Many"
01224                     break;
01225                 }
01226             }
01227         }
01228 
01229         pNode = pLevelRange->FindNext(pNode);
01230     }
01231 
01232     switch ((INT32)dRes)
01233     {
01234     case -2:    // Many
01235         // There is no consistent set of LiveEffects applied to the selection
01236         SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_RES), -1);
01237         SetStringGadgetValue(_R(IDC_COMBOBOX_LE_RES), _R(IDS_LE_MANY), FALSE, -1);
01238         EnableGadget(_R(IDC_COMBOBOX_LE_RES), FALSE);
01239         break;
01240 
01241     case -1:    // None
01242         // There are no LiveEffects applied to the selection
01243         SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_RES), -1);
01244         SetStringGadgetValue(_R(IDC_COMBOBOX_LE_RES), _R(IDS_LE_NONE), FALSE, -1);
01245         EnableGadget(_R(IDC_COMBOBOX_LE_RES), FALSE);
01246         break;
01247 
01248     case 0:     // Automatic
01249         // There is a consistent LiveEffect resolution of 0/automatic applied to the selection
01250         SetStringGadgetValue(_R(IDC_COMBOBOX_LE_RES), _R(IDS_LE_AUTO), FALSE, -1);
01251         SetSelectedValueIndex(_R(IDC_COMBOBOX_LE_RES), 0);
01252         EnableGadget(_R(IDC_COMBOBOX_LE_RES), bCanChangeRes);
01253         break;
01254 
01255     default:    // Consistent value
01256         SetResDropListValue(_R(IDC_COMBOBOX_LE_RES), TRUE, (INT32)dRes);
01257         EnableGadget(_R(IDC_COMBOBOX_LE_RES), bCanChangeRes);
01258         break;
01259     }
01260 }

void LiveEffectsInfoBarOp::SetGadgetWritable INT32  id,
BOOL  enable
[protected]
 

Sets the state of the 'Read Only' flag of an edit field or combo box. NOTE!!! This should be in DialogOp/DialogManager!

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/11/94
Parameters:
id,the 'IDC_?' of the control. [INPUTS] enable, TRUE to allow the control to be typed into. FALSE to make it read only.

Definition at line 1623 of file liveeffectsinfo.cpp.

01624 {
01625     // Get the window handle of the gadget, from the gadget ID
01626     HWND gadget = ::GetDlgItem(WindowID, id);
01627 
01628     // See if it's got a child window (it may be a Combo Box)
01629     HWND hEdit = ::ChildWindowFromPoint(gadget, CPoint(1,1));
01630 
01631     if (hEdit)              // Was there a child window ?
01632         gadget = hEdit;     // Yes, so send the message to it
01633 
01634     if (enable)
01635     {
01636         ::SendMessage(gadget, EM_SETREADONLY, FALSE, 0);    // Clear the Read Only Flag
01637     }
01638     else
01639     {
01640         ::SendMessage(gadget, EM_SETREADONLY, TRUE, 0);     // Set the Read Only Flag
01641     }
01642 }

void LiveEffectsInfoBarOp::SetToolActiveState BOOL  IsToolActive  ) 
 

Allows the info bar to know if it is valid or not.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/8/94
Parameters:
IsToolActive - TRUE if the tool is becoming active, FALSE if it not [INPUTS]

Definition at line 1052 of file liveeffectsinfo.cpp.

01053 {
01054     // Set the control state
01055     m_bControlsExist = IsToolActive;
01056 }

void LiveEffectsInfoBarOp::UpdateAddButton EffectsStack pStack,
ListRange pLevelRange
[protected]
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/09/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 1377 of file liveeffectsinfo.cpp.

01378 {
01379     // Don't try to set our controls when they're not there!
01380     if (!m_bControlsExist)
01381         return;
01382 
01383     if (pLevelRange==NULL)
01384         return;
01385 
01386 //  BOOL bEnableButton = !XPEHost::IsEditSessionRunning();
01387     BOOL bEnableButton = (pLevelRange->FindFirst()!=NULL);
01388 
01389     EnableGadget(_R(IDC_CCBUTTON_LE_ADD), bEnableButton);
01390     EnableGadget(_R(IDC_BUTTON_LE_ADD), bEnableButton);
01391 }

void LiveEffectsInfoBarOp::UpdateEditButton EffectsStack pStack,
ListRange pLevelRange
[protected]
 

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

Definition at line 1439 of file liveeffectsinfo.cpp.

01440 {
01441     // Don't try to set our controls when they're not there!
01442     if (!m_bControlsExist)
01443         return;
01444 
01445     if (pLevelRange==NULL)
01446         return;
01447 
01448     BOOL bEnableButton = FALSE;
01449     if (pStack->bConsistent /*&& !XPEHost::IsEditSessionRunning()*/)
01450     {
01451         Node* pNode = pLevelRange->FindFirst();
01452         while (pNode)
01453         {
01454             if (pNode->IsEffect())
01455             {
01456                 bEnableButton = TRUE;
01457                 break;
01458             }
01459 
01460             pNode = pLevelRange->FindNext(pNode);
01461         }
01462     }
01463 
01464     EnableGadget(_R(IDC_CCBUTTON_LE_EDIT), bEnableButton);
01465     EnableGadget(_R(IDC_BUTTON_LE_EDIT), bEnableButton);
01466 }

void LiveEffectsInfoBarOp::UpdateLockAllButton  )  [protected]
 

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

Definition at line 1483 of file liveeffectsinfo.cpp.

01484 {
01485     // Don't try to set our controls when they're not there!
01486     if (!m_bControlsExist)
01487         return;
01488 
01489     SelRange Sel(*(GetApplication()->FindSelection()));
01490     Sel.SetPromoteToParent(TRUE);
01491     Node* pNode = Sel.FindFirst();
01492     Node* pNextNode = NULL;
01493     BOOL bSomeOrAllAreLocked = FALSE;
01494     BOOL bEnableButton = FALSE;
01495     while (pNode && !bSomeOrAllAreLocked && !bEnableButton)
01496     {
01497         pNextNode = Sel.FindNext(pNode);
01498 
01499         // We must find all effects in our subtree
01500         Node* pScanNode = pNode->FindFirstPreorder();
01501         while (pScanNode)
01502         {
01503             if (pScanNode->IsBitmapEffect() && !((NodeBitmapEffect*)pScanNode)->IsFeatherEffect())
01504             {
01505                 NodeBitmapEffect* pEffect = (NodeBitmapEffect*)pScanNode;
01506                 if (pEffect->IsLockedEffect())
01507                 {
01508                     bEnableButton = (bEnableButton || pEffect->CanBeUnlocked());
01509                     bSomeOrAllAreLocked = (bSomeOrAllAreLocked || pEffect->CanBeUnlocked());
01510                     if (bEnableButton && bSomeOrAllAreLocked)
01511                         break;
01512                 }
01513                 else
01514                     bEnableButton = TRUE;
01515 
01516                 // We don't want to lock any effects under this one
01517                 // So find the next node in preorder order outside the scan node
01518                 pScanNode = pScanNode->FindNextPreorder(pNode, TRUE);
01519             }
01520             else
01521                 pScanNode = pScanNode->FindNextPreorder(pNode);
01522         }
01523 
01524         pNode = pNextNode;
01525     }
01526 
01527     m_bLockAllSwitchState = bSomeOrAllAreLocked;
01528     SetBoolGadgetSelected(_R(IDC_CCBUTTON_LE_TOGGLELOCKALL), m_bLockAllSwitchState);
01529     EnableGadget(_R(IDC_CCBUTTON_LE_TOGGLELOCKALL), bEnableButton);
01530 }

void LiveEffectsInfoBarOp::UpdateLockButton ListRange pLevelRange  )  [protected]
 

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

Definition at line 1277 of file liveeffectsinfo.cpp.

01278 {
01279 // While the Lock button is hidden from the UI
01280 // we have to avoid trying to use it (I can't find
01281 // a way to test programmatically whether it exists)
01282 return;
01283 
01284     // Don't try to set our controls when they're not there!
01285     if (!m_bControlsExist)
01286         return;
01287 
01288     if (pLevelRange==NULL)
01289         return;
01290 
01291     // Try to find a consistent lock state...
01292     BOOL bSomeOrAllAreLocked = FALSE;
01293     BOOL bEnableButton = FALSE;
01294     Node* pNode = pLevelRange->FindFirst();
01295     while (pNode)
01296     {
01297         if (pNode->IsBitmapEffect())
01298         {
01299             NodeBitmapEffect* pEffect = (NodeBitmapEffect*)pNode;
01300             if (!pEffect->IsFeatherEffect())
01301             {
01302                 if (pEffect->IsLockedEffect())
01303                 {
01304                     bEnableButton = (bEnableButton || pEffect->CanBeUnlocked());
01305                     bSomeOrAllAreLocked = (bSomeOrAllAreLocked || pEffect->CanBeUnlocked());
01306                     if (bSomeOrAllAreLocked && bEnableButton)
01307                         break;
01308                 }
01309                 else
01310                     bEnableButton = TRUE;
01311             }
01312         }
01313 
01314         pNode = pLevelRange->FindNext(pNode);
01315     }
01316 
01317     m_bLockSwitchState = bSomeOrAllAreLocked;
01318     SetBoolGadgetSelected(_R(IDC_CCBUTTON_LE_TOGGLELOCK), m_bLockSwitchState);
01319     EnableGadget(_R(IDC_CCBUTTON_LE_TOGGLELOCK), bEnableButton);
01320 }

void LiveEffectsInfoBarOp::UpdateRemoveAllButton  )  [protected]
 

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

Definition at line 1547 of file liveeffectsinfo.cpp.

01548 {
01549     // Don't try to set our controls when they're not there!
01550     if (!m_bControlsExist)
01551         return;
01552 
01553     SelRange Sel(*(GetApplication()->FindSelection()));
01554     Node* pNode = Sel.FindFirst();
01555     BOOL bEnableButton = FALSE;
01556     ListRange* pStack = NULL;
01557     while (pNode)
01558     {
01559         pStack = EffectsStack::GetEffectsStackFromNode(pNode, TRUE, TRUE);
01560         if (pStack)
01561         {
01562             bEnableButton = TRUE;
01563             break;
01564         }
01565 
01566         pNode = Sel.FindNext(pNode);
01567     }
01568 
01569     if (pStack)
01570     {
01571         delete pStack;
01572         pStack = NULL;
01573     }
01574 
01575     EnableGadget(_R(IDC_CCBUTTON_LE_REMOVEALL), bEnableButton);
01576 }

void LiveEffectsInfoBarOp::UpdateRemoveButton ListRange pLevelRange  )  [protected]
 

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

Definition at line 1337 of file liveeffectsinfo.cpp.

01338 {
01339     // Don't try to set our controls when they're not there!
01340     if (!m_bControlsExist)
01341         return;
01342 
01343     if (pLevelRange==NULL)
01344         return;
01345 
01346     BOOL bEnableButton = FALSE;
01347     Node* pNode = pLevelRange->FindFirst();
01348     while (pNode)
01349     {
01350         if (pNode->IsEffect())
01351         {
01352             bEnableButton = TRUE;
01353             break;
01354         }
01355 
01356         pNode = pLevelRange->FindNext(pNode);
01357     }
01358 
01359     EnableGadget(_R(IDC_CCBUTTON_LE_REMOVE), bEnableButton);
01360 }

void LiveEffectsInfoBarOp::UpdateSetupButton  )  [protected]
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/07/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 1593 of file liveeffectsinfo.cpp.

01594 {
01595     // Don't try to set our controls when they're not there!
01596     if (!m_bControlsExist)
01597         return;
01598 
01599     OpDescriptor* pOp = NULL;
01600     pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_PLUGSDLG);
01601 
01602     String_256 strDesc;
01603     EnableGadget(_R(IDC_BUTTON_LE_SETUP), pOp && !pOp->GetOpsState(&strDesc).Greyed);
01604 }

void LiveEffectsInfoBarOp::UpdateState  )  [virtual]
 

Sets the state of button on the bar to keep them up to date.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/1/97

Reimplemented from DialogBarOp.

Definition at line 1071 of file liveeffectsinfo.cpp.

01072 {
01073     // Don't try to set our controls when they're not there!
01074     if (!m_bControlsExist)
01075         return;
01076 
01077     if (CCamApp::DisableSys)            // Inside an error handler
01078         return;
01079 
01080     EffectsStack* pStack = m_pTool->GetEffectsStack();
01081     INT32 iStackPos = m_pTool->GetCurrentStackPos();
01082 
01083     IXMLDOMDocumentPtr pDoc = XPEHost::GetEditorsList();
01084     PopulateOrderDropdown(pStack, iStackPos);
01085 
01086     ListRange* pLevelRange = NULL;
01087     if (pStack)
01088         pLevelRange = pStack->GetLevelRange(&iStackPos);
01089 
01090     UpdateAddButton(pStack, pLevelRange);
01091     UpdateEditButton(pStack, pLevelRange);
01092     PopulateResolutionDropdown(pStack, pLevelRange);
01093     UpdateLockButton(pLevelRange);
01094     UpdateRemoveButton(pLevelRange);
01095     UpdateLockAllButton();
01096     UpdateRemoveAllButton();
01097     UpdateSetupButton();
01098 }


Member Data Documentation

BOOL LiveEffectsInfoBarOp::m_bControlsExist [protected]
 

Definition at line 174 of file liveeffectsinfo.h.

BOOL LiveEffectsInfoBarOp::m_bDropDownInited [protected]
 

Definition at line 175 of file liveeffectsinfo.h.

BOOL LiveEffectsInfoBarOp::m_bLockAllSwitchState [protected]
 

Definition at line 177 of file liveeffectsinfo.h.

BOOL LiveEffectsInfoBarOp::m_bLockSwitchState [protected]
 

Definition at line 176 of file liveeffectsinfo.h.

LiveEffectsTool* LiveEffectsInfoBarOp::m_pTool
 

Definition at line 169 of file liveeffectsinfo.h.


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