GuidesPropertiesTab Class Reference

Allows the user to set various layer properties, such as:-. More...

#include <prpsgds.h>

Inheritance diagram for GuidesPropertiesTab:

LayerPropertyTabs PropertyTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 GuidesPropertiesTab ()
 GuidesPropertiesTab constructor. Creates a non-undoable operation.
 ~GuidesPropertiesTab ()
 GuidesPropertiesTab destructor.
virtual BOOL Init ()
 GuidesPropertiesTab initialisation routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the messages for this layer property tab.
virtual BOOL InitSection ()
 This hunts the current layer for guidelines of type GuideType, and returns the nearest one to the given ordinate of that type Sets initial values for this tab on the layer properties dialog box.
virtual BOOL CommitSection ()
 Takes the values in this tab of the layer properties dialog box. Called when ok or apply now is pressed on the main dialog box.
virtual BOOL UpdateLayerSection ()
 Called when the layer-related section of the tab should be updated.
virtual BOOL UpdateGuidelineSection ()
 Called when the guideline-related section of the tab should be updated.
virtual BOOL ColourListChanged (Document *pDoc)
 Called when the colour list changes in some way. pDoc points to the doc that contains the list that's changed. If pDoc is NULL, then there is no longer a colour list (e.g. all docs closed).
virtual BOOL GreySection ()
 Called when the user has closed all documents.
virtual BOOL UngreySection ()
 Called when the user has selected a new document.
BOOL ChangeControlStatus (const BOOL Status)
 Called to grey/ungrey all controls on this tab.
virtual BOOL UpdateSection ()
 Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly.
virtual CDlgResID GetPageID ()
 Allows the options dialog code to determine the dialog ID of this section.
virtual BOOL IsPropertyRequired ()
 Allows the layer propertiesto determine if this tab is required.

Private Member Functions

BOOL ShowDetails ()
 Shows the details of the associated layer in this tab.
BOOL ShowGuidelines (Layer *pLayer)
 Shows the guidelines in the guideline list.
BOOL ShowColours ()
 Shows the colours of the doc in the colour list.
BOOL PropertiesClicked ()
 Opens up the guideline properties dlg for the first selected item in the guideline list box.
BOOL NewClicked ()
 Allows you to create a new Guideline.
BOOL DeleteClicked ()
 Allows you to delete the selected Guidelines.
BOOL ColourChanged (INT32 Index)
 Handles a change in the colour list selection.
BOOL BuildGuidelineList (Layer *pLayer)
 Builds a list of the guidelines in the given layer Uses member var GuidelineList.

Private Attributes

BOOL GreyStatus
GuidelineType GuideType
ColourDropDownpColourDropDown
List GuidelineList

Detailed Description

Allows the user to set various layer properties, such as:-.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
See also:
LayerProperties; LayerProperties;

Definition at line 152 of file prpsgds.h.


Constructor & Destructor Documentation

GuidesPropertiesTab::GuidesPropertiesTab  ) 
 

GuidesPropertiesTab constructor. Creates a non-undoable operation.

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

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Definition at line 153 of file prpsgds.cpp.

00154 {   
00155     GuideType       = GUIDELINE_HORZ;
00156     pColourDropDown = NULL;
00157 }            

GuidesPropertiesTab::~GuidesPropertiesTab  ) 
 

GuidesPropertiesTab destructor.

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

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Definition at line 175 of file prpsgds.cpp.

00176 {
00177     if (pColourDropDown != NULL)
00178         delete pColourDropDown;
00179 
00180     GuidelineList.DeleteAll();
00181 }        


Member Function Documentation

BOOL GuidesPropertiesTab::BuildGuidelineList Layer pLayer  )  [private]
 

Builds a list of the guidelines in the given layer Uses member var GuidelineList.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
pLayer = ptr layer that contains guidelines [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:

Definition at line 430 of file prpsgds.cpp.

00431 {
00432     GuidelineList.DeleteAll();
00433     pPropertiesDlg->DeleteAllValues(_R(IDC_GUIDETAB_GUIDELINELIST));
00434 
00435     ERROR2IF(pLayer == NULL, FALSE,"pLayer is NULL");
00436 
00437     Node* pNode = pLayer->FindFirstChild(CC_RUNTIME_CLASS(NodeGuideline));
00438     while (pNode != NULL)
00439     {
00440         NodeGuideline* pGuideline = (NodeGuideline*) pNode;
00441         if (pGuideline->GetType() == GuideType)
00442         {
00443             GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.GetHead();
00444             while (pItem != NULL && (pItem->pGuideline->GetOrdinate() < pGuideline->GetOrdinate()))
00445                 pItem = (GuidelineListItem*)GuidelineList.GetNext(pItem);
00446 
00447             GuidelineListItem* pNewItem = new GuidelineListItem(pGuideline);
00448 
00449             if (pNewItem != NULL)
00450             {
00451                 if (pItem == NULL)
00452                     GuidelineList.AddTail(pNewItem);
00453                 else
00454                     GuidelineList.InsertBefore(pItem,pNewItem);
00455             }
00456         }
00457 
00458         pNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeGuideline));
00459     }
00460 
00461     return TRUE;
00462 }

BOOL GuidesPropertiesTab::ChangeControlStatus const BOOL  Status  ) 
 

Called to grey/ungrey all controls on this tab.

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

Errors: -

See also:
GuidesPropertiesTab::GreySection; GuidesPropertiesTab::UngreySection;

Definition at line 357 of file prpsgds.cpp.

00358 {
00359     BOOL Enable;
00360 
00361     Layer* pLayer = GetGuideLayer();
00362     Enable = (pLayer != NULL) && Status;
00363 
00364     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_GUIDELINELIST),Enable);
00365     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_HORZ),         Enable);
00366     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_VERT),         Enable);
00367     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURLIST),   Enable);
00368     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURTEXT),   Enable);
00369 
00370     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_NEW),          Status);    // Always available
00371 
00372     INT32 SelCount = pPropertiesDlg->GetSelectedCount(_R(IDC_GUIDETAB_GUIDELINELIST));
00373 
00374     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_DELETE),       Enable && (SelCount >= 1));
00375     pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_PROPERTIES),   Enable && (SelCount == 1));
00376 
00377     if (!Enable)
00378         pPropertiesDlg->DeleteAllValues(_R(IDC_GUIDETAB_GUIDELINELIST));
00379 
00380     return TRUE;
00381 }           

BOOL GuidesPropertiesTab::ColourChanged INT32  Index  )  [private]
 

Handles a change in the colour list selection.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/10/95
Parameters:
Index = index of selected item (Values < 0 will return FALSE); [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
-

Definition at line 769 of file prpsgds.cpp.

00770 {
00771     if (pColourDropDown == NULL || Index < 0)
00772         return FALSE;
00773  
00774     IndexedColour* pNewColour = pColourDropDown->DecodeSelection(Index);
00775 
00776     Layer* pLayer = GetGuideLayer();
00777     if (pLayer != NULL)
00778     {
00779         OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGELAYERCOLOUR);
00780         ERROR3IF(pOpDesc == NULL,"FindOpDescriptor(OPTOKEN_CHANGELAYERCOLOUR) failed");
00781 
00782         if (pOpDesc != NULL)
00783         {
00784             OpChangeLayerColourParam ChangeColourParam(pDocument,pLayer,pNewColour);
00785             pOpDesc->Invoke(&ChangeColourParam);
00786         }
00787 //      pLayer->SetGuideColour(pNewColour);
00788 //      LayerSGallery::ForceRedrawLayer(pDocument,pLayer);
00789     }
00790     return TRUE;
00791 }

BOOL GuidesPropertiesTab::ColourListChanged Document pDoc  )  [virtual]
 

Called when the colour list changes in some way. pDoc points to the doc that contains the list that's changed. If pDoc is NULL, then there is no longer a colour list (e.g. all docs closed).

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/95 inputs: pDoc = ptr to document that contains the changed list, or NULL if there's no longer a list
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
-

Reimplemented from PropertyTabs.

Definition at line 645 of file prpsgds.cpp.

00646 {
00647     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateGuidelineSection() called with no dialog pointer");
00648     ERROR2IF(pColourDropDown == NULL,FALSE,"ptr to 'colour drop down' is NULL");
00649 
00650     if (pPropertiesDlg->TalkToPage(GetPageID()))
00651     {
00652         BOOL Enable = (pDoc != NULL);
00653 
00654         pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURLIST),Enable);
00655         pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURTEXT),Enable);
00656 
00657         if (Enable)
00658             ShowColours();
00659         else
00660             pColourDropDown->ClearList();           
00661     }
00662     return TRUE;
00663 }

BOOL GuidesPropertiesTab::CommitSection  )  [virtual]
 

Takes the values in this tab of the layer properties dialog box. Called when ok or apply now is pressed on the main dialog box.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if values in dialog box ok, False otherwise.

Errors: -

See also:
GuidesPropertiesTab::InitSection()

Reimplemented from LayerPropertyTabs.

Definition at line 257 of file prpsgds.cpp.

00258 {
00259 TRACEUSER( "Neville", _T("GuidesPropertiesTab::CommitSection\n"));
00260     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::CommitSection called with no dialog pointer");
00261 
00262     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
00263     if (!ok)
00264         return TRUE;            // Talk to page failed to return now
00265 
00266 
00267     return TRUE;
00268 }

BOOL GuidesPropertiesTab::DeleteClicked  )  [private]
 

Allows you to delete the selected Guidelines.

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

Errors: -

See also:
-

Definition at line 808 of file prpsgds.cpp.

00809 {
00810     INT32* pIndexList = pPropertiesDlg->GetSelectedItems(_R(IDC_GUIDETAB_GUIDELINELIST));
00811     INT32 Count = GuidelineList.GetCount();
00812 
00813     INT32 i;
00814 
00815     BOOL ok = (pIndexList != NULL && Count > 0);
00816     NodeGuideline** pGuidelineList = NULL;
00817 
00818     if (ok)
00819     {
00820         pGuidelineList = (NodeGuideline**)CCMalloc(sizeof(NodeGuideline*)*(Count+1));
00821 
00822         ok = (pGuidelineList != NULL);
00823 
00824         if (ok)
00825         {
00826             for (i=0; (pIndexList[i] >= 0) && (i < Count);i++)
00827             {
00828                 GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.FindItem(pIndexList[i]);
00829                 if (pItem != NULL)
00830                     pGuidelineList[i] = pItem->pGuideline;
00831                 else
00832                 {
00833                     pGuidelineList[i] = NULL;
00834                     ERROR3_PF(("List item at index [%d] is NULL",i));
00835                 }
00836             }
00837 
00838             pGuidelineList[i] = NULL;
00839         }
00840     }
00841     else
00842         ok = FALSE;
00843 
00844     if (ok)
00845     {
00846         OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_GUIDELINE);
00847         ERROR3IF(pOpDesc == NULL,"FindOpDescriptor(OPTOKEN_GUIDELINE) failed");
00848 
00849         if (pOpDesc != NULL)
00850         {
00851             OpGuidelineParam GuidelineParam;
00852 
00853             GuidelineParam.Method           = GUIDELINEOPMETHOD_DELETE;
00854             GuidelineParam.pGuidelineList   = pGuidelineList;
00855 
00856             pOpDesc->Invoke(&GuidelineParam);
00857         }
00858     }
00859 
00860     if (pGuidelineList != NULL)
00861         CCFree(pGuidelineList);
00862 
00863     if (pIndexList != NULL)
00864         delete [] pIndexList;
00865 
00866     return ok;
00867 }

CDlgResID GuidesPropertiesTab::GetPageID  )  [virtual]
 

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The dialog ID of this tab section.

Errors: -

See also:
-

Reimplemented from LayerPropertyTabs.

Definition at line 219 of file prpsgds.cpp.

00220 {
00221     return _R(IDD_TAB_GUIDELINE_PROPERTIES);
00222 }

BOOL GuidesPropertiesTab::GreySection  )  [virtual]
 

Called when the user has closed all documents.

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

Errors: -

See also:
GuidesPropertiesTab::UngreySection;

Reimplemented from PropertyTabs.

Definition at line 285 of file prpsgds.cpp.

00286 {
00287 TRACEUSER( "Neville", _T("GreySection in GuidesPropertiesTab section\n"));
00288     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::GreySection called with no dialog pointer");
00289 
00290     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
00291     if (!ok)
00292         return TRUE;    // Talk to page failed to return now
00293 
00294     // Only update if we are not already grey 
00295     if (GreyStatus == TRUE)
00296         return TRUE;
00297 
00298     // Call our central greying/ungreying function
00299     ok = ChangeControlStatus(FALSE);
00300     
00301     GreyStatus = TRUE;
00302 
00303     return ok;
00304 } 

BOOL GuidesPropertiesTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the messages for this layer property tab.

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

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Reimplemented from LayerPropertyTabs.

Definition at line 680 of file prpsgds.cpp.

00681 {
00682 TRACEUSER( "Neville", _T("GuidesPropertiesTab::HandleMsg\n"));
00683     ERROR2IF(Msg == NULL,FALSE,"GuidesPropertiesTab::Message null message received");
00684     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::HandleMsg called with no dialog pointer");
00685 
00686     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
00687     if (!ok)
00688         return TRUE;        // no page present = handled message
00689     
00690     switch(Msg->DlgMsg)
00691     {
00692         case DIM_CREATE:    // Initialise controls
00693             GreyStatus = FALSE; // we are ungreyed by default
00694             ok = InitSection();
00695             if (!ok)
00696                 InformError();
00697             break;
00698         case DIM_LFT_BN_CLICKED:
00699             //LayerPropertyTabs::SetApplyNowState(TRUE);
00700             if (FALSE) {}
00701             else if (Msg->GadgetID == _R(IDC_GUIDETAB_HORZ))
00702             {
00703                 if (GuideType != GUIDELINE_HORZ)
00704                 {
00705                     GuideType = GUIDELINE_HORZ;
00706                     ShowDetails();
00707                 }
00708             }
00709             else if (Msg->GadgetID == _R(IDC_GUIDETAB_VERT))
00710             {
00711                 if (GuideType != GUIDELINE_VERT)
00712                 {
00713                     GuideType = GUIDELINE_VERT;
00714                     ShowDetails();
00715                 }
00716             }
00717             else if (Msg->GadgetID == _R(IDC_GUIDETAB_PROPERTIES))
00718             {
00719                 PropertiesClicked();
00720                 ShowDetails();
00721             }
00722             else if (Msg->GadgetID == _R(IDC_GUIDETAB_NEW))
00723             {
00724                 NewClicked();
00725                 ShowDetails();
00726             }
00727             else if (Msg->GadgetID == _R(IDC_GUIDETAB_DELETE))
00728             {   
00729                 DeleteClicked();
00730                 ShowDetails();
00731             }
00732             break;
00733 
00734         case DIM_SELECTION_CHANGED:
00735         case DIM_TEXT_CHANGED:
00736             //LayerPropertyTabs::SetApplyNowState(TRUE);
00737             if (FALSE) {}
00738             else if (Msg->GadgetID == _R(IDC_GUIDETAB_GUIDELINELIST))
00739             {
00740                 ChangeControlStatus(!GreyStatus);
00741             }
00742             else if (Msg->GadgetID == _R(IDC_GUIDETAB_COLOURLIST))
00743             {
00744                 ColourChanged(pPropertiesDlg->GetSelectedValueIndex(Msg->GadgetID));
00745                 ShowDetails();
00746             }
00747             break;
00748         default:
00749             break;
00750     }
00751     return TRUE;
00752 }  

BOOL GuidesPropertiesTab::Init void   )  [virtual]
 

GuidesPropertiesTab initialisation routine.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if initialised ok, False if failed.

Errors: -

See also:
LayerPropertyTabsDlg::Init; LayerPropertyTabs::Init;

Reimplemented from LayerPropertyTabs.

Definition at line 199 of file prpsgds.cpp.

00200 {   
00201     return TRUE;
00202 }        

BOOL GuidesPropertiesTab::InitSection  )  [virtual]
 

This hunts the current layer for guidelines of type GuideType, and returns the nearest one to the given ordinate of that type Sets initial values for this tab on the layer properties dialog box.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Reimplemented from LayerPropertyTabs.

Definition at line 997 of file prpsgds.cpp.

00998 {
00999 TRACEUSER( "Neville", _T("GuidesPropertiesTab::InitSection\n"));
01000     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::InitSection called with no dialog pointer");
01001 
01002     pColourDropDown = new ColourDropDown;
01003     if (pColourDropDown != NULL)
01004         pColourDropDown->Init(pPropertiesDlg->GetReadWriteWindowID(),_R(IDC_GUIDETAB_COLOURLIST));
01005 
01006     ShowDetails();
01007 
01008     return TRUE;
01009 }

BOOL GuidesPropertiesTab::IsPropertyRequired  )  [virtual]
 

Allows the layer propertiesto determine if this tab is required.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Returns:
Returns True if this tab is a program option.

Reimplemented from PropertyTabs.

Definition at line 235 of file prpsgds.cpp.

00236 {
00237     return TRUE;
00238 }

BOOL GuidesPropertiesTab::NewClicked  )  [private]
 

Allows you to create a new Guideline.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/95
Returns:
FALSE if fails

Definition at line 878 of file prpsgds.cpp.

00879 {
00880     // set guideline to be at user ordinate 0
00881     Spread*    pSpread  = Document::GetSelectedSpread();
00882     MILLIPOINT Ordinate = NodeGuideline::ToSpreadOrdinate(pSpread,0,GuideType);
00883     GuidelinePropDlg::SetNewGuidelineParams(GuideType,Ordinate);
00884 
00885     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_NEWGUIDELINEPROPDLG);
00886     if (pOpDesc!=NULL)
00887         pOpDesc->Invoke();
00888     else
00889         ERROR3("GuidesPropertiesTab::NewClicked() - OpDescriptor::FindOpDescriptor(OPTOKEN_NEWGUIDELINEPROPDLG) - failed");
00890 
00891     return TRUE;
00892 }

BOOL GuidesPropertiesTab::PropertiesClicked  )  [private]
 

Opens up the guideline properties dlg for the first selected item in the guideline list box.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/95
Returns:
FALSE if fails

Definition at line 903 of file prpsgds.cpp.

00904 {
00905     INT32 Index = pPropertiesDlg->GetFirstSelectedItem(_R(IDC_GUIDETAB_GUIDELINELIST));
00906     Layer* pLayer = GetGuideLayer();
00907     if (Index < 0 || pLayer == NULL) return FALSE;
00908 
00909     BOOL Valid;
00910     /*MILLIPOINT Ordinate =*/ pPropertiesDlg->GetDimensionGadgetValue(_R(IDC_GUIDETAB_GUIDELINELIST),pLayer,&Valid,Index);
00911 
00912     if (Valid)
00913     {
00914         GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.FindItem(Index);
00915         if (pItem!=NULL && pItem->pGuideline!=NULL)
00916         {
00917             GuidelinePropDlg::SetEditGuidelineParams(pItem->pGuideline);
00918             OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_EDITGUIDELINEPROPDLG);
00919             if (pOpDesc != NULL)
00920                 pOpDesc->Invoke();
00921             else
00922                 ERROR3("GuidesPropertiesTab::PropertiesClicked() - OpDescriptor::FindOpDescriptor(OPTOKEN_EDITGUIDELINEPROPDLG) failed");
00923         }
00924         else
00925             ERROR3_PF(("Unable to find guideline item at index (%d)",Index));
00926     }
00927 
00928     return TRUE;    
00929 }

BOOL GuidesPropertiesTab::ShowColours  )  [private]
 

Shows the colours of the doc in the colour list.

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

Errors: -

See also:
GuidesPropertiesTab

Definition at line 514 of file prpsgds.cpp.

00515 {
00516     if (pColourDropDown != NULL)
00517     {
00518         IndexedColour* pIndexedColour = NULL;
00519         Layer* pLayer = GetGuideLayer();
00520         if (pLayer != NULL)
00521         {
00522             DocColour* pDocColour = pLayer->GetGuideColour();
00523             if (pDocColour != NULL)
00524             {
00525                 pIndexedColour = pDocColour->FindParentIndexedColour();
00526                 if (pIndexedColour->IsDeleted())
00527                 {
00528                     pLayer->SetGuideColour(NULL);
00529                     pIndexedColour = NULL;
00530                 }
00531             }
00532         }
00533 
00534         pColourDropDown->ClearAllSpecialEntries();
00535 
00536         if (pIndexedColour != NULL)
00537         {
00538             if (!pIndexedColour->IsNamed())
00539             {
00540                 String_256 LocalColourText(_R(IDS_LOCALCOLOUR));
00541                 DocColour LocalColour;
00542                 LocalColour.MakeRefToIndexedColour(pIndexedColour);
00543 
00544                 pColourDropDown->AddSpecialEntry(&LocalColourText,&LocalColour);
00545             }
00546 
00547             pColourDropDown->FillInColourList(pIndexedColour);
00548         }
00549         else
00550             pColourDropDown->FillInColourList(NULL,0);
00551     }
00552     return TRUE;
00553 }

BOOL GuidesPropertiesTab::ShowDetails  )  [private]
 

Shows the details of the associated layer in this tab.

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

Errors: -

See also:
GuidesPropertiesTab

Definition at line 570 of file prpsgds.cpp.

00571 {
00572     Layer* pLayer = GetGuideLayer();
00573     if (pLayer != NULL)
00574     {
00575         ShowGuidelines(pLayer);
00576         ShowColours();
00577 
00578         pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_GUIDETAB_HORZ),GuideType == GUIDELINE_HORZ);
00579         pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_GUIDETAB_VERT),GuideType == GUIDELINE_VERT);
00580     }
00581 
00582     ChangeControlStatus(!GreyStatus);
00583 
00584     return TRUE;
00585 }

BOOL GuidesPropertiesTab::ShowGuidelines Layer pLayer  )  [private]
 

Shows the guidelines in the guideline list.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
Parameters:
pLayer = ptr layer that contains guidelines [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:

Definition at line 479 of file prpsgds.cpp.

00480 {
00481     ERROR2IF(pLayer == NULL, FALSE,"pLayer is NULL");
00482 
00483     BuildGuidelineList(pLayer);
00484 
00485     GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.GetHead();
00486     while (pItem != NULL)
00487     {   
00488         NodeGuideline* pGuideline = pItem->pGuideline;
00489 
00490         MILLIPOINT Ordinate = NodeGuideline::ToUserOrdinate(pGuideline->FindParentSpread(),pGuideline->GetOrdinate(),GuideType);
00491         pPropertiesDlg->SetDimensionGadgetValue(_R(IDC_GUIDETAB_GUIDELINELIST),Ordinate,pGuideline);
00492 
00493         pItem = (GuidelineListItem*)GuidelineList.GetNext(pItem);
00494     }
00495 
00496     return TRUE;
00497 }

BOOL GuidesPropertiesTab::UngreySection  )  [virtual]
 

Called when the user has selected a new document.

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

Errors: -

See also:
GuidesPropertiesTab::UngreySection;

Reimplemented from PropertyTabs.

Definition at line 321 of file prpsgds.cpp.

00322 {
00323 TRACEUSER( "Neville", _T("UngreySection in GuidesPropertiesTab section\n"));
00324     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UngreySection called with no dialog pointer");
00325 
00326     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());  // The GuidesPropertiesTab identifier
00327     if (!ok)
00328         return TRUE;    // Talk to page failed to return now
00329 
00330     // Only update if we are not already ungrey 
00331     if (GreyStatus == FALSE)
00332         return TRUE;
00333 
00334     // Call our central greying/ungreying function
00335     ok = ChangeControlStatus(TRUE);
00336     
00337     GreyStatus = FALSE;
00338 
00339     return ok;
00340 }

BOOL GuidesPropertiesTab::UpdateGuidelineSection  )  [virtual]
 

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

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

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Reimplemented from PropertyTabs.

Definition at line 623 of file prpsgds.cpp.

00624 {
00625     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateGuidelineSection() called with no dialog pointer");
00626     return (pPropertiesDlg->TalkToPage(GetPageID()) && ShowDetails());
00627 }

BOOL GuidesPropertiesTab::UpdateLayerSection  )  [virtual]
 

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

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

Errors: -

See also:
LayerPropertyTabsDlg; LayerPropertyTabs;

Reimplemented from PropertyTabs.

Definition at line 602 of file prpsgds.cpp.

00603 {
00604     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateLayerSection() called with no dialog pointer");
00605     return (pPropertiesDlg->TalkToPage(GetPageID()) && ShowDetails());
00606 }

BOOL GuidesPropertiesTab::UpdateSection  )  [virtual]
 

Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/09/95
Returns:
-

Errors: -

See also:
GuidesPropertiesTab::GreySection; GuidesPropertiesTab::UngreySection; GuidesPropertiesTab::InitSection;

Reimplemented from PropertyTabs.

Definition at line 398 of file prpsgds.cpp.

00399 {
00400 TRACEUSER( "Neville", _T("GuidesPropertiesTab::UpdateSection\n"));
00401     ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateSection called with no dialog pointer");
00402 
00403     BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
00404     if (!ok)
00405         return TRUE;        // page not present
00406 
00407 
00408     // Update our controls here
00409 
00410     // We are happy with what happened
00411     return TRUE;
00412 }


Member Data Documentation

BOOL GuidesPropertiesTab::GreyStatus [private]
 

Definition at line 206 of file prpsgds.h.

List GuidesPropertiesTab::GuidelineList [private]
 

Definition at line 209 of file prpsgds.h.

GuidelineType GuidesPropertiesTab::GuideType [private]
 

Definition at line 207 of file prpsgds.h.

ColourDropDown* GuidesPropertiesTab::pColourDropDown [private]
 

Definition at line 208 of file prpsgds.h.


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