PasteSpecialDlg Class Reference

Allows the user to choose the clipbaord format to be pasted. More...

#include <clipext.h>

Inheritance diagram for PasteSpecialDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PasteSpecialDlg ()
 PasteSpecialDlg constructor.
void DoWithParam (OpDescriptor *, OpParam *)
 Creates then opens the dialog.
BOOL Create ()
 PasteSpecialDlg create method.
virtual MsgResult Message (Msg *Message)
 Handles all the dialog's messages.

Static Public Member Functions

static UINT32 InvokeDialog (void)
 Opens the paste special dialogue on screen, elicits a response, and returns having chosen the format to paste. This is a MODAL Dlg.
static OpState GetState (String_256 *, OpDescriptor *)
 PasteSpecialDlg GetState method.
static BOOL Init ()
 PasteSpecialDlg Init method. Called by sginit.cpp.

Static Public Attributes

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

Protected Attributes

OpParampParam

Detailed Description

Allows the user to choose the clipbaord format to be pasted.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/5/95
Notes: Call InvokeDialog to show the dialogue

Definition at line 445 of file clipext.h.


Constructor & Destructor Documentation

PasteSpecialDlg::PasteSpecialDlg  ) 
 

PasteSpecialDlg constructor.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95

Definition at line 2455 of file clipext.cpp.


Member Function Documentation

BOOL PasteSpecialDlg::Create void   )  [virtual]
 

PasteSpecialDlg create method.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95
Returns:
TRUE if successful, else FALSE

Reimplemented from DialogOp.

Definition at line 2638 of file clipext.cpp.

02639 {
02640     return(DialogOp::Create());
02641 }

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

Creates then opens the dialog.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95
Parameters:
pOpParam points to a structure to recieve the return result [INPUTS] pOpParam->Param1 will contain the result on return

Reimplemented from Operation.

Definition at line 2658 of file clipext.cpp.

02659 {
02660     ERROR3IF(pOpParam == NULL, "Come on, play by the rules");
02661     pParam = pOpParam;
02662     pParam->Param1 = 0;     // Set a safe default return result
02663 
02664     if (!Create())
02665     {
02666         InformError();
02667         End();
02668     }
02669 }

OpState PasteSpecialDlg::GetState String_256 ,
OpDescriptor
[static]
 

PasteSpecialDlg GetState method.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95

Definition at line 2592 of file clipext.cpp.

02593 {    
02594     OpState OpSt;
02595     return(OpSt);
02596 }

BOOL PasteSpecialDlg::Init void   )  [static]
 

PasteSpecialDlg Init method. Called by sginit.cpp.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95

Reimplemented from SimpleCCObject.

Definition at line 2611 of file clipext.cpp.

02612 {  
02613     return (RegisterOpDescriptor(
02614                                 0,
02615                                 _R(IDS_PASTESPECIALDLG),
02616                                 CC_RUNTIME_CLASS(PasteSpecialDlg),
02617                                 OPTOKEN_PASTESPECIALDLG,
02618                                 PasteSpecialDlg::GetState,
02619                                 _R(IDST_PASTESPECIALDLG),
02620                                 _R(IDBBL_PASTESPECIALDLG)
02621                                 )
02622             ); 
02623 }   

UINT32 PasteSpecialDlg::InvokeDialog void   )  [static]
 

Opens the paste special dialogue on screen, elicits a response, and returns having chosen the format to paste. This is a MODAL Dlg.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/95
Returns:
The Windows clipboard format chosen, or 0 to cancel

Definition at line 2687 of file clipext.cpp.

02688 {
02689     OpParam Info(0, 0);
02690     OpDescriptor *PSDlg = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(PasteSpecialDlg));
02691 
02692     ERROR3IF(PSDlg == NULL,
02693             "PasteSpecialDlg::InvokeDialog is unable to find the Dlg OpDescriptor");
02694 
02695     if (PSDlg != NULL)
02696         PSDlg->Invoke(&Info);
02697 
02698     return(Info.Param1);
02699 }

MsgResult PasteSpecialDlg::Message Msg Message  )  [virtual]
 

Handles all the dialog's messages.

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

Errors: -

See also:
-

Reimplemented from DialogOp.

Definition at line 2476 of file clipext.cpp.

02477 {
02478     BOOL CloseDlg = FALSE;
02479 
02480     if (IS_OUR_DIALOG_MSG(Message))
02481     {
02482         DialogMsg* Msg = (DialogMsg*)Message;
02483 
02484         switch (Msg->DlgMsg)
02485         {
02486             case DIM_CREATE:
02487                 {
02488                     INT32 Index = 0;
02489                     UINT32 ThisFormat = 0;
02490                     BOOL HaveTextAlready = FALSE;
02491                     do
02492                     {
02493                         ThisFormat = EnumClipboardFormats(ThisFormat);
02494                         if (ThisFormat != 0 && ExternalClipboard::CanImport(ThisFormat))
02495                         {
02496                             BOOL AddToList = TRUE;
02497                             if (ThisFormat == CF_TEXT || ThisFormat == CF_OEMTEXT || ThisFormat == CF_UNICODETEXT)
02498                             {
02499                                 if (HaveTextAlready)
02500                                     AddToList = FALSE;
02501 
02502                                 HaveTextAlready = TRUE;
02503                             }
02504 
02505                             if (AddToList)
02506                             {
02507                                 String_64 name;
02508                                 ExternalClipboard::GetExternalFormatName(ThisFormat, &name);
02509                                 SetStringGadgetValue(_R(IDC_PASTESPECIAL_LIST), (StringBase *) &name, FALSE, Index);
02510                                 Index++;
02511                             }
02512                         }
02513                     } while (ThisFormat != 0);
02514 
02515                     SetSelectedValueIndex(_R(IDC_PASTESPECIAL_LIST), 0);
02516                 }
02517                 break;
02518                 
02519 
02520             case DIM_SELECTION_CHANGED_COMMIT:
02521                 // Assume it was the listbox!
02522             case DIM_COMMIT:
02523             case DIM_SOFT_COMMIT:
02524                 {
02525                     pParam->Param1 = 0; // Safe default
02526 
02527                     INT32 Index = GetSelectedValueIndex(_R(IDC_PASTESPECIAL_LIST));
02528 
02529                     BOOL HaveTextAlready = FALSE;
02530                     UINT32 ThisFormat = 0;
02531                     do
02532                     {
02533                         ThisFormat = EnumClipboardFormats(ThisFormat);
02534                         if (ThisFormat != 0 && ExternalClipboard::CanImport(ThisFormat))
02535                         {
02536                             BOOL IsInList = TRUE;
02537                             if (ThisFormat == CF_TEXT || ThisFormat == CF_OEMTEXT || ThisFormat == CF_UNICODETEXT)
02538                             {
02539                                 if (HaveTextAlready)
02540                                     IsInList = FALSE;
02541 
02542                                 HaveTextAlready = TRUE;
02543                             }
02544 
02545                             if (IsInList)
02546                             {
02547                                 Index--;
02548                                 if (Index < 0)
02549                                 {
02550                                     pParam->Param1 = ThisFormat;
02551                                     break;
02552                                 }
02553                             }
02554                         }
02555                     } while (ThisFormat != 0);
02556                 }
02557 
02558                 CloseDlg = TRUE;
02559                 break;
02560 
02561             case DIM_CANCEL:
02562                 pParam->Param1 = 0;
02563                 CloseDlg = TRUE;
02564                 break;
02565         }
02566     }
02567 
02568     // Call down to the base class to automatically handle help, etc
02569     MsgResult Result = DialogOp::Message(Message);
02570 
02571     if (CloseDlg)
02572     {
02573         Close();
02574         End();
02575     }
02576 
02577     return(Result);
02578 }  


Member Data Documentation

const INT32 PasteSpecialDlg::IDD = _R(IDD_CAM_PASTESPECIAL) [static]
 

Definition at line 458 of file clipext.h.

const CDlgMode PasteSpecialDlg::Mode = MODAL [static]
 

Definition at line 459 of file clipext.h.

OpParam* PasteSpecialDlg::pParam [protected]
 

Definition at line 467 of file clipext.h.


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