SaveTemplateDialog Class Reference

The Save Template dialog. It saves templates, basically. More...

#include <filedlgs.h>

Inheritance diagram for SaveTemplateDialog:

SaveFileDialog BaseFileDialog List of all members.

Public Member Functions

 SaveTemplateDialog (PathName &pathToPutInDialog)
 Contructor.
void OnUseAsDefault ()
 Called when the "Use As Default" switch is clicked on. This function gets the value of the switch and puts it into our member variable.
void OnDefaultTemplatesFolder ()
 Called when the "Default templates folder" switch is clicked on. This function gets the value of the switch and puts it into our member variable.
void OnFileNameChange ()
 Called when the user selects a new file. This checks the path of the file against the default template path of the document type. If the paths are the same, we put the "Use As Default" switch on.

Static Public Attributes

static BOOL m_fUseAsDefault = TRUE
static BOOL m_fDefaultTemplatesFolder = TRUE

Protected Member Functions

 DECLARE_DYNAMIC (SaveTemplateDialog)

Protected Attributes

String_256 m_strTitleOfDialog

Private Member Functions

void DoDataExchange (CDataExchange *pDX)
 Data exchange.
BOOL ExplorerInitDialog (wxWindow *hDlg)
 Should be called when the explorer style dialog boxes need setting up. We can take this opportunity to add in any extra controls that we require.
BOOL PrepareDialog ()
 Does anything the dialogs want doing after they have been created, but before they are displayed.

Detailed Description

The Save Template dialog. It saves templates, basically.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/10/97
See also:
BaseFileDialog, SaveFileDialog

Definition at line 435 of file filedlgs.h.


Constructor & Destructor Documentation

SaveTemplateDialog::SaveTemplateDialog PathName pathToShowInDialog  ) 
 

Contructor.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/10/97
Parameters:
pathToShowIngDialog The path to show in the dialog [INPUTS]

Definition at line 4116 of file filedlgs.cpp.

04117     : SaveFileDialog( PCTSTR( String_256( _R(IDS_NEWTEMPLATES_FILTER) ) ) , 
04118         String_256(pathToShowInDialog.GetLocation(TRUE)),
04119         String_256(pathToShowInDialog.GetFileName(TRUE)), String_256() )
04120 
04121 {
04122     m_fUseAsDefault=FALSE;
04123     m_fDefaultTemplatesFolder=TRUE;
04124     
04125     PrepareDialog();
04126 }


Member Function Documentation

SaveTemplateDialog::DECLARE_DYNAMIC SaveTemplateDialog   )  [protected]
 

void SaveTemplateDialog::DoDataExchange CDataExchange *  pDX  )  [private]
 

Data exchange.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/5/95
Parameters:
(a standard MFC object) [INPUTS]

Reimplemented from SaveFileDialog.

Definition at line 4194 of file filedlgs.cpp.

04195 {
04196     BaseFileDialog::DoDataExchange(pDX);
04197     //{{AFX_DATA_MAP(CMyDialog)
04198 #ifdef _DEBUG
04199     DDX_Check(pDX, _R(IDC_COMPRESS_BUTTON), CamelotNativeEPSFilter::CompressNative);
04200 #endif
04201 //  DDX_Check(pDX, _R(IDC_SAVEASWEB_BUTTON), SaveWebFile); //BaseCamelotFilter::ExportWebFile);
04202     if (CCamApp::IsNewWindowsUI())
04203     {
04204         DDX_Check(pDX, _R(IDC_SHOWPREVIEW), BaseFileDialog::ShowPreviewBitmap);
04205         DDX_Check(pDX, _R(IDC_USEASDEFAULT), SaveTemplateDialog::m_fUseAsDefault);
04206         //DDX_Check(pDX, _R(IDC_DEFAULTTEMPLATESFOLDER), SaveTemplateDialog::m_fDefaultTemplatesFolder);
04207     }
04208     //}}AFX_DATA_MAP
04209 }

BOOL SaveTemplateDialog::ExplorerInitDialog wxWindow *  hDlg  )  [private, virtual]
 

Should be called when the explorer style dialog boxes need setting up. We can take this opportunity to add in any extra controls that we require.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/10/97
Returns:
TRUE if it worked, FALSE if it failed
See also:
BaseFileDialog::ExplorerInitDialog; BaseFileDialog::OnHookMsg; BaseFileDialog::HookProc;

Reimplemented from SaveFileDialog.

Definition at line 4142 of file filedlgs.cpp.

04143 {
04144 PORTNOTE("other", "Remove MFC code" )
04145 #if !defined(EXCLUDE_FROM_XARALX)
04146     // Do nothing if not on explorer type dialog boxes
04147     if (!CCamApp::IsNewWindowsUI())
04148         return TRUE;
04149 
04150     // Set up and initialise the new buttons and controls
04151 
04152     //The "show preview"
04153     CheckDlgButton(_R(IDC_SHOWPREVIEW), BaseFileDialog::ShowPreviewBitmap != FALSE);
04154 
04155     //The "Use for all new drawings"
04156     CheckDlgButton(_R(IDC_USEASDEFAULT), FALSE);
04157 
04158     //And show the preview window   
04159     wxWindow* Icon = FindWindow( _R(IDC_PREVIEW));
04160     ::EnableWindow(Icon, TRUE);
04161 
04162     //But hide the options button
04163     Icon = FindWindow( _R(IDC_FILEDLG_OPTIONS));
04164     ::ShowWindow(Icon, SW_HIDE);
04165 
04166     // Move the Preview box down a little, so that it lines up with the List box
04167     wxWindow*   wndDlg = GetParent();
04168     wxWindow*   pWndPreview = GetDlgItem(_R(IDC_PREVIEW));
04169     wxRect      rPreview, rList;
04170     pWndPreview->GetWindowRect(&rPreview);
04171     ScreenToClient(rPreview);
04172     wxWindow*   pWndList = wndDlg->GetDlgItem(lst1);    // lst1 is the ID for the main list box
04173     pWndList->GetWindowRect(&rList);
04174     ScreenToClient(rList);
04175     pWndPreview->SetWindowPos(NULL, rPreview.GetLeft(), rList.GetTop(), rPreview.GetWidth(), rPreview.GetHeight(), 0);
04176 
04177     ExplorerInited = TRUE;
04178 #endif
04179 
04180     return TRUE;
04181 }

void SaveTemplateDialog::OnDefaultTemplatesFolder  ) 
 

Called when the "Default templates folder" switch is clicked on. This function gets the value of the switch and puts it into our member variable.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/10/97
Returns:
-
(It seems that normal Data Exchange methods don't work if the control is on an extension to the dialog)

Definition at line 4288 of file filedlgs.cpp.

04289 {
04290     // Do nothing.
04291 }

void SaveTemplateDialog::OnFileNameChange  )  [virtual]
 

Called when the user selects a new file. This checks the path of the file against the default template path of the document type. If the paths are the same, we put the "Use As Default" switch on.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/97
Returns:
-

Reimplemented from BaseFileDialog.

Definition at line 4309 of file filedlgs.cpp.

04310 {
04311 #if _MFC_VER >= 0x400
04312     if (!CCamApp::IsNewWindowsUI())
04313         return;
04314 
04315     //Get the new filename
04316     wxString cstrNameOfNewFile = GetPathName();
04317         
04318     // If its empty then return immediately
04319     if (cstrNameOfNewFile.IsEmpty())
04320         return;
04321 
04322     PathName pathOfNewFile(cstrNameOfNewFile.GetBuffer(256));
04323     
04324     cstrNameOfNewFile.ReleaseBuffer();
04325     
04326     if (!pathOfNewFile.IsValid())
04327     {
04328         // There was a problem e.g. user has typed f:
04329         // Magically a bad pathname sets an error so clear it!
04330         Error::ClearError();
04331         return;
04332     }
04333 
04334 #endif
04335 
04336     BaseFileDialog::OnFileNameChange();
04337 
04338     return;
04339 }

void SaveTemplateDialog::OnUseAsDefault  ) 
 

Called when the "Use As Default" switch is clicked on. This function gets the value of the switch and puts it into our member variable.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/97
Returns:
-
(It seems that normal Data Exchange methods don't work if the control is on an extension to the dialog)

Definition at line 4268 of file filedlgs.cpp.

04269 {
04270     m_fUseAsDefault = dynamic_cast<wxCheckBox*>( FindWindow( _R(IDC_USEASDEFAULT) ) )->IsChecked();
04271 }

BOOL SaveTemplateDialog::PrepareDialog  )  [private, virtual]
 

Does anything the dialogs want doing after they have been created, but before they are displayed.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/10/97
Returns:
TRUE if it worked, FALSE if not

Reimplemented from SaveFileDialog.

Definition at line 4224 of file filedlgs.cpp.

04225 {
04226     // Set the title of the dialog
04227     m_strTitleOfDialog = String_256(_R(IDS_NEWTEMPLATES_TITLEOFDIALOG));
04228 
04229     wxFileDialog::SetTitle( (TCHAR*)m_strTitleOfDialog );
04230 
04231     // Select the desired path
04232     if (!DefaultPath.IsEmpty())
04233     {
04234         TRACEUSER( "jlh92", _T("TemplDir = %s\n"), PCTSTR(DefaultPath) );
04235         // Set the default path
04236         SetDirectory( DefaultPath );
04237     }
04238     else
04239     {
04240         // or use the global default path
04241         if (DefaultSaveFilePath.Length() > 0)
04242             SetDirectory( DefaultSaveFilePath );
04243     }
04244 
04245     // Do the same for the filename
04246     if (!DefaultName.IsEmpty())
04247         SetFilename( DefaultName );
04248 
04249     // See if the base class wants to do anything
04250     return TRUE;
04251 }


Member Data Documentation

BOOL SaveTemplateDialog::m_fDefaultTemplatesFolder = TRUE [static]
 

Definition at line 442 of file filedlgs.h.

BOOL SaveTemplateDialog::m_fUseAsDefault = TRUE [static]
 

Definition at line 441 of file filedlgs.h.

String_256 SaveTemplateDialog::m_strTitleOfDialog [protected]
 

Definition at line 452 of file filedlgs.h.


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