filedlgs.cpp File Reference

(r1785/r1712)

#include "camtypes.h"
#include "camelot.h"
#include "filedlgs.h"
#include "camframe.h"
#include "native.h"
#include "nativeps.h"
#include "helpuser.h"
#include "bmapprev.h"
#include "bmpfiltr.h"
#include "palman.h"
#include "webparam.h"
#include "xarprefs.h"
#include "webprefs.h"
#include "webfiltr.h"
#include "ctrlhelp.h"
#include "bitfilt.h"
#include "dlgcol.h"
#include "dlgview.h"
#include "osrndrgn.h"
#include "nodebmp.h"
#include "bitmpinf.h"
#include "oilbitmap.h"
#include "webaddr.h"
#include "aprps.h"
#include "exjpeg.h"
#include "ngprop.h"
#include "menuops.h"
#include "progress.h"
#include "qualattr.h"

Go to the source code of this file.

Defines

#define MAX_ALLOWED_NAME_LENGTH   60
#define NumberOfNames   60
#define OFN_EXPLORER   0
 Creates a base class file dialog, installing a hook etc.

Functions

void FixFPControlRegister ()
 IMPLEMENT_CLASS (BaseFileDialog, wxFileDialog)
 IMPLEMENT_CLASS (OpenFileDialog, BaseFileDialog)
 IMPLEMENT_CLASS (SaveFileDialog, BaseFileDialog)
 IMPLEMENT_CLASS (SaveTemplateDialog, SaveFileDialog)
 IMPLEMENT_CLASS (ImportFileDialog, BaseFileDialog)
 IMPLEMENT_CLASS (ExportFileDialog, BaseFileDialog)
 IMPLEMENT_CLASS (GIFExportFileDialog, ExportFileDialog)
 ON_BN_CLICKED (_R(ID_CC_HELP_BUTTON), BaseFileDialog::OnHelp) ON_BN_CLICKED(_R(IDC_SHOWPREVIEW)
BaseFileDialog::OnShowPreviewBitmap
BaseFileDialog::OnShowPreviewBitmap 
ON_BN_CLICKED (_R(IDC_FILEDLG_OPTIONS), BaseFileDialog::OnOptions) ON_BN_CLICKED(_R(ID_CC_HELP_BUTTON)
BaseFileDialog::OnShowPreviewBitmap
BaseFileDialog::OnShowPreviewBitmap
BaseFileDialog::OnHelp 
ON_BN_CLICKED (_R(IDC_SHOWPREVIEW), BaseFileDialog::OnShowPreviewBitmap) ON_BN_CLICKED(_R(IDC_USEASDEFAULT)
RenderRegionCreateOSRenderRegion (DocRect *pRequiredSize, ReDrawInfoType *ExtraInfo, BOOL UseSelViewColContext)
 Simplifies the creation of a render region as used in a dialog box. It will create a render region, scaled to the correct size etc and deal with all the Creation, initialisation etc of the region. StartRender is also called, so if this function does not return NULL you are able to start drawing into it. You MUST call DestroyOSRenderRegion when you have draw everything that you need to as this calls StopRender (which does the blit to the screen) as well as deleting the render region for you.
BOOL DestroyOSRenderRegion (RenderRegion *pRender)
 Deinitialises the render region and deletes it.

Variables

const DWORD FCIDM_SHVIEW_THUMBNAIL = 0x702D
const INT32 MaxWebName = 40


Define Documentation

#define MAX_ALLOWED_NAME_LENGTH   60
 

Definition at line 170 of file filedlgs.cpp.

#define NumberOfNames   60
 

Definition at line 172 of file filedlgs.cpp.

#define OFN_EXPLORER   0
 

Creates a base class file dialog, installing a hook etc.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> & JustinF
Date:
26/1/95
Parameters:
IsFileOpen - TRUE if this is a File Open dialog, FALSE if it is a Save Dialog [INPUTS] Flags - The flags you want set in the CFileDialog. lpszFilter - The Filter String pParentWnd - The owner of this window (by default the main frame window)
Technical Notes: We set the OFN_EXPLORER on Windows 95 only. Really this should include the new shell on NT when we work with it. If you set this flag on NT without the new shell, then you get a useful not enough memory or similar error and the dialog box fails to open. At present, the user will see nothing as we don't seem to cope with errors. We need to set the flag as some functions e.g. ExportFileDialog::OnTypeChange() will only work with it set. Used to fix the filenames up when switching to a new filter.

Definition at line 278 of file filedlgs.cpp.


Function Documentation

RenderRegion* CreateOSRenderRegion DocRect pRequiredSize,
ReDrawInfoType ExtraInfo,
BOOL  UseSelViewColContext
 

Simplifies the creation of a render region as used in a dialog box. It will create a render region, scaled to the correct size etc and deal with all the Creation, initialisation etc of the region. StartRender is also called, so if this function does not return NULL you are able to start drawing into it. You MUST call DestroyOSRenderRegion when you have draw everything that you need to as this calls StopRender (which does the blit to the screen) as well as deleting the render region for you.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> (Copied from Rik/Jason code in DialogOp::CreateGRenderRegion)
Date:
17/7/96
Parameters:
pRequiredSize - The size that you want the effective area of the window to [INPUTS] be. Measured in Millipoints. eg. If you want your control to appear to be 1 inch square (whatever the actual size of it is), pass in a DocRect that looks a bit like this ... DocRect(0,0,72000,72000) ExtraInfo - The info about the region, as supplied by the dialog manager
Returns:
Render Region. This returns a pointer to a render region, or NULL if it failed to create one.
Scope: Global

Notes: Use GRenderRegions when you want fast redraw, grad fills, and transparency. If only simple rendering is required, think about perhaps using an OSRenderRegion instead.

See also:
DialogOp::DestroyOSRenderRegion

DialogOp::CreateGRenderRegion

Definition at line 2101 of file filedlgs.cpp.

02103 {
02104     // Make a new dialog view
02105     DialogView *pDialogView = new DialogView;
02106     if (pDialogView == NULL)
02107         // Error - return failure.
02108         return NULL;
02109 
02110     // Initialise the DialogView
02111     if (!pDialogView->Init())
02112     {
02113         // Error - return failure.
02114         delete pDialogView;
02115         return NULL;
02116     }
02117 
02118     // Pixelise the rectangle
02119     pRequiredSize->lo.Pixelise(pDialogView);
02120     pRequiredSize->hi.Pixelise(pDialogView);
02121     DocRect ClipRect = *pRequiredSize;
02122 
02123     // Get some default params for the render region
02124     FIXED16 Scale(1);
02125 
02126     // Ok, go and scale things
02127     INT32 ReqDx = ClipRect.Width();
02128     INT32 ReqDy = ClipRect.Height();
02129 
02130     // Work out the scale factors
02131     FIXED16 XScale = FIXED16(double(ExtraInfo->dx) / double(ReqDx));
02132     FIXED16 YScale = FIXED16(double(ExtraInfo->dy) / double(ReqDy));
02133 
02134     // Build the matricies
02135     // One to shift everything to the correct side of the X axis
02136     Matrix Translate(0, -ExtraInfo->dy);
02137 
02138     // One to scale everything into the window
02139     Matrix ScaleIt(XScale, YScale);
02140 
02141     // One to translate everything to the origin
02142     Matrix ToOrigin(-ClipRect.lo.x, -ClipRect.lo.y);
02143 
02144     // Combine them all
02145     ToOrigin *= ScaleIt;
02146     ToOrigin *= Translate;
02147 
02148     // If the caller wants to use the same colour separation options (ColourPlate) as the
02149     // currently selected view, then copy the ColourPlate across to the new DialogView
02150     if (UseSelViewColContext && DocView::GetSelected() != NULL)
02151         pDialogView->SetColourPlate(DocView::GetSelected()->GetColourPlate());
02152 
02153     // Make a render region for the screen, asking specifically for an OSRenderRegion,
02154     // and none of this sneaky & cunning diverting it back into being a GRenderRegion!
02155 //  RenderRegion* pRender = OSRenderRegion::Create(ClipRect, ToOrigin, Scale,
02156 //                                                  RENDERTYPE_SCREEN, NULL, TRUE);
02157     RenderRegion* pRender = OSRenderRegion::Create(ClipRect, ToOrigin, Scale,
02158                                                     RENDERTYPE_SCREEN, NULL, FALSE, TRUE);
02159     // Penultimate param FALSE so that a GDRAW render region is used...
02160     // Last param TRUE so that the render bitmap is forced into 32BPP mode
02161     // (this fixes problems with palettes when drawing the preview in 256 colour mode)
02162 
02163     if (pRender != NULL)
02164     {
02165         // Try and create the bitmap etc
02166         if (pRender->AttachDevice(pDialogView, ExtraInfo->pDC, NULL))
02167         {
02168             // Try and start the render region
02169             if (pRender->StartRender())
02170             {
02171                 return pRender;
02172             }
02173         }
02174 
02175         // Failed to attach and start the render region so free up the region
02176         delete pRender;
02177     }
02178 
02179     // Something went wrong, fail
02180     delete pDialogView;
02181     return NULL;
02182 }

BOOL DestroyOSRenderRegion RenderRegion pRender  ) 
 

Deinitialises the render region and deletes it.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> (Copied from Rik/Jason code in DialogOp::CreateGRenderRegion)
Date:
17/7/96
Parameters:
A pointer to a render region return by CreateOSRenderRegion [INPUTS]
Returns:
TRUE if it worked, FALSE if the render region passed in was bad
Scope: Global

Returns:
Errors: ERROR2 error if pRender is NULL
See also:
DialogOp::CreateGRenderRegion

DialogOp::CreateOSRenderRegion

Definition at line 2206 of file filedlgs.cpp.

02207 {
02208     // Test for preconditions
02209     ERROR2IF(pRender==NULL, FALSE, "DestroyOSRenderRegion was passed a NULL render region");
02210 
02211     // Blit to the screen
02212     pRender->StopRender();
02213 
02214     // and delete the render region and its (dialog) view
02215     // these are deleted in this order because the RenderRegion destructor may
02216     // call functions on its RenderView
02217     View* pView = pRender->GetRenderView();
02218     delete pRender;
02219     delete pView;
02220 
02221     // It worked
02222     return TRUE;
02223 }

void FixFPControlRegister  ) 
 

IMPLEMENT_CLASS GIFExportFileDialog  ,
ExportFileDialog 
 

IMPLEMENT_CLASS ExportFileDialog  ,
BaseFileDialog 
 

IMPLEMENT_CLASS ImportFileDialog  ,
BaseFileDialog 
 

IMPLEMENT_CLASS SaveTemplateDialog  ,
SaveFileDialog 
 

IMPLEMENT_CLASS SaveFileDialog  ,
BaseFileDialog 
 

IMPLEMENT_CLASS OpenFileDialog  ,
BaseFileDialog 
 

IMPLEMENT_CLASS BaseFileDialog  ,
wxFileDialog 
 

BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnHelp SaveTemplateDialog::OnUseAsDefault BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnOptions ON_BN_CLICKED _R(IDC_SHOWPREVIEW)  ,
BaseFileDialog::OnShowPreviewBitmap 
 

BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnShowPreviewBitmap ON_BN_CLICKED _R(IDC_FILEDLG_OPTIONS)  ,
BaseFileDialog::OnOptions 
 

BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnShowPreviewBitmap BaseFileDialog::OnHelp SaveTemplateDialog::OnUseAsDefault BaseFileDialog::OnShowPreviewBitmap ON_BN_CLICKED _R(ID_CC_HELP_BUTTON)  ,
BaseFileDialog::OnHelp 
 


Variable Documentation

const DWORD FCIDM_SHVIEW_THUMBNAIL = 0x702D
 

Definition at line 174 of file filedlgs.cpp.

const INT32 MaxWebName = 40
 

Definition at line 2673 of file filedlgs.cpp.


Generated on Sat Nov 10 03:49:31 2007 for Camelot by  doxygen 1.4.4