SelMediaDlg Class Reference

#include <selmedia.h>

Inheritance diagram for SelMediaDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SelMediaDlg ()
MsgResult Message (Msg *Message)
void Do (OpDescriptor *)
 This function should be over-ridden to perform an operation without passing a parameter.
void DoWithParam (OpDescriptor *, OpParam *pParam)
 Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the SelMediaDlgParam class.
BOOL Create ()
 The create method reserves everything needed to guarantee that the dialog will appear. It returns FALSE if it fails. If any dialog merging was specified (by providing a non-zero value for SubDialogID in the call to the DialogOp constructor) then it will be carried out when this function is called.

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().
static OpState GetState (String_256 *, OpDescriptor *)

Static Public Attributes

static const UINT32 IDD = _R(IDD_SEL_MEDIA_APP_DIALOG)
static const CDlgMode Mode = MODAL

Protected Member Functions

void InitValues ()

Protected Attributes

SelMediaDlgParamm_pOptions

Detailed Description

Definition at line 145 of file selmedia.h.


Constructor & Destructor Documentation

SelMediaDlg::SelMediaDlg  ) 
 

Definition at line 148 of file selmedia.cpp.


Member Function Documentation

BOOL SelMediaDlg::Create void   )  [virtual]
 

The create method reserves everything needed to guarantee that the dialog will appear. It returns FALSE if it fails. If any dialog merging was specified (by providing a non-zero value for SubDialogID in the call to the DialogOp constructor) then it will be carried out when this function is called.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/8/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if all resources to create the dialog can be successfully allocated. FALSE otherwise

Errors: If the resources cannot be allocated then ERRORIF is called with a Dialog creation failed error message.

See also:
-

Reimplemented from DialogOp.

Definition at line 239 of file selmedia.cpp.

00240 {
00241     if (DialogOp::Create())
00242     {
00243         return TRUE;
00244     }
00245     else
00246         return FALSE;
00247 }

void SelMediaDlg::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 251 of file selmedia.cpp.

00252 {
00253     Create();
00254     Open();
00255 }

void SelMediaDlg::DoWithParam OpDescriptor ,
OpParam pParam
[virtual]
 

Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the SelMediaDlgParam class.

Author:
Luke_hart (Xara Group Ltd) <LukeH@xara.com>
Date:
23/08/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 274 of file selmedia.cpp.

00275 {
00276     if (pParam == NULL)
00277     {
00278         ERROR3("SelMediaDlg::DoWithParam - NULL Args");
00279         return;
00280     }
00281 
00282     // Use the OpParam that has been passed in to us
00283     ERROR3IF( !pParam->IS_KIND_OF(SelMediaDlgParam), "pParam isn't" );
00284     m_pOptions = (SelMediaDlgParam*) pParam;
00285 
00286     // Force the dialog box to be created, as it is modal it will be opened via a message
00287     BOOL                fOk = Create();
00288     if( !fOk )
00289     {
00290         // Could not create the dialog box so call inform error 
00291         InformError();
00292         End();         // End the operation 
00293     }
00294 }

OpState SelMediaDlg::GetState String_256 ,
OpDescriptor
[static]
 

Definition at line 215 of file selmedia.cpp.

00216 {
00217     OpState OpSt;
00218     return(OpSt);
00219 }

BOOL SelMediaDlg::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 223 of file selmedia.cpp.

00224 {
00225     return (RegisterOpDescriptor(
00226                                 0,
00227                                 _R(IDS_SELMEDIADLG),
00228                                 CC_RUNTIME_CLASS(SelMediaDlg),
00229                                 OPTOKEN_SELMEDIADLG,
00230                                 SelMediaDlg::GetState,
00231                                 0,  /* help ID */
00232                                 _R(IDBBL_SELMEDIADLG),
00233                                 0   /* bitmap ID */
00234                                 ));
00235 }

void SelMediaDlg::InitValues  )  [protected]
 

Definition at line 154 of file selmedia.cpp.

00155 {
00156     bool                fItemSel = false;
00157 
00158     // Add possible replay apps
00159     SelMediaDlgParam::CMediaAppListIter end( m_pOptions->m_pAppList->end() );
00160     SelMediaDlgParam::CMediaAppListIter iter( m_pOptions->m_pAppList->begin() );
00161     for( INT32 ord = 0; iter != end; ++iter, ++ord )
00162     {
00163         SetStringGadgetValue( _R(IDC_LIST1), String_256(iter->first), FALSE, ord );
00164 
00165         if( m_pOptions->m_strSel != _T("") )
00166         {
00167             if( m_pOptions->m_strSel == iter->first )
00168             {
00169                 fItemSel = true;
00170                 SetSelectedValueIndex( _R(IDC_LIST1), ord );
00171             }
00172         }
00173         else
00174         if( iter->second )
00175         {
00176             fItemSel = true;
00177             SetSelectedValueIndex( _R(IDC_LIST1), ord );
00178         }
00179     }
00180 
00181     if( !fItemSel )
00182         SetSelectedValueIndex( _R(IDC_LIST1), 0 );
00183 }

MsgResult SelMediaDlg::Message Msg Message  )  [virtual]
 

if (IS_OUR_DIALOG_MSG(Message)) { DialogMsg* Msg = (DialogMsg*)Message; Handle Msg here }

Pass message on to base class for rest of handling. return <BaseClass>Message(Message);

This Pure virtual function will ENSURE

Returns:
Errors: -
See also:
MessageHandler

IS_OUR_DIALOG_MSG

Reimplemented from DialogOp.

Definition at line 187 of file selmedia.cpp.

00188 {
00189     if (IS_OUR_DIALOG_MSG(Message))
00190     {
00191         DialogMsg* Msg = (DialogMsg*)Message;
00192         // Handle ok button
00193         if ((Msg->DlgMsg == DIM_COMMIT) || (Msg->DlgMsg == DIM_CANCEL))
00194         {
00195             m_pOptions->m_strSel = GetStringGadgetValue( _R(IDC_LIST1) );
00196             TRACEUSER( "jlh92", _T("Return sel is %s\n"), PCTSTR(m_pOptions->m_strSel) );
00197 
00198             m_pOptions->m_fValid = ( DIM_COMMIT == Msg->DlgMsg );
00199 
00200             Close(); // Hide the dialog
00201             End();
00202         }
00203         else
00204         if( DIM_SOFT_COMMIT == Msg->DlgMsg ||
00205             DIM_CREATE == Msg->DlgMsg )
00206             InitValues();
00207 
00208         return (DLG_EAT_IF_HUNGRY(Msg));
00209     }
00210     return OK;
00211 }


Member Data Documentation

const UINT32 SelMediaDlg::IDD = _R(IDD_SEL_MEDIA_APP_DIALOG) [static]
 

Definition at line 165 of file selmedia.h.

SelMediaDlgParam* SelMediaDlg::m_pOptions [protected]
 

Definition at line 150 of file selmedia.h.

const CDlgMode SelMediaDlg::Mode = MODAL [static]
 

Definition at line 166 of file selmedia.h.


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