OpLibGalClipTheme Class Reference

#include <sglcart.h>

Inheritance diagram for OpLibGalClipTheme:

OpDescriptor MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpLibGalClipTheme ()
 Constructs an OpLibGalClipTheme object.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpLibGalClipTheme)
virtual void OnControlCreate (OpDescControlCreateMsg *pCreateMsg)
 Called when the combo-boxes associated with this descriptor are created.
virtual void OnSelectionChange (OpDescControlMsg *pSelChangedMsg, List *pGadgetList)
 Called when the combo-boxes associated with this descriptor are changed.
void UpdateGadgets ()
 Sets the text in all the combos associated with this descriptor to the currently selected clipart/web theme selection.

Detailed Description

Definition at line 314 of file sglcart.h.


Constructor & Destructor Documentation

OpLibGalClipTheme::OpLibGalClipTheme  ) 
 

Constructs an OpLibGalClipTheme object.

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

Definition at line 3463 of file sglcart.cpp.

03464   : OpDescriptor(0,
03465                  _R(IDS_LIBGAL_CLIPTHEME),
03466                  CC_RUNTIME_CLASS(OpLibGalClipTheme),
03467                  OPTOKEN_LIBGAL_CLIPTHEME,
03468                  OpDisplayLibClipartGallery::GetState,
03469                  0,
03470                  _R(IDBBL_LIBGAL_CLIPTHEME),
03471                  0,
03472                  _R(IDC_LIBGAL_CLIPTHEME),
03473                  TRUE)
03474 {
03475     // Empty.
03476 }


Member Function Documentation

OpLibGalClipTheme::CC_DECLARE_DYNCREATE OpLibGalClipTheme   )  [private]
 

void OpLibGalClipTheme::OnControlCreate OpDescControlCreateMsg pCreateMsg  )  [private, virtual]
 

Called when the combo-boxes associated with this descriptor are created.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/09/2000
Parameters:
pCreateMsg --- message describing this creation event [INPUTS]

Reimplemented from OpDescriptor.

Definition at line 3490 of file sglcart.cpp.

03491 {
03492     // Fill up the gadget's list with the names of properties.  These must be in
03493     // ascending order of property indices.
03494     pCreateMsg->pDlgOp->SetStringGadgetValue(
03495                             pCreateMsg->SetGadgetID, &String(_R(IDS_LIBGAL_CLIPTHEME_CLIPART)));
03496     pCreateMsg->pDlgOp->SetStringGadgetValue(
03497                             pCreateMsg->SetGadgetID, &String(_R(IDS_LIBGAL_CLIPTHEME_WEBTHEME)));
03498 
03499     // Resize the list to fit and update associated gadgets.
03500     pCreateMsg->pDlgOp->SetComboListLength(pCreateMsg->SetGadgetID);
03501     UpdateGadgets();
03502 }

void OpLibGalClipTheme::OnSelectionChange OpDescControlMsg pSelChangedMsg,
List pGadgetList
[private, virtual]
 

Called when the combo-boxes associated with this descriptor are changed.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/09/2000
Parameters:
pSelChangedMsg --- message describing the change event [INPUTS] pGadgetList --- list of gadgets associated with this

Reimplemented from OpDescriptor.

Definition at line 3517 of file sglcart.cpp.

03518 {
03519     LibClipartSGallery::Instance()->m_bRedraw = TRUE;
03520 
03521     // Extract the index of the item selected from the list, if any.
03522     INT32 i = pSelChangedMsg->pDlgOp->GetSelectedValueIndex(pSelChangedMsg->SetGadgetID);
03523     if (i == -1)
03524     {
03525         LibClipartSGallery::Instance()->m_bRedraw = FALSE;
03526         i = LibClipartSGallery::Instance()->GetClipTheme();
03527     }
03528 
03529     //Only redraw if the mode has actually been changed...
03530     if (i != LibClipartSGallery::Instance()->GetClipTheme())
03531     {
03532         // Matt - 02/01/2001 - in search of a quick fix...
03533         // Store DefaultLibraryPath information in the appropriate static...
03534         if (i == 1)
03535         {
03536             LibClipartSGallery::ClipartPath = LibClipartSGallery::DefaultLibraryPath;
03537             LibClipartSGallery::DefaultLibraryPath = LibClipartSGallery::WebThemePath;
03538         }
03539         else
03540         {
03541             LibClipartSGallery::WebThemePath = LibClipartSGallery::DefaultLibraryPath;
03542             LibClipartSGallery::DefaultLibraryPath = LibClipartSGallery::ClipartPath;
03543         }
03544 
03545         // Update the gallery's property index.
03546         LibClipartSGallery::Instance()->SetClipTheme((INT32) i);
03547         UpdateGadgets();
03548 
03549         //Now Redraw the gallery after changing between Clipart and Web Themes...
03550         if (LibClipartSGallery::Instance()->m_bRedraw)
03551         {
03552             LibClipartSGallery::Instance()->ModeHasChanged();
03553             LibClipartSGallery::Instance()->SelectionHasChanged();
03554             LibClipartSGallery::Instance()->ForceRedrawOfList();
03555         }
03556     }
03557 }

void OpLibGalClipTheme::UpdateGadgets  )  [private]
 

Sets the text in all the combos associated with this descriptor to the currently selected clipart/web theme selection.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/09/2000
See also:
OpDescriptor::BuildGadgetList

Definition at line 3570 of file sglcart.cpp.

03571 {
03572     // Create a list of all the gadget IDs
03573     List theGadgets;
03574     if (BuildGadgetList(&theGadgets))
03575     {
03576         // Iterate over each control in the list.
03577         INT32 nVal = LibClipartSGallery::Instance()->GetClipTheme();
03578         for (GadgetListItem* pgli = (GadgetListItem*) theGadgets.GetHead(); 
03579              pgli != 0; 
03580              pgli = (GadgetListItem*) theGadgets.GetNext(pgli))
03581         {
03582             // Set each control to display the text.
03583             pgli->pDialogBarOp->SetSelectedValueIndex(pgli->gidGadgetID, nVal);
03584         }
03585 
03586         // Tidy up.
03587         theGadgets.DeleteAll();
03588     }
03589 } 


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