SepsDlg Class Reference

#include <optsprin.h>

Inheritance diagram for SepsDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SepsDlg ()
 default constructor
 ~SepsDlg ()
 destructor
MsgResult Message (Msg *Message)
 main message handler, will call HandleMessage if message is for the dialog box, otherwise forward to base class
BOOL Create ()
 local version of DialogOp::Create()
void Do (OpDescriptor *)
 This function should be over-ridden to perform an operation without passing a parameter.
void DoWithParam (OpDescriptor *, OpParam *Param)
 This function should be over-ridden to perform an operation which requires parameters.

Static Public Member Functions

static OpState GetState (String_256 *, OpDescriptor *)
static BOOL Init (void)
 Declares a preference that allows you to clear memory in delete().
static BOOL InvokeDialog (ColourPlate *pTheColourPlate, PrintBaseTab *pParentDialog)
 display the dialog

Static Public Attributes

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

Protected Member Functions

void InitControls (void)
 (Re-)Initialises all controls in the seps dialogue tab
MsgResult HandleMessage (DialogMsg *Msg)
 local message handler

Private Member Functions

 CC_DECLARE_DYNCREATE (SepsDlg)

Private Attributes

ColourPlatepColourPlate
ColourPlatepLocalColourPlate
PrintBaseTabpParent
SepsDlgParampParam

Detailed Description

Definition at line 293 of file optsprin.h.


Constructor & Destructor Documentation

SepsDlg::SepsDlg  ) 
 

default constructor

> SepsDlg::SepsDlg()

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

Errors: -

See also:
- class SepsDlg

Definition at line 3111 of file optsprin.cpp.

03111                  : DialogOp(IDD, Mode)
03112 {
03113     pColourPlate = NULL;
03114     pLocalColourPlate = NULL;
03115     pParam = NULL;
03116 }

SepsDlg::~SepsDlg  ) 
 

destructor

> SepsDlg::~SepsDlg()

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

Errors: -

See also:
- class SepsDlg

Definition at line 3294 of file optsprin.cpp.

03295 {
03296     delete pLocalColourPlate;
03297 }


Member Function Documentation

SepsDlg::CC_DECLARE_DYNCREATE SepsDlg   )  [private]
 

BOOL SepsDlg::Create void   )  [virtual]
 

local version of DialogOp::Create()

> SepsDlg::Create()

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/6/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
- DialogOp::Create() for now

Errors: -

See also:
- class SepsDlg

Reimplemented from DialogOp.

Definition at line 3133 of file optsprin.cpp.

03134 {
03135     return DialogOp::Create();
03136 }

void SepsDlg::Do OpDescriptor  )  [virtual]
 

This function should be over-ridden to perform an operation without passing a parameter.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/6/94
Parameters:
OpDesc,: A pointer to the OpDescriptor which invoked the operation [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Operation::DoWithParam

Reimplemented from Operation.

Definition at line 3300 of file optsprin.cpp.

03301 {
03302     ERROR3("Don't call SepsDlg::Do - use DoWithParam");
03303     End();
03304 }

void SepsDlg::DoWithParam OpDescriptor ,
OpParam Param
[virtual]
 

This function should be over-ridden to perform an operation which requires parameters.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/6/94
Parameters:
OpDesc,: A pointer to the OpDescriptor which invoked the operation [INPUTS] pOpParam: Optional operator parameters, these are similar to a window procedures (lParam, wParam). Each operation requiring parameters will describe what these should be.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Operation::Do

Reimplemented from Operation.

Definition at line 3307 of file optsprin.cpp.

03308 {
03309     ERROR3IF(Param == NULL, "Illegal NULL param");
03310     if (!Param)
03311         return;
03312 
03313     pParam = (SepsDlgParam *) Param;
03314     ERROR3IF(pParam->pColourPlate == NULL, "Illegal NULL param");
03315     if (!pParam->pColourPlate)
03316         return;
03317 
03318     pColourPlate = pParam->pColourPlate;
03319     pLocalColourPlate = new ColourPlate(*pColourPlate);
03320     ERROR3IF(pLocalColourPlate == NULL,"Error in SepsDlg::DoWithParam() : allocation failure"); 
03321     if (!pLocalColourPlate)
03322         return;
03323 
03324     pParent = pParam->pParent;
03325 
03326     pParam->Result = FALSE;     // Set up a reasonable default return value
03327 
03328     if (!Create())
03329     {
03330         InformError();
03331         End();
03332     }
03333 }

OpState SepsDlg::GetState String_256 ,
OpDescriptor
[static]
 

Definition at line 3351 of file optsprin.cpp.

03352 {
03353     OpState State;
03354 
03355     return(State);
03356 }

MsgResult SepsDlg::HandleMessage DialogMsg Msg  )  [protected]
 

local message handler

> SepsDlg::HandleMessage(DialogMessage* Msg)

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/6/96
Parameters:
- pointer to a DialogMessage object [INPUTS]
- [OUTPUTS]
Returns:
- MsgResult::OK for now

Errors: -

See also:
- class SepsDlg

Definition at line 3220 of file optsprin.cpp.

03221 {
03222     ERROR2IF(pColourPlate == NULL,FAIL,"Error in SepsDlg::HandleMessage() : unexpected null pointer");  
03223     ERROR2IF(pLocalColourPlate == NULL,FAIL,"Error in SepsDlg::HandleMessage() : unexpected null pointer");
03224     switch (Msg->DlgMsg)
03225     {
03226         case DIM_CREATE:
03227             //Display the current settings data for our colour plate 
03228             InitControls();
03229             break;
03230 
03231         case DIM_COMMIT:        // OK button clicked
03232             {
03233                 BOOL angleIsValid = FALSE;
03234                 BOOL frequencyIsValid = FALSE;
03235                 double angle = GetDoubleGadgetValue(_R(IDC_EDITANGLE), 0, 360, _R(IDS_INVALID_ANGLE), &angleIsValid); 
03236                 double frequency = GetDoubleGadgetValue(_R(IDC_EDITFREQUENCY), 1, 1000, _R(IDS_INVALID_FREQUENCY), &frequencyIsValid); 
03237                 if (angleIsValid && frequencyIsValid)
03238                 {
03239                     pColourPlate->SetOverprint(pLocalColourPlate->Overprints());
03240                     pColourPlate->SetScreenInfo(angle, frequency);
03241                     pColourPlate->SetDisabled(pLocalColourPlate->IsDisabled());
03242 
03243                     if (fabs(pLocalColourPlate->GetScreenAngle() - pColourPlate->GetScreenAngle()) > 0.0001)
03244                         pParam->Result = TRUE;
03245                     else if (fabs(pLocalColourPlate->GetScreenFrequency() - pColourPlate->GetScreenFrequency()) > 0.0001)
03246                         pParam->Result = TRUE;
03247 
03248                     Close();
03249                     End();
03250                     return OK;
03251                 }
03252             }
03253             break;
03254 
03255         case DIM_CANCEL:        // Cancel button clicked
03256             {
03257                 Close();
03258                 End();
03259                 return OK;      // After End, we mustn't call base class, as this object may have been deleted
03260             }
03261             break;
03262 
03263         case DIM_LFT_BN_CLICKED: // Left button pressed
03264             {
03265                 if (Msg->GadgetID == _R(IDC_CHECKPRINT))
03266                     pLocalColourPlate->SetDisabled(!GetBoolGadgetSelected(_R(IDC_CHECKPRINT)));
03267                 else if (Msg->GadgetID == _R(IDC_CHECKOVERPRINT))
03268                     pLocalColourPlate->SetOverprint(GetBoolGadgetSelected(_R(IDC_CHECKOVERPRINT)));
03269             }
03270         default:
03271             break;
03272 
03273     }
03274     // Always call the base class, or things like help buttons won't work
03275     return DialogOp::Message(Msg);
03276 }

BOOL SepsDlg::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 3336 of file optsprin.cpp.

03337 {
03338     return RegisterOpDescriptor(    0,
03339                                     _R(IDS_SEPSDIALOG),
03340                                     CC_RUNTIME_CLASS(SepsDlg),
03341                                     OPTOKEN_SEPSDIALOG,
03342                                     SepsDlg::GetState,
03343                                     0,                          // help ID 
03344                                     0           // bubble help
03345                                 );
03346 
03347 }

void SepsDlg::InitControls void   )  [protected]
 

(Re-)Initialises all controls in the seps dialogue tab

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96

Definition at line 3151 of file optsprin.cpp.

03152 {
03153     String_256 Temp;
03154     pColourPlate->GetDescription(&Temp);
03155 
03156     String_256 plateDescr;
03157     plateDescr.MakeMsg(_R(IDS_SEPPROPERTIES), (TCHAR *) Temp);
03158 
03159     SetStringGadgetValue(_R(IDC_PLATECAPTION), plateDescr);
03160 
03161     //Screen frequency  
03162     String_256 frequency;
03163     camSprintf((TCHAR*) frequency, _T("%1.4f"), double(pColourPlate->GetScreenFrequency()));
03164     SetStringGadgetValue(_R(IDC_EDITFREQUENCY), frequency, TRUE);
03165 
03166     //Screen angle  
03167     String_256 angle;
03168     camSprintf((TCHAR*) angle, _T("%1.4f"), double(pColourPlate->GetScreenAngle()));
03169     SetStringGadgetValue(_R(IDC_EDITANGLE), angle, TRUE);
03170 
03171     //'Print this ink' checkbox
03172     SetBoolGadgetSelected(_R(IDC_CHECKPRINT), !pColourPlate->IsDisabled());
03173 
03174     //'Overprint' checkbox
03175     SetBoolGadgetSelected(_R(IDC_CHECKOVERPRINT), pColourPlate->Overprints());
03176 }

BOOL SepsDlg::InvokeDialog ColourPlate pTheColourPlate,
PrintBaseTab pParentDialog
[static]
 

display the dialog

> BOOL SepsDlg::InvokeDialog(ColourPlate *pTheColourPlate, PrintBaseTab* pParentDialog)

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/6/96
Parameters:
- pointer to the colour plate we're setting, pointer to the Separations dialog tab [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the colour plate angle or frequency values were changed

Errors: -

See also:
- class SepsDlg

Definition at line 3372 of file optsprin.cpp.

03373 {
03374     ERROR3IF(pTheColourPlate == NULL, "Come on, play by the rules");
03375     ERROR3IF(pParentDialog == NULL, "Come on, play by the rules!!!");
03376 
03377     OpDescriptor *TheDlg = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(SepsDlg));
03378 
03379     ERROR3IF(TheDlg == NULL, "SepsDlg::InvokeDialog is unable to find the Dlg OpDescriptor");
03380 
03381     if (TheDlg != NULL)
03382     {
03383         SepsDlgParam Param;
03384         Param.pColourPlate = pTheColourPlate;
03385         Param.pParent = pParentDialog;
03386         Param.Result = FALSE;
03387 
03388         TheDlg->Invoke(&Param);
03389         return(Param.Result);
03390     }
03391 
03392     return(FALSE);
03393 }

MsgResult SepsDlg::Message Msg Message  )  [virtual]
 

main message handler, will call HandleMessage if message is for the dialog box, otherwise forward to base class

> SepsDlg::Message(Msg* Message)

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/6/96
Parameters:
- pointer to a Msg object [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
- class SepsDlg

Reimplemented from DialogOp.

Definition at line 3196 of file optsprin.cpp.

03197 {
03198     if (IS_OUR_DIALOG_MSG(Message))
03199         return HandleMessage((DialogMsg*) Message);
03200 
03201     return DialogOp::Message(Message);
03202 }


Member Data Documentation

const INT32 SepsDlg::IDD = _R(IDD_PLATEPROPS) [static]
 

CLASS SepsDlg ******************************** Adrian 17/06/96 ********************************

Definition at line 302 of file optsprin.h.

const CDlgMode SepsDlg::Mode = MODAL [static]
 

Definition at line 303 of file optsprin.h.

ColourPlate* SepsDlg::pColourPlate [private]
 

Definition at line 318 of file optsprin.h.

ColourPlate* SepsDlg::pLocalColourPlate [private]
 

Definition at line 319 of file optsprin.h.

SepsDlgParam* SepsDlg::pParam [private]
 

Definition at line 321 of file optsprin.h.

PrintBaseTab* SepsDlg::pParent [private]
 

Definition at line 320 of file optsprin.h.


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