filedlgs.h File Reference

(r1785/r1282)

Go to the source code of this file.

Classes

struct  OPENFILENAMEEX
class  BaseFileDialog
 To provide a custom File Save / Open Dialog that goes to the correct directory etc. More...
class  OpenFileDialog
 Brings up an Open file dialog that goes to the correct directory etc. More...
class  SaveFileDialog
 This is the Save Dialog that is brought up in responce to the saveas option. It will select the last used directory etc and is generally very fabby. More...
class  SaveTemplateDialog
 The Save Template dialog. It saves templates, basically. More...
class  ImportFileDialog
 To provide a custom open file dialog, which enables us to resize the drop down list of filters. More...
class  ExportFileDialog
 To provide a custom open file dialog, which enables us to resize the drop down list of filters. More...
class  GIFExportFileDialog
 To provide a custom open file dialog for GIF Animation Export. This class has been derived because the help system uses the name of the class - in this case, "ExportFileDialog" - to determine which help page the button should link to. In order to get this help button to link to a separate "Export Animated GIF" help page, we have created a derived class of "ExportFileDialog" that the Export Animated GIF command can display. More...

Defines

#define XPDialog
#define IDC_COMPRESS_BUTTON   (131)
#define MAX_ALLOWED_NAME_LENGTH   60
#define TotalControls   60
#define IDC_LAYERS_BUTTON   (130)

Functions

RenderRegionCreateOSRenderRegion (DocRect *pRequiredSize, ReDrawInfoType *ExtraInfo, BOOL UseSelViewColContext=FALSE)
 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.


Define Documentation

#define IDC_COMPRESS_BUTTON   (131)
 

Definition at line 353 of file filedlgs.h.

#define IDC_LAYERS_BUTTON   (130)
 

Definition at line 479 of file filedlgs.h.

#define MAX_ALLOWED_NAME_LENGTH   60
 

Definition at line 474 of file filedlgs.h.

#define TotalControls   60
 

Definition at line 475 of file filedlgs.h.

#define XPDialog
 

Definition at line 107 of file filedlgs.h.


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 }


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