SliceSaveFileDlg Class Reference

#include <slice.h>

Inheritance diagram for SliceSaveFileDlg:

SaveFileDialog BaseFileDialog List of all members.

Public Member Functions

 SliceSaveFileDlg (LPCTSTR FilterString, String_256 &DefPath, String_256 &DefName, String_256 &DocumentName)
virtual BOOL IsValidFilename ()
 override for the virtual function in SaveFileDialog. That had a message "file exists : replace or cancel?" This extends that to a "file exists : replace, insert or cancel?" for the insertion of HTML into existing HTML Param Returns

Public Attributes

BOOL m_Inject

Detailed Description

Definition at line 263 of file slice.h.


Constructor & Destructor Documentation

SliceSaveFileDlg::SliceSaveFileDlg LPCTSTR  FilterString,
String_256 DefPath,
String_256 DefName,
String_256 DocumentName
[inline]
 

Definition at line 266 of file slice.h.

00266                                                                                                                :
00267         SaveFileDialog(FilterString, DefPath, DefName, DocumentName) {m_Inject = FALSE; }


Member Function Documentation

BOOL SliceSaveFileDlg::IsValidFilename  )  [virtual]
 

override for the virtual function in SaveFileDialog. That had a message "file exists : replace or cancel?" This extends that to a "file exists : replace, insert or cancel?" for the insertion of HTML into existing HTML Param Returns

Author:
Simon_Knight (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/2/00

Reimplemented from BaseFileDialog.

Definition at line 2978 of file slice.cpp.

02979 {
02980     // Get the pathname
02981     CString FullPath = GetPathName();
02982     AppendExtension(&FullPath);
02983 
02984     // Webster - RanbirR 17/02/97
02985     // Save the file name with our Filter extension, for use in our Message Box.
02986 #ifdef WEBSTER
02987     CString FileName(FullPath);
02988 #endif //webster
02989 
02990     // if doesn't exist then thats fine
02991     if (_taccess( FullPath, 0 )) // requires io.h
02992     {
02993         //  WEBSTER-ranbirr-27/03/97
02994         // Remove the extension from the file. Webster - RanbirR 11\02\97.
02995     #ifdef WEBSTER
02996         RemoveFileExtension(&FileName);
02997     #endif //webster
02998         return TRUE;
02999     }
03000 
03001     // Added for Webster - Ranbir 11\02\97  
03002     // Removes the exstion from a file name.
03003 #ifdef WEBSTER
03004     RemoveFileExtension(&FileName);
03005 #endif //webster
03006 
03007     // Get the filename into a Path object
03008 #ifndef WEBSTER
03009     String_256 KernelFilename(FullPath);
03010     PathName FileMessage(KernelFilename);
03011     KernelFilename =  FileMessage.GetTruncatedPath(50);
03012 #endif //webster
03013     
03014     // Webster - RanbirR 17/02/97 
03015     // Use "FileName", since it contains the Filter extension.
03016 #ifdef WEBSTER
03017     String_256 KernelFilename(FileName);
03018     PathName FileMessage(KernelFilename);
03019     KernelFilename =  FileMessage.GetTruncatedPath(50);
03020 #endif //webster
03021 
03022     const TCHAR* Name;
03023     Name = (TCHAR*)KernelFilename;
03024 
03025     TCHAR prompt[256];
03026     if (!::LoadString( AfxGetResourceHandle(), _R(IDM_OVERWRITE_INJECT), prompt, 256 ) )
03027         camStrcpy( prompt, "%s?" );                             // in case cannot load
03028 
03029     // fill in the %s field with the filename
03030     TCHAR ErrorMsg[512];
03031     wsprintf( ErrorMsg, prompt, (const TCHAR*)Name );
03032     Error::SetError( 0, ErrorMsg, 0 );
03033     SetNextMsgHelpContext(_R(IDM_OVERWRITE_INJECT));
03034 
03035     // then ask the user
03036     ErrorInfo Info;
03037     Info.Button[0] = _R(IDB_OVERWRITE);
03038     Info.Button[1] = _R(IDS_INJECT);
03039     Info.Button[2] = _R(IDS_CANCEL);
03040     
03041     // This makes the cancel button the default one in this situation
03042     // as defaulting to replace is bad.
03043     Info.OK = Info.Cancel = 3;
03044 
03045     switch (AskQuestion( &Info ))
03046     {
03047         // if they cancel, then the name is not acceptable to them
03048         case _R(IDS_CANCEL):
03049             return FALSE;
03050 
03051         case _R(IDS_INJECT):
03052             m_Inject = TRUE;
03053         case _R(IDB_OVERWRITE):
03054         default:
03055             break;
03056     }
03057 
03058     return TRUE;
03059 }


Member Data Documentation

BOOL SliceSaveFileDlg::m_Inject
 

Definition at line 273 of file slice.h.


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