/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.cpp
-// Purpose: wxFileDialog
+// Purpose: wxFileDialog
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
'****'
} ;
+// 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
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);
return false;
}
+#endif
void ExtendedOpenFile( ConstStr255Param message , ConstStr255Param path , const char *filter , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
{
// 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
myData.numfilters = 0 ;
}
// display the dialog
+
+#if !TARGET_CARBON
dlgHookUPP = NULL ;
// dlgHookUPP = NewDlgHookYDProc(SFGetFolderDialogHook);
DisposeRoutineDescriptor(dlgHookUPP);
DisposeRoutineDescriptor(myModalFilterUPP);
-
+#else
+#endif
// if cancel wasn't pressed and no fatal error occurred...
if (theSFR->sfGood)
strcpy((char *)filename, m_fileName) ;
c2pstr((char *)filename ) ;
+ #if !TARGET_CARBON
StandardPutFile( prompt , filename , &reply ) ;
+
+ #else
+ #endif
if ( reply.sfGood == false )
{
m_path = "" ;
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 = "" ;