00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 #ifndef INC_FILEDLGS
00102 #define INC_FILEDLGS
00103
00104
00105 PORTNOTE("other", "XPDialog doesn't make sense" )
00106 #if !defined(EXCLUDE_FROM_XARALX)
00107 #define XPDialog
00108 #endif
00109
00110
00111
00112
00113 class PathName;
00114 class String_256;
00115 class RenderRegion;
00116 class BitmapExportOptions;
00117
00118
00119
00120 RenderRegion* CreateOSRenderRegion(DocRect* pRequiredSize, ReDrawInfoType* ExtraInfo,
00121 BOOL UseSelViewColContext = FALSE);
00122 BOOL DestroyOSRenderRegion(RenderRegion* pRender);
00123
00124 PORTNOTE("other", "Removed MFC type Hooks" )
00125 #if !defined(EXCLUDE_FROM_XARALX)
00126 #ifdef XPDialog
00127
00128 struct OPENFILENAMEEX : public OPENFILENAME
00129 {
00130 void * pvReserved;
00131 DWORD dwReserved;
00132 DWORD FlagsEx;
00133 };
00134 #endif
00135 #endif
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 class BaseFileDialog : public wxFileDialog
00146 {
00147 DECLARE_CLASS(BaseFileDialog)
00148
00149 public:
00150
00151 static String_256 DefaultSaveFilePath;
00152 static String_256 DefaultOpenFilePath;
00153 static INT32 SelectedFilter;
00154
00155 static BOOL MakeBakFiles;
00156 static BOOL ShowPreviewBitmap;
00157 static BOOL ThumbNailMode;
00158
00159
00160 static BOOL Init();
00161
00162
00163 BaseFileDialog(BOOL IsFileOpen, DWORD dwFlags, LPCTSTR lpszFilter = NULL, wxWindow* pParentWnd = NULL);
00164 ~BaseFileDialog();
00165
00166
00167 virtual BOOL PrepareDialog();
00168
00169
00170 virtual INT32 GetSelectedFilterIndex();
00171 virtual INT32 SetSelectedFilterIndex(INT32 NewIndex);
00172
00173 virtual BOOL SetTitle(INT32 TitleId);
00174
00175 virtual BOOL SetInitialDirectory(const String_256& pDir);
00176
00177 virtual BOOL SetDefaultFileName(String_256& Name);
00178
00179 virtual BOOL GetChosenFileName(PathName * pName);
00180
00181 virtual Filter * GetSelectedExportFilter(INT32 TheSelectedFilter);
00182 virtual void SetSelectedExportFilter(UINT32 uiFilterID);
00183
00184 virtual INT32 OpenAndGetFileName();
00185
00186
00187 static TCHAR *BuildFilterString(BOOL GetImport, UINT32 SelectedFilterID, INT32 *SelectedFilter,
00188 CCRuntimeClass *pTypeOfFilter = CC_RUNTIME_CLASS(Filter),
00189 UINT32 Bpp = 0, UINT32 BitmapCount = 1);
00190
00191
00192 virtual void AppendExtension(wxString* pFilename);
00193
00194
00195 virtual BOOL IsValidFilename();
00196
00197 #ifdef XPDialog
00198
00199 virtual int ShowModal();
00200 #endif
00201
00202
00203
00204 #ifdef WEBSTER
00205 virtual BOOL RemoveFileExtension(wxString* pFilename);
00206 #endif //WEBSTER
00207
00208
00209
00210
00211
00212 static BaseFileDialog* m_pCurrentFileDialog;
00213 PORTNOTE("other", "Removed OnPaletteChanged - windowsy" )
00214 #if !defined(EXCLUDE_FROM_XARALX)
00215 afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
00216 #endif
00217
00218 protected:
00219 enum
00220 {
00221 TITLE_SIZE = 128
00222 };
00223
00224 TCHAR Title[TITLE_SIZE];
00225
00226 PORTNOTE("other", "Removed MFC type Hooks" )
00227 #if !defined(EXCLUDE_FROM_XARALX)
00228
00229 virtual UINT32 OnHookMsg(wxWindow* hwnd, UINT32 nMsg, WPARAM wParam, LPARAM lParam);
00230
00231 virtual UINT32 OnFileTypeChange();
00232
00233
00234 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00235
00236 BOOL ExplorerInited;
00237
00238
00239 virtual BOOL ExplorerFileHookNotify(wxWindow* hDlg, LPOFNOTIFY pofn);
00240
00241
00242
00243
00244
00245
00246 static UINT32 CALLBACK HookProc(wxWindow* hwnd, UINT32 nMsg, WPARAM wParam, LPARAM lParam);
00247
00248
00249 DECLARE_DYNAMIC(BaseFileDialog);
00250
00251
00252
00253 afx_msg LRESULT OnRedrawMessage(WPARAM, LPARAM);
00254
00255 afx_msg void OnShowPreviewBitmap();
00256
00257 afx_msg void OnHelp();
00258
00259 afx_msg void OnSize(UINT32 nType, INT32 cx, INT32 cy);
00260
00261
00262
00263
00264
00265
00266 afx_msg void OnOptions();
00267 virtual BOOL HandleOptions();
00268
00269 virtual void OnFileNameChange( );
00270
00271
00272 virtual BOOL GetPreviewBitmapFromFile ( PathName * pPath );
00273
00274
00275 virtual BOOL OpenFileForPreview ( CCDiskFile &File,
00276 PathName *pPath );
00277 virtual BOOL ReadRIFFPreview ( CCDiskFile &File,
00278 PathName *pPath );
00279 virtual BOOL ReadNativePreview ( CCDiskFile &File,
00280 PathName *pPath );
00281 virtual BOOL ReadBitmapPreview ( CCDiskFile &File,
00282 PathName *pPath,
00283 UINT32 FilterID );
00284 virtual void OnFolderChange();
00285
00286
00287 #ifdef XPDialog
00288 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00289 OPENFILENAMEEX m_ofnEx;
00290 #endif
00291 #endif
00292
00293
00294 KernelBitmap * pBitmapToUse;
00295
00296 BOOL WantPreviewBitmap;
00297
00298 private:
00299
00300 wxString m_previousPathName;
00301
00302 };
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 class OpenFileDialog : public BaseFileDialog
00316 {
00317 DECLARE_CLASS(OpenFileDialog)
00318
00319 public:
00320
00321 INT32 NativeFilterPos;
00322
00323
00324 OpenFileDialog(LPCTSTR FilterString);
00325 BOOL PrepareDialog();
00326
00327
00328 void SetDefaultPath(const String_256& NewPath);
00329
00330
00331 static TCHAR* BuildFilterString(INT32* NativeFilterPos);
00332
00333 protected:
00334
00335 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00336
00337 private:
00338
00339 void OnInitDialog( wxInitDialogEvent& event );
00340 PORTNOTE("other", "Removed MFC junk" )
00341 #if !defined(EXCLUDE_FROM_XARALX)
00342 void DoDataExchange(CDataExchange* pDX);
00343
00344 DECLARE_DYNAMIC(OpenFileDialog);
00345 DECLARE_MESSAGE_MAP()
00346 #endif
00347
00348
00349 };
00350
00351
00352
00353 #define IDC_COMPRESS_BUTTON (131)
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365 class SaveFileDialog : public BaseFileDialog
00366 {
00367 DECLARE_CLASS(SaveFileDialog)
00368
00369 public:
00370 SaveFileDialog(LPCTSTR FilterString, const String_256&, const String_256&);
00371 SaveFileDialog(LPCTSTR FilterString, const String_256& DefPath, const String_256& DefName,
00372 const String_256& DocumentName);
00373
00374
00375 virtual BOOL PrepareDialog();
00376
00377
00378 void SetDefaultPath(const String_256& NewPath);
00379
00380
00381 virtual void AppendExtension(wxString* pFilename);
00382
00383 protected:
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00394
00395 PORTNOTE("other", "Removed MFC type Hooks" )
00396 #if !defined(EXCLUDE_FROM_XARALX)
00397
00398
00399 virtual BOOL HandleOptions();
00400 #endif
00401
00402 protected:
00403
00404 String_256 DefaultName;
00405 String_256 DefaultPath;
00406 String_256 DocName;
00407
00408 wxButton *CompressButton;
00409 wxButton *Options;
00410 wxStaticText *CurrentOptions;
00411
00412
00413 BOOL OnInitDialog();
00414 BOOL OnFileNameOK();
00415 PORTNOTE("other", "Removed MFC junk" )
00416 #if !defined(EXCLUDE_FROM_XARALX)
00417 void DoDataExchange(CDataExchange* pDX);
00418
00419
00420 DECLARE_DYNAMIC(SaveFileDialog);
00421 DECLARE_MESSAGE_MAP()
00422 #endif
00423 };
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435 class SaveTemplateDialog : public SaveFileDialog
00436 {
00437 DECLARE_CLASS(SaveTemplateDialog)
00438
00439 public:
00440 SaveTemplateDialog(PathName& pathToPutInDialog);
00441 static BOOL m_fUseAsDefault;
00442 static BOOL m_fDefaultTemplatesFolder;
00443 void OnUseAsDefault();
00444 void OnDefaultTemplatesFolder();
00445
00446 PORTNOTE("other", "Removed MFC junk" )
00447 #if !defined(EXCLUDE_FROM_XARALX)
00448 void OnFileNameChange();
00449 #endif
00450
00451 protected:
00452 String_256 m_strTitleOfDialog;
00453
00454 PORTNOTE("other", "Removed MFC junk" )
00455 #if !defined(EXCLUDE_FROM_XARALX)
00456 DECLARE_DYNAMIC(SaveTemplateDialog);
00457 DECLARE_MESSAGE_MAP()
00458 #endif
00459
00460 private:
00461 PORTNOTE("other", "Removed MFC junk" )
00462 #if !defined(EXCLUDE_FROM_XARALX)
00463
00464 void DoDataExchange(CDataExchange* pDX);
00465 #endif
00466
00467 BOOL ExplorerInitDialog(wxWindow* hDlg);
00468
00469 BOOL PrepareDialog();
00470 };
00471
00472
00473
00474 #define MAX_ALLOWED_NAME_LENGTH 60
00475 #define TotalControls 60
00476
00477
00478
00479 #define IDC_LAYERS_BUTTON (130)
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493 class ImportFileDialog : public BaseFileDialog
00494 {
00495 DECLARE_CLASS(ImportFileDialog)
00496
00497 public:
00498 ImportFileDialog(LPCTSTR lpszFilter = NULL);
00499
00500 protected:
00501
00502 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00503
00504 private:
00505 wxButton *LayersButton;
00506
00507 BOOL OnInitDialog( wxInitDialogEvent& event );
00508 PORTNOTE("other", "Removed MFC junk" )
00509 #if !defined(EXCLUDE_FROM_XARALX)
00510 void DoDataExchange(CDataExchange* pDX);
00511 afx_msg void OnLButtonDblClk(UINT32 nFlags, CPoint point);
00512 DECLARE_MESSAGE_MAP()
00513 DECLARE_DYNAMIC(ImportFileDialog);
00514 #endif
00515 };
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529 class ExportFileDialog : public BaseFileDialog
00530 {
00531 DECLARE_CLASS(ExportFileDialog)
00532
00533 public:
00534 ExportFileDialog(LPCTSTR lpszFilter = NULL);
00535
00536
00537 virtual void AppendExtension(wxString* pFilename);
00538 virtual void AddExtension(wxString* pFilename, BOOL Replace = FALSE, BOOL AskAboutReplace = FALSE,
00539 UINT32 Selection = 0 );
00540
00541 #if FALSE
00542
00543 BitmapExportOptions* GetExportOptions() { return m_pOptions; };
00544 #endif
00545
00546 void ExportABitmap(BOOL bExportABitmap, KernelBitmap* pBitmap = 0)
00547 { m_bExportABitmap = bExportABitmap; m_pBitmapToExport = pBitmap; }
00548
00549 protected:
00550
00551 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00552 virtual BOOL HandleOptions();
00553
00554 private:
00555 BOOL OnInitDialog( wxInitDialogEvent& event );
00556 PORTNOTE("other", "Removed MFC junk" )
00557 #if !defined(EXCLUDE_FROM_XARALX)
00558 void DoDataExchange(CDataExchange* pDX);
00559 #endif
00560 BOOL OnFileNameOK();
00561
00562 virtual void OnTypeChange();
00563 virtual void OnLBSelChangedNotify(UINT32 nIDBox, UINT32 iCurSel, UINT32 nCode);
00564
00565 virtual BOOL IsValidFilename();
00566 BOOL SetStateOnFilterChange();
00567
00568 PORTNOTE("other", "Removed MFC junk" )
00569 #if !defined(EXCLUDE_FROM_XARALX)
00570 afx_msg void OnAutoPreview();
00571
00572 DECLARE_MESSAGE_MAP()
00573
00574 DECLARE_DYNAMIC(ExportFileDialog);
00575 #endif
00576
00577 protected:
00578 BOOL m_bExportABitmap;
00579 KernelBitmap *m_pBitmapToExport;
00580 #if FALSE
00581
00582 BitmapExportOptions* m_pOptions;
00583 #endif
00584 };
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600 class GIFExportFileDialog : public ExportFileDialog
00601 {
00602 DECLARE_CLASS(GIFExportFileDialog)
00603
00604 PORTNOTE("other", "Removed MFC junk" )
00605 #if !defined(EXCLUDE_FROM_XARALX)
00606 DECLARE_DYNAMIC(GIFExportFileDialog);
00607 #endif
00608
00609 public:
00610 GIFExportFileDialog(LPCTSTR lpszFilter);
00611
00612 virtual BOOL HandleOptions();
00613
00614
00615 virtual BOOL ExplorerInitDialog(wxWindow* hDlg);
00616 };
00617
00618 #endif // !INC_FILEDLGS