GuidelinePropDlg Class Reference

Allows the user to change the properties of a guideline. More...

#include <guides.h>

Inheritance diagram for GuidelinePropDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 GuidelinePropDlg ()
 GuidelinePropDlg constructor. Creates a non-undoable operation.
void Do (OpDescriptor *)
 Creates then opens the dialog.
MsgResult Message (Msg *Message)
 Handles all the scale dialog's messages.
void ShowDetails ()
 Shows guideline details in the dialog.
BOOL CommitValues ()
 Called when the OK button is selected.

Static Public Member Functions

static OpState GetState (String_256 *, OpDescriptor *)
 GuidelinePropDlg GetState method.
static BOOL Init ()
 GuidelinePropDlg Init method.
static void SetNewGuidelineParams (GuidelineType type, MILLIPOINT pos)
 Set up param block for guideline property dialog.
static void SetEditGuidelineParams (NodeGuideline *pGuide)
 Set up param block for guideline property dialog.

Static Public Attributes

static const INT32 IDD = _R(IDD_GUIDELINE_PROPERTIES)
static const CDlgMode Mode = MODAL

Static Private Attributes

static GuidelinePropDlgParams Params

Detailed Description

Allows the user to change the properties of a guideline.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95

Definition at line 528 of file guides.h.


Constructor & Destructor Documentation

GuidelinePropDlg::GuidelinePropDlg  ) 
 

GuidelinePropDlg constructor. Creates a non-undoable operation.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95

Definition at line 2570 of file guides.cpp.


Member Function Documentation

BOOL GuidelinePropDlg::CommitValues  ) 
 

Called when the OK button is selected.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95
Returns:
TRUE if values excepted, FALSE otherwise

Definition at line 2754 of file guides.cpp.

02755 {
02756     OpGuidelineParam GuidelineParam;
02757 
02758     BOOL ok;
02759     MILLIPOINT Ordinate = GetDimensionGadgetValue(_R(IDC_GUIDELINEPROP_POSITION),Document::GetSelectedSpread(),&ok);
02760 
02761     if (!ok)
02762         return FALSE;
02763 
02764     if (Params.pGuideline != NULL)
02765     {
02766         GuidelineParam.Method      = GUIDELINEOPMETHOD_MOVE_IMMEDIATE;
02767         GuidelineParam.pGuideline  = Params.pGuideline;
02768         GuidelineParam.NewOrdinate = NodeGuideline::ToSpreadOrdinate(Params.pGuideline->FindParentSpread(),Ordinate,Params.pGuideline->GetType());
02769     }
02770     else
02771     {
02772         GuidelineParam.Method      = GUIDELINEOPMETHOD_NEW_IMMEDIATE;
02773         GuidelineParam.Type        = Params.Type;
02774         GuidelineParam.NewOrdinate = NodeGuideline::ToSpreadOrdinate(Document::GetSelectedSpread(),Ordinate,Params.Type);
02775     }
02776 
02777     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_GUIDELINE);
02778     ERROR3IF(pOpDesc == NULL,"FindOpDescriptor(OPTOKEN_GUIDELINE) failed");
02779 
02780     if (pOpDesc != NULL)
02781         pOpDesc->Invoke(&GuidelineParam);
02782 
02783     return TRUE;
02784 }

void GuidelinePropDlg::Do OpDescriptor pOpDesc  )  [virtual]
 

Creates then opens the dialog.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95
Parameters:
pOpDesc - [INPUTS]

Reimplemented from Operation.

Definition at line 2695 of file guides.cpp.

02696 {
02697     if (Create()==FALSE)
02698     {
02699         InformError(0,_R(IDS_OK));
02700         End();
02701     }
02702 }

OpState GuidelinePropDlg::GetState String_256 pReasonGreyed,
OpDescriptor pOpDesc
[static]
 

GuidelinePropDlg GetState method.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95
Parameters:
pOpDesc - [INPUTS]
pReasonGreyed - [OUTPUTS]
Returns:
op state

Definition at line 2647 of file guides.cpp.

02648 {    
02649     OpState OpSt;
02650     return OpSt;
02651 }

BOOL GuidelinePropDlg::Init void   )  [static]
 

GuidelinePropDlg Init method.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95
Returns:
FALSE if fails

Reimplemented from SimpleCCObject.

Definition at line 2663 of file guides.cpp.

02664 {  
02665     return RegisterOpDescriptor(0,
02666                                 _R(IDS_OPEDITGUIDELINEPROPDLG),
02667                                 CC_RUNTIME_CLASS(GuidelinePropDlg),
02668                                 OPTOKEN_EDITGUIDELINEPROPDLG,
02669                                 GuidelinePropDlg::GetState,
02670                                 0,  // help ID
02671                                 0,  // bubble ID
02672                                 0   // bitmap ID
02673                                 )
02674         && RegisterOpDescriptor(0,
02675                                 _R(IDS_OPNEWGUIDELINEPROPDLG),
02676                                 CC_RUNTIME_CLASS(GuidelinePropDlg),
02677                                 OPTOKEN_NEWGUIDELINEPROPDLG,
02678                                 GuidelinePropDlg::GetState,
02679                                 0,  // help ID
02680                                 0,  // bubble ID
02681                                 0   // bitmap ID
02682                                 );
02683 }   

MsgResult GuidelinePropDlg::Message Msg pMsg  )  [virtual]
 

Handles all the scale dialog's messages.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95
Parameters:
pMsg - [INPUTS]
Returns:
a message result

Reimplemented from DialogOp.

Definition at line 2585 of file guides.cpp.

02586 {
02587     if (IS_OUR_DIALOG_MSG(pMsg))
02588     {
02589         DialogMsg* Msg = (DialogMsg*)pMsg;
02590         BOOL EndDialog = FALSE;
02591 
02592         switch (Msg->DlgMsg)
02593         {
02594             case DIM_CREATE:
02595                 ShowDetails();
02596                 SetKeyboardFocus (_R(IDC_GUIDELINEPROP_POSITION)) ;
02597                 HighlightText    (_R(IDC_GUIDELINEPROP_POSITION)) ;
02598                 break;
02599                 
02600             case DIM_COMMIT:
02601                 EndDialog = CommitValues();
02602                 if (!EndDialog)
02603                     Msg->DlgMsg = DIM_NONE;  // stop default handler from closing dialog
02604                 break;
02605 
02606             case DIM_SOFT_COMMIT:
02607                 break; 
02608 
02609             case DIM_CANCEL:
02610                 EndDialog = TRUE;
02611                 break;
02612 
02613             case DIM_LFT_BN_CLICKED:
02614                 break; 
02615 
02616             case DIM_TEXT_CHANGED:
02617                 break;
02618 
02619             default:
02620                 break;
02621         }
02622 
02623         if (EndDialog)  // Dialog communication over 
02624         {              // Isn't this pretty?
02625             Close();  // Close the dialog 
02626             End();   // Destroy dialog 
02627             return OK;
02628         }
02629     }
02630 
02631     // Pass everything on to the base class . . .
02632     return DialogOp::Message(pMsg);
02633 }  

void GuidelinePropDlg::SetEditGuidelineParams NodeGuideline pGuide  )  [static]
 

Set up param block for guideline property dialog.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/95
Parameters:
pGuide - guide to edit [INPUTS]

Definition at line 2814 of file guides.cpp.

02815 {
02816     ERROR3IF(pGuide==NULL,"GuidelinePropDlg::SetEditGuidelineParam() - pGuide==NULL");
02817     Params.pGuideline = pGuide;
02818     Params.Type       = GUIDELINE_NOTYPE;
02819     Params.Ordinate   = 0;
02820 }

void GuidelinePropDlg::SetNewGuidelineParams GuidelineType  type,
MILLIPOINT  pos
[static]
 

Set up param block for guideline property dialog.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/95
Parameters:
Type - type of guide (hoiz/vert) [INPUTS] pos - position of guide

Definition at line 2797 of file guides.cpp.

02798 {
02799     Params.pGuideline = NULL;
02800     Params.Type       = type;
02801     Params.Ordinate   = pos;
02802 }

void GuidelinePropDlg::ShowDetails  ) 
 

Shows guideline details in the dialog.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/9/95

Definition at line 2713 of file guides.cpp.

02714 {
02715     MILLIPOINT    Ordinate;
02716     GuidelineType Type;
02717     Spread*       pSpread;
02718     String_256    TitleStr("");
02719     if (Params.pGuideline!=NULL)
02720     {
02721         pSpread  = Params.pGuideline->FindParentSpread();
02722         Ordinate = Params.pGuideline->GetOrdinate();
02723         Type     = Params.pGuideline->GetType();
02724         TitleStr = String_256(_R(IDS_OPEDITGUIDELINEPROPDLGTITLE));
02725     }
02726     else
02727     {
02728         pSpread  = Document::GetSelectedSpread();
02729         Ordinate = Params.Ordinate;
02730         Type     = Params.Type;
02731         TitleStr = String_256(_R(IDS_OPNEWGUIDELINEPROPDLGTITLE));
02732     }
02733 
02734     SetTitlebarName(&TitleStr);
02735 
02736     Ordinate = NodeGuideline::ToUserOrdinate(pSpread,Ordinate,Type);
02737     SetDimensionGadgetValue(_R(IDC_GUIDELINEPROP_POSITION),Ordinate,pSpread);
02738 
02739     UINT32 IDS = (Type==GUIDELINE_HORZ) ? _R(IDS_HORIZONTAL) : _R(IDS_VERTICAL);
02740     String_256 Str(IDS);
02741     SetStringGadgetValue(_R(IDC_GUIDELINEPROP_TYPE),IDS);
02742 }


Member Data Documentation

const INT32 GuidelinePropDlg::IDD = _R(IDD_GUIDELINE_PROPERTIES) [static]
 

Definition at line 538 of file guides.h.

const CDlgMode GuidelinePropDlg::Mode = MODAL [static]
 

Definition at line 539 of file guides.h.

GuidelinePropDlgParams GuidelinePropDlg::Params [static, private]
 

Definition at line 553 of file guides.h.


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