NameDialog Class Reference

Allows the user to edit the parts of a layer. More...

#include <namedlg.h>

Inheritance diagram for NameDialog:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 NameDialog ()
 NameDialog constructor. Creates a non-undoable operation.
virtual void DoWithParam (OpDescriptor *, OpParam *)
 Opens a dialog with the name given in pOpParam.
virtual MsgResult Message (Msg *Message)
 See DialogOp.
void ShowLayerDetails ()
void CommitDialogValues ()

Static Public Member Functions

static BOOL Init ()
 Declares a NameDialog.
static BOOL Invoke (NameDialogParam &NameParam)
 Pops up a name dialog without you having to type in all that OpDescriptor hoo haa.
static OpState GetState (String_256 *, OpDescriptor *)
 See DialogOp.

Static Public Attributes

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

Protected Member Functions

virtual void OnCreate ()
 Responds to a DIM_CREATE message by initializing the dialog control. It sets the name control with the string passed in the NameDialogParam via the DoWithParam() member.
virtual void OnCommit ()
 Takes the string from the dialog and puts it in the NameDialogParam given in DoWithParam().
virtual void OnCancel ()
 Responds to a DIM_CANCEL message, by setting ??????????????????? in the NameDialogParam.
const StringBaseGetName () const
BOOL SetName (const StringBase &StringEntered)
BOOL SetCancelled ()
void SetNameParam (NameDialogParam &NameParam)
 Data access.

Private Attributes

NameDialogParamm_pNameParam

Detailed Description

Allows the user to edit the parts of a layer.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
20/07/97

Definition at line 151 of file namedlg.h.


Constructor & Destructor Documentation

NameDialog::NameDialog  ) 
 

NameDialog constructor. Creates a non-undoable operation.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 271 of file namedlg.cpp.

00271                       : DialogOp(NameDialog::IDD, NameDialog::Mode) 
00272 {   
00273     m_pNameParam = NULL;
00274 }        


Member Function Documentation

void NameDialog::CommitDialogValues  ) 
 

void NameDialog::DoWithParam OpDescriptor ,
OpParam pOpParam
[virtual]
 

Opens a dialog with the name given in pOpParam.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97
Parameters:
pOpParam : a NameDialogParam, containing any suggested name [INPUTS]
pOpParam : the NameDialogParam contains [OUTPUTS]

Reimplemented from Operation.

Definition at line 290 of file namedlg.cpp.

00291 {
00292     VOID_ENSURE_NOT_NULL(pOpParam);
00293     ENSURE_KIND(pOpParam, NameDialogParam);
00294 
00295     SetNameParam(*(NameDialogParam*)pOpParam);
00296 
00297     BOOL ok = Create();
00298 
00299     if (!ok)            // Could not create 
00300     {
00301         End();          // End the operation 
00302     }
00303 }

const StringBase & NameDialog::GetName  )  const [protected]
 

Definition at line 450 of file namedlg.cpp.

00451 {
00452     ERROR2IF(m_pNameParam == NULL, NullString, "NULL Member");
00453 
00454     return m_pNameParam->GetNameEntered();
00455 }

OpState NameDialog::GetState String_256 ,
OpDescriptor
[static]
 

See DialogOp.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 252 of file namedlg.cpp.

00253 {    
00254     OpState OpSt;
00255 
00256     return(OpSt);
00257 }

BOOL NameDialog::Init void   )  [static]
 

Declares a NameDialog.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Reimplemented from SimpleCCObject.

Definition at line 194 of file namedlg.cpp.

00195 {  
00196     return (RegisterOpDescriptor(
00197                                 0,
00198                                 _R(IDS_STYLENAMEDLG),
00199                                 CC_RUNTIME_CLASS(NameDialog),
00200                                 OPTOKEN_NAMEDLG,
00201                                 NameDialog::GetState,
00202                                 0, //_R(IDH_Command_Wizard_Properties), // help ID
00203                                 0   // bubble ID
00204                                 )
00205             ); 
00206 }   

BOOL NameDialog::Invoke NameDialogParam NameParam  )  [static]
 

Pops up a name dialog without you having to type in all that OpDescriptor hoo haa.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97
Parameters:
NameParam,: A NameDialogParam containing any name you want to appear in the [INPUTS] dialog when it starts up.
NameParam,: The NameDialogParam containing any name typed into the dialog. [OUTPUTS]
Returns:
TRUE if the entry was okayed, FALSE if cancelled.

Definition at line 226 of file namedlg.cpp.

00227 {
00228     OpDescriptor* const pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_NAMEDLG);
00229     if (pOpDesc != NULL)
00230     {
00231         pOpDesc->Invoke(&NameParam);
00232     }
00233     else
00234     {
00235         ERROR3("Couldn't find OPTOKEN_NAMEDLG op descriptor");
00236     }
00237 
00238     return !NameParam.DialogCancelled();
00239 }

MsgResult NameDialog::Message Msg Message  )  [virtual]
 

See DialogOp.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Reimplemented from DialogOp.

Definition at line 316 of file namedlg.cpp.

00317 {
00318     if (IS_OUR_DIALOG_MSG(Message))
00319     {
00320         DialogMsg* pMsg = (DialogMsg*)Message;
00321         BOOL EndDialog = FALSE;
00322         switch (pMsg->DlgMsg)
00323         {
00324             case DIM_CREATE:
00325                 OnCreate();
00326                 break;
00327                 
00328             case DIM_COMMIT:
00329                 OnCommit();
00330                 EndDialog = TRUE;
00331                 break;
00332 
00333             case DIM_CANCEL:
00334                 OnCancel();
00335                 EndDialog = TRUE;
00336                 break;
00337         }
00338 
00339         if (EndDialog)
00340         {
00341             Close();    // Close the dialog 
00342             End();      // Destroy dialog - BEWARE! delete's this
00343         }
00344 
00345     }
00346 
00347     // Pass everything on to the base class . . .
00348     return DialogOp::Message(Message);
00349 }  

void NameDialog::OnCancel  )  [protected, virtual]
 

Responds to a DIM_CANCEL message, by setting ??????????????????? in the NameDialogParam.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 420 of file namedlg.cpp.

00421 {
00422     SetCancelled();
00423 }

void NameDialog::OnCommit  )  [protected, virtual]
 

Takes the string from the dialog and puts it in the NameDialogParam given in DoWithParam().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 392 of file namedlg.cpp.

00393 {
00394     BOOL Valid = TRUE;
00395 
00396     String_256 NewName;
00397 
00398     // Get the string from the layer name dialog
00399     NewName = GetStringGadgetValue(_R(IDC_NAME_NAME), &Valid);
00400 
00401     if (Valid)
00402     {
00403         Valid = SetName(NewName);
00404     }
00405 }

void NameDialog::OnCreate  )  [protected, virtual]
 

Responds to a DIM_CREATE message by initializing the dialog control. It sets the name control with the string passed in the NameDialogParam via the DoWithParam() member.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 367 of file namedlg.cpp.

00368 {
00369     String_256 Name = GetName();
00370 
00371     BOOL Ok = SetStringGadgetValue(_R(IDC_NAME_NAME),&Name);
00372 
00373     if (Ok)
00374     {
00375         SetKeyboardFocus(_R(IDC_NAME_NAME));
00376         HighlightText(_R(IDC_NAME_NAME));
00377     }
00378 }

BOOL NameDialog::SetCancelled  )  [protected]
 

Definition at line 458 of file namedlg.cpp.

00459 {
00460     ENSURE_NOT_NULL(m_pNameParam);
00461 
00462     m_pNameParam->SetDialogCancelled();
00463 
00464     return TRUE;
00465 }

BOOL NameDialog::SetName const StringBase StringEntered  )  [protected]
 

Definition at line 442 of file namedlg.cpp.

00443 {
00444     ENSURE_NOT_NULL(m_pNameParam);
00445 
00446     return m_pNameParam->SetNameGiven(StringEntered);
00447 }

void NameDialog::SetNameParam NameDialogParam NameParam  )  [protected]
 

Data access.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from MarkN)
Date:
13/07/97

Definition at line 436 of file namedlg.cpp.

00437 {
00438     m_pNameParam = &NameParam;
00439 }

void NameDialog::ShowLayerDetails  ) 
 


Member Data Documentation

const INT32 NameDialog::IDD = _R(IDD_NAME) [static]
 

Definition at line 169 of file namedlg.h.

NameDialogParam* NameDialog::m_pNameParam [private]
 

Definition at line 184 of file namedlg.h.

const CDlgMode NameDialog::Mode = MODAL [static]
 

Definition at line 170 of file namedlg.h.


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