merge with latest sources

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2000-08-09 10:10:14 +00:00
parent 57681e5bfd
commit 2f1ae41432
176 changed files with 7712 additions and 5094 deletions

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.cpp
// Purpose: wxFileDialog
// Purpose: wxFileDialog
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
@@ -19,7 +19,9 @@
#include "wx/filedlg.h"
#include "wx/intl.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
#endif
// begin wxmac
@@ -43,6 +45,27 @@ OSType gfiltersmac[] =
'****'
} ;
// the data we need to pass to our standard file hook routine
// includes a pointer to the dialog, a pointer to the standard
// file reply record (so we can inspect the current selection)
// and a copy of the "previous" file spec of the reply record
// so we can see if the selection has changed
const int kwxMacFileTypes = 10 ;
struct OpenUserDataRec {
StandardFileReply *sfrPtr;
FSSpec oldSelectionFSSpec;
char filter[kwxMacFileTypes][10] ;
OSType filtermactypes[kwxMacFileTypes] ;
int numfilters ;
DialogPtr theDlgPtr;
};
typedef struct OpenUserDataRec
OpenUserDataRec, *OpenUserDataRecPtr;
#if !TARGET_CARBON
static void wxMacSetupStandardFile(short newVRefNum, long newDirID)
{
enum
@@ -97,25 +120,6 @@ enum {
kDontUseQuotes = false
};
// the data we need to pass to our standard file hook routine
// includes a pointer to the dialog, a pointer to the standard
// file reply record (so we can inspect the current selection)
// and a copy of the "previous" file spec of the reply record
// so we can see if the selection has changed
const int kwxMacFileTypes = 10 ;
struct OpenUserDataRec {
StandardFileReply *sfrPtr;
FSSpec oldSelectionFSSpec;
char filter[kwxMacFileTypes][10] ;
OSType filtermactypes[kwxMacFileTypes] ;
int numfilters ;
DialogPtr theDlgPtr;
};
typedef struct OpenUserDataRec
OpenUserDataRec, *OpenUserDataRecPtr;
static void GetLabelString(StringPtr theStr, short stringNum)
{
GetIndString(theStr, kStrListID, stringNum);
@@ -185,6 +189,7 @@ static pascal Boolean SFGetFolderModalDialogFilter(DialogPtr theDlgPtr, EventRec
return false;
}
#endif
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
{
@@ -204,7 +209,7 @@ void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const
// set initial contents of Select button to a space
CopyPStr("\p ", theSFR->sfFile.name);
memcpy( theSFR->sfFile.name , "\p " , 2 ) ;
// point the user data parameter at the reply record so we can get to it later
@@ -240,6 +245,8 @@ void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const
myData.numfilters = 0 ;
}
// display the dialog
#if !TARGET_CARBON
dlgHookUPP = NULL ;
// dlgHookUPP = NewDlgHookYDProc(SFGetFolderDialogHook);
@@ -263,7 +270,8 @@ void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const
DisposeRoutineDescriptor(dlgHookUPP);
DisposeRoutineDescriptor(myModalFilterUPP);
#else
#endif
// if cancel wasn't pressed and no fatal error occurred...
if (theSFR->sfGood)
@@ -454,8 +462,12 @@ int wxFileDialog::ShowModal()
strcpy((char *)filename, m_fileName) ;
c2pstr((char *)filename ) ;
#if !TARGET_CARBON
StandardPutFile( prompt , filename , &reply ) ;
#else
#endif
if ( reply.sfGood == false )
{
m_path = "" ;
@@ -479,14 +491,17 @@ int wxFileDialog::ShowModal()
strcpy((char *)path, m_path ) ;
c2pstr((char *)path ) ;
FileFilterYDUPP crossPlatformFileFilterUPP;
StandardFileReply reply ;
FileFilterYDUPP crossPlatformFileFilterUPP = 0 ;
#if !TARGET_CARBON
crossPlatformFileFilterUPP =
NewFileFilterYDProc(CrossPlatformFileFilter);
#endif
ExtendedOpenFile( prompt , path , m_wildCard , crossPlatformFileFilterUPP, &reply);
DisposeRoutineDescriptor(crossPlatformFileFilterUPP);
#if !TARGET_CARBON
DisposeFileFilterYDUPP(crossPlatformFileFilterUPP);
#endif
if ( reply.sfGood == false )
{
m_path = "" ;